1 |
%define i18ndate 20010626 |
2 |
|
3 |
Name: bash |
4 |
Version: 4.2 |
5 |
Release: %mkrel 1 |
6 |
Summary: The GNU Bourne Again shell (bash) |
7 |
Group: Shells |
8 |
License: GPLv2+ |
9 |
URL: http://www.gnu.org/software/bash/bash.html |
10 |
Source0: ftp://ftp.gnu.org/pub/gnu/bash/%{name}-%{version}.tar.gz |
11 |
Source1: %{SOURCE0}.sig |
12 |
Source2: ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-3.2.tar.bz2 |
13 |
Source3: dot-bashrc |
14 |
Source4: dot-bash_profile |
15 |
Source5: dot-bash_logout |
16 |
Source6: alias.sh |
17 |
Source7: bashrc |
18 |
Source8: profile.d-bash |
19 |
Patch1: bash-2.02-security.patch |
20 |
# ensure profile is read (Redhat) |
21 |
Patch3: bash-4.0-profile.patch |
22 |
Patch4: bash-2.05b-readlinefixes.patch |
23 |
Patch6: bash-2.04-compat.patch |
24 |
#https://bugzilla.novell.com/attachment.cgi?id=67684 |
25 |
Patch100: bash-3.1-extended_quote.patch |
26 |
# Official upstream patches |
27 |
# none |
28 |
Patch1000: bash-strcoll-bug.diff |
29 |
Patch1003: bash-2.05b-checkwinsize.patch |
30 |
Patch1004: bash-3.2-lzma-copmpletion.patch |
31 |
# (fc) 3.2-12mdv fix format string |
32 |
Patch1006: bash-3.2-format-security.patch |
33 |
BuildRequires: autoconf2.5 |
34 |
BuildRequires: bison |
35 |
BuildRequires: groff |
36 |
BuildRequires: libtermcap-devel |
37 |
BuildRequires: texinfo |
38 |
# explicit file provides |
39 |
Provides: /bin/sh |
40 |
|
41 |
%description |
42 |
Bash is a GNU project sh-compatible shell or command language |
43 |
interpreter. Bash (Bourne Again shell) incorporates useful features |
44 |
from the Korn shell (ksh) and the C shell (csh). Most sh scripts |
45 |
can be run by bash without modification. |
46 |
|
47 |
Bash offers several improvements over sh, including command line |
48 |
editing, unlimited size command history, job control, shell |
49 |
functions and aliases, indexed arrays of unlimited size and |
50 |
integer arithmetic in any base from two to 64. Bash is ultimately |
51 |
intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and |
52 |
Tools standard. |
53 |
|
54 |
%package doc |
55 |
Summary: Documentation for the GNU Bourne Again shell (bash) |
56 |
Group: Books/Computer books |
57 |
Requires: %{name} = %{version}-%{release} |
58 |
Obsoletes: bash3-doc < 3.2.48 |
59 |
Provides: bash3-doc |
60 |
|
61 |
%description doc |
62 |
This package provides documentation for GNU Bourne Again shell (bash). |
63 |
|
64 |
%prep |
65 |
%setup -q -a 2 |
66 |
mv doc/README . |
67 |
|
68 |
%patch1 -p1 -b .security |
69 |
%patch3 -p1 -b .profile |
70 |
# 20060126 warly obsolete exept maybe for the replacement of @ by kH, this will have to be checked |
71 |
#%patch4 -p1 -b .readline |
72 |
%patch6 -p1 -b .compat |
73 |
%patch1000 -p1 -b .strcoll_bugx |
74 |
%patch1003 -p1 -b .checkwinsize |
75 |
%patch1004 -p1 -b .lzma |
76 |
%patch1006 -p1 -b .format-security |
77 |
%patch100 -p0 -b .quote |
78 |
|
79 |
echo %{version} > _distribution |
80 |
echo %{release} > _patchlevel |
81 |
sed -i -e s/mdk// _patchlevel |
82 |
|
83 |
%build |
84 |
|
85 |
export CFLAGS="%{optflags} -Os" |
86 |
export CXXFLAGS=$CFLAGS |
87 |
export DEBUGGER_START_FILE="%{_datadir}/bashdb/bashdb-main.inc" |
88 |
|
89 |
%configure2_5x \ |
90 |
--enable-command-timing \ |
91 |
--disable-rpath \ |
92 |
--enable-history \ |
93 |
--enable-job-control \ |
94 |
--enable-multibyte \ |
95 |
--enable-readline \ |
96 |
--with-installed-readline \ |
97 |
--without-gnu-malloc \ |
98 |
--without-bash-malloc \ |
99 |
--disable-strict-posix-default \ |
100 |
--enable-select \ |
101 |
--enable-prompt-string-decoding \ |
102 |
--enable-process-substitution \ |
103 |
--enable-alias \ |
104 |
--enable-bang-history \ |
105 |
--enable-coprocesses \ |
106 |
--enable-directory-stack \ |
107 |
--enable-brace-expansion |
108 |
|
109 |
%make |
110 |
|
111 |
# all tests must pass |
112 |
%check |
113 |
make check |
114 |
|
115 |
%install |
116 |
rm -rf %{buildroot} |
117 |
|
118 |
%makeinstall_std |
119 |
|
120 |
# beurk |
121 |
rm -rf %{buildroot}%{_datadir}/locale/en@boldquot/ %{buildroot}%{_datadir}/locale/en@quot/ |
122 |
|
123 |
#Sucks |
124 |
chmod +w doc/texinfo.tex |
125 |
chmod 755 examples/misc/aliasconv.* |
126 |
chmod 755 examples/misc/cshtobash |
127 |
chmod 755 %{buildroot}%{_bindir}/bashbug |
128 |
|
129 |
# Take out irritating ^H's from the documentation |
130 |
mkdir tmp_doc |
131 |
for i in `/bin/ls doc/` ; \ |
132 |
do cat doc/$i > tmp_doc/$i ; \ |
133 |
cat tmp_doc/$i | perl -p -e 's/.//g' > doc/$i ; \ |
134 |
rm tmp_doc/$i ; \ |
135 |
done |
136 |
rmdir tmp_doc |
137 |
|
138 |
mkdir -p %{buildroot}/bin |
139 |
pushd %{buildroot} && mv usr/bin/bash bin/bash && popd |
140 |
pushd %{buildroot}/bin && ln -s bash sh && popd |
141 |
pushd %{buildroot}/bin && ln -sf bash bash3 && popd |
142 |
|
143 |
# make builtins.1 and rbash.1 with bash.1 in place (fix mdv#51379) |
144 |
pushd doc |
145 |
mkdir tmp_fix_so |
146 |
cd tmp_fix_so |
147 |
cp ../builtins.1 ../rbash.1 . |
148 |
sed -e '/^.if \\n(zZ=1 .ig zZ/,/^.zZ/d' ../bash.1 > bash.1 |
149 |
soelim builtins.1 > ../builtins.1 |
150 |
sed -e '/^.if \\n(zY=1 .ig zY/,/^.zY/d' ../bash.1 > bash.1 |
151 |
soelim rbash.1 > ../rbash.1 |
152 |
popd |
153 |
|
154 |
# make manpages for bash builtins as per suggestion in DOC/README |
155 |
cd doc |
156 |
sed -e ' |
157 |
/^\.SH NAME/, /\\- bash built-in commands, see \\fBbash\\fR(1)$/{ |
158 |
/^\.SH NAME/d |
159 |
s/^bash, // |
160 |
s/\\- bash built-in commands, see \\fBbash\\fR(1)$// |
161 |
s/,//g |
162 |
b |
163 |
} |
164 |
d |
165 |
' builtins.1 > man.pages |
166 |
install -m 644 builtins.1 %{buildroot}%{_mandir}/man1/builtins.1 |
167 |
|
168 |
install -m 644 rbash.1 %{buildroot}%{_mandir}/man1/rbash.1 |
169 |
|
170 |
for i in `cat man.pages` ; do |
171 |
echo .so man1/builtins.1 > %{buildroot}%{_mandir}/man1/$i.1 |
172 |
done |
173 |
|
174 |
# now turn man.pages into a filelist for the man subpackage |
175 |
|
176 |
cat man.pages |tr -s ' ' '\n' |sed ' |
177 |
1i\ |
178 |
%defattr(0644,root,root,0755) |
179 |
s:^:%{_mandir}/man1/: |
180 |
s/$/.1%{_extension}/ |
181 |
' > ../man.pages |
182 |
|
183 |
perl -p -i -e 's!.*/(printf|export|echo|pwd|test|kill).1%{_extension}!!' ../man.pages |
184 |
|
185 |
mkdir -p %{buildroot}%{_sysconfdir}/skel |
186 |
mkdir -p %{buildroot}%{_sysconfdir}/profile.d |
187 |
install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/skel/.bashrc |
188 |
install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/skel/.bash_profile |
189 |
install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/skel/.bash_logout |
190 |
install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/profile.d/60alias.sh |
191 |
install -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/bashrc |
192 |
install -m 644 %{SOURCE8} %{buildroot}%{_sysconfdir}/profile.d/95bash-extras.sh |
193 |
|
194 |
ln -s bash %{buildroot}/bin/rbash |
195 |
|
196 |
# These're provided by other packages |
197 |
rm -f %{buildroot}{%{_infodir}/dir,%{_mandir}/man1/{echo,export,kill,printf,pwd,test}.1} |
198 |
|
199 |
cd .. |
200 |
|
201 |
install -m 644 doc/bash.info %{buildroot}%{_infodir}/ |
202 |
|
203 |
%find_lang %{name} |
204 |
|
205 |
# merges list |
206 |
cat man.pages %{name}.lang > files.list |
207 |
|
208 |
%clean |
209 |
rm -rf %{buildroot} |
210 |
|
211 |
%files -f files.list |
212 |
%defattr(-,root,root) |
213 |
%doc README |
214 |
%config(noreplace) %{_sysconfdir}/skel/.b* |
215 |
%{_sysconfdir}/profile.d/60alias.sh |
216 |
%{_sysconfdir}/profile.d/95bash-extras.sh |
217 |
%config(noreplace) %{_sysconfdir}/bashrc |
218 |
/bin/rbash |
219 |
/bin/bash |
220 |
/bin/bash3 |
221 |
/bin/sh |
222 |
%{_infodir}/bash.info* |
223 |
%{_mandir}/man1/bash.1* |
224 |
%{_mandir}/man1/rbash.1* |
225 |
%{_mandir}/man1/builtins.1* |
226 |
%{_mandir}/man1/bashbug.1* |
227 |
%{_bindir}/bashbug |
228 |
|
229 |
%files doc |
230 |
%defattr(-,root,root) |
231 |
%doc COMPAT NEWS NOTES POSIX CHANGES |
232 |
%doc examples |
233 |
%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt |