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