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