1 |
%define i18ndate 20010626 |
2 |
%define patchlevel 28 |
3 |
%define rel 1 |
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 |
|
53 |
# Mageia/Mandriva patches |
54 |
Patch1001: bash-2.02-security.patch |
55 |
# ensure profile is read (Redhat) |
56 |
Patch1003: bash-4.0-profile.patch |
57 |
Patch1004: bash-2.05b-readlinefixes.patch |
58 |
Patch1006: bash-2.04-compat.patch |
59 |
#https://bugzilla.novell.com/attachment.cgi?id=67684 |
60 |
Patch1010: bash-3.1-extended_quote.patch |
61 |
Patch1020: bash-strcoll-bug.diff |
62 |
Patch1023: bash-2.05b-checkwinsize.patch |
63 |
Patch1024: bash-3.2-lzma-copmpletion.patch |
64 |
# (fc) 3.2-12mdv fix format string |
65 |
Patch1026: bash-3.2-format-security.patch |
66 |
|
67 |
BuildRequires: autoconf2.5 |
68 |
BuildRequires: bison |
69 |
BuildRequires: groff |
70 |
BuildRequires: libtermcap-devel |
71 |
BuildRequires: texinfo |
72 |
# explicit file provides |
73 |
Provides: /bin/sh |
74 |
|
75 |
%description |
76 |
Bash is a GNU project sh-compatible shell or command language |
77 |
interpreter. Bash (Bourne Again shell) incorporates useful features |
78 |
from the Korn shell (ksh) and the C shell (csh). Most sh scripts |
79 |
can be run by bash without modification. |
80 |
|
81 |
Bash offers several improvements over sh, including command line |
82 |
editing, unlimited size command history, job control, shell |
83 |
functions and aliases, indexed arrays of unlimited size and |
84 |
integer arithmetic in any base from two to 64. Bash is ultimately |
85 |
intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and |
86 |
Tools standard. |
87 |
|
88 |
%package doc |
89 |
Summary: Documentation for the GNU Bourne Again shell (bash) |
90 |
Group: Books/Computer books |
91 |
Requires: %{name} = %{version}-%{release} |
92 |
Obsoletes: bash3-doc < 3.2.48 |
93 |
Provides: bash3-doc |
94 |
|
95 |
%description doc |
96 |
This package provides documentation for GNU Bourne Again shell (bash). |
97 |
|
98 |
%prep |
99 |
%setup -q -a 2 |
100 |
mv doc/README . |
101 |
|
102 |
%patch1 -p0 |
103 |
%patch2 -p0 |
104 |
%patch3 -p0 |
105 |
%patch4 -p0 |
106 |
%patch5 -p0 |
107 |
%patch6 -p0 |
108 |
%patch7 -p0 |
109 |
%patch8 -p0 |
110 |
%patch9 -p0 |
111 |
%patch10 -p0 |
112 |
%patch11 -p0 |
113 |
%patch12 -p0 |
114 |
%patch13 -p0 |
115 |
%patch14 -p0 |
116 |
%patch15 -p0 |
117 |
%patch16 -p0 |
118 |
%patch17 -p0 |
119 |
%patch18 -p0 |
120 |
%patch19 -p0 |
121 |
%patch20 -p0 |
122 |
%patch21 -p0 |
123 |
%patch22 -p0 |
124 |
%patch23 -p0 |
125 |
%patch24 -p0 |
126 |
%patch25 -p0 |
127 |
%patch26 -p0 |
128 |
%patch27 -p0 |
129 |
%patch28 -p0 |
130 |
|
131 |
%patch1001 -p1 -b .security |
132 |
%patch1003 -p1 -b .profile |
133 |
# 20060126 warly obsolete exept maybe for the replacement of @ by kH, this will have to be checked |
134 |
#%patch1004 -p1 -b .readline |
135 |
%patch1006 -p1 -b .compat |
136 |
%patch1010 -p0 -b .quote |
137 |
%patch1020 -p1 -b .strcoll_bugx |
138 |
%patch1023 -p1 -b .checkwinsize |
139 |
%patch1024 -p1 -b .lzma |
140 |
%patch1026 -p1 -b .format-security |
141 |
|
142 |
%build |
143 |
|
144 |
export CFLAGS="%{optflags} -Os" |
145 |
export CXXFLAGS=$CFLAGS |
146 |
export DEBUGGER_START_FILE="%{_datadir}/bashdb/bashdb-main.inc" |
147 |
|
148 |
%configure2_5x \ |
149 |
--enable-command-timing \ |
150 |
--disable-rpath \ |
151 |
--enable-history \ |
152 |
--enable-job-control \ |
153 |
--enable-multibyte \ |
154 |
--enable-readline \ |
155 |
--with-installed-readline \ |
156 |
--without-gnu-malloc \ |
157 |
--without-bash-malloc \ |
158 |
--disable-strict-posix-default \ |
159 |
--enable-select \ |
160 |
--enable-prompt-string-decoding \ |
161 |
--enable-process-substitution \ |
162 |
--enable-alias \ |
163 |
--enable-bang-history \ |
164 |
--enable-coprocesses \ |
165 |
--enable-directory-stack \ |
166 |
--enable-brace-expansion |
167 |
|
168 |
%make |
169 |
|
170 |
# all tests must pass |
171 |
%check |
172 |
make check |
173 |
|
174 |
%install |
175 |
rm -rf %{buildroot} |
176 |
|
177 |
%makeinstall_std |
178 |
|
179 |
# beurk |
180 |
rm -rf %{buildroot}%{_datadir}/locale/en@boldquot/ %{buildroot}%{_datadir}/locale/en@quot/ |
181 |
|
182 |
#Sucks |
183 |
chmod +w doc/texinfo.tex |
184 |
chmod 755 examples/misc/aliasconv.* |
185 |
chmod 755 examples/misc/cshtobash |
186 |
chmod 755 %{buildroot}%{_bindir}/bashbug |
187 |
|
188 |
# Take out irritating ^H's from the documentation |
189 |
mkdir tmp_doc |
190 |
for i in `/bin/ls doc/` ; \ |
191 |
do cat doc/$i > tmp_doc/$i ; \ |
192 |
cat tmp_doc/$i | perl -p -e 's/.//g' > doc/$i ; \ |
193 |
rm tmp_doc/$i ; \ |
194 |
done |
195 |
rmdir tmp_doc |
196 |
|
197 |
mkdir -p %{buildroot}/bin |
198 |
pushd %{buildroot} && mv usr/bin/bash bin/bash && popd |
199 |
pushd %{buildroot}/bin && ln -s bash sh && popd |
200 |
pushd %{buildroot}/bin && ln -sf bash bash3 && popd |
201 |
|
202 |
# make builtins.1 and rbash.1 with bash.1 in place (fix mdv#51379) |
203 |
pushd doc |
204 |
mkdir tmp_fix_so |
205 |
cd tmp_fix_so |
206 |
cp ../builtins.1 ../rbash.1 . |
207 |
sed -e '/^.if \\n(zZ=1 .ig zZ/,/^.zZ/d' ../bash.1 > bash.1 |
208 |
soelim builtins.1 > ../builtins.1 |
209 |
sed -e '/^.if \\n(zY=1 .ig zY/,/^.zY/d' ../bash.1 > bash.1 |
210 |
soelim rbash.1 > ../rbash.1 |
211 |
popd |
212 |
rm -rf doc/tmp_fix_so |
213 |
|
214 |
# make manpages for bash builtins as per suggestion in DOC/README |
215 |
cd doc |
216 |
sed -e ' |
217 |
/^\.SH NAME/, /\\- bash built-in commands, see \\fBbash\\fR(1)$/{ |
218 |
/^\.SH NAME/d |
219 |
s/^bash, // |
220 |
s/\\- bash built-in commands, see \\fBbash\\fR(1)$// |
221 |
s/,//g |
222 |
b |
223 |
} |
224 |
d |
225 |
' builtins.1 > man.pages |
226 |
install -m 644 builtins.1 %{buildroot}%{_mandir}/man1/builtins.1 |
227 |
|
228 |
install -m 644 rbash.1 %{buildroot}%{_mandir}/man1/rbash.1 |
229 |
|
230 |
for i in `cat man.pages` ; do |
231 |
echo .so man1/builtins.1 > %{buildroot}%{_mandir}/man1/$i.1 |
232 |
done |
233 |
|
234 |
# now turn man.pages into a filelist for the man subpackage |
235 |
|
236 |
cat man.pages |tr -s ' ' '\n' |sed ' |
237 |
1i\ |
238 |
%defattr(0644,root,root,0755) |
239 |
s:^:%{_mandir}/man1/: |
240 |
s/$/.1%{_extension}/ |
241 |
' > ../man.pages |
242 |
|
243 |
perl -p -i -e 's!.*/(printf|export|echo|pwd|test|kill).1%{_extension}!!' ../man.pages |
244 |
|
245 |
mkdir -p %{buildroot}%{_sysconfdir}/skel |
246 |
mkdir -p %{buildroot}%{_sysconfdir}/profile.d |
247 |
install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/skel/.bashrc |
248 |
install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/skel/.bash_profile |
249 |
install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/skel/.bash_logout |
250 |
install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/profile.d/60alias.sh |
251 |
install -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/bashrc |
252 |
install -m 644 %{SOURCE8} %{buildroot}%{_sysconfdir}/profile.d/95bash-extras.sh |
253 |
|
254 |
ln -s bash %{buildroot}/bin/rbash |
255 |
|
256 |
# These're provided by other packages |
257 |
rm -f %{buildroot}{%{_infodir}/dir,%{_mandir}/man1/{echo,export,kill,printf,pwd,test}.1} |
258 |
|
259 |
cd .. |
260 |
|
261 |
install -m 644 doc/bash.info %{buildroot}%{_infodir}/ |
262 |
|
263 |
%find_lang %{name} |
264 |
|
265 |
# merges list |
266 |
cat man.pages %{name}.lang > files.list |
267 |
|
268 |
%clean |
269 |
rm -rf %{buildroot} |
270 |
|
271 |
%files -f files.list |
272 |
%defattr(-,root,root) |
273 |
%doc README |
274 |
%config(noreplace) %{_sysconfdir}/skel/.b* |
275 |
%{_sysconfdir}/profile.d/60alias.sh |
276 |
%{_sysconfdir}/profile.d/95bash-extras.sh |
277 |
%config(noreplace) %{_sysconfdir}/bashrc |
278 |
/bin/rbash |
279 |
/bin/bash |
280 |
/bin/bash3 |
281 |
/bin/sh |
282 |
%{_infodir}/bash.info* |
283 |
%{_mandir}/man1/bash.1* |
284 |
%{_mandir}/man1/rbash.1* |
285 |
%{_mandir}/man1/builtins.1* |
286 |
%{_mandir}/man1/bashbug.1* |
287 |
%{_bindir}/bashbug |
288 |
|
289 |
%files doc |
290 |
%defattr(-,root,root) |
291 |
%doc COMPAT NEWS NOTES POSIX CHANGES |
292 |
%doc examples |
293 |
%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt |