wok-stable view bash/receipt @ rev 12438

bash: CVE-2014-6271 fix
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Sep 25 12:58:21 2014 +0200 (2014-09-25)
parents 8ad990dde0f8
children 4acc6a6b8f4f
line source
1 # SliTaz package receipt.
3 PACKAGE="bash"
4 VERSION="4.2"
5 CATEGORY="system-tools"
6 SHORT_DESC="The GNU bourne SHell."
7 MAINTAINER="pankso@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://www.gnu.org/software/bash/"
10 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
12 DEPENDS="readline"
13 BUILD_DEPENDS="readline bison"
15 # Rules to compile & install the temporary toolchain.
16 cook_tmp_toolchain()
17 {
18 cd $src
19 # CVE-2014-6271
20 patch -p0 < $stuff/funcdef-import-4.2.patch
21 ./configure --without-bash-malloc &&
22 make && make install
23 }
25 # Rules to configure and make the package.
26 compile_rules()
27 {
28 # Patch and then build.
29 cd $src
30 # CVE-2014-6271
31 patch -p0 < $stuff/funcdef-import-4.2.patch
32 # Skip tests that can not run while cross-compiling.
33 cat > config.cache << "EOF"
34 ac_cv_func_mmap_fixed_mapped=yes
35 ac_cv_func_strcoll_works=yes
36 ac_cv_func_working_mktime=yes
37 bash_cv_func_sigsetjmp=present
38 bash_cv_getcwd_malloc=yes
39 bash_cv_job_control_missing=present
40 bash_cv_printf_a_format=yes
41 bash_cv_sys_named_pipes=present
42 bash_cv_ulimit_maxfds=yes
43 bash_cv_under_sys_siglist=yes
44 bash_cv_unusable_rtsigs=no
45 gt_cv_int_divbyzero_sigfpe=yes
46 EOF
47 ./configure \
48 $CONFIGURE_ARGS \
49 --cache-file=config.cache \
50 --bindir=/bin \
51 --enable-history --enable-alias \
52 --disable-nls --without-bash-malloc \
53 --disable-help-builtin \
54 --with-installed-readline &&
55 make &&
56 # Bash doesn't care about DESTDIR in environnment variable.
57 make DESTDIR=$DESTDIR install
58 }
60 # Rules to gen a SliTaz package suitable for Tazpkg.
61 genpkg_rules()
62 {
63 cp -a $_pkg/bin $fs
64 # Config files.
65 #
66 mkdir $fs/etc
67 cp $stuff/example.bashrc $fs/etc/bashrc
68 }
70 # Post install commands for Tazpkg.
71 # Check /bin/sh stat.
72 #
73 post_install()
74 {
75 local root
76 root=$1
77 echo "Processing post-install commands..."
78 sh=`readlink $root/bin/sh`
79 if [ ! "$sh" = "/bin/bash" ]; then
80 echo ""
81 echo "**** Actual SH link : $sh"
82 echo ""
83 echo -n "Do you want Bash for /bin/sh (yes/No) ? : "
84 read -t 30 anser
85 if [ "$anser" == "yes" ]; then
86 echo ""
87 echo -n "Removing sh link to make a new one pointing on /bin/bash..."
88 rm $root/bin/sh && ln -s /bin/bash $root/bin/sh
89 status
90 else
91 echo ""
92 echo "Leaving /bin/sh to : $sh"
93 fi
94 fi
95 }
97 # Restore a valid sh link if needed.
98 pre_remove()
99 {
100 local root
101 root=$1
102 sh=`readlink $root/bin/sh`
103 if [ ! "$sh" = "busybox" ]; then
104 rm $root/bin/sh &&
105 ln -s /bin/busybox $root/bin/sh
106 fi
107 }