]> git.pld-linux.org Git - packages/ash.git/blob - ash.spec
- removed patching non-existing eval.c.orig from memout patch
[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 %{?BOOT:BuildRequires:  uClibc-devel-BOOT}
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 Conflicts:      mkinitrd <= 1.7
44
45 %define         _bindir         /bin
46
47 %description
48 ash is a bourne shell clone from Berkeley. It supports all of the
49 standard Bourne shell commands and has the advantage of supporting
50 them while remaining considerably smaller than bash.
51
52 %description -l de
53 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
54 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
55 weniger Platz beansprucht als bash.
56
57 %description -l fr
58 ash est un clone Berkeley du shell Bourne. Il gère toutes les
59 commandes standard du shell Bourne et a l'avantage de les gérer tout
60 en restant considérablement plus petit que bash.
61
62 %description -l pl
63 Ash jest klonem shell'a Bourne'a z Berkeley. Obs³uguje standardowe
64 komendy shell'a Bourne'a i jest mniejszy ni¿ bash.
65
66 %description -l tr
67 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
68 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
69 avantajýna sahiptir.
70
71 %package static
72 Summary:        Small bourne shell from Berkeley
73 Summary(de):    Kleine Bourne-Shell von Berkeley
74 Summary(fr):    Shell Bourne réduit de Berkeley
75 Summary(pl):    Ma³y shell bourne'a 
76 Summary(tr):    Ufak bir bourne kabuðu
77 Group:          Applications/Shells
78 Group(de):      Applikationen/Shells
79 Group(pl):      Aplikacje/Pow³oki
80 Prereq:         fileutils
81 Prereq:         grep
82 Conflicts:      mkinitrd <= 1.7
83
84 %description static
85 ash is a bourne shell clone from Berkeley. It supports all of the
86 standard Bourne shell commands and has the advantage of supporting
87 them while remaining considerably smaller than bash.
88
89 %description static -l de
90 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
91 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
92 weniger Platz beansprucht als bash.
93
94 %description static -l fr
95 ash est un clone Berkeley du shell Bourne. Il gère toutes les
96 commandes standard du shell Bourne et a l'avantage de les gérer tout
97 en restant considérablement plus petit que bash.
98
99 %description static -l pl
100 Ash jest klonem shell'a Bourne'a z Berkeley. Obs³uguje standardowe
101 komendy shell'a Bourne'a i jest mniejszy ni¿ bash.
102
103 %description static -l tr
104 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
105 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
106 avantajýna sahiptir.
107
108 %if %{?BOOT:1}%{!?BOOT:0}
109 %package BOOT
110 Summary:        Small bourne shell from Berkeley
111 Summary(de):    Kleine Bourne-Shell von Berkeley
112 Summary(fr):    Shell Bourne réduit de Berkeley
113 Summary(pl):    Ma³y shell bourne'a 
114 Summary(tr):    Ufak bir bourne kabuðu
115 Group:          Applications/Shells
116 Group(de):      Applikationen/Shells
117 Group(pl):      Aplikacje/Pow³oki
118
119 %description BOOT
120 ash is a bourne shell clone from Berkeley. It supports all of the
121 standard Bourne shell commands and has the advantage of supporting
122 them while remaining considerably smaller than bash.
123 Version for bootdisk
124
125 %endif
126
127 %prep
128 %setup -q
129 %patch0 -p1
130 %patch1 -p1
131 %patch2 -p1
132 %patch3 -p1
133 %patch4 -p1
134 %patch5 -p1
135 %patch6 -p1
136 %patch7 -p1
137 %patch8 -p1
138 %patch9 -p1
139 %patch10 -p1
140 %patch11 -p1
141 %patch12 -p1
142 %patch13 -p1
143 %patch14 -p1
144 %patch15 -p1
145 %patch16 -p1
146 # this is mainly for information, maybe add changelog to %doc?
147 %patch17 -p1
148 %patch18 -p1
149 %patch19 -p1
150
151 %build
152 # BOOT
153 %if %{?BOOT:1}%{!?BOOT:0}
154 %{__make} \
155         OPT_FLAGS="-I/usr/lib/bootdisk%{_includedir} -Os" \
156         LDFLAGS="-nostdlib %{rpmldflags}" \
157         LDLIBS="%{_libdir}/bootdisk%{_libdir}/crt0.o %{_libdir}/bootdisk%{_libdir}/libc.a -lgcc"
158 mv -f sh ash.BOOT
159 %{__make} clean
160 %endif
161
162 # other
163 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="-static %{rpmldflags}"
164 mv -f sh ash.static
165 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}"
166
167 %install
168 rm -rf $RPM_BUILD_ROOT
169
170 # BOOT
171 %if %{?BOOT:1}%{!?BOOT:0}
172 install -d $RPM_BUILD_ROOT/usr/lib/bootdisk/bin
173 install ash.BOOT $RPM_BUILD_ROOT/usr/lib/bootdisk/bin/ash
174 ln -sf ash $RPM_BUILD_ROOT/usr/lib/bootdisk/bin/sh
175 %endif
176
177 # other
178 install -d $RPM_BUILD_ROOT/{%{_bindir},%{_mandir}/man1}
179 install sh $RPM_BUILD_ROOT%{_bindir}/ash
180 install ash.static $RPM_BUILD_ROOT%{_bindir}/ash.static
181 install sh.1 $RPM_BUILD_ROOT%{_mandir}/man1/ash.1
182 echo ".so ash.1" > $RPM_BUILD_ROOT%{_mandir}/man1/bsh.1
183 ln -sf ash $RPM_BUILD_ROOT/%{_bindir}/bsh
184
185 %post
186 if [ ! -f /etc/shells ]; then
187         echo "%{_bindir}/ash" > /etc/shells
188         echo "%{_bindir}/bsh" >> /etc/shells
189 else
190         if ! grep -q '^%{_bindir}/ash$' /etc/shells ; then
191                 echo "%{_bindir}/ash" >> /etc/shells
192         fi
193         if ! grep -q '^%{_bindir}/bsh$' /etc/shells ; then
194                 echo "%{_bindir}/bsh" >> /etc/shells
195         fi
196 fi
197
198 %post static
199 if [ ! -f /etc/shells ]; then
200         echo "%{_bindir}/ash.static" >> /etc/shells
201 else
202         if ! grep -q '^%{_bindir}/ash.static$' /etc/shells ; then
203                 echo "%{_bindir}/ash.static" >> /etc/shells
204         fi
205 fi
206
207 %preun
208 if [ "$0" = 0 ]; then
209         grep -v '^%{_bindir}/ash$' /etc/shells | grep -v '^%{_bindir}/bsh$' > /etc/shells.new
210         mv -f /etc/shells.new /etc/shells
211 fi
212
213 %preun static
214 if [ "$0" = 0 ]; then
215         grep -v '^%{_bindir}/ash\.static$' /etc/shells > /etc/shells.new
216         mv -f /etc/shells.new /etc/shells
217 fi
218
219 %verifyscript
220 for n in ash bsh ; do
221     echo -n "Looking for $n in /etc/shells... "
222     if ! grep -q "^%{_bindir}/${n}\$" /etc/shells ; then
223         echo "missing"
224         echo "${n} missing from /etc/shells" >&2
225     else
226         echo "found"
227     fi
228 done
229
230 %verifyscript static
231 echo -n "Looking for ash.static in /etc/shells... "
232 if ! grep -q '^%{_bindir}/ash\.static$' /etc/shells ; then
233         echo "missing"
234         echo "ash.static missing from /etc/shells" >&2
235 else
236         echo "found"
237 fi
238
239 %clean
240 rm -rf $RPM_BUILD_ROOT
241
242 %files
243 %defattr(644,root,root,755)
244 %attr(755,root,root) %{_bindir}/ash
245 %attr(755,root,root) %{_bindir}/bsh
246 %{_mandir}/man1/*
247
248 %files static
249 %defattr(644,root,root,755)
250 %attr(755,root,root) %{_bindir}/ash.static
251
252 %if %{?BOOT:1}%{!?BOOT:0}
253 %files BOOT
254 %defattr(644,root,root,755)
255 %attr(755,root,root) /usr/lib/bootdisk/bin/*
256 %endif
This page took 0.082121 seconds and 4 git commands to generate.