|
@@ -1,8 +1,11 @@
|
|
|
+%define bashversion 4.2
|
|
|
+%define patchlevel 8
|
|
|
+
|
|
|
Summary: The GNU Bourne Again shell (bash).
|
|
|
Summary(ja): GNU Bourne Again シェル (bash).
|
|
|
|
|
|
Name: bash
|
|
|
-Version: 4.1
|
|
|
+Version: %{bashversion}.%{patchlevel}
|
|
|
Release: 1%{?_dist_release}
|
|
|
|
|
|
Group: System Environment/Shells
|
|
@@ -11,19 +14,18 @@ License: GPLv2+
|
|
|
Vendor: Project Vine
|
|
|
Distribution: Vine Linux
|
|
|
|
|
|
-Source0: ftp://ftp.gnu.org/pub/gnu/bash/bash-%{version}.tar.gz
|
|
|
-#Source2: ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-%{version}.tar.gz
|
|
|
-Source6: http://www.caliban.org/files/bash/bash-completion-20060301.tar.bz2
|
|
|
+Source0: ftp://ftp.gnu.org/pub/gnu/bash/bash-%{bashversion}.tar.gz
|
|
|
Source10: bashrc-vine
|
|
|
|
|
|
# Official upstream patches
|
|
|
-Patch1: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.1-patches/bash41-001
|
|
|
-Patch2: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.1-patches/bash41-002
|
|
|
-Patch3: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.1-patches/bash41-003
|
|
|
-Patch4: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.1-patches/bash41-004
|
|
|
-Patch5: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.1-patches/bash41-005
|
|
|
-Patch6: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.1-patches/bash41-006
|
|
|
-Patch7: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.1-patches/bash41-007
|
|
|
+Patch1: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-001
|
|
|
+Patch2: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-002
|
|
|
+Patch3: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-003
|
|
|
+Patch4: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-004
|
|
|
+Patch5: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-005
|
|
|
+Patch6: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-006
|
|
|
+Patch7: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-007
|
|
|
+Patch8: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2-patches/bash42-008
|
|
|
|
|
|
# Other patches
|
|
|
Patch101: bash-2.02-security.patch
|
|
@@ -36,18 +38,33 @@ Patch107: bash-2.05b-pgrp_sync.patch
|
|
|
Patch108: bash-2.05b-readline-oom.patch
|
|
|
Patch109: bash-2.05b-xcc.patch
|
|
|
Patch110: bash-3.2-audit.patch
|
|
|
-Patch112: bash-3.2-ssh_source_bash.patch
|
|
|
-Patch113: bash-bashbug.patch
|
|
|
-Patch115: bash-infotags.patch
|
|
|
-Patch116: bash-requires.patch
|
|
|
-Patch117: bash-setlocale.patch
|
|
|
+Patch111: bash-3.2-ssh_source_bash.patch
|
|
|
+Patch112: bash-bashbug.patch
|
|
|
+Patch113: bash-infotags.patch
|
|
|
+Patch114: bash-requires.patch
|
|
|
+Patch115: bash-setlocale.patch
|
|
|
+Patch116: bash-tty-tests.patch
|
|
|
+
|
|
|
+# 484809, check if interp section is NOBITS
|
|
|
+Patch117: bash-4.0-nobits.patch
|
|
|
+
|
|
|
+# Do the same CFLAGS in generated Makefile in examples
|
|
|
+Patch118: bash-4.1-examples.patch
|
|
|
+
|
|
|
+# Builtins like echo and printf won't report errors
|
|
|
+# when output does not succeed due to EPIPE
|
|
|
+Patch119: bash-4.1-broken_pipe.patch
|
|
|
+
|
|
|
+# Enable system-wide .bash_logout for login shells
|
|
|
+Patch120: bash-4.2-rc2-logout.patch
|
|
|
+
|
|
|
+# Static analyzis shows some issues in bash-2.05a-interpreter.patch
|
|
|
+Patch121: bash-4.2-coverity.patch
|
|
|
|
|
|
-Obsoletes: bash <= 1.14.7
|
|
|
-Obsoletes: bash2
|
|
|
-Prefix: %{_prefix}
|
|
|
Buildroot: %{_tmppath}/%{name}-%{version}-root
|
|
|
BuildRequires: texinfo, bison, ncurses-devel, autoconf, gettext
|
|
|
-Requires(post): ncurses
|
|
|
+Obsoletes: bash <= 1.14.7
|
|
|
+Obsoletes: bash2
|
|
|
|
|
|
|
|
|
%description
|
|
@@ -78,7 +95,8 @@ Again shell.
|
|
|
|
|
|
|
|
|
%prep
|
|
|
-%setup -q
|
|
|
+%setup -q -n %{name}-%{bashversion}
|
|
|
+
|
|
|
# Official upstream patches
|
|
|
%patch1 -p0 -b .001
|
|
|
%patch2 -p0 -b .002
|
|
@@ -87,6 +105,7 @@ Again shell.
|
|
|
%patch5 -p0 -b .005
|
|
|
%patch6 -p0 -b .006
|
|
|
%patch7 -p0 -b .007
|
|
|
+%patch8 -p0 -b .008
|
|
|
|
|
|
# Other patches
|
|
|
%patch101 -p1 -b .security
|
|
@@ -99,11 +118,17 @@ Again shell.
|
|
|
%patch108 -p1 -b .readline_oom
|
|
|
%patch109 -p1 -b .xcc
|
|
|
%patch110 -p1 -b .audit
|
|
|
-%patch112 -p1 -b .ssh_source_bash
|
|
|
-%patch113 -p1 -b .bashbug
|
|
|
-%patch115 -p1 -b .infotags
|
|
|
-%patch116 -p1 -b .requires
|
|
|
-%patch117 -p1 -b .setlocale
|
|
|
+%patch111 -p1 -b .ssh_source_bash
|
|
|
+%patch112 -p1 -b .bashbug
|
|
|
+%patch113 -p1 -b .infotags
|
|
|
+%patch114 -p1 -b .requires
|
|
|
+%patch115 -p1 -b .setlocale
|
|
|
+%patch116 -p1 -b .tty_tests
|
|
|
+%patch117 -p1 -b .nobits
|
|
|
+%patch118 -p1 -b .examples
|
|
|
+%patch119 -p1 -b .broken_pipe
|
|
|
+%patch120 -p1 -b .logout
|
|
|
+%patch121 -p1 -b .coverity
|
|
|
|
|
|
echo %{version} > _distribution
|
|
|
echo %{release} |sed 's/vl.*//' > _patchlevel
|
|
@@ -113,23 +138,19 @@ echo %{release} |sed 's/vl.*//' > _patchlevel
|
|
|
%configure --with-bash-malloc=no
|
|
|
make CPPFLAGS="-D_GNU_SOURCE -DRECYCLES_PIDS `getconf LFS_CFLAGS`"
|
|
|
|
|
|
-#%check
|
|
|
-#make check
|
|
|
-
|
|
|
%install
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
|
# Fix bug #83776
|
|
|
perl -pi -e 's,bashref\.info,bash.info,' doc/bashref.info
|
|
|
|
|
|
-%makeinstall
|
|
|
+make DESTDIR=$RPM_BUILD_ROOT install
|
|
|
|
|
|
-mkdir -p $RPM_BUILD_ROOT/bin
|
|
|
-pushd $RPM_BUILD_ROOT && mv usr/bin/bash bin/bash && popd
|
|
|
-pushd $RPM_BUILD_ROOT/bin && ln -s bash sh && popd
|
|
|
pushd $RPM_BUILD_ROOT
|
|
|
-gzip -9nf .%{_infodir}/bash.info
|
|
|
-rm -f .%{_infodir}/dir
|
|
|
+ mkdir ./bin
|
|
|
+ mv ./usr/bin/bash ./bin/bash
|
|
|
+ ln -s bash ./bin/sh
|
|
|
+ rm -f .%{_infodir}/dir
|
|
|
popd
|
|
|
|
|
|
ln -s bash.1 %{buildroot}%{_mandir}/man1/sh.1
|
|
@@ -177,46 +198,58 @@ rm -rf %{buildroot}
|
|
|
# ***** bash doesn't use install-info. It's always listed in %{_infodir}/dir
|
|
|
# to prevent prereq loops
|
|
|
|
|
|
-%post
|
|
|
-
|
|
|
-HASBASH=""
|
|
|
-HASSH=""
|
|
|
-
|
|
|
-if [ ! -f /etc/shells ]; then
|
|
|
- > /etc/shells
|
|
|
-fi
|
|
|
-
|
|
|
-(while read line ; do
|
|
|
- if [ $line = /bin/bash ]; then
|
|
|
- HASBASH=1
|
|
|
- elif [ $line = /bin/sh ]; then
|
|
|
- HASSH=1
|
|
|
- fi
|
|
|
- done
|
|
|
-
|
|
|
- if [ -z "$HASBASH" ]; then
|
|
|
- echo "/bin/bash" >> /etc/shells
|
|
|
- fi
|
|
|
-
|
|
|
- if [ -z "$HASSH" ]; then
|
|
|
- echo "/bin/sh" >> /etc/shells
|
|
|
-fi) < /etc/shells
|
|
|
-
|
|
|
-# remove obsolete /bin/bash entry from /etc/shells
|
|
|
-if [ -x /bin/grep ] ; then
|
|
|
- if /bin/grep -q /bin/bash2 /etc/shells ; then
|
|
|
- /bin/grep -v '^/bin/bash2$' < /etc/shells > /etc/shells.new
|
|
|
- mv /etc/shells.new /etc/shells
|
|
|
- fi
|
|
|
-fi
|
|
|
-
|
|
|
-
|
|
|
-%postun
|
|
|
-if [ "$1" = 0 ]; then
|
|
|
- /bin/grep -v '^/bin/bash$' < /etc/shells | \
|
|
|
- /bin/grep -v '^/bin/sh$' > /etc/shells.new
|
|
|
- mv /etc/shells.new /etc/shells
|
|
|
-fi
|
|
|
+# post is in lua so that we can run it without any external deps. Helps
|
|
|
+# for bootstrapping a new install.
|
|
|
+# Jesse Keating 2009-01-29 (code from Ignacio Vazquez-Abrams)
|
|
|
+%post -p <lua>
|
|
|
+bashfound = false;
|
|
|
+shfound = false;
|
|
|
+
|
|
|
+f = io.open("/etc/shells", "r");
|
|
|
+if f == nil
|
|
|
+then
|
|
|
+ f = io.open("/etc/shells", "w");
|
|
|
+else
|
|
|
+ repeat
|
|
|
+ t = f:read();
|
|
|
+ if t == "/bin/bash"
|
|
|
+ then
|
|
|
+ bashfound = true;
|
|
|
+ end
|
|
|
+ if t == "/bin/sh"
|
|
|
+ then
|
|
|
+ shfound = true;
|
|
|
+ end
|
|
|
+ until t == nil;
|
|
|
+end
|
|
|
+f:close()
|
|
|
+
|
|
|
+f = io.open("/etc/shells", "a");
|
|
|
+if not bashfound
|
|
|
+then
|
|
|
+ f:write("/bin/bash\n")
|
|
|
+end
|
|
|
+if not shfound
|
|
|
+then
|
|
|
+ f:write("/bin/sh\n")
|
|
|
+end
|
|
|
+f:close()
|
|
|
+
|
|
|
+%postun -p <lua>
|
|
|
+t={}
|
|
|
+for line in io.lines("/etc/shells")
|
|
|
+do
|
|
|
+ if line ~= "/bin/bash" and line ~= "/bin/sh"
|
|
|
+ then
|
|
|
+ table.insert(t,line)
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
+f = io.open("/etc/shells", "w+")
|
|
|
+for n,line in pairs(t)
|
|
|
+do
|
|
|
+ f:write(line.."\n")
|
|
|
+end
|
|
|
|
|
|
|
|
|
%files -f %{name}.lang
|
|
@@ -243,6 +276,11 @@ fi
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
+* Tue Apr 12 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 4.2.8-1
|
|
|
+- update to 4.2 patch level 8
|
|
|
+- use lua script in post/postun
|
|
|
+- update patches from fedora
|
|
|
+
|
|
|
* Fri Sep 03 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 4.1-1
|
|
|
- update to 4.1 patch level 7
|
|
|
|