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.
152 # this is mainly for information, maybe add changelog to %doc?
160 %if %{!?_without_embed:1}%{?_without_embed:0}
161 # some of this utilities does not compile with uClibc
162 # and it is not necessary
163 %{__make} mksignames mkbuiltins mknodes mksignames mksyntax mktokens
165 OPT_FLAGS="%{embed_cflags}" \
167 mv -f sh ash-embed-shared
169 OPT_FLAGS="%{embed_cflags}" \
172 mv -f sh ash-embed-static
177 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="-static %{rpmldflags}"
179 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}"
182 rm -rf $RPM_BUILD_ROOT
185 %if %{!?_without_embed:1}%{?_without_embed:0}
186 install -d $RPM_BUILD_ROOT/%{embed_path}/{shared,static}
187 install ash-embed-static $RPM_BUILD_ROOT/%{embed_path}/static/ash
188 install ash-embed-shared $RPM_BUILD_ROOT/%{embed_path}/shared/ash
189 ln -sf ash $RPM_BUILD_ROOT/%{embed_path}/shared/sh
190 ln -sf ash $RPM_BUILD_ROOT/%{embed_path}/static/sh
194 install -d $RPM_BUILD_ROOT/{%{_bindir},%{_mandir}/man1}
195 install sh $RPM_BUILD_ROOT%{_bindir}/ash
196 install ash.static $RPM_BUILD_ROOT%{_bindir}/ash.static
197 install sh.1 $RPM_BUILD_ROOT%{_mandir}/man1/ash.1
198 echo ".so ash.1" > $RPM_BUILD_ROOT%{_mandir}/man1/bsh.1
199 ln -sf ash $RPM_BUILD_ROOT/%{_bindir}/bsh
202 if [ ! -f /etc/shells ]; then
203 echo "%{_bindir}/ash" > /etc/shells
204 echo "%{_bindir}/bsh" >> /etc/shells
206 if ! grep -q '^%{_bindir}/ash$' /etc/shells ; then
207 echo "%{_bindir}/ash" >> /etc/shells
209 if ! grep -q '^%{_bindir}/bsh$' /etc/shells ; then
210 echo "%{_bindir}/bsh" >> /etc/shells
215 if [ ! -f /etc/shells ]; then
216 echo "%{_bindir}/ash.static" >> /etc/shells
218 if ! grep -q '^%{_bindir}/ash.static$' /etc/shells ; then
219 echo "%{_bindir}/ash.static" >> /etc/shells
224 if [ "$1" = 0 ]; then
225 grep -v '^%{_bindir}/ash$' /etc/shells | grep -v '^%{_bindir}/bsh$' > /etc/shells.new
226 mv -f /etc/shells.new /etc/shells
230 if [ "$1" = 0 ]; then
231 grep -v '^%{_bindir}/ash\.static$' /etc/shells > /etc/shells.new
232 mv -f /etc/shells.new /etc/shells
236 for n in ash bsh ; do
237 echo -n "Looking for $n in /etc/shells... "
238 if ! grep -q "^%{_bindir}/${n}\$" /etc/shells ; then
240 echo "${n} missing from /etc/shells" >&2
247 echo -n "Looking for ash.static in /etc/shells... "
248 if ! grep -q '^%{_bindir}/ash\.static$' /etc/shells ; then
250 echo "ash.static missing from /etc/shells" >&2
256 rm -rf $RPM_BUILD_ROOT
259 %defattr(644,root,root,755)
260 %attr(755,root,root) %{_bindir}/ash
261 %attr(755,root,root) %{_bindir}/bsh
265 %defattr(644,root,root,755)
266 %attr(755,root,root) %{_bindir}/ash.static
268 %if %{!?_without_embed:1}%{?_without_embed:0}
270 %defattr(644,root,root,755)
271 %attr(755,root,root) %{embed_path}/*/*