]> git.pld-linux.org Git - packages/ash.git/blob - ash.spec
- umask in scripts, other fixes/cosmetics where needed
[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 Patch21:        %{name}-dietlibc.patch
43 %{!?_without_static:BuildRequires:      glibc-static}
44 %{?_with_dietlibc:BuildRequires:        dietlibc-static}
45 BuildRequires:  byacc
46 BuildRequires:  flex
47 Requires(post,preun,verify):    grep
48 Requires(preun):        fileutils
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 Requires(post,preun,verify):    grep
102 Requires(preun):        fileutils
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 %clean
174 rm -rf $RPM_BUILD_ROOT
175
176 %post
177 umask 022
178 if [ ! -f /etc/shells ]; then
179         echo "%{_bindir}/ash" > /etc/shells
180         echo "%{_bindir}/bsh" >> /etc/shells
181 else
182         if ! grep -q '^%{_bindir}/ash$' /etc/shells ; then
183                 echo "%{_bindir}/ash" >> /etc/shells
184         fi
185         if ! grep -q '^%{_bindir}/bsh$' /etc/shells ; then
186                 echo "%{_bindir}/bsh" >> /etc/shells
187         fi
188 fi
189
190 %preun
191 if [ "$1" = 0 ]; then
192         umask 022
193         grep -v '^%{_bindir}/ash$' /etc/shells | grep -v '^%{_bindir}/bsh$' > /etc/shells.new
194         mv -f /etc/shells.new /etc/shells
195 fi
196
197 %post static
198 umask 022
199 if [ ! -f /etc/shells ]; then
200         echo "%{_bindir}/ash.static" >> /etc/shells
201 else
202         if ! grep -q '^%{_bindir}/ash.static$' /etc/shells ; then
203                 echo "%{_bindir}/ash.static" >> /etc/shells
204         fi
205 fi
206
207 %preun static
208 if [ "$1" = 0 ]; then
209         umask 022
210         grep -v '^%{_bindir}/ash\.static$' /etc/shells > /etc/shells.new
211         mv -f /etc/shells.new /etc/shells
212 fi
213
214 %verifyscript
215 for n in ash bsh ; do
216         echo -n "Looking for $n in /etc/shells... "
217         if ! grep -q "^%{_bindir}/${n}\$" /etc/shells ; then
218                 echo "missing"
219                 echo "${n} missing from /etc/shells" >&2
220         else
221                 echo "found"
222         fi
223 done
224
225 %verifyscript static
226 echo -n "Looking for ash.static in /etc/shells... "
227 if ! grep -q '^%{_bindir}/ash\.static$' /etc/shells ; then
228         echo "missing"
229         echo "ash.static missing from /etc/shells" >&2
230 else
231         echo "found"
232 fi
233
234 %files
235 %defattr(644,root,root,755)
236 %attr(755,root,root) %{_bindir}/ash
237 %attr(755,root,root) %{_bindir}/bsh
238 %{_mandir}/man1/*
239
240 %{!?_without_static:%files static}
241 %{!?_without_static:%defattr(644,root,root,755)}
242 %{!?_without_static:%attr(755,root,root) %{_bindir}/ash.static}
This page took 0.042453 seconds and 4 git commands to generate.