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