3 # _without_embed - don't build uClibc version
4 Summary: Small bourne shell from Berkeley
5 Summary(de): Kleine Bourne-Shell von Berkeley
6 Summary(fr): Shell Bourne réduit de Berkeley
7 Summary(pl): Ma³y shell bourne'a
8 Summary(tr): Ufak bir bourne kabuðu
13 Group: Applications/Shells
14 Group(de): Applikationen/Shells
15 Group(pl): Aplikacje/Pow³oki
16 Source: %{name}-%{version}.tar.gz
17 Patch0: %{name}-builtin.patch
18 Patch1: %{name}-echo.patch
19 Patch2: %{name}-getcwd.patch
20 Patch3: %{name}-getopt.patch
21 Patch4: %{name}-glob.patch
22 Patch5: %{name}-jobs.patch
23 Patch6: %{name}-kill.patch
24 Patch7: %{name}-makefile.patch
25 Patch8: %{name}-manpage.patch
26 Patch9: %{name}-hetio.patch
27 Patch10: %{name}-memout.patch
28 Patch11: %{name}-misc.patch
29 Patch12: %{name}-redir.patch
30 Patch13: %{name}-setmode.patch
31 Patch14: %{name}-syntax.patch
32 Patch15: %{name}-test.patch
33 Patch16: %{name}-times.patch
34 Patch17: %{name}-debian.patch
35 Patch18: %{name}-ppid.patch
36 Patch19: %{name}-freebsd.patch
37 Patch20: %{name}-sighup.patch
40 BuildRequires: glibc-static
43 %if %{!?_without_embed:1}%{?_without_embed:0}
44 BuildRequires: uClibc-devel
45 BuildRequires: uClibc-static
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 Conflicts: mkinitrd <= 1.7
50 %define embed_path /usr/lib/embed
51 %define embed_cc %{_arch}-uclibc-cc
52 %define embed_cflags %{rpmcflags} -Os
57 ash is a bourne shell clone from Berkeley. It supports all of the
58 standard Bourne shell commands and has the advantage of supporting
59 them while remaining considerably smaller than bash.
62 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
63 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
64 weniger Platz beansprucht als bash.
67 ash est un clone Berkeley du shell Bourne. Il gère toutes les
68 commandes standard du shell Bourne et a l'avantage de les gérer tout
69 en restant considérablement plus petit que bash.
72 Ash jest klonem shell'a Bourne'a z Berkeley. Obs³uguje standardowe
73 komendy shell'a Bourne'a i jest mniejszy ni¿ bash.
76 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
77 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
81 Summary: Small bourne shell from Berkeley
82 Summary(de): Kleine Bourne-Shell von Berkeley
83 Summary(fr): Shell Bourne réduit de Berkeley
84 Summary(pl): Ma³y shell bourne'a
85 Summary(tr): Ufak bir bourne kabuðu
86 Group: Applications/Shells
87 Group(de): Applikationen/Shells
88 Group(pl): Aplikacje/Pow³oki
91 Conflicts: mkinitrd <= 1.7
94 ash is a bourne shell clone from Berkeley. It supports all of the
95 standard Bourne shell commands and has the advantage of supporting
96 them while remaining considerably smaller than bash.
98 %description static -l de
99 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
100 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
101 weniger Platz beansprucht als bash.
103 %description static -l fr
104 ash est un clone Berkeley du shell Bourne. Il gère toutes les
105 commandes standard du shell Bourne et a l'avantage de les gérer tout
106 en restant considérablement plus petit que bash.
108 %description static -l pl
109 Ash jest klonem shell'a Bourne'a z Berkeley. Obs³uguje standardowe
110 komendy shell'a Bourne'a i jest mniejszy ni¿ bash.
112 %description static -l tr
113 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
114 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
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 Group(de): Applikationen/Shells
125 Group(pl): Aplikacje/Pow³oki
128 ash is a bourne shell clone from Berkeley. It supports all of the
129 standard Bourne shell commands and has the advantage of supporting
130 them while remaining considerably smaller than bash.
131 Version for embedded systems.
133 %description embed -l pl
134 Ash jest klonem shell'a Bourne'a z Berkeley. Obs³uguje standardowe
135 komendy shell'a Bourne'a i jest mniejszy ni¿ bash. Wersja dla systemów
157 # this is mainly for information, maybe add changelog to %doc?
165 %if %{!?_without_embed:1}%{?_without_embed:0}
166 # some of this utilities does not compile with uClibc
167 # and it is not necessary
168 %{__make} mksignames mkbuiltins mknodes mksignames mksyntax mktokens
170 OPT_FLAGS="%{embed_cflags}" \
172 mv -f sh ash-embed-shared
174 OPT_FLAGS="%{embed_cflags}" \
177 mv -f sh ash-embed-static
182 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="-static %{rpmldflags}"
184 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}"
187 rm -rf $RPM_BUILD_ROOT
190 %if %{!?_without_embed:1}%{?_without_embed:0}
191 install -d $RPM_BUILD_ROOT/%{embed_path}/{shared,static}
192 install ash-embed-static $RPM_BUILD_ROOT/%{embed_path}/static/ash
193 install ash-embed-shared $RPM_BUILD_ROOT/%{embed_path}/shared/ash
194 ln -sf ash $RPM_BUILD_ROOT/%{embed_path}/shared/sh
195 ln -sf ash $RPM_BUILD_ROOT/%{embed_path}/static/sh
199 install -d $RPM_BUILD_ROOT/{%{_bindir},%{_mandir}/man1}
200 install sh $RPM_BUILD_ROOT%{_bindir}/ash
201 install ash.static $RPM_BUILD_ROOT%{_bindir}/ash.static
202 install sh.1 $RPM_BUILD_ROOT%{_mandir}/man1/ash.1
203 echo ".so ash.1" > $RPM_BUILD_ROOT%{_mandir}/man1/bsh.1
204 ln -sf ash $RPM_BUILD_ROOT/%{_bindir}/bsh
207 if [ ! -f /etc/shells ]; then
208 echo "%{_bindir}/ash" > /etc/shells
209 echo "%{_bindir}/bsh" >> /etc/shells
211 if ! grep -q '^%{_bindir}/ash$' /etc/shells ; then
212 echo "%{_bindir}/ash" >> /etc/shells
214 if ! grep -q '^%{_bindir}/bsh$' /etc/shells ; then
215 echo "%{_bindir}/bsh" >> /etc/shells
220 if [ ! -f /etc/shells ]; then
221 echo "%{_bindir}/ash.static" >> /etc/shells
223 if ! grep -q '^%{_bindir}/ash.static$' /etc/shells ; then
224 echo "%{_bindir}/ash.static" >> /etc/shells
229 if [ "$1" = 0 ]; then
230 grep -v '^%{_bindir}/ash$' /etc/shells | grep -v '^%{_bindir}/bsh$' > /etc/shells.new
231 mv -f /etc/shells.new /etc/shells
235 if [ "$1" = 0 ]; then
236 grep -v '^%{_bindir}/ash\.static$' /etc/shells > /etc/shells.new
237 mv -f /etc/shells.new /etc/shells
241 for n in ash bsh ; do
242 echo -n "Looking for $n in /etc/shells... "
243 if ! grep -q "^%{_bindir}/${n}\$" /etc/shells ; then
245 echo "${n} missing from /etc/shells" >&2
252 echo -n "Looking for ash.static in /etc/shells... "
253 if ! grep -q '^%{_bindir}/ash\.static$' /etc/shells ; then
255 echo "ash.static missing from /etc/shells" >&2
261 rm -rf $RPM_BUILD_ROOT
264 %defattr(644,root,root,755)
265 %attr(755,root,root) %{_bindir}/ash
266 %attr(755,root,root) %{_bindir}/bsh
270 %defattr(644,root,root,755)
271 %attr(755,root,root) %{_bindir}/ash.static
273 %if %{!?_without_embed:1}%{?_without_embed:0}
275 %defattr(644,root,root,755)
276 %attr(755,root,root) %{embed_path}/*/*