1 |
%define i18ndate 20010626 |
2 |
%define patchlevel 37 |
3 |
%define rel 2 |
4 |
|
5 |
Name: bash |
6 |
Version: 4.2 |
7 |
Release: %mkrel %{patchlevel}.%{rel} |
8 |
Summary: The GNU Bourne Again shell (bash) |
9 |
Group: Shells |
10 |
License: GPLv2+ |
11 |
URL: http://www.gnu.org/software/bash/bash.html |
12 |
Source0: ftp://ftp.gnu.org/pub/gnu/bash/%{name}-%{version}.tar.gz |
13 |
Source1: ftp://ftp.gnu.org/pub/gnu/bash/%{name}-%{version}.tar.gz.sig |
14 |
Source2: ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-3.2.tar.bz2 |
15 |
Source3: dot-bashrc |
16 |
Source4: dot-bash_profile |
17 |
Source5: dot-bash_logout |
18 |
Source6: alias.sh |
19 |
Source7: bashrc |
20 |
Source8: profile.d-bash |
21 |
|
22 |
# Official upstream patches |
23 |
# from ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/ |
24 |
Patch01: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-001 |
25 |
Patch02: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-002 |
26 |
Patch03: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-003 |
27 |
Patch04: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-004 |
28 |
Patch05: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-005 |
29 |
Patch06: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-006 |
30 |
Patch07: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-007 |
31 |
Patch08: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-008 |
32 |
Patch09: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-009 |
33 |
Patch10: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-010 |
34 |
Patch11: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-011 |
35 |
Patch12: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-012 |
36 |
Patch13: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-013 |
37 |
Patch14: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-014 |
38 |
Patch15: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-015 |
39 |
Patch16: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-016 |
40 |
Patch17: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-017 |
41 |
Patch18: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-018 |
42 |
Patch19: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-019 |
43 |
Patch20: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-020 |
44 |
Patch21: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-021 |
45 |
Patch22: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-022 |
46 |
Patch23: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-023 |
47 |
Patch24: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-024 |
48 |
Patch25: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-025 |
49 |
Patch26: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-026 |
50 |
Patch27: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-027 |
51 |
Patch28: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-028 |
52 |
Patch29: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-029 |
53 |
Patch30: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-030 |
54 |
Patch31: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-031 |
55 |
Patch32: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-032 |
56 |
Patch33: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-033 |
57 |
Patch34: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-034 |
58 |
Patch35: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-035 |
59 |
Patch36: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-036 |
60 |
Patch37: ftp://ftp.gnu.org/gnu/bash/bash-%{version}-patches/bash42-037 |
61 |
|
62 |
# Mageia/Mandriva patches |
63 |
Patch1001: bash-2.02-security.patch |
64 |
# ensure profile is read (Redhat) |
65 |
Patch1003: bash-4.0-profile.patch |
66 |
Patch1004: bash-2.05b-readlinefixes.patch |
67 |
Patch1006: bash-2.04-compat.patch |
68 |
#https://bugzilla.novell.com/attachment.cgi?id=67684 |
69 |
Patch1010: bash-3.1-extended_quote.patch |
70 |
Patch1020: bash-strcoll-bug.diff |
71 |
Patch1023: bash-2.05b-checkwinsize.patch |
72 |
Patch1024: bash-3.2-lzma-copmpletion.patch |
73 |
# (fc) 3.2-12mdv fix format string |
74 |
Patch1026: bash-3.2-format-security.patch |
75 |
|
76 |
BuildRequires: autoconf2.5 |
77 |
BuildRequires: bison |
78 |
BuildRequires: groff |
79 |
BuildRequires: libtermcap-devel |
80 |
BuildRequires: texinfo |
81 |
# explicit file provides |
82 |
Provides: /bin/sh |
83 |
|
84 |
%description |
85 |
Bash is a GNU project sh-compatible shell or command language |
86 |
interpreter. Bash (Bourne Again shell) incorporates useful features |
87 |
from the Korn shell (ksh) and the C shell (csh). Most sh scripts |
88 |
can be run by bash without modification. |
89 |
|
90 |
Bash offers several improvements over sh, including command line |
91 |
editing, unlimited size command history, job control, shell |
92 |
functions and aliases, indexed arrays of unlimited size and |
93 |
integer arithmetic in any base from two to 64. Bash is ultimately |
94 |
intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and |
95 |
Tools standard. |
96 |
|
97 |
%package doc |
98 |
Summary: Documentation for the GNU Bourne Again shell (bash) |
99 |
Group: Documentation |
100 |
Requires: %{name} = %{version}-%{release} |
101 |
Obsoletes: bash3-doc < 3.2.48 |
102 |
Provides: bash3-doc |
103 |
|
104 |
%description doc |
105 |
This package provides documentation for GNU Bourne Again shell (bash). |
106 |
|
107 |
%prep |
108 |
%setup -q -a 2 |
109 |
mv doc/README . |
110 |
|
111 |
%patch1 -p0 |
112 |
%patch2 -p0 |
113 |
%patch3 -p0 |
114 |
%patch4 -p0 |
115 |
%patch5 -p0 |
116 |
%patch6 -p0 |
117 |
%patch7 -p0 |
118 |
%patch8 -p0 |
119 |
%patch9 -p0 |
120 |
%patch10 -p0 |
121 |
%patch11 -p0 |
122 |
%patch12 -p0 |
123 |
%patch13 -p0 |
124 |
%patch14 -p0 |
125 |
%patch15 -p0 |
126 |
%patch16 -p0 |
127 |
%patch17 -p0 |
128 |
%patch18 -p0 |
129 |
%patch19 -p0 |
130 |
%patch20 -p0 |
131 |
%patch21 -p0 |
132 |
%patch22 -p0 |
133 |
%patch23 -p0 |
134 |
%patch24 -p0 |
135 |
%patch25 -p0 |
136 |
%patch26 -p0 |
137 |
%patch27 -p0 |
138 |
%patch28 -p0 |
139 |
%patch29 -p0 |
140 |
%patch30 -p0 |
141 |
%patch31 -p0 |
142 |
%patch32 -p0 |
143 |
%patch33 -p0 |
144 |
%patch34 -p0 |
145 |
%patch35 -p0 |
146 |
%patch36 -p0 |
147 |
%patch37 -p0 |
148 |
|
149 |
%patch1001 -p1 -b .security |
150 |
%patch1003 -p1 -b .profile |
151 |
# 20060126 warly obsolete exept maybe for the replacement of @ by kH, this will have to be checked |
152 |
#%patch1004 -p1 -b .readline |
153 |
%patch1006 -p1 -b .compat |
154 |
%patch1010 -p0 -b .quote |
155 |
%patch1020 -p1 -b .strcoll_bugx |
156 |
%patch1023 -p1 -b .checkwinsize |
157 |
%patch1024 -p1 -b .lzma |
158 |
%patch1026 -p1 -b .format-security |
159 |
|
160 |
%build |
161 |
|
162 |
export CFLAGS="%{optflags} -Os" |
163 |
export CXXFLAGS=$CFLAGS |
164 |
export DEBUGGER_START_FILE="%{_datadir}/bashdb/bashdb-main.inc" |
165 |
|
166 |
%configure2_5x \ |
167 |
--enable-command-timing \ |
168 |
--disable-rpath \ |
169 |
--enable-history \ |
170 |
--enable-job-control \ |
171 |
--enable-multibyte \ |
172 |
--enable-readline \ |
173 |
--with-installed-readline \ |
174 |
--without-gnu-malloc \ |
175 |
--without-bash-malloc \ |
176 |
--disable-strict-posix-default \ |
177 |
--enable-select \ |
178 |
--enable-prompt-string-decoding \ |
179 |
--enable-process-substitution \ |
180 |
--enable-alias \ |
181 |
--enable-bang-history \ |
182 |
--enable-coprocesses \ |
183 |
--enable-directory-stack \ |
184 |
--enable-brace-expansion |
185 |
|
186 |
%make |
187 |
|
188 |
# all tests must pass |
189 |
%check |
190 |
make check |
191 |
|
192 |
%install |
193 |
rm -rf %{buildroot} |
194 |
|
195 |
%makeinstall_std |
196 |
|
197 |
# beurk |
198 |
rm -rf %{buildroot}%{_datadir}/locale/en@boldquot/ %{buildroot}%{_datadir}/locale/en@quot/ |
199 |
|
200 |
#Sucks |
201 |
chmod +w doc/texinfo.tex |
202 |
chmod 755 examples/misc/aliasconv.* |
203 |
chmod 755 examples/misc/cshtobash |
204 |
chmod 755 %{buildroot}%{_bindir}/bashbug |
205 |
|
206 |
# Take out irritating ^H's from the documentation |
207 |
mkdir tmp_doc |
208 |
for i in `/bin/ls doc/` ; \ |
209 |
do cat doc/$i > tmp_doc/$i ; \ |
210 |
cat tmp_doc/$i | perl -p -e 's/.//g' > doc/$i ; \ |
211 |
rm tmp_doc/$i ; \ |
212 |
done |
213 |
rmdir tmp_doc |
214 |
|
215 |
mkdir -p %{buildroot}/bin |
216 |
pushd %{buildroot} && mv usr/bin/bash bin/bash && popd |
217 |
pushd %{buildroot}/bin && ln -s bash sh && popd |
218 |
pushd %{buildroot}/bin && ln -sf bash bash3 && popd |
219 |
|
220 |
# make builtins.1 and rbash.1 with bash.1 in place (fix mdv#51379) |
221 |
pushd doc |
222 |
mkdir tmp_fix_so |
223 |
cd tmp_fix_so |
224 |
cp ../builtins.1 ../rbash.1 . |
225 |
sed -e '/^.if \\n(zZ=1 .ig zZ/,/^.zZ/d' ../bash.1 > bash.1 |
226 |
soelim builtins.1 > ../builtins.1 |
227 |
sed -e '/^.if \\n(zY=1 .ig zY/,/^.zY/d' ../bash.1 > bash.1 |
228 |
soelim rbash.1 > ../rbash.1 |
229 |
popd |
230 |
rm -rf doc/tmp_fix_so |
231 |
|
232 |
# make manpages for bash builtins as per suggestion in DOC/README |
233 |
cd doc |
234 |
sed -e ' |
235 |
/^\.SH NAME/, /\\- bash built-in commands, see \\fBbash\\fR(1)$/{ |
236 |
/^\.SH NAME/d |
237 |
s/^bash, // |
238 |
s/\\- bash built-in commands, see \\fBbash\\fR(1)$// |
239 |
s/,//g |
240 |
b |
241 |
} |
242 |
d |
243 |
' builtins.1 > man.pages |
244 |
install -m 644 builtins.1 %{buildroot}%{_mandir}/man1/builtins.1 |
245 |
|
246 |
install -m 644 rbash.1 %{buildroot}%{_mandir}/man1/rbash.1 |
247 |
|
248 |
for i in `cat man.pages` ; do |
249 |
echo .so man1/builtins.1 > %{buildroot}%{_mandir}/man1/$i.1 |
250 |
done |
251 |
|
252 |
# now turn man.pages into a filelist for the man subpackage |
253 |
|
254 |
cat man.pages |tr -s ' ' '\n' |sed ' |
255 |
1i\ |
256 |
%defattr(0644,root,root,0755) |
257 |
s:^:%{_mandir}/man1/: |
258 |
s/$/.1%{_extension}/ |
259 |
' > ../man.pages |
260 |
|
261 |
perl -p -i -e 's!.*/(printf|export|echo|pwd|test|kill).1%{_extension}!!' ../man.pages |
262 |
|
263 |
mkdir -p %{buildroot}%{_sysconfdir}/skel |
264 |
mkdir -p %{buildroot}%{_sysconfdir}/profile.d |
265 |
install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/skel/.bashrc |
266 |
install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/skel/.bash_profile |
267 |
install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/skel/.bash_logout |
268 |
install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/profile.d/60alias.sh |
269 |
install -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/bashrc |
270 |
install -m 644 %{SOURCE8} %{buildroot}%{_sysconfdir}/profile.d/95bash-extras.sh |
271 |
|
272 |
ln -s bash %{buildroot}/bin/rbash |
273 |
|
274 |
# These're provided by other packages |
275 |
rm -f %{buildroot}{%{_infodir}/dir,%{_mandir}/man1/{echo,export,kill,printf,pwd,test}.1} |
276 |
|
277 |
cd .. |
278 |
|
279 |
install -m 644 doc/bash.info %{buildroot}%{_infodir}/ |
280 |
|
281 |
%find_lang %{name} |
282 |
|
283 |
# merges list |
284 |
cat man.pages %{name}.lang > files.list |
285 |
|
286 |
%clean |
287 |
rm -rf %{buildroot} |
288 |
|
289 |
%files -f files.list |
290 |
%defattr(-,root,root) |
291 |
%doc README |
292 |
%config(noreplace) %{_sysconfdir}/skel/.b* |
293 |
%{_sysconfdir}/profile.d/60alias.sh |
294 |
%{_sysconfdir}/profile.d/95bash-extras.sh |
295 |
%config(noreplace) %{_sysconfdir}/bashrc |
296 |
/bin/rbash |
297 |
/bin/bash |
298 |
/bin/bash3 |
299 |
/bin/sh |
300 |
%{_infodir}/bash.info* |
301 |
%{_mandir}/man1/bash.1* |
302 |
%{_mandir}/man1/rbash.1* |
303 |
%{_mandir}/man1/builtins.1* |
304 |
%{_mandir}/man1/bashbug.1* |
305 |
%{_bindir}/bashbug |
306 |
|
307 |
%files doc |
308 |
%defattr(-,root,root) |
309 |
%doc COMPAT NEWS NOTES POSIX CHANGES |
310 |
%doc examples |
311 |
%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt |