]> git.pld-linux.org Git - packages/ash.git/blob - ash.spec
im just testing one helper
[packages/ash.git] / ash.spec
1 # Env: 123
2 # Branch: HEAD
3 # conditional build:
4 # if BOOT is defined, build BOOT package too
5 Summary:        Small bourne shell from Berkeley
6 Summary(de):    Kleine Bourne-Shell von Berkeley
7 Summary(fr):    Shell Bourne réduit de Berkeley
8 Summary(pl):    Ma³y shell bourne'a 
9 Summary(tr):    Ufak bir bourne kabuðu
10 Name:           ash
11 Version:        0.4.0
12 Release:        3
13 License:        BSD
14 Group:          Applications/Shells
15 Group(de):      Applikationen/Shells
16 Group(pl):      Aplikacje/Pow³oki
17 Source:         %{name}-%{version}.tar.gz
18 Patch0:         %{name}-builtin.patch
19 Patch1:         %{name}-echo.patch
20 Patch2:         %{name}-getcwd.patch
21 Patch3:         %{name}-getopt.patch
22 Patch4:         %{name}-glob.patch
23 Patch5:         %{name}-jobs.patch
24 Patch6:         %{name}-kill.patch
25 Patch7:         %{name}-makefile.patch
26 Patch8:         %{name}-manpage.patch
27 Patch9:         %{name}-hetio.patch
28 Patch10:        %{name}-memout.patch
29 Patch11:        %{name}-misc.patch
30 Patch12:        %{name}-redir.patch
31 Patch13:        %{name}-setmode.patch
32 Patch14:        %{name}-syntax.patch
33 Patch15:        %{name}-test.patch
34 Patch16:        %{name}-times.patch
35 Patch17:        %{name}-debian.patch
36 Patch18:        %{name}-ppid.patch
37 Patch19:        %{name}-freebsd.patch
38 Patch20:        %{name}-sighup.patch
39 Prereq:         fileutils
40 Prereq:         grep
41 BuildRequires:  glibc-static
42 BuildRequires:  flex
43 BuildRequires:  byacc
44 %if %{?BOOT:1}%{!?BOOT:0}
45 BuildRequires:  uClibc-devel-BOOT >= 20000521
46 %endif
47 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 Conflicts:      mkinitrd <= 1.7
49
50 %define         _bindir         /bin
51
52 %description
53 ash is a bourne shell clone from Berkeley. It supports all of the
54 standard Bourne shell commands and has the advantage of supporting
55 them while remaining considerably smaller than bash.
56
57 %description -l de
58 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
59 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
60 weniger Platz beansprucht als bash.
61
62 %description -l fr
63 ash est un clone Berkeley du shell Bourne. Il gère toutes les
64 commandes standard du shell Bourne et a l'avantage de les gérer tout
65 en restant considérablement plus petit que bash.
66
67 %description -l pl
68 Ash jest klonem shell'a Bourne'a z Berkeley. Obs³uguje standardowe
69 komendy shell'a Bourne'a i jest mniejszy ni¿ bash.
70
71 %description -l tr
72 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
73 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
74 avantajýna sahiptir.
75
76 %package static
77 Summary:        Small bourne shell from Berkeley
78 Summary(de):    Kleine Bourne-Shell von Berkeley
79 Summary(fr):    Shell Bourne réduit de Berkeley
80 Summary(pl):    Ma³y shell bourne'a 
81 Summary(tr):    Ufak bir bourne kabuðu
82 Group:          Applications/Shells
83 Group(de):      Applikationen/Shells
84 Group(pl):      Aplikacje/Pow³oki
85 Prereq:         fileutils
86 Prereq:         grep
87 Conflicts:      mkinitrd <= 1.7
88
89 %description static
90 ash is a bourne shell clone from Berkeley. It supports all of the
91 standard Bourne shell commands and has the advantage of supporting
92 them while remaining considerably smaller than bash.
93
94 %description static -l de
95 ash ist ein Bourne-Shell-Clone aus Berkeley, der alle
96 Standard-Bourne-Shell- Befehle unterstützt und dennoch erheblich
97 weniger Platz beansprucht als bash.
98
99 %description static -l fr
100 ash est un clone Berkeley du shell Bourne. Il gère toutes les
101 commandes standard du shell Bourne et a l'avantage de les gérer tout
102 en restant considérablement plus petit que bash.
103
104 %description static -l pl
105 Ash jest klonem shell'a Bourne'a z Berkeley. Obs³uguje standardowe
106 komendy shell'a Bourne'a i jest mniejszy ni¿ bash.
107
108 %description static -l tr
109 ash, Berkeley'in bir bourne kabuðu kopyasýdýr. Standart bourne kabuðu
110 komutlarýnýn tümünü destekler ve bash kabuðundan daha küçük olma
111 avantajýna sahiptir.
112
113 %if %{?BOOT:1}%{!?BOOT:0}
114 %package BOOT
115 Summary:        Small bourne shell from Berkeley
116 Summary(de):    Kleine Bourne-Shell von Berkeley
117 Summary(fr):    Shell Bourne réduit de Berkeley
118 Summary(pl):    Ma³y shell bourne'a 
119 Summary(tr):    Ufak bir bourne kabuðu
120 Group:          Applications/Shells
121 Group(de):      Applikationen/Shells
122 Group(pl):      Aplikacje/Pow³oki
123
124 %description BOOT
125 ash is a bourne shell clone from Berkeley. It supports all of the
126 standard Bourne shell commands and has the advantage of supporting
127 them while remaining considerably smaller than bash.
128 Version for bootdisk
129
130 %endif
131
132 %prep
133 %setup -q
134 %patch0 -p1
135 %patch1 -p1
136 %patch2 -p1
137 %patch3 -p1
138 %patch4 -p1
139 %patch5 -p1
140 %patch6 -p1
141 %patch7 -p1
142 %patch8 -p1
143 %patch9 -p1
144 #%patch10 -p1
145 %patch11 -p1
146 %patch12 -p1
147 %patch13 -p1
148 %patch14 -p1
149 %patch15 -p1
150 %patch16 -p1
151 # this is mainly for information, maybe add changelog to %doc?
152 %patch17 -p1
153 %patch18 -p1
154 %patch19 -p1
155 %patch20 -p1
156
157 %build
158 # BOOT
159 %if %{?BOOT:1}%{!?BOOT:0}
160 # some of this utilities does not compile with uClibc
161 # and it is not necessary
162 %{__make} mksignames mkbuiltins mknodes mksignames mksyntax mktokens
163 %{__make} \
164         OPT_FLAGS="-I/usr/lib/bootdisk%{_includedir} -Os" \
165         LDFLAGS="-nostdlib %{rpmldflags}" \
166         LDLIBS="%{_libdir}/bootdisk%{_libdir}/crt0.o %{_libdir}/bootdisk%{_libdir}/libc.a -lgcc"
167 mv -f sh ash.BOOT
168 %{__make} clean
169 %endif
170
171 # this patch imposes memory buffers - uClibc lacks them
172 patch -p1 <%{PATCH10}
173
174 # other
175 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="-static %{rpmldflags}"
176 mv -f sh ash.static
177 %{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}"
178
179 %install
180 rm -rf $RPM_BUILD_ROOT
181
182 # BOOT
183 %if %{?BOOT:1}%{!?BOOT:0}
184 install -d $RPM_BUILD_ROOT/usr/lib/bootdisk/bin
185 install ash.BOOT $RPM_BUILD_ROOT/usr/lib/bootdisk/bin/ash
186 ln -sf ash $RPM_BUILD_ROOT/usr/lib/bootdisk/bin/sh
187 %endif
188
189 # other
190 install -d $RPM_BUILD_ROOT/{%{_bindir},%{_mandir}/man1}
191 install sh $RPM_BUILD_ROOT%{_bindir}/ash
192 install ash.static $RPM_BUILD_ROOT%{_bindir}/ash.static
193 install sh.1 $RPM_BUILD_ROOT%{_mandir}/man1/ash.1
194 echo ".so ash.1" > $RPM_BUILD_ROOT%{_mandir}/man1/bsh.1
195 ln -sf ash $RPM_BUILD_ROOT/%{_bindir}/bsh
196
197 %post
198 if [ ! -f /etc/shells ]; then
199         echo "%{_bindir}/ash" > /etc/shells
200         echo "%{_bindir}/bsh" >> /etc/shells
201 else
202         if ! grep -q '^%{_bindir}/ash$' /etc/shells ; then
203                 echo "%{_bindir}/ash" >> /etc/shells
204         fi
205         if ! grep -q '^%{_bindir}/bsh$' /etc/shells ; then
206                 echo "%{_bindir}/bsh" >> /etc/shells
207         fi
208 fi
209
210 %post static
211 if [ ! -f /etc/shells ]; then
212         echo "%{_bindir}/ash.static" >> /etc/shells
213 else
214         if ! grep -q '^%{_bindir}/ash.static$' /etc/shells ; then
215                 echo "%{_bindir}/ash.static" >> /etc/shells
216         fi
217 fi
218
219 %preun
220 if [ "$1" = 0 ]; then
221         grep -v '^%{_bindir}/ash$' /etc/shells | grep -v '^%{_bindir}/bsh$' > /etc/shells.new
222         mv -f /etc/shells.new /etc/shells
223 fi
224
225 %preun static
226 if [ "$1" = 0 ]; then
227         grep -v '^%{_bindir}/ash\.static$' /etc/shells > /etc/shells.new
228         mv -f /etc/shells.new /etc/shells
229 fi
230
231 %verifyscript
232 for n in ash bsh ; do
233     echo -n "Looking for $n in /etc/shells... "
234     if ! grep -q "^%{_bindir}/${n}\$" /etc/shells ; then
235         echo "missing"
236         echo "${n} missing from /etc/shells" >&2
237     else
238         echo "found"
239     fi
240 done
241
242 %verifyscript static
243 echo -n "Looking for ash.static in /etc/shells... "
244 if ! grep -q '^%{_bindir}/ash\.static$' /etc/shells ; then
245         echo "missing"
246         echo "ash.static missing from /etc/shells" >&2
247 else
248         echo "found"
249 fi
250
251 %clean
252 rm -rf $RPM_BUILD_ROOT
253
254 %files
255 %defattr(644,root,root,755)
256 %attr(755,root,root) %{_bindir}/ash
257 %attr(755,root,root) %{_bindir}/bsh
258 %{_mandir}/man1/*
259
260 %files static
261 %defattr(644,root,root,755)
262 %attr(755,root,root) %{_bindir}/ash.static
263
264 %if %{?BOOT:1}%{!?BOOT:0}
265 %files BOOT
266 %defattr(644,root,root,755)
267 %attr(755,root,root) /usr/lib/bootdisk/bin/*
268 %endif
This page took 0.079226 seconds and 4 git commands to generate.