]>
Commit | Line | Data |
---|---|---|
47366afb PG |
1 | # |
2 | # Conditional build | |
24643259 | 3 | %bcond_without static # don't build static |
34db5700 | 4 | %bcond_with dietlibc # link with dietlibc, implies without static |
24643259 | 5 | %bcond_with uClibc # link with uclibc |
059491f0 | 6 | # Branch: HEAD |
086f4131 | 7 | |
24643259 | 8 | %if %{with dietlibc} |
9 | %undefine with_static | |
10 | %endif | |
086f4131 | 11 | |
a52a61ad | 12 | Summary: Small bourne shell from Berkeley |
d1a1d19b JR |
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 | |
a52a61ad | 23 | Name: ash |
a53b80aa | 24 | Version: 0.4.0 |
80376774 | 25 | Release: 10 |
a52a61ad | 26 | License: BSD |
2334b4c1 | 27 | Group: Applications/Shells |
5e6d396d | 28 | Source0: %{name}-%{version}.tar.gz |
54ddd2aa | 29 | # Source0-md5: 1c59f5b62a081cb0cb3b053c01d79529 |
d427b829 JB |
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 | |
f9a2efa2 | 50 | Patch20: %{name}-sighup.patch |
5c7bf789 | 51 | Patch21: %{name}-dietlibc.patch |
d427b829 | 52 | BuildRequires: byacc |
24643259 | 53 | %{?with_dietlibc:BuildRequires: dietlibc-devel} |
907c49e7 | 54 | BuildRequires: flex |
24643259 | 55 | %if %{with static} |
15f735d1 | 56 | %{!?with_uClibc:BuildRequires: glibc-static} |
24643259 | 57 | %{?with_uClibc:BuildRequires: uClibc-static > 2:0.9.27-1} |
58 | %endif | |
59 | %{?with_uClibc:BuildRequires: uClibc-devel > 2:0.9.27-1} | |
907c49e7 JB |
60 | Requires(post,preun,verify): grep |
61 | Requires(preun): fileutils | |
fb96503e | 62 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
a52a61ad | 63 | Conflicts: mkinitrd <= 1.7 |
2584bade | 64 | |
25190792 | 65 | %define _bindir /bin |
fe66e27d | 66 | |
2584bade | 67 | %description |
a52a61ad | 68 | ash is a bourne shell clone from Berkeley. It supports all of the |
69 | standard Bourne shell commands and has the advantage of supporting | |
70 | them while remaining considerably smaller than bash. | |
2584bade | 71 | |
d1a1d19b | 72 | %description -l de.UTF-8 |
a52a61ad | 73 | ash ist ein Bourne-Shell-Clone aus Berkeley, der alle |
d1a1d19b | 74 | Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich |
a52a61ad | 75 | weniger Platz beansprucht als bash. |
2584bade | 76 | |
d1a1d19b | 77 | %description -l es.UTF-8 |
d7c36caf | 78 | Ash es un clon del shell bourne de Berkeley. Soporta todos los |
d1a1d19b JR |
79 | comandos padrón de la Bourne shell y tiene la ventaja de soportarlos |
80 | con un tamaño considerablemente menor del que bash. | |
e8d158e7 | 81 | |
d1a1d19b JR |
82 | %description -l fr.UTF-8 |
83 | ash est un clone Berkeley du shell Bourne. Il gère toutes les | |
84 | commandes standard du shell Bourne et a l'avantage de les gérer tout | |
85 | en restant considérablement plus petit que bash. | |
2584bade | 86 | |
d1a1d19b JR |
87 | %description -l pl.UTF-8 |
88 | Ash jest klonem shella Bourne'a z Berkeley. Obsługuje standardowe | |
89 | komendy shella Bourne'a i jest mniejszy niż bash. | |
2584bade | 90 | |
d1a1d19b JR |
91 | %description -l pt_BR.UTF-8 |
92 | ash é um clone do shell bourne de Berkeley. Ele suporta todos os | |
93 | comandos-padrão da Bourne shell e tem a vantagem de suportá-los com um | |
e8d158e7 | 94 | tamanho consideravelmente menor do que bash. |
95 | ||
d1a1d19b JR |
96 | %description -l ru.UTF-8 |
97 | Шелл - это базовая системная программа, которая интерпретирует команды | |
98 | пользователя, вводимые с клавиатуры или при помощи мыши. Ash - это | |
99 | клон Bourne shell (sh) из Беркли. Ash поддерживает все стандартные | |
100 | команды шелла sh, будучи значительно меньше чем sh. В ash отсутствуют | |
101 | некоторые возможности Bourne shell (например, история команд), но он | |
102 | требует значительно меньше памяти. | |
103 | ||
104 | %description -l tr.UTF-8 | |
105 | ash, Berkeley'in bir bourne kabuğu kopyasıdır. Standart bourne kabuğu | |
106 | komutlarının tümünü destekler ve bash kabuğundan daha küçük olma | |
107 | avantajına sahiptir. | |
108 | ||
109 | %description -l uk.UTF-8 | |
110 | Шел - це базова системна програма, котра інтерпретує команди | |
111 | користувача, які вводяться з клавіатури або за допомогою миші. Ash - | |
112 | це клон Bourne shell (sh) з Берклі. Ash підтримує усі стандартні | |
113 | команди шела sh, будучи значно меншим ніж sh. В ash відсутні деякі | |
114 | можливості Bourne shell (наприклад, історія команд), зате він вимагає | |
115 | значно менше пам'яті. | |
2b758f2f | 116 | |
6a376262 | 117 | %package static |
a52a61ad | 118 | Summary: Small bourne shell from Berkeley |
d1a1d19b JR |
119 | Summary(de.UTF-8): Kleine Bourne-Shell von Berkeley |
120 | Summary(fr.UTF-8): Shell Bourne réduit de Berkeley | |
121 | Summary(pl.UTF-8): Mały shell bourne'a | |
122 | Summary(tr.UTF-8): Ufak bir bourne kabuğu | |
2334b4c1 | 123 | Group: Applications/Shells |
907c49e7 JB |
124 | Requires(post,preun,verify): grep |
125 | Requires(preun): fileutils | |
a52a61ad | 126 | Conflicts: mkinitrd <= 1.7 |
6a376262 | 127 | |
128 | %description static | |
a52a61ad | 129 | ash is a bourne shell clone from Berkeley. It supports all of the |
130 | standard Bourne shell commands and has the advantage of supporting | |
131 | them while remaining considerably smaller than bash. | |
6a376262 | 132 | |
d1a1d19b | 133 | %description static -l de.UTF-8 |
a52a61ad | 134 | ash ist ein Bourne-Shell-Clone aus Berkeley, der alle |
d1a1d19b | 135 | Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich |
a52a61ad | 136 | weniger Platz beansprucht als bash. |
6a376262 | 137 | |
d1a1d19b JR |
138 | %description static -l fr.UTF-8 |
139 | ash est un clone Berkeley du shell Bourne. Il gère toutes les | |
140 | commandes standard du shell Bourne et a l'avantage de les gérer tout | |
141 | en restant considérablement plus petit que bash. | |
6a376262 | 142 | |
d1a1d19b JR |
143 | %description static -l pl.UTF-8 |
144 | Ash jest klonem shella Bourne'a z Berkeley. Obsługuje standardowe | |
145 | komendy shella Bourne'a i jest mniejszy niż bash. | |
6a376262 | 146 | |
d1a1d19b JR |
147 | %description static -l tr.UTF-8 |
148 | ash, Berkeley'in bir bourne kabuğu kopyasıdır. Standart bourne kabuğu | |
149 | komutlarının tümünü destekler ve bash kabuğundan daha küçük olma | |
150 | avantajına sahiptir. | |
6a376262 | 151 | |
2584bade | 152 | %prep |
d427b829 | 153 | %setup -q |
a53b80aa MM |
154 | %patch0 -p1 |
155 | %patch1 -p1 | |
156 | %patch2 -p1 | |
157 | %patch3 -p1 | |
158 | %patch4 -p1 | |
159 | %patch5 -p1 | |
160 | %patch6 -p1 | |
161 | %patch7 -p1 | |
162 | %patch8 -p1 | |
163 | %patch9 -p1 | |
83559fb9 | 164 | %patch10 -p1 |
a53b80aa MM |
165 | %patch11 -p1 |
166 | %patch12 -p1 | |
167 | %patch13 -p1 | |
168 | %patch14 -p1 | |
169 | %patch15 -p1 | |
170 | %patch16 -p1 | |
171 | # this is mainly for information, maybe add changelog to %doc? | |
172 | %patch17 -p1 | |
173 | %patch18 -p1 | |
174 | %patch19 -p1 | |
f9a2efa2 | 175 | %patch20 -p1 |
086f4131 | 176 | %{?_with_dietlibc:%patch21 -p1} |
2584bade | 177 | |
178 | %build | |
5c1699eb | 179 | |
24643259 | 180 | %define __cc %{_target_cpu}-pld-linux-gcc |
181 | %{?with_dietlibc:%define __cc %{_target_cpu}-dietlibc-gcc} | |
182 | %{?with_uClibc:%define __cc %{_target_cpu}-uclibc-gcc} | |
086f4131 | 183 | |
24643259 | 184 | %{?with_static:%{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="-static %{rpmldflags}" CC="%{__cc}"} |
185 | %{?with_static:mv -f sh ash.static} | |
a97f8bec | 186 | %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" CC="%{__cc}" |
5c1699eb | 187 | |
2584bade | 188 | %install |
189 | rm -rf $RPM_BUILD_ROOT | |
dedfb4b9 | 190 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1} |
df2126b2 | 191 | |
fe66e27d | 192 | install sh $RPM_BUILD_ROOT%{_bindir}/ash |
24643259 | 193 | %{?with_static:install ash.static $RPM_BUILD_ROOT%{_bindir}/ash.static} |
4da54553 | 194 | install sh.1 $RPM_BUILD_ROOT%{_mandir}/man1/ash.1 |
195 | echo ".so ash.1" > $RPM_BUILD_ROOT%{_mandir}/man1/bsh.1 | |
dedfb4b9 | 196 | ln -sf ash $RPM_BUILD_ROOT%{_bindir}/bsh |
dab08540 | 197 | |
907c49e7 JB |
198 | %clean |
199 | rm -rf $RPM_BUILD_ROOT | |
200 | ||
2584bade | 201 | %post |
907c49e7 | 202 | umask 022 |
19afc58d | 203 | if [ ! -f /etc/shells ]; then |
966b3451 TP |
204 | echo "%{_bindir}/ash" > /etc/shells |
205 | echo "%{_bindir}/bsh" >> /etc/shells | |
19afc58d | 206 | else |
966b3451 TP |
207 | if ! grep -q '^%{_bindir}/ash$' /etc/shells ; then |
208 | echo "%{_bindir}/ash" >> /etc/shells | |
209 | fi | |
210 | if ! grep -q '^%{_bindir}/bsh$' /etc/shells ; then | |
211 | echo "%{_bindir}/bsh" >> /etc/shells | |
212 | fi | |
6a376262 | 213 | fi |
214 | ||
907c49e7 JB |
215 | %preun |
216 | if [ "$1" = 0 ]; then | |
217 | umask 022 | |
218 | grep -v '^%{_bindir}/ash$' /etc/shells | grep -v '^%{_bindir}/bsh$' > /etc/shells.new | |
219 | mv -f /etc/shells.new /etc/shells | |
220 | fi | |
221 | ||
6a376262 | 222 | %post static |
907c49e7 | 223 | umask 022 |
6a376262 | 224 | if [ ! -f /etc/shells ]; then |
966b3451 | 225 | echo "%{_bindir}/ash.static" >> /etc/shells |
6a376262 | 226 | else |
966b3451 TP |
227 | if ! grep -q '^%{_bindir}/ash.static$' /etc/shells ; then |
228 | echo "%{_bindir}/ash.static" >> /etc/shells | |
229 | fi | |
19afc58d | 230 | fi |
2584bade | 231 | |
6a376262 | 232 | %preun static |
4f133cd4 | 233 | if [ "$1" = 0 ]; then |
907c49e7 | 234 | umask 022 |
966b3451 TP |
235 | grep -v '^%{_bindir}/ash\.static$' /etc/shells > /etc/shells.new |
236 | mv -f /etc/shells.new /etc/shells | |
6a376262 | 237 | fi |
238 | ||
2584bade | 239 | %verifyscript |
d427b829 | 240 | for n in ash bsh ; do |
966b3451 TP |
241 | echo -n "Looking for $n in /etc/shells... " |
242 | if ! grep -q "^%{_bindir}/${n}\$" /etc/shells ; then | |
243 | echo "missing" | |
244 | echo "${n} missing from /etc/shells" >&2 | |
245 | else | |
246 | echo "found" | |
247 | fi | |
2584bade | 248 | done |
249 | ||
d427b829 JB |
250 | %verifyscript static |
251 | echo -n "Looking for ash.static in /etc/shells... " | |
252 | if ! grep -q '^%{_bindir}/ash\.static$' /etc/shells ; then | |
253 | echo "missing" | |
254 | echo "ash.static missing from /etc/shells" >&2 | |
255 | else | |
256 | echo "found" | |
257 | fi | |
258 | ||
2584bade | 259 | %files |
e4a82c98 | 260 | %defattr(644,root,root,755) |
fe66e27d SZ |
261 | %attr(755,root,root) %{_bindir}/ash |
262 | %attr(755,root,root) %{_bindir}/bsh | |
4da54553 | 263 | %{_mandir}/man1/* |
6a376262 | 264 | |
24643259 | 265 | %if %{with static} |
266 | %files static | |
267 | %defattr(644,root,root,755) | |
268 | %attr(755,root,root) %{_bindir}/ash.static | |
269 | %endif |