]> git.pld-linux.org Git - packages/ash.git/blob - ash.spec
- added -m386 for BOOT
[packages/ash.git] / ash.spec
1 # conditional build:
2 # if BOOT is defined, build BOOT package too
3 Summary:        Small bourne shell from Berkeley
4 Summary(de):    Kleine Bourne-Shell von Berkeley
5 Summary(fr):    Shell Bourne réduit de Berkeley
6 Summary(pl):    Ma³y shell bourne'a 
7 Summary(tr):    Ufak bir bourne kabuðu
8 Name:           ash
9 Version:        0.4.0
10 Release:        2
11 License:        BSD
12 Group:          Applications/Shells
13 Group(de):      Applikationen/Shells
14 Group(pl):      Aplikacje/Pow³oki
15 Source:         %{name}-%{version}.tar.gz
16 Patch0:         %{name}-builtin.patch
17 Patch1:         %{name}-echo.patch
18 Patch2:         %{name}-getcwd.patch
19 Patch3:         %{name}-getopt.patch
20 Patch4:         %{name}-glob.patch
21 Patch5:         %{name}-jobs.patch
22 Patch6:         %{name}-kill.patch
23 Patch7:         %{name}-makefile.patch
24 Patch8:         %{name}-manpage.patch
25 Patch9:         %{name}-hetio.patch
26 Patch10:        %{name}-memout.patch
27 Patch11:        %{name}-misc.patch
28 Patch12:        %{name}-redir.patch
29 Patch13:        %{name}-setmode.patch
30 Patch14:        %{name}-syntax.patch
31 Patch15:        %{name}-test.patch
32 Patch16:        %{name}-times.patch
33 Patch17:        %{name}-debian.patch
34 Patch18:        %{name}-ppid.patch
35 Patch19:        %{name}-freebsd.patch
36 Prereq:         fileutils
37 Prereq:         grep
38 BuildRequires:  glibc-static
39 BuildRequires:  flex
40 BuildRequires:  byacc
41 %if %{?BOOT:1}%{!?BOOT:0}
42 BuildRequires:  uClibc-devel-BOOT >= 20000521
43 %endif
44 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 Conflicts:      mkinitrd <= 1.7
46
47 %define         _bindir         /bin
48
49 %description
50 ash is a bourne shell clone from Berkeley. It supports all of the
51 standard Bourne shell commands and has the advantage of supporting
52 them while remaining considerably smaller than bash.
53
54 %description -l de
55 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
56 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
57 weniger Platz beansprucht als bash.
58
59 %description -l fr
60 ash est un clone Berkeley du shell Bourne. Il gère toutes les
61 commandes standard du shell Bourne et a l'avantage de les gérer tout
62 en restant considérablement plus petit que bash.
63
64 %description -l pl
65 Ash jest klonem shell'a Bourne'a z Berkeley. Obs³uguje standardowe
66 komendy shell'a Bourne'a i jest mniejszy ni¿ bash.
67
68 %description -l tr
69 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
70 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
71 avantajýna sahiptir.
72
73 %package static
74 Summary:        Small bourne shell from Berkeley
75 Summary(de):    Kleine Bourne-Shell von Berkeley
76 Summary(fr):    Shell Bourne réduit de Berkeley
77 Summary(pl):    Ma³y shell bourne'a 
78 Summary(tr):    Ufak bir bourne kabuðu
79 Group:          Applications/Shells
80 Group(de):      Applikationen/Shells
81 Group(pl):      Aplikacje/Pow³oki
82 Prereq:         fileutils
83 Prereq:         grep
84 Conflicts:      mkinitrd <= 1.7
85
86 %description static
87 ash is a bourne shell clone from Berkeley. It supports all of the
88 standard Bourne shell commands and has the advantage of supporting
89 them while remaining considerably smaller than bash.
90
91 %description static -l de
92 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
93 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
94 weniger Platz beansprucht als bash.
95
96 %description static -l fr
97 ash est un clone Berkeley du shell Bourne. Il gère toutes les
98 commandes standard du shell Bourne et a l'avantage de les gérer tout
99 en restant considérablement plus petit que bash.
100
101 %description static -l pl
102 Ash jest klonem shell'a Bourne'a z Berkeley. Obs³uguje standardowe
103 komendy shell'a Bourne'a i jest mniejszy ni¿ bash.
104
105 %description static -l tr
106 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
107 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
108 avantajýna sahiptir.
109
110 %if %{?BOOT:1}%{!?BOOT:0}
111 %package BOOT
112 Summary:        Small bourne shell from Berkeley
113 Summary(de):    Kleine Bourne-Shell von Berkeley
114 Summary(fr):    Shell Bourne réduit de Berkeley
115 Summary(pl):    Ma³y shell bourne'a 
116 Summary(tr):    Ufak bir bourne kabuðu
117 Group:          Applications/Shells
118 Group(de):      Applikationen/Shells
119 Group(pl):      Aplikacje/Pow³oki
120
121 %description BOOT
122 ash is a bourne shell clone from Berkeley. It supports all of the
123 standard Bourne shell commands and has the advantage of supporting
124 them while remaining considerably smaller than bash.
125 Version for bootdisk
126
127 %endif
128
129 %prep
130 %setup -q
131 %patch0 -p1
132 %patch1 -p1
133 %patch2 -p1
134 %patch3 -p1
135 %patch4 -p1
136 %patch5 -p1
137 %patch6 -p1
138 %patch7 -p1
139 %patch8 -p1
140 %patch9 -p1
141 #%patch10 -p1
142 %patch11 -p1
143 %patch12 -p1
144 %patch13 -p1
145 %patch14 -p1
146 %patch15 -p1
147 %patch16 -p1
148 # this is mainly for information, maybe add changelog to %doc?
149 %patch17 -p1
150 %patch18 -p1
151 %patch19 -p1
152
153 %build
154 # BOOT
155 %if %{?BOOT:1}%{!?BOOT:0}
156 # some of this utilities does not compile with uClibc
157 # and it is not necessary
158 %{__make} mksignames mkbuiltins mknodes mksignames mksyntax mktokens
159 %{__make} \
160         OPT_FLAGS="-m386 -I/usr/lib/bootdisk%{_includedir} -Os" \
161         LDFLAGS="-nostdlib %{rpmldflags}" \
162         LDLIBS="%{_libdir}/bootdisk%{_libdir}/crt0.o %{_libdir}/bootdisk%{_libdir}/libc.a -lgcc"
163 mv -f sh ash.BOOT
164 %{__make} clean
165 %endif
166
167 # this patch imposes memory buffers - uClibc lacks them
168 patch -p1 <%{PATCH10}
169
170 # other
171 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="-static %{rpmldflags}"
172 mv -f sh ash.static
173 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}"
174
175 %install
176 rm -rf $RPM_BUILD_ROOT
177
178 # BOOT
179 %if %{?BOOT:1}%{!?BOOT:0}
180 install -d $RPM_BUILD_ROOT/usr/lib/bootdisk/bin
181 install -s ash.BOOT $RPM_BUILD_ROOT/usr/lib/bootdisk/bin/ash
182 ln -sf ash $RPM_BUILD_ROOT/usr/lib/bootdisk/bin/sh
183 %endif
184
185 # other
186 install -d $RPM_BUILD_ROOT/{%{_bindir},%{_mandir}/man1}
187 install sh $RPM_BUILD_ROOT%{_bindir}/ash
188 install ash.static $RPM_BUILD_ROOT%{_bindir}/ash.static
189 install sh.1 $RPM_BUILD_ROOT%{_mandir}/man1/ash.1
190 echo ".so ash.1" > $RPM_BUILD_ROOT%{_mandir}/man1/bsh.1
191 ln -sf ash $RPM_BUILD_ROOT/%{_bindir}/bsh
192
193 %post
194 if [ ! -f /etc/shells ]; then
195         echo "%{_bindir}/ash" > /etc/shells
196         echo "%{_bindir}/bsh" >> /etc/shells
197 else
198         if ! grep -q '^%{_bindir}/ash$' /etc/shells ; then
199                 echo "%{_bindir}/ash" >> /etc/shells
200         fi
201         if ! grep -q '^%{_bindir}/bsh$' /etc/shells ; then
202                 echo "%{_bindir}/bsh" >> /etc/shells
203         fi
204 fi
205
206 %post static
207 if [ ! -f /etc/shells ]; then
208         echo "%{_bindir}/ash.static" >> /etc/shells
209 else
210         if ! grep -q '^%{_bindir}/ash.static$' /etc/shells ; then
211                 echo "%{_bindir}/ash.static" >> /etc/shells
212         fi
213 fi
214
215 %preun
216 if [ "$1" = 0 ]; then
217         grep -v '^%{_bindir}/ash$' /etc/shells | grep -v '^%{_bindir}/bsh$' > /etc/shells.new
218         mv -f /etc/shells.new /etc/shells
219 fi
220
221 %preun static
222 if [ "$1" = 0 ]; then
223         grep -v '^%{_bindir}/ash\.static$' /etc/shells > /etc/shells.new
224         mv -f /etc/shells.new /etc/shells
225 fi
226
227 %verifyscript
228 for n in ash bsh ; do
229     echo -n "Looking for $n in /etc/shells... "
230     if ! grep -q "^%{_bindir}/${n}\$" /etc/shells ; then
231         echo "missing"
232         echo "${n} missing from /etc/shells" >&2
233     else
234         echo "found"
235     fi
236 done
237
238 %verifyscript static
239 echo -n "Looking for ash.static in /etc/shells... "
240 if ! grep -q '^%{_bindir}/ash\.static$' /etc/shells ; then
241         echo "missing"
242         echo "ash.static missing from /etc/shells" >&2
243 else
244         echo "found"
245 fi
246
247 %clean
248 rm -rf $RPM_BUILD_ROOT
249
250 %files
251 %defattr(644,root,root,755)
252 %attr(755,root,root) %{_bindir}/ash
253 %attr(755,root,root) %{_bindir}/bsh
254 %{_mandir}/man1/*
255
256 %files static
257 %defattr(644,root,root,755)
258 %attr(755,root,root) %{_bindir}/ash.static
259
260 %if %{?BOOT:1}%{!?BOOT:0}
261 %files BOOT
262 %defattr(644,root,root,755)
263 %attr(755,root,root) /usr/lib/bootdisk/bin/*
264 %endif
This page took 0.04829 seconds and 4 git commands to generate.