]> git.pld-linux.org Git - packages/ash.git/blob - ash.spec
- fixed with dietlibc bcond comment
[packages/ash.git] / ash.spec
1 #
2 # Conditional build
3 %bcond_without  static          # don't build static
4 %bcond_with     dietlibc        # link with dietlibc, implies without static
5 %bcond_with     uClibc          # link with uclibc
6 # Branch: HEAD
7
8 %if %{with dietlibc}
9 %undefine       with_static
10 %endif
11
12 Summary:        Small bourne shell from Berkeley
13 Summary(de):    Kleine Bourne-Shell von Berkeley
14 Summary(es):    Pequeña shell bourne de Berkeley
15 Summary(fr):    Shell Bourne réduit de Berkeley
16 Summary(pl):    Ma³y shell bourne'a
17 Summary(pt_BR): Pequena shell bourne de Berkeley
18 Summary(ru):    ïÂÌÅÇÞÅÎÎÁÑ ×ÅÒÓÉÑ Bourne shell (sh)
19 Summary(tr):    Ufak bir bourne kabuðu
20 Summary(uk):    ðÏÌÅÇÛÅÎÁ ×ÅÒӦѠBourne shell (sh)
21 Summary(zh_CN): [ϵͳ]BerkeleyµÄ΢ÐÍBourne Shell
22 Summary(zh_TW): [\e-A¨t\e$)B²Î]Berkeleyªº\e-A·L\e$)B«¬Bourne Shell
23 Name:           ash
24 Version:        0.4.0
25 Release:        10
26 License:        BSD
27 Group:          Applications/Shells
28 Source0:        %{name}-%{version}.tar.gz
29 # Source0-md5:  1c59f5b62a081cb0cb3b053c01d79529
30 Patch0:         %{name}-builtin.patch
31 Patch1:         %{name}-echo.patch
32 Patch2:         %{name}-getcwd.patch
33 Patch3:         %{name}-getopt.patch
34 Patch4:         %{name}-glob.patch
35 Patch5:         %{name}-jobs.patch
36 Patch6:         %{name}-kill.patch
37 Patch7:         %{name}-makefile.patch
38 Patch8:         %{name}-manpage.patch
39 Patch9:         %{name}-hetio.patch
40 Patch10:        %{name}-memout.patch
41 Patch11:        %{name}-misc.patch
42 Patch12:        %{name}-redir.patch
43 Patch13:        %{name}-setmode.patch
44 Patch14:        %{name}-syntax.patch
45 Patch15:        %{name}-test.patch
46 Patch16:        %{name}-times.patch
47 Patch17:        %{name}-debian.patch
48 Patch18:        %{name}-ppid.patch
49 Patch19:        %{name}-freebsd.patch
50 Patch20:        %{name}-sighup.patch
51 Patch21:        %{name}-dietlibc.patch
52 BuildRequires:  byacc
53 %{?with_dietlibc:BuildRequires: dietlibc-devel}
54 BuildRequires:  flex
55 %if %{with static}
56 %{?without_uClibc:BuildRequires: glibc-static}
57 %{?with_uClibc:BuildRequires: uClibc-static > 2:0.9.27-1}
58 %endif
59 %{?with_uClibc:BuildRequires: uClibc-devel > 2:0.9.27-1}
60 Requires(post,preun,verify):    grep
61 Requires(preun):        fileutils
62 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63 Conflicts:      mkinitrd <= 1.7
64
65 %define         _bindir         /bin
66
67 %description
68 ash is a bourne shell clone from Berkeley. It supports all of the
69 standard Bourne shell commands and has the advantage of supporting
70 them while remaining considerably smaller than bash.
71
72 %description -l de
73 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
74 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
75 weniger Platz beansprucht als bash.
76
77 %description -l es
78 Ash es un clon del shell bourne de Berkeley. Soporta todos los
79 comandos padrón de la Bourne shell y tiene la ventaja de soportarlos
80 con un tamaño considerablemente menor del que bash.
81
82 %description -l fr
83 ash est un clone Berkeley du shell Bourne. Il gère toutes les
84 commandes standard du shell Bourne et a l'avantage de les gérer tout
85 en restant considérablement plus petit que bash.
86
87 %description -l pl
88 Ash jest klonem shella Bourne'a z Berkeley. Obs³uguje standardowe
89 komendy shella Bourne'a i jest mniejszy ni¿ bash.
90
91 %description -l pt_BR
92 ash é um clone do shell bourne de Berkeley. Ele suporta todos os
93 comandos-padrão da Bourne shell e tem a vantagem de suportá-los com um
94 tamanho consideravelmente menor do que bash.
95
96 %description -l ru
97 ûÅÌÌ - ÜÔÏ ÂÁÚÏ×ÁÑ ÓÉÓÔÅÍÎÁÑ ÐÒÏÇÒÁÍÍÁ, ËÏÔÏÒÁÑ ÉÎÔÅÒÐÒÅÔÉÒÕÅÔ ËÏÍÁÎÄÙ
98 ÐÏÌØÚÏ×ÁÔÅÌÑ, ××ÏÄÉÍÙÅ Ó ËÌÁ×ÉÁÔÕÒÙ ÉÌÉ ÐÒÉ ÐÏÍÏÝÉ ÍÙÛÉ. Ash - ÜÔÏ
99 ËÌÏΠBourne shell (sh) ÉÚ âÅÒËÌÉ. Ash ÐÏÄÄÅÒÖÉ×ÁÅÔ ×ÓÅ ÓÔÁÎÄÁÒÔÎÙÅ
100 ËÏÍÁÎÄÙ ÛÅÌÌÁ sh, ÂÕÄÕÞÉ ÚÎÁÞÉÔÅÌØÎÏ ÍÅÎØÛÅ ÞÅÍ sh. ÷ ash ÏÔÓÕÔÓÔ×ÕÀÔ
101 ÎÅËÏÔÏÒÙÅ ×ÏÚÍÏÖÎÏÓÔÉ Bourne shell (ÎÁÐÒÉÍÅÒ, ÉÓÔÏÒÉÑ ËÏÍÁÎÄ), ÎÏ ÏÎ
102 ÔÒÅÂÕÅÔ ÚÎÁÞÉÔÅÌØÎÏ ÍÅÎØÛÅ ÐÁÍÑÔÉ.
103
104 %description -l tr
105 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
106 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
107 avantajýna sahiptir.
108
109 %description -l uk
110 ûÅÌ - ÃÅ ÂÁÚÏ×Á ÓÉÓÔÅÍÎÁ ÐÒÏÇÒÁÍÁ, ËÏÔÒÁ ¦ÎÔÅÒÐÒÅÔÕ¤ ËÏÍÁÎÄÉ
111 ËÏÒÉÓÔÕ×ÁÞÁ, Ñ˦ ××ÏÄÑÔØÓÑ Ú ËÌÁצÁÔÕÒÉ ÁÂÏ ÚÁ ÄÏÐÏÍÏÇÏÀ ÍÉÛ¦. Ash -
112 ÃÅ ËÌÏΠBourne shell (sh) Ú âÅÒË̦. Ash Ð¦ÄÔÒÉÍÕ¤ ÕÓ¦ ÓÔÁÎÄÁÒÔΦ
113 ËÏÍÁÎÄÉ ÛÅÌÁ sh, ÂÕÄÕÞÉ ÚÎÁÞÎÏ ÍÅÎÛÉ͠Φ֠sh. ÷ ash ×¦ÄÓÕÔΦ ÄÅÑ˦
114 ÍÏÖÌÉ×ÏÓÔ¦ Bourne shell (ÎÁÐÒÉËÌÁÄ, ¦ÓÔÏҦѠËÏÍÁÎÄ), ÚÁÔŠצΠ×ÉÍÁÇÁ¤
115 ÚÎÁÞÎÏ ÍÅÎÛÅ ÐÁÍ'ÑÔ¦.
116
117 %package static
118 Summary:        Small bourne shell from Berkeley
119 Summary(de):    Kleine Bourne-Shell von Berkeley
120 Summary(fr):    Shell Bourne réduit de Berkeley
121 Summary(pl):    Ma³y shell bourne'a
122 Summary(tr):    Ufak bir bourne kabuðu
123 Group:          Applications/Shells
124 Requires(post,preun,verify):    grep
125 Requires(preun):        fileutils
126 Conflicts:      mkinitrd <= 1.7
127
128 %description static
129 ash is a bourne shell clone from Berkeley. It supports all of the
130 standard Bourne shell commands and has the advantage of supporting
131 them while remaining considerably smaller than bash.
132
133 %description static -l de
134 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
135 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
136 weniger Platz beansprucht als bash.
137
138 %description static -l fr
139 ash est un clone Berkeley du shell Bourne. Il gère toutes les
140 commandes standard du shell Bourne et a l'avantage de les gérer tout
141 en restant considérablement plus petit que bash.
142
143 %description static -l pl
144 Ash jest klonem shella Bourne'a z Berkeley. Obs³uguje standardowe
145 komendy shella Bourne'a i jest mniejszy ni¿ bash.
146
147 %description static -l tr
148 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
149 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
150 avantajýna sahiptir.
151
152 %prep
153 %setup -q
154 %patch0 -p1
155 %patch1 -p1
156 %patch2 -p1
157 %patch3 -p1
158 %patch4 -p1
159 %patch5 -p1
160 %patch6 -p1
161 %patch7 -p1
162 %patch8 -p1
163 %patch9 -p1
164 %patch10 -p1
165 %patch11 -p1
166 %patch12 -p1
167 %patch13 -p1
168 %patch14 -p1
169 %patch15 -p1
170 %patch16 -p1
171 # this is mainly for information, maybe add changelog to %doc?
172 %patch17 -p1
173 %patch18 -p1
174 %patch19 -p1
175 %patch20 -p1
176 %{?_with_dietlibc:%patch21 -p1}
177
178 %build
179
180 %define __cc %{_target_cpu}-pld-linux-gcc
181 %{?with_dietlibc:%define __cc %{_target_cpu}-dietlibc-gcc}
182 %{?with_uClibc:%define __cc %{_target_cpu}-uclibc-gcc}
183
184 %{?with_static:%{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="-static %{rpmldflags}" CC="%{__cc}"}
185 %{?with_static:mv -f sh ash.static}
186 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" CC="%{__cc}"
187
188 %install
189 rm -rf $RPM_BUILD_ROOT
190 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
191
192 install sh $RPM_BUILD_ROOT%{_bindir}/ash
193 %{?with_static:install ash.static $RPM_BUILD_ROOT%{_bindir}/ash.static}
194 install sh.1 $RPM_BUILD_ROOT%{_mandir}/man1/ash.1
195 echo ".so ash.1" > $RPM_BUILD_ROOT%{_mandir}/man1/bsh.1
196 ln -sf ash $RPM_BUILD_ROOT%{_bindir}/bsh
197
198 %clean
199 rm -rf $RPM_BUILD_ROOT
200
201 %post
202 umask 022
203 if [ ! -f /etc/shells ]; then
204         echo "%{_bindir}/ash" > /etc/shells
205         echo "%{_bindir}/bsh" >> /etc/shells
206 else
207         if ! grep -q '^%{_bindir}/ash$' /etc/shells ; then
208                 echo "%{_bindir}/ash" >> /etc/shells
209         fi
210         if ! grep -q '^%{_bindir}/bsh$' /etc/shells ; then
211                 echo "%{_bindir}/bsh" >> /etc/shells
212         fi
213 fi
214
215 %preun
216 if [ "$1" = 0 ]; then
217         umask 022
218         grep -v '^%{_bindir}/ash$' /etc/shells | grep -v '^%{_bindir}/bsh$' > /etc/shells.new
219         mv -f /etc/shells.new /etc/shells
220 fi
221
222 %post static
223 umask 022
224 if [ ! -f /etc/shells ]; then
225         echo "%{_bindir}/ash.static" >> /etc/shells
226 else
227         if ! grep -q '^%{_bindir}/ash.static$' /etc/shells ; then
228                 echo "%{_bindir}/ash.static" >> /etc/shells
229         fi
230 fi
231
232 %preun static
233 if [ "$1" = 0 ]; then
234         umask 022
235         grep -v '^%{_bindir}/ash\.static$' /etc/shells > /etc/shells.new
236         mv -f /etc/shells.new /etc/shells
237 fi
238
239 %verifyscript
240 for n in ash bsh ; do
241         echo -n "Looking for $n in /etc/shells... "
242         if ! grep -q "^%{_bindir}/${n}\$" /etc/shells ; then
243                 echo "missing"
244                 echo "${n} missing from /etc/shells" >&2
245         else
246                 echo "found"
247         fi
248 done
249
250 %verifyscript static
251 echo -n "Looking for ash.static in /etc/shells... "
252 if ! grep -q '^%{_bindir}/ash\.static$' /etc/shells ; then
253         echo "missing"
254         echo "ash.static missing from /etc/shells" >&2
255 else
256         echo "found"
257 fi
258
259 %files
260 %defattr(644,root,root,755)
261 %attr(755,root,root) %{_bindir}/ash
262 %attr(755,root,root) %{_bindir}/bsh
263 %{_mandir}/man1/*
264
265 %if %{with static}
266 %files static
267 %defattr(644,root,root,755)
268 %attr(755,root,root) %{_bindir}/ash.static
269 %endif
This page took 0.129526 seconds and 3 git commands to generate.