wok-6.x annotate bash/receipt @ rev 22628

updated dar (2.4.18 -> 2.6.7)
author Hans-G?nter Theisgen
date Mon Jan 13 07:45:07 2020 +0100 (2020-01-13)
parents 970c5ec9a60a
children 71360a13cd94
rev   line source
pankso@14 1 # SliTaz package receipt.
pankso@14 2
pankso@14 3 PACKAGE="bash"
Hans-G?nter@22531 4 VERSION="5.0.11"
pascal@17197 5 BASEVERSION="${VERSION%.*}"
pankso@202 6 CATEGORY="system-tools"
Hans-G?nter@22531 7 TAGS="shell"
pankso@14 8 SHORT_DESC="The GNU bourne SHell."
pankso@14 9 MAINTAINER="pankso@slitaz.org"
pascal@15201 10 LICENSE="GPL3"
Hans-G?nter@22531 11 WEB_SITE="https://www.gnu.org/software/bash/"
Hans-G?nter@22531 12
pascal@17197 13 TARBALL="$PACKAGE-$BASEVERSION.tar.gz"
pankso@14 14 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
Hans-G?nter@22531 15
pascal@17195 16 BASHCHECKURL="https://raw.githubusercontent.com/hannob/bashcheck/master/bashcheck"
pascal@17195 17 BASHCHECK="$(basename $BASHCHECKURL)"
Hans-G?nter@22531 18
pascal@17197 19 BASHPATCHES="$(for i in $(seq 1 ${VERSION##*.}); do printf "bash${BASEVERSION/./}-%03d " $i; done)"
pascal@17195 20 EXTRA_SOURCE_FILES="$BASHCHECK $BASHPATCHES"
pankso@14 21
pascal@19754 22 DEPENDS="libtinfo"
Hans-G?nter@22531 23 BUILD_DEPENDS="bison texinfo"
pascal@17195 24
pascal@17195 25 patch_bash()
pascal@17195 26 {
Hans-G?nter@22531 27 for i in $BASHPATCHES
Hans-G?nter@22531 28 do
Hans-G?nter@22531 29 if [ ! -s "$SOURCES_REPOSITORY/$i" ]
Hans-G?nter@22531 30 then
devl547@19593 31 echo "Downloading $i"
devl547@19593 32 busybox wget -O "$SOURCES_REPOSITORY/$i" \
pascal@17197 33 http://ftp.gnu.org/gnu/bash/bash-$BASEVERSION-patches/$i
pascal@19699 34 fi
pascal@17195 35 echo "Apply $i ..."
pascal@17195 36 patch -p0 < $SOURCES_REPOSITORY/$i
Hans-G?nter@22531 37 done
pascal@17195 38 }
slaxemulator@10407 39
gokhlayeh@8171 40 # Rules to compile & install the temporary toolchain.
gokhlayeh@8171 41 cook_tmp_toolchain()
gokhlayeh@8171 42 {
pascal@17195 43 patch_bash
gokhlayeh@8171 44 ./configure --without-bash-malloc &&
Hans-G?nter@22531 45 make &&
Hans-G?nter@22531 46 make install
gokhlayeh@8171 47 }
gokhlayeh@8171 48
pankso@14 49 # Rules to configure and make the package.
pankso@14 50 compile_rules()
pankso@14 51 {
pankso@14 52 # Patch and then build.
pascal@17195 53 patch_bash
Hans-G?nter@22531 54
pankso@10352 55 # Skip tests that can not run while cross-compiling.
pankso@10352 56 cat > config.cache << "EOF"
pankso@10352 57 ac_cv_func_mmap_fixed_mapped=yes
pankso@10352 58 ac_cv_func_strcoll_works=yes
pankso@10352 59 ac_cv_func_working_mktime=yes
pankso@10352 60 bash_cv_func_sigsetjmp=present
pankso@10352 61 bash_cv_getcwd_malloc=yes
pankso@10352 62 bash_cv_job_control_missing=present
pankso@10352 63 bash_cv_printf_a_format=yes
pankso@10352 64 bash_cv_sys_named_pipes=present
pankso@10352 65 bash_cv_ulimit_maxfds=yes
pankso@10352 66 bash_cv_under_sys_siglist=yes
pankso@10352 67 bash_cv_unusable_rtsigs=no
pankso@10352 68 gt_cv_int_divbyzero_sigfpe=yes
pankso@10352 69 EOF
Hans-G?nter@22531 70
Hans-G?nter@22531 71 ./configure \
Hans-G?nter@22531 72 --cache-file=config.cache \
Hans-G?nter@22531 73 --bindir=/bin \
Hans-G?nter@22531 74 --enable-history \
Hans-G?nter@22531 75 --enable-alias \
Hans-G?nter@22531 76 --disable-nls \
Hans-G?nter@22531 77 --without-bash-malloc \
Hans-G?nter@22531 78 --disable-help-builtin \
Hans-G?nter@22531 79 --with-installed-readline=no \
Hans-G?nter@22531 80 $CONFIGURE_ARGS &&
pascal@1553 81 make &&
gokhlayeh@8171 82 # Bash doesn't care about DESTDIR in environnment variable.
gokhlayeh@8171 83 make DESTDIR=$DESTDIR install
Hans-G?nter@22531 84
pascal@17195 85 [ -s "$SOURCES_REPOSITORY/$BASHCHECK" ] ||
devl547@19593 86 busybox wget --no-check-certificate -O "$SOURCES_REPOSITORY/$BASHCHECK" $BASHCHECKURL
pascal@17196 87 $DESTDIR/bin/bash $SOURCES_REPOSITORY/$BASHCHECK $DESTDIR/bin/bash | tee bashcheck.log
pascal@17195 88 grep Vulnerable bashcheck.log && echo "ERROR: Vulnerable"
pankso@14 89 }
pankso@14 90
pankso@14 91 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@14 92 genpkg_rules()
pankso@14 93 {
Hans-G?nter@22531 94 cp -a $install/bin $fs
Hans-G?nter@22531 95
Hans-G?nter@22531 96 # Configuration files.
pankso@14 97 mkdir $fs/etc
Hans-G?nter@22531 98 cp $stuff/example.bashrc $fs/etc/bashrc
pankso@14 99 }
pankso@14 100
xfred222@13689 101
pankso@14 102 post_install()
pankso@14 103 {
Hans-G?nter@22531 104 mkdir -p "$1/etc/skel"
Hans-G?nter@22531 105 cp -a "$1/etc/bashrc" "$1/etc/skel/.bashrc"
al@18466 106
al@18466 107 # Exit function in non-interactive mode (when user can't answer question)
al@18968 108 ! tty -s && return
al@18466 109
pascal@20319 110 echo
al@18466 111 echo -n 'Do you want to set Bash to default (y/N) ? : '
al@18466 112 read -t 30 answer
al@18481 113 [ "$answer" != 'y' ] && return
al@18466 114
al@18466 115 echo
al@18466 116 echo 'Setting bash as default shell for all users'
al@18466 117 sed -i 's|:/bin/[ckz]*sh$|:/bin/bash|' "$1/etc/passwd"
al@18466 118
al@18466 119 echo 'Creating ~/.bashrc file for all users'
Hans-G?nter@22531 120 for i in $(awk -F: '$7=="/bin/bash"{print $6}' "$1/etc/passwd")
Hans-G?nter@22531 121 do
al@18466 122 [ -e "$1$i/.bashrc" ] && continue
Hans-G?nter@22531 123 cp "$1/etc/bashrc" "$1$i/.bashrc"
Hans-G?nter@22531 124 chown $(stat -c%U:%G "$1$i") "$1$i/.bashrc"
Hans-G?nter@22531 125 done
pankso@14 126 }
pankso@2156 127
xfred222@13689 128
pankso@2156 129 pre_remove()
pankso@2156 130 {
al@18466 131 echo
al@18466 132 echo 'Setting sh as default shell for all users'
al@18466 133 sed -i 's|:/bin/bash$|:/bin/sh|' "$1/etc/passwd"
al@18466 134 [ -f "$1/etc/skel/.bashrc" ] && rm "$1/etc/skel/.bashrc"
pankso@2156 135 }