]> git.pld-linux.org Git - packages/ash.git/blob - ash.spec
- BR: dietlibc-static (conditional)
[packages/ash.git] / ash.spec
1 # conditional build
2 # --without static
3 # --with dietlibc (link with dietlibc, implies --without static)
4 # Branch: HEAD
5
6 %{?_with_dietlibc:%define _without_static 1}
7
8 Summary:        Small bourne shell from Berkeley
9 Summary(de):    Kleine Bourne-Shell von Berkeley
10 Summary(fr):    Shell Bourne réduit de Berkeley
11 Summary(pl):    Ma³y shell bourne'a
12 Summary(ru):    ïÂÌÅÇÞÅÎÎÁÑ ×ÅÒÓÉÑ Bourne shell (sh)
13 Summary(tr):    Ufak bir bourne kabuðu
14 Summary(uk):    ðÏÌÅÇÛÅÎÁ ×ÅÒӦѠBourne shell (sh)
15 Name:           ash
16 Version:        0.4.0
17 Release:        8
18 License:        BSD
19 Group:          Applications/Shells
20 Source0:        %{name}-%{version}.tar.gz
21 Patch0:         %{name}-builtin.patch
22 Patch1:         %{name}-echo.patch
23 Patch2:         %{name}-getcwd.patch
24 Patch3:         %{name}-getopt.patch
25 Patch4:         %{name}-glob.patch
26 Patch5:         %{name}-jobs.patch
27 Patch6:         %{name}-kill.patch
28 Patch7:         %{name}-makefile.patch
29 Patch8:         %{name}-manpage.patch
30 Patch9:         %{name}-hetio.patch
31 Patch10:        %{name}-memout.patch
32 Patch11:        %{name}-misc.patch
33 Patch12:        %{name}-redir.patch
34 Patch13:        %{name}-setmode.patch
35 Patch14:        %{name}-syntax.patch
36 Patch15:        %{name}-test.patch
37 Patch16:        %{name}-times.patch
38 Patch17:        %{name}-debian.patch
39 Patch18:        %{name}-ppid.patch
40 Patch19:        %{name}-freebsd.patch
41 Patch20:        %{name}-sighup.patch
42 %{?_with_dietlibc:Patch21:      %{name}-dietlibc.patch}
43 PreReq:         fileutils
44 PreReq:         grep
45 %{!?_without_static:BuildRequires:      glibc-static}
46 %{?_with_dietlibc:BuildRequires:        dietlibc-static}
47 BuildRequires:  flex
48 BuildRequires:  byacc
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 Conflicts:      mkinitrd <= 1.7
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 ru
74 ûÅÌÌ - ÜÔÏ ÂÁÚÏ×ÁÑ ÓÉÓÔÅÍÎÁÑ ÐÒÏÇÒÁÍÍÁ, ËÏÔÏÒÁÑ ÉÎÔÅÒÐÒÅÔÉÒÕÅÔ ËÏÍÁÎÄÙ
75 ÐÏÌØÚÏ×ÁÔÅÌÑ, ××ÏÄÉÍÙÅ Ó ËÌÁ×ÉÁÔÕÒÙ ÉÌÉ ÐÒÉ ÐÏÍÏÝÉ ÍÙÛÉ. Ash - ÜÔÏ
76 ËÌÏΠBourne shell (sh) ÉÚ âÅÒËÌÉ. Ash ÐÏÄÄÅÒÖÉ×ÁÅÔ ×ÓÅ ÓÔÁÎÄÁÒÔÎÙÅ
77 ËÏÍÁÎÄÙ ÛÅÌÌÁ sh, ÂÕÄÕÞÉ ÚÎÁÞÉÔÅÌØÎÏ ÍÅÎØÛÅ ÞÅÍ sh. ÷ ash ÏÔÓÕÔÓÔ×ÕÀÔ
78 ÎÅËÏÔÏÒÙÅ ×ÏÚÍÏÖÎÏÓÔÉ Bourne shell (ÎÁÐÒÉÍÅÒ, ÉÓÔÏÒÉÑ ËÏÍÁÎÄ), ÎÏ ÏÎ
79 ÔÒÅÂÕÅÔ ÚÎÁÞÉÔÅÌØÎÏ ÍÅÎØÛÅ ÐÁÍÑÔÉ.
80
81 %description -l tr
82 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
83 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
84 avantajýna sahiptir.
85
86 %description -l uk
87 ûÅÌ - ÃÅ ÂÁÚÏ×Á ÓÉÓÔÅÍÎÁ ÐÒÏÇÒÁÍÁ, ËÏÔÒÁ ¦ÎÔÅÒÐÒÅÔÕ¤ ËÏÍÁÎÄÉ
88 ËÏÒÉÓÔÕ×ÁÞÁ, Ñ˦ ××ÏÄÑÔØÓÑ Ú ËÌÁצÁÔÕÒÉ ÁÂÏ ÚÁ ÄÏÐÏÍÏÇÏÀ ÍÉÛ¦. Ash -
89 ÃÅ ËÌÏΠBourne shell (sh) Ú âÅÒË̦. Ash Ð¦ÄÔÒÉÍÕ¤ ÕÓ¦ ÓÔÁÎÄÁÒÔΦ
90 ËÏÍÁÎÄÉ ÛÅÌÁ sh, ÂÕÄÕÞÉ ÚÎÁÞÎÏ ÍÅÎÛÉ͠Φ֠sh. ÷ ash ×¦ÄÓÕÔΦ ÄÅÑ˦
91 ÍÏÖÌÉ×ÏÓÔ¦ Bourne shell (ÎÁÐÒÉËÌÁÄ, ¦ÓÔÏҦѠËÏÍÁÎÄ), ÚÁÔŠצΠ×ÉÍÁÇÁ¤
92 ÚÎÁÞÎÏ ÍÅÎÛÅ ÐÁÍ'ÑÔ¦.
93
94 %package static
95 Summary:        Small bourne shell from Berkeley
96 Summary(de):    Kleine Bourne-Shell von Berkeley
97 Summary(fr):    Shell Bourne réduit de Berkeley
98 Summary(pl):    Ma³y shell bourne'a
99 Summary(tr):    Ufak bir bourne kabuðu
100 Group:          Applications/Shells
101 PreReq:         fileutils
102 PreReq:         grep
103 Conflicts:      mkinitrd <= 1.7
104
105 %description static
106 ash is a bourne shell clone from Berkeley. It supports all of the
107 standard Bourne shell commands and has the advantage of supporting
108 them while remaining considerably smaller than bash.
109
110 %description static -l de
111 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
112 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
113 weniger Platz beansprucht als bash.
114
115 %description static -l fr
116 ash est un clone Berkeley du shell Bourne. Il gère toutes les
117 commandes standard du shell Bourne et a l'avantage de les gérer tout
118 en restant considérablement plus petit que bash.
119
120 %description static -l pl
121 Ash jest klonem shella Bourne'a z Berkeley. Obs³uguje standardowe
122 komendy shella Bourne'a i jest mniejszy ni¿ bash.
123
124 %description static -l tr
125 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
126 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
127 avantajýna sahiptir.
128
129 %prep
130 %setup -q
131 %patch0 -p1
132 %patch1 -p1
133 %patch2 -p1
134 %patch3 -p1
135 %patch4 -p1
136 %patch5 -p1
137 %patch6 -p1
138 %patch7 -p1
139 %patch8 -p1
140 %patch9 -p1
141 %patch10 -p1
142 %patch11 -p1
143 %patch12 -p1
144 %patch13 -p1
145 %patch14 -p1
146 %patch15 -p1
147 %patch16 -p1
148 # this is mainly for information, maybe add changelog to %doc?
149 %patch17 -p1
150 %patch18 -p1
151 %patch19 -p1
152 %patch20 -p1
153 %{?_with_dietlibc:%patch21 -p1}
154
155 %build
156
157 %{?_with_dietlibc:%define __cc %{_arch}-dietlibc-gcc}
158
159 %{!?_without_static:%{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="-static %{rpmldflags}"}
160 %{!?_without_static:mv -f sh ash.static}
161 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" CC="%{__cc}"
162
163 %install
164 rm -rf $RPM_BUILD_ROOT
165
166 install -d $RPM_BUILD_ROOT/{%{_bindir},%{_mandir}/man1}
167 install sh $RPM_BUILD_ROOT%{_bindir}/ash
168 %{!?_without_static:install ash.static $RPM_BUILD_ROOT%{_bindir}/ash.static}
169 install sh.1 $RPM_BUILD_ROOT%{_mandir}/man1/ash.1
170 echo ".so ash.1" > $RPM_BUILD_ROOT%{_mandir}/man1/bsh.1
171 ln -sf ash $RPM_BUILD_ROOT/%{_bindir}/bsh
172
173 %post
174 if [ ! -f /etc/shells ]; then
175         echo "%{_bindir}/ash" > /etc/shells
176         echo "%{_bindir}/bsh" >> /etc/shells
177 else
178         if ! grep -q '^%{_bindir}/ash$' /etc/shells ; then
179                 echo "%{_bindir}/ash" >> /etc/shells
180         fi
181         if ! grep -q '^%{_bindir}/bsh$' /etc/shells ; then
182                 echo "%{_bindir}/bsh" >> /etc/shells
183         fi
184 fi
185
186 %post static
187 if [ ! -f /etc/shells ]; then
188         echo "%{_bindir}/ash.static" >> /etc/shells
189 else
190         if ! grep -q '^%{_bindir}/ash.static$' /etc/shells ; then
191                 echo "%{_bindir}/ash.static" >> /etc/shells
192         fi
193 fi
194
195 %preun
196 if [ "$1" = 0 ]; then
197         grep -v '^%{_bindir}/ash$' /etc/shells | grep -v '^%{_bindir}/bsh$' > /etc/shells.new
198         mv -f /etc/shells.new /etc/shells
199 fi
200
201 %preun static
202 if [ "$1" = 0 ]; then
203         grep -v '^%{_bindir}/ash\.static$' /etc/shells > /etc/shells.new
204         mv -f /etc/shells.new /etc/shells
205 fi
206
207 %verifyscript
208 for n in ash bsh ; do
209         echo -n "Looking for $n in /etc/shells... "
210         if ! grep -q "^%{_bindir}/${n}\$" /etc/shells ; then
211                 echo "missing"
212                 echo "${n} missing from /etc/shells" >&2
213         else
214                 echo "found"
215         fi
216 done
217
218 %verifyscript static
219 echo -n "Looking for ash.static in /etc/shells... "
220 if ! grep -q '^%{_bindir}/ash\.static$' /etc/shells ; then
221         echo "missing"
222         echo "ash.static missing from /etc/shells" >&2
223 else
224         echo "found"
225 fi
226
227 %clean
228 rm -rf $RPM_BUILD_ROOT
229
230 %files
231 %defattr(644,root,root,755)
232 %attr(755,root,root) %{_bindir}/ash
233 %attr(755,root,root) %{_bindir}/bsh
234 %{_mandir}/man1/*
235
236 %{!?_without_static:%files static}
237 %{!?_without_static:%defattr(644,root,root,755)}
238 %{!?_without_static:%attr(755,root,root) %{_bindir}/ash.static}
This page took 0.054538 seconds and 4 git commands to generate.