wok-4.x view bash/receipt @ rev 12469

tazpkg: upgrade core pkgs first
author Stanislas Leduc <shann@slitaz.org>
date Wed Nov 09 19:06:12 2022 +0000 (24 months ago)
parents fa8aff184d68
children
line source
1 # SliTaz package receipt.
3 PACKAGE="bash"
4 VERSION="4.2.53"
5 BASEVERSION="${VERSION%.*}"
6 CATEGORY="system-tools"
7 SHORT_DESC="The GNU bourne SHell."
8 MAINTAINER="pankso@slitaz.org"
9 LICENSE="GPL3"
10 TARBALL="$PACKAGE-$BASEVERSION.tar.gz"
11 WEB_SITE="http://www.gnu.org/software/bash/"
12 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
13 BASHCHECKURL="https://raw.githubusercontent.com/hannob/bashcheck/master/bashcheck"
14 BASHCHECK="$(basename $BASHCHECKURL)"
15 BASHPATCHES="$(for i in $(seq 1 ${VERSION##*.}); do printf "bash${BASEVERSION/./}-%03d " $i; done)"
16 EXTRA_SOURCE_FILES="$BASHCHECK $BASHPATCHES"
18 DEPENDS="readline"
19 BUILD_DEPENDS="readline bison wget texinfo"
21 patch_bash()
22 {
23 for i in $BASHPATCHES ; do
24 [ -s "$SOURCES_REPOSITORY/$i" ] ||
25 wget -O "$SOURCES_REPOSITORY/$i" \
26 http://ftp.gnu.org/gnu/bash/bash-$BASEVERSION-patches/$i
27 echo "Apply $i ..."
28 patch -p0 < $SOURCES_REPOSITORY/$i
29 done
30 }
32 # Rules to compile & install the temporary toolchain.
33 cook_tmp_toolchain()
34 {
35 cd $src
36 patch_bash
37 ./configure --without-bash-malloc &&
38 make && make install
39 }
41 # Rules to configure and make the package.
42 compile_rules()
43 {
44 # Patch and then build.
45 cd $src
46 patch_bash
47 # Skip tests that can not run while cross-compiling.
48 cat > config.cache << "EOF"
49 ac_cv_func_mmap_fixed_mapped=yes
50 ac_cv_func_strcoll_works=yes
51 ac_cv_func_working_mktime=yes
52 bash_cv_func_sigsetjmp=present
53 bash_cv_getcwd_malloc=yes
54 bash_cv_job_control_missing=present
55 bash_cv_printf_a_format=yes
56 bash_cv_sys_named_pipes=present
57 bash_cv_ulimit_maxfds=yes
58 bash_cv_under_sys_siglist=yes
59 bash_cv_unusable_rtsigs=no
60 gt_cv_int_divbyzero_sigfpe=yes
61 EOF
62 ./configure \
63 $CONFIGURE_ARGS \
64 --cache-file=config.cache \
65 --bindir=/bin \
66 --enable-history --enable-alias \
67 --disable-nls --without-bash-malloc \
68 --disable-help-builtin \
69 --with-installed-readline &&
70 make &&
71 # Bash doesn't care about DESTDIR in environnment variable.
72 make DESTDIR=$DESTDIR install
73 [ -s "$SOURCES_REPOSITORY/$BASHCHECK" ] ||
74 wget --no-check-certificate -O "$SOURCES_REPOSITORY/$BASHCHECK" $BASHCHECKURL
75 $DESTDIR/bin/bash $SOURCES_REPOSITORY/$BASHCHECK $DESTDIR/bin/bash | tee bashcheck.log
76 grep Vulnerable bashcheck.log && echo "ERROR: Vulnerable"
77 }
79 # Rules to gen a SliTaz package suitable for Tazpkg.
80 genpkg_rules()
81 {
82 cp -a $_pkg/bin $fs
83 # Config files.
84 #
85 mkdir $fs/etc
86 cp $stuff/example.bashrc $fs/etc/bashrc
87 }
89 # Post install commands for Tazpkg.
90 # Check /bin/sh stat.
91 #
92 post_install()
93 {
94 local root
95 root=$1
96 echo "Processing post-install commands..."
97 sh=`readlink $root/bin/sh`
98 if [ ! "$sh" = "/bin/bash" ]; then
99 echo ""
100 echo "**** Actual SH link : $sh"
101 echo ""
102 echo -n "Do you want Bash for /bin/sh (yes/No) ? : "
103 read -t 30 anser
104 if [ "$anser" == "yes" ]; then
105 echo ""
106 echo -n "Removing sh link to make a new one pointing on /bin/bash..."
107 rm $root/bin/sh && ln -s /bin/bash $root/bin/sh
108 status
109 else
110 echo ""
111 echo "Leaving /bin/sh to : $sh"
112 fi
113 fi
114 }
116 # Restore a valid sh link if needed.
117 pre_remove()
118 {
119 local root
120 root=$1
121 sh=`readlink $root/bin/sh`
122 if [ ! "$sh" = "busybox" ]; then
123 rm $root/bin/sh &&
124 ln -s /bin/busybox $root/bin/sh
125 fi
126 }