]> git.pld-linux.org Git - packages/ash.git/blob - ash.spec
- ash-extern.patch: a variable can't be both extern and static
[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
182 %define __cc %{_target_cpu}-pld-linux-gcc
183 %{?with_dietlibc:%define __cc %{_target_cpu}-dietlibc-gcc}
184 %{?with_uClibc:%define __cc %{_target_cpu}-uclibc-gcc}
185
186 %{?with_static:%{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="-static %{rpmldflags}" CC="%{__cc}"}
187 %{?with_static:mv -f sh ash.static}
188 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" CC="%{__cc}"
189
190 %install
191 rm -rf $RPM_BUILD_ROOT
192 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
193
194 install sh $RPM_BUILD_ROOT%{_bindir}/ash
195 %{?with_static: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 %clean
201 rm -rf $RPM_BUILD_ROOT
202
203 %post
204 umask 022
205 if [ ! -f /etc/shells ]; then
206         echo "%{_bindir}/ash" > /etc/shells
207         echo "%{_bindir}/bsh" >> /etc/shells
208 else
209         if ! grep -q '^%{_bindir}/ash$' /etc/shells ; then
210                 echo "%{_bindir}/ash" >> /etc/shells
211         fi
212         if ! grep -q '^%{_bindir}/bsh$' /etc/shells ; then
213                 echo "%{_bindir}/bsh" >> /etc/shells
214         fi
215 fi
216
217 %preun
218 if [ "$1" = 0 ]; then
219         umask 022
220         grep -v '^%{_bindir}/ash$' /etc/shells | grep -v '^%{_bindir}/bsh$' > /etc/shells.new
221         mv -f /etc/shells.new /etc/shells
222 fi
223
224 %post static
225 umask 022
226 if [ ! -f /etc/shells ]; then
227         echo "%{_bindir}/ash.static" >> /etc/shells
228 else
229         if ! grep -q '^%{_bindir}/ash.static$' /etc/shells ; then
230                 echo "%{_bindir}/ash.static" >> /etc/shells
231         fi
232 fi
233
234 %preun static
235 if [ "$1" = 0 ]; then
236         umask 022
237         grep -v '^%{_bindir}/ash\.static$' /etc/shells > /etc/shells.new
238         mv -f /etc/shells.new /etc/shells
239 fi
240
241 %verifyscript
242 for n in ash bsh ; do
243         echo -n "Looking for $n in /etc/shells... "
244         if ! grep -q "^%{_bindir}/${n}\$" /etc/shells ; then
245                 echo "missing"
246                 echo "${n} missing from /etc/shells" >&2
247         else
248                 echo "found"
249         fi
250 done
251
252 %verifyscript static
253 echo -n "Looking for ash.static in /etc/shells... "
254 if ! grep -q '^%{_bindir}/ash\.static$' /etc/shells ; then
255         echo "missing"
256         echo "ash.static missing from /etc/shells" >&2
257 else
258         echo "found"
259 fi
260
261 %files
262 %defattr(644,root,root,755)
263 %attr(755,root,root) %{_bindir}/ash
264 %attr(755,root,root) %{_bindir}/bsh
265 %{_mandir}/man1/*
266
267 %if %{with static}
268 %files static
269 %defattr(644,root,root,755)
270 %attr(755,root,root) %{_bindir}/ash.static
271 %endif
This page took 0.085819 seconds and 4 git commands to generate.