]> git.pld-linux.org Git - packages/ash.git/blob - ash.spec
- dropped pre-cvs changelog
[packages/ash.git] / ash.spec
1 #
2 # Conditional build
3 %bcond_without  static          # don't build static
4 %bcond_with     dietlibc        # link with dietlibc, implies without static
5 %bcond_with     uClibc          # link with uclibc
6 # Branch: HEAD
7
8 %if %{with dietlibc}
9 %undefine       with_static
10 %endif
11
12 Summary:        Small bourne shell from Berkeley
13 Summary(de.UTF-8):      Kleine Bourne-Shell von Berkeley
14 Summary(es.UTF-8):      Pequeña shell bourne de Berkeley
15 Summary(fr.UTF-8):      Shell Bourne réduit de Berkeley
16 Summary(pl.UTF-8):      Mały shell bourne'a
17 Summary(pt_BR.UTF-8):   Pequena shell bourne de Berkeley
18 Summary(ru.UTF-8):      Облегченная версия Bourne shell (sh)
19 Summary(tr.UTF-8):      Ufak bir bourne kabuğu
20 Summary(uk.UTF-8):      Полегшена версія Bourne shell (sh)
21 Summary(zh_CN.UTF-8):   [系统]Berkeley的微型Bourne Shell
22 Summary(zh_TW.UTF-8):   [\e-A系\e$)B統]Berkeley的\e-A微\e$)B型Bourne Shell
23 Name:           ash
24 Version:        0.4.0
25 Release:        11
26 License:        BSD
27 Group:          Applications/Shells
28 Source0:        %{name}-%{version}.tar.gz
29 # Source0-md5:  1c59f5b62a081cb0cb3b053c01d79529
30 Patch0:         %{name}-builtin.patch
31 Patch1:         %{name}-echo.patch
32 Patch2:         %{name}-getcwd.patch
33 Patch3:         %{name}-getopt.patch
34 Patch4:         %{name}-glob.patch
35 Patch5:         %{name}-jobs.patch
36 Patch6:         %{name}-kill.patch
37 Patch7:         %{name}-makefile.patch
38 Patch8:         %{name}-manpage.patch
39 Patch9:         %{name}-hetio.patch
40 Patch10:        %{name}-memout.patch
41 Patch11:        %{name}-misc.patch
42 Patch12:        %{name}-redir.patch
43 Patch13:        %{name}-setmode.patch
44 Patch14:        %{name}-syntax.patch
45 Patch15:        %{name}-test.patch
46 Patch16:        %{name}-times.patch
47 Patch17:        %{name}-debian.patch
48 Patch18:        %{name}-ppid.patch
49 Patch19:        %{name}-freebsd.patch
50 Patch20:        %{name}-sighup.patch
51 Patch21:        %{name}-dietlibc.patch
52 Patch22:        %{name}-extern.patch
53 BuildRequires:  byacc
54 %{?with_dietlibc:BuildRequires: dietlibc-devel}
55 BuildRequires:  flex
56 %if %{with static}
57 %{!?with_uClibc:BuildRequires: glibc-static}
58 %{?with_uClibc:BuildRequires: uClibc-static > 2:0.9.27-1}
59 %endif
60 %{?with_uClibc:BuildRequires: uClibc-devel > 2:0.9.27-1}
61 Requires(post,preun,verify):    grep
62 Requires(preun):        fileutils
63 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64 Conflicts:      mkinitrd <= 1.7
65
66 %define         _bindir         /bin
67
68 %description
69 ash is a bourne shell clone from Berkeley. It supports all of the
70 standard Bourne shell commands and has the advantage of supporting
71 them while remaining considerably smaller than bash.
72
73 %description -l de.UTF-8
74 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
75 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
76 weniger Platz beansprucht als bash.
77
78 %description -l es.UTF-8
79 Ash es un clon del shell bourne de Berkeley. Soporta todos los
80 comandos padrón de la Bourne shell y tiene la ventaja de soportarlos
81 con un tamaño considerablemente menor del que bash.
82
83 %description -l fr.UTF-8
84 ash est un clone Berkeley du shell Bourne. Il gère toutes les
85 commandes standard du shell Bourne et a l'avantage de les gérer tout
86 en restant considérablement plus petit que bash.
87
88 %description -l pl.UTF-8
89 Ash jest klonem shella Bourne'a z Berkeley. Obsługuje standardowe
90 komendy shella Bourne'a i jest mniejszy niż bash.
91
92 %description -l pt_BR.UTF-8
93 ash é um clone do shell bourne de Berkeley. Ele suporta todos os
94 comandos-padrão da Bourne shell e tem a vantagem de suportá-los com um
95 tamanho consideravelmente menor do que bash.
96
97 %description -l ru.UTF-8
98 Шелл - это базовая системная программа, которая интерпретирует команды
99 пользователя, вводимые с клавиатуры или при помощи мыши. Ash - это
100 клон Bourne shell (sh) из Беркли. Ash поддерживает все стандартные
101 команды шелла sh, будучи значительно меньше чем sh. В ash отсутствуют
102 некоторые возможности Bourne shell (например, история команд), но он
103 требует значительно меньше памяти.
104
105 %description -l tr.UTF-8
106 ash, Berkeley'in bir bourne kabuğu kopyasıdır. Standart bourne kabuğu
107 komutlarının tümünü destekler ve bash kabuğundan daha küçük olma
108 avantajına sahiptir.
109
110 %description -l uk.UTF-8
111 Шел - це базова системна програма, котра інтерпретує команди
112 користувача, які вводяться з клавіатури або за допомогою миші. Ash -
113 це клон Bourne shell (sh) з Берклі. Ash підтримує усі стандартні
114 команди шела sh, будучи значно меншим ніж sh. В ash відсутні деякі
115 можливості Bourne shell (наприклад, історія команд), зате він вимагає
116 значно менше пам'яті.
117
118 %package static
119 Summary:        Small bourne shell from Berkeley
120 Summary(de.UTF-8):      Kleine Bourne-Shell von Berkeley
121 Summary(fr.UTF-8):      Shell Bourne réduit de Berkeley
122 Summary(pl.UTF-8):      Mały shell bourne'a
123 Summary(tr.UTF-8):      Ufak bir bourne kabuğu
124 Group:          Applications/Shells
125 Requires(post,preun,verify):    grep
126 Requires(preun):        fileutils
127 Conflicts:      mkinitrd <= 1.7
128
129 %description static
130 ash is a bourne shell clone from Berkeley. It supports all of the
131 standard Bourne shell commands and has the advantage of supporting
132 them while remaining considerably smaller than bash.
133
134 %description static -l de.UTF-8
135 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
136 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
137 weniger Platz beansprucht als bash.
138
139 %description static -l fr.UTF-8
140 ash est un clone Berkeley du shell Bourne. Il gère toutes les
141 commandes standard du shell Bourne et a l'avantage de les gérer tout
142 en restant considérablement plus petit que bash.
143
144 %description static -l pl.UTF-8
145 Ash jest klonem shella Bourne'a z Berkeley. Obsługuje standardowe
146 komendy shella Bourne'a i jest mniejszy niż bash.
147
148 %description static -l tr.UTF-8
149 ash, Berkeley'in bir bourne kabuğu kopyasıdır. Standart bourne kabuğu
150 komutlarının tümünü destekler ve bash kabuğundan daha küçük olma
151 avantajına sahiptir.
152
153 %prep
154 %setup -q
155 %patch0 -p1
156 %patch1 -p1
157 %patch2 -p1
158 %patch3 -p1
159 %patch4 -p1
160 %patch5 -p1
161 %patch6 -p1
162 %patch7 -p1
163 %patch8 -p1
164 %patch9 -p1
165 %patch10 -p1
166 %patch11 -p1
167 %patch12 -p1
168 %patch13 -p1
169 %patch14 -p1
170 %patch15 -p1
171 %patch16 -p1
172 # this is mainly for information, maybe add changelog to %doc?
173 %patch17 -p1
174 %patch18 -p1
175 %patch19 -p1
176 %patch20 -p1
177 %{?_with_dietlibc:%patch21 -p1}
178 %patch22 -p1
179
180 %build
181 %if %{with static}
182 %{__make} \
183 %if %{with dietlibc}
184         CC="diet %{__cc}" \
185 %else
186 %if %{with uClibc}
187         CC="%{_target_cpu}-uclibc-gcc"\
188 %else
189         CC="%{__cc}"
190 %endif
191 %endif
192         OPT_FLAGS="%{rpmcflags} -Os" \
193         LDFLAGS="-static %{rpmldflags}"
194
195 mv -f sh ash.static
196 %endif
197
198 %{__make} \
199         CC="%{__cc}" \
200         OPT_FLAGS="%{rpmcflags}" \
201         LDFLAGS="%{rpmldflags}"
202
203 %install
204 rm -rf $RPM_BUILD_ROOT
205 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
206
207 install sh $RPM_BUILD_ROOT%{_bindir}/ash
208 %{?with_static:install ash.static $RPM_BUILD_ROOT%{_bindir}/ash.static}
209 install sh.1 $RPM_BUILD_ROOT%{_mandir}/man1/ash.1
210 echo ".so ash.1" > $RPM_BUILD_ROOT%{_mandir}/man1/bsh.1
211 ln -sf ash $RPM_BUILD_ROOT%{_bindir}/bsh
212
213 %clean
214 rm -rf $RPM_BUILD_ROOT
215
216 %post
217 umask 022
218 if [ ! -f /etc/shells ]; then
219         echo "%{_bindir}/ash" > /etc/shells
220         echo "%{_bindir}/bsh" >> /etc/shells
221 else
222         if ! grep -q '^%{_bindir}/ash$' /etc/shells ; then
223                 echo "%{_bindir}/ash" >> /etc/shells
224         fi
225         if ! grep -q '^%{_bindir}/bsh$' /etc/shells ; then
226                 echo "%{_bindir}/bsh" >> /etc/shells
227         fi
228 fi
229
230 %preun
231 if [ "$1" = 0 ]; then
232         umask 022
233         grep -v '^%{_bindir}/ash$' /etc/shells | grep -v '^%{_bindir}/bsh$' > /etc/shells.new
234         mv -f /etc/shells.new /etc/shells
235 fi
236
237 %post static
238 umask 022
239 if [ ! -f /etc/shells ]; then
240         echo "%{_bindir}/ash.static" >> /etc/shells
241 else
242         if ! grep -q '^%{_bindir}/ash.static$' /etc/shells ; then
243                 echo "%{_bindir}/ash.static" >> /etc/shells
244         fi
245 fi
246
247 %preun static
248 if [ "$1" = 0 ]; then
249         umask 022
250         grep -v '^%{_bindir}/ash\.static$' /etc/shells > /etc/shells.new
251         mv -f /etc/shells.new /etc/shells
252 fi
253
254 %verifyscript
255 for n in ash bsh ; do
256         echo -n "Looking for $n in /etc/shells... "
257         if ! grep -q "^%{_bindir}/${n}\$" /etc/shells ; then
258                 echo "missing"
259                 echo "${n} missing from /etc/shells" >&2
260         else
261                 echo "found"
262         fi
263 done
264
265 %verifyscript static
266 echo -n "Looking for ash.static in /etc/shells... "
267 if ! grep -q '^%{_bindir}/ash\.static$' /etc/shells ; then
268         echo "missing"
269         echo "ash.static missing from /etc/shells" >&2
270 else
271         echo "found"
272 fi
273
274 %files
275 %defattr(644,root,root,755)
276 %attr(755,root,root) %{_bindir}/ash
277 %attr(755,root,root) %{_bindir}/bsh
278 %{_mandir}/man1/*
279
280 %if %{with static}
281 %files static
282 %defattr(644,root,root,755)
283 %attr(755,root,root) %{_bindir}/ash.static
284 %endif
This page took 0.040455 seconds and 3 git commands to generate.