wok-6.x annotate bash/receipt @ rev 24538
updated fbcat (0.5.1 -> 0.5.2)
author | Hans-G?nter Theisgen |
---|---|
date | Wed Feb 23 15:14:49 2022 +0100 (2022-02-23) |
parents | 71360a13cd94 |
children |
rev | line source |
---|---|
pankso@14 | 1 # SliTaz package receipt. |
pankso@14 | 2 |
pankso@14 | 3 PACKAGE="bash" |
Hans-G?nter@24359 | 4 VERSION="5.1.16" |
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@24336 | 25 # What is the latest version available today? |
pascal@24336 | 26 current_version() |
pascal@24336 | 27 { |
pascal@24336 | 28 wget -O - ${WGET_URL%/*} 2>/dev/null | \ |
pascal@24336 | 29 sed "/alpha/d;/doc/d;/$PACKAGE-/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|" | sort -Vr | sed q |
pascal@24336 | 30 } |
pascal@24336 | 31 |
pascal@17195 | 32 patch_bash() |
pascal@17195 | 33 { |
Hans-G?nter@22531 | 34 for i in $BASHPATCHES |
Hans-G?nter@22531 | 35 do |
Hans-G?nter@22531 | 36 if [ ! -s "$SOURCES_REPOSITORY/$i" ] |
Hans-G?nter@22531 | 37 then |
devl547@19593 | 38 echo "Downloading $i" |
devl547@19593 | 39 busybox wget -O "$SOURCES_REPOSITORY/$i" \ |
pascal@17197 | 40 http://ftp.gnu.org/gnu/bash/bash-$BASEVERSION-patches/$i |
pascal@19699 | 41 fi |
pascal@17195 | 42 echo "Apply $i ..." |
pascal@17195 | 43 patch -p0 < $SOURCES_REPOSITORY/$i |
Hans-G?nter@22531 | 44 done |
pascal@17195 | 45 } |
slaxemulator@10407 | 46 |
gokhlayeh@8171 | 47 # Rules to compile & install the temporary toolchain. |
gokhlayeh@8171 | 48 cook_tmp_toolchain() |
gokhlayeh@8171 | 49 { |
Hans-G?nter@24359 | 50 patch_bash && |
gokhlayeh@8171 | 51 ./configure --without-bash-malloc && |
Hans-G?nter@22531 | 52 make && |
Hans-G?nter@22531 | 53 make install |
gokhlayeh@8171 | 54 } |
gokhlayeh@8171 | 55 |
pankso@14 | 56 # Rules to configure and make the package. |
pankso@14 | 57 compile_rules() |
pankso@14 | 58 { |
pankso@14 | 59 # Patch and then build. |
pascal@17195 | 60 patch_bash |
Hans-G?nter@22531 | 61 |
pankso@10352 | 62 # Skip tests that can not run while cross-compiling. |
pankso@10352 | 63 cat > config.cache << "EOF" |
pankso@10352 | 64 ac_cv_func_mmap_fixed_mapped=yes |
pankso@10352 | 65 ac_cv_func_strcoll_works=yes |
pankso@10352 | 66 ac_cv_func_working_mktime=yes |
pankso@10352 | 67 bash_cv_func_sigsetjmp=present |
pankso@10352 | 68 bash_cv_getcwd_malloc=yes |
pankso@10352 | 69 bash_cv_job_control_missing=present |
pankso@10352 | 70 bash_cv_printf_a_format=yes |
pankso@10352 | 71 bash_cv_sys_named_pipes=present |
pankso@10352 | 72 bash_cv_ulimit_maxfds=yes |
pankso@10352 | 73 bash_cv_under_sys_siglist=yes |
pankso@10352 | 74 bash_cv_unusable_rtsigs=no |
pankso@10352 | 75 gt_cv_int_divbyzero_sigfpe=yes |
pankso@10352 | 76 EOF |
Hans-G?nter@22531 | 77 |
Hans-G?nter@22531 | 78 ./configure \ |
Hans-G?nter@22531 | 79 --cache-file=config.cache \ |
Hans-G?nter@22531 | 80 --bindir=/bin \ |
Hans-G?nter@22531 | 81 --enable-history \ |
Hans-G?nter@22531 | 82 --enable-alias \ |
Hans-G?nter@22531 | 83 --disable-nls \ |
Hans-G?nter@22531 | 84 --without-bash-malloc \ |
Hans-G?nter@22531 | 85 --disable-help-builtin \ |
Hans-G?nter@22531 | 86 --with-installed-readline=no \ |
Hans-G?nter@22531 | 87 $CONFIGURE_ARGS && |
pascal@1553 | 88 make && |
Hans-G?nter@24359 | 89 # Bash doesn't care about DESTDIR in environment variable. |
Hans-G?nter@24359 | 90 make install DESTDIR=$DESTDIR |
pankso@14 | 91 } |
pankso@14 | 92 |
pankso@14 | 93 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@14 | 94 genpkg_rules() |
pankso@14 | 95 { |
Hans-G?nter@24359 | 96 mkdir $fs/etc |
Hans-G?nter@24359 | 97 |
Hans-G?nter@24359 | 98 cook_copy_folders bin |
Hans-G?nter@22531 | 99 |
Hans-G?nter@22531 | 100 # Configuration files. |
Hans-G?nter@22531 | 101 cp $stuff/example.bashrc $fs/etc/bashrc |
pankso@14 | 102 } |
pankso@14 | 103 |
Hans-G?nter@24359 | 104 testsuite() |
Hans-G?nter@24359 | 105 { |
Hans-G?nter@24359 | 106 [ -s "$SOURCES_REPOSITORY/$BASHCHECK" ] || |
Hans-G?nter@24359 | 107 busybox wget --no-check-certificate \ |
Hans-G?nter@24359 | 108 -O "$SOURCES_REPOSITORY/$BASHCHECK" \ |
Hans-G?nter@24359 | 109 $BASHCHECKURL |
Hans-G?nter@24359 | 110 $DESTDIR/bin/bash $SOURCES_REPOSITORY/$BASHCHECK $DESTDIR/bin/bash | \ |
Hans-G?nter@24359 | 111 tee bashcheck.log |
Hans-G?nter@24359 | 112 grep Vulnerable bashcheck.log && |
Hans-G?nter@24359 | 113 echo "ERROR: Vulnerable" |
Hans-G?nter@24359 | 114 } |
xfred222@13689 | 115 |
pankso@14 | 116 post_install() |
pankso@14 | 117 { |
Hans-G?nter@22531 | 118 mkdir -p "$1/etc/skel" |
Hans-G?nter@22531 | 119 cp -a "$1/etc/bashrc" "$1/etc/skel/.bashrc" |
al@18466 | 120 |
al@18466 | 121 # Exit function in non-interactive mode (when user can't answer question) |
al@18968 | 122 ! tty -s && return |
al@18466 | 123 |
pascal@20319 | 124 echo |
al@18466 | 125 echo -n 'Do you want to set Bash to default (y/N) ? : ' |
al@18466 | 126 read -t 30 answer |
Hans-G?nter@24359 | 127 [ "$answer" != 'y' ] && |
Hans-G?nter@24359 | 128 return |
al@18466 | 129 |
al@18466 | 130 echo |
al@18466 | 131 echo 'Setting bash as default shell for all users' |
Hans-G?nter@24359 | 132 sed -i 's|:/bin/[ckz]*sh$|:/bin/bash|' "$1/etc/passwd" |
al@18466 | 133 |
al@18466 | 134 echo 'Creating ~/.bashrc file for all users' |
Hans-G?nter@22531 | 135 for i in $(awk -F: '$7=="/bin/bash"{print $6}' "$1/etc/passwd") |
Hans-G?nter@22531 | 136 do |
al@18466 | 137 [ -e "$1$i/.bashrc" ] && continue |
Hans-G?nter@22531 | 138 cp "$1/etc/bashrc" "$1$i/.bashrc" |
Hans-G?nter@22531 | 139 chown $(stat -c%U:%G "$1$i") "$1$i/.bashrc" |
Hans-G?nter@22531 | 140 done |
pankso@14 | 141 } |
pankso@2156 | 142 |
xfred222@13689 | 143 |
pankso@2156 | 144 pre_remove() |
pankso@2156 | 145 { |
al@18466 | 146 echo |
al@18466 | 147 echo 'Setting sh as default shell for all users' |
Hans-G?nter@24359 | 148 sed -i 's|:/bin/bash$|:/bin/sh|' "$1/etc/passwd" |
Hans-G?nter@24359 | 149 [ -f "$1/etc/skel/.bashrc" ] && |
Hans-G?nter@24359 | 150 rm "$1/etc/skel/.bashrc" |
pankso@2156 | 151 } |