]> git.pld-linux.org Git - packages/ash.git/blob - ash.spec
- fixed for uclibc
[packages/ash.git] / ash.spec
1 # Branch: HEAD
2 # conditional build:
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
9 Name:           ash
10 Version:        0.4.0
11 Release:        5
12 License:        BSD
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
38 Prereq:         fileutils
39 Prereq:         grep
40 BuildRequires:  glibc-static
41 BuildRequires:  flex
42 BuildRequires:  byacc
43 %if %{!?_without_embed:1}%{?_without_embed:0}
44 BuildRequires:  uClibc-devel
45 BuildRequires:  uClibc-static
46 %endif
47 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 Conflicts:      mkinitrd <= 1.7
49
50 %define embed_path      /usr/lib/embed
51 %define embed_cc        %{_arch}-uclibc-cc
52 %define embed_cflags    %{rpmcflags} -Os
53
54 %define         _bindir         /bin
55
56 %description
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.
60
61 %description -l de
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.
65
66 %description -l fr
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.
70
71 %description -l pl
72 Ash jest klonem shell'a Bourne'a z Berkeley. Obs³uguje standardowe
73 komendy shell'a Bourne'a i jest mniejszy ni¿ bash.
74
75 %description -l tr
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
78 avantajýna sahiptir.
79
80 %package static
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
89 Prereq:         fileutils
90 Prereq:         grep
91 Conflicts:      mkinitrd <= 1.7
92
93 %description static
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.
97
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.
102
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.
107
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.
111
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
115 avantajýna sahiptir.
116
117 %package embed
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
126
127 %description embed
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.
132
133 %prep
134 %setup -q
135 %patch0 -p1
136 %patch1 -p1
137 %patch2 -p1
138 %patch3 -p1
139 %patch4 -p1
140 %patch5 -p1
141 %patch6 -p1
142 %patch7 -p1
143 %patch8 -p1
144 %patch9 -p1
145 %patch10 -p1
146 %patch11 -p1
147 %patch12 -p1
148 %patch13 -p1
149 %patch14 -p1
150 %patch15 -p1
151 %patch16 -p1
152 # this is mainly for information, maybe add changelog to %doc?
153 %patch17 -p1
154 %patch18 -p1
155 %patch19 -p1
156 %patch20 -p1
157
158 %build
159 # BOOT
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
164 %{__make} \
165         OPT_FLAGS="%{embed_cflags}" \
166         CC=%{embed_cc}
167 mv -f sh ash-embed-shared
168 %{__make} \
169         OPT_FLAGS="%{embed_cflags}" \
170         LDFLAGS="-static" \
171         CC=%{embed_cc}
172 mv -f sh ash-embed-static
173 %{__make} clean
174 %endif
175
176 # other
177 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="-static %{rpmldflags}"
178 mv -f sh ash.static
179 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}"
180
181 %install
182 rm -rf $RPM_BUILD_ROOT
183
184 # BOOT
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
191 %endif
192
193 # other
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
200
201 %post
202 if [ ! -f /etc/shells ]; then
203         echo "%{_bindir}/ash" > /etc/shells
204         echo "%{_bindir}/bsh" >> /etc/shells
205 else
206         if ! grep -q '^%{_bindir}/ash$' /etc/shells ; then
207                 echo "%{_bindir}/ash" >> /etc/shells
208         fi
209         if ! grep -q '^%{_bindir}/bsh$' /etc/shells ; then
210                 echo "%{_bindir}/bsh" >> /etc/shells
211         fi
212 fi
213
214 %post static
215 if [ ! -f /etc/shells ]; then
216         echo "%{_bindir}/ash.static" >> /etc/shells
217 else
218         if ! grep -q '^%{_bindir}/ash.static$' /etc/shells ; then
219                 echo "%{_bindir}/ash.static" >> /etc/shells
220         fi
221 fi
222
223 %preun
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
227 fi
228
229 %preun static
230 if [ "$1" = 0 ]; then
231         grep -v '^%{_bindir}/ash\.static$' /etc/shells > /etc/shells.new
232         mv -f /etc/shells.new /etc/shells
233 fi
234
235 %verifyscript
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
239         echo "missing"
240         echo "${n} missing from /etc/shells" >&2
241     else
242         echo "found"
243     fi
244 done
245
246 %verifyscript static
247 echo -n "Looking for ash.static in /etc/shells... "
248 if ! grep -q '^%{_bindir}/ash\.static$' /etc/shells ; then
249         echo "missing"
250         echo "ash.static missing from /etc/shells" >&2
251 else
252         echo "found"
253 fi
254
255 %clean
256 rm -rf $RPM_BUILD_ROOT
257
258 %files
259 %defattr(644,root,root,755)
260 %attr(755,root,root) %{_bindir}/ash
261 %attr(755,root,root) %{_bindir}/bsh
262 %{_mandir}/man1/*
263
264 %files static
265 %defattr(644,root,root,755)
266 %attr(755,root,root) %{_bindir}/ash.static
267
268 %if %{!?_without_embed:1}%{?_without_embed:0}
269 %files embed
270 %defattr(644,root,root,755)
271 %attr(755,root,root) %{embed_path}/*/*
272 %endif
This page took 0.098079 seconds and 3 git commands to generate.