wok-current annotate bash/receipt @ rev 17341
slitaz-configs-base: Up (5.5.7); mesa-dri: remove vmwgfx
author | Xander Ziiryanoff <psychomaniak@xakep.ru> |
---|---|
date | Wed Nov 05 23:50:10 2014 +0100 (2014-11-05) |
parents | e76deed8769f |
children | dfef8de3d270 |
rev | line source |
---|---|
pankso@14 | 1 # SliTaz package receipt. |
pankso@14 | 2 |
pankso@14 | 3 PACKAGE="bash" |
pascal@17197 | 4 VERSION="4.2.53" |
pascal@17197 | 5 BASEVERSION="${VERSION%.*}" |
pankso@202 | 6 CATEGORY="system-tools" |
pankso@14 | 7 SHORT_DESC="The GNU bourne SHell." |
pankso@14 | 8 MAINTAINER="pankso@slitaz.org" |
pascal@15201 | 9 LICENSE="GPL3" |
pascal@17197 | 10 TARBALL="$PACKAGE-$BASEVERSION.tar.gz" |
pankso@14 | 11 WEB_SITE="http://www.gnu.org/software/bash/" |
pankso@14 | 12 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL" |
pascal@17195 | 13 BASHCHECKURL="https://raw.githubusercontent.com/hannob/bashcheck/master/bashcheck" |
pascal@17195 | 14 BASHCHECK="$(basename $BASHCHECKURL)" |
pascal@17197 | 15 BASHPATCHES="$(for i in $(seq 1 ${VERSION##*.}); do printf "bash${BASEVERSION/./}-%03d " $i; done)" |
pascal@17195 | 16 EXTRA_SOURCE_FILES="$BASHCHECK $BASHPATCHES" |
pankso@14 | 17 |
slaxemulator@10407 | 18 DEPENDS="readline" |
pascal@17195 | 19 BUILD_DEPENDS="readline bison wget texinfo" |
pascal@17195 | 20 |
pascal@17195 | 21 patch_bash() |
pascal@17195 | 22 { |
pascal@17195 | 23 for i in $BASHPATCHES ; do |
pascal@17195 | 24 [ -s "$SOURCES_REPOSITORY/$i" ] || |
pascal@17195 | 25 wget -O "$SOURCES_REPOSITORY/$i" \ |
pascal@17197 | 26 http://ftp.gnu.org/gnu/bash/bash-$BASEVERSION-patches/$i |
pascal@17195 | 27 echo "Apply $i ..." |
pascal@17195 | 28 patch -p0 < $SOURCES_REPOSITORY/$i |
pascal@17195 | 29 done |
pascal@17195 | 30 } |
slaxemulator@10407 | 31 |
gokhlayeh@8171 | 32 # Rules to compile & install the temporary toolchain. |
gokhlayeh@8171 | 33 cook_tmp_toolchain() |
gokhlayeh@8171 | 34 { |
gokhlayeh@8171 | 35 cd $src |
pascal@17195 | 36 patch_bash |
gokhlayeh@8171 | 37 ./configure --without-bash-malloc && |
gokhlayeh@8171 | 38 make && make install |
gokhlayeh@8171 | 39 } |
gokhlayeh@8171 | 40 |
pankso@14 | 41 # Rules to configure and make the package. |
pankso@14 | 42 compile_rules() |
pankso@14 | 43 { |
pankso@14 | 44 # Patch and then build. |
pankso@14 | 45 cd $src |
pascal@17195 | 46 patch_bash |
pankso@10352 | 47 # Skip tests that can not run while cross-compiling. |
pankso@10352 | 48 cat > config.cache << "EOF" |
pankso@10352 | 49 ac_cv_func_mmap_fixed_mapped=yes |
pankso@10352 | 50 ac_cv_func_strcoll_works=yes |
pankso@10352 | 51 ac_cv_func_working_mktime=yes |
pankso@10352 | 52 bash_cv_func_sigsetjmp=present |
pankso@10352 | 53 bash_cv_getcwd_malloc=yes |
pankso@10352 | 54 bash_cv_job_control_missing=present |
pankso@10352 | 55 bash_cv_printf_a_format=yes |
pankso@10352 | 56 bash_cv_sys_named_pipes=present |
pankso@10352 | 57 bash_cv_ulimit_maxfds=yes |
pankso@10352 | 58 bash_cv_under_sys_siglist=yes |
pankso@10352 | 59 bash_cv_unusable_rtsigs=no |
pankso@10352 | 60 gt_cv_int_divbyzero_sigfpe=yes |
pankso@10352 | 61 EOF |
pankso@10344 | 62 ./configure \ |
pankso@10352 | 63 $CONFIGURE_ARGS \ |
pankso@10352 | 64 --cache-file=config.cache \ |
pankso@10344 | 65 --bindir=/bin \ |
gokhlayeh@8171 | 66 --enable-history --enable-alias \ |
gokhlayeh@8171 | 67 --disable-nls --without-bash-malloc \ |
pankso@10344 | 68 --disable-help-builtin \ |
pankso@10344 | 69 --with-installed-readline && |
pascal@1553 | 70 make && |
gokhlayeh@8171 | 71 # Bash doesn't care about DESTDIR in environnment variable. |
gokhlayeh@8171 | 72 make DESTDIR=$DESTDIR install |
pascal@17195 | 73 [ -s "$SOURCES_REPOSITORY/$BASHCHECK" ] || |
pascal@17195 | 74 wget --no-check-certificate -O "$SOURCES_REPOSITORY/$BASHCHECK" $BASHCHECKURL |
pascal@17196 | 75 $DESTDIR/bin/bash $SOURCES_REPOSITORY/$BASHCHECK $DESTDIR/bin/bash | tee bashcheck.log |
pascal@17195 | 76 grep Vulnerable bashcheck.log && echo "ERROR: Vulnerable" |
pankso@14 | 77 } |
pankso@14 | 78 |
pankso@14 | 79 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@14 | 80 genpkg_rules() |
pankso@14 | 81 { |
pascal@14999 | 82 cp -a $install/bin $fs |
pankso@14 | 83 # Config files. |
pankso@14 | 84 # |
pankso@14 | 85 mkdir $fs/etc |
pankso@9697 | 86 cp $stuff/example.bashrc $fs/etc/bashrc |
pankso@14 | 87 } |
pankso@14 | 88 |
xfred222@13689 | 89 |
pankso@14 | 90 post_install() |
pankso@14 | 91 { |
pankso@14 | 92 local root |
pankso@14 | 93 root=$1 |
pankso@14 | 94 echo "Processing post-install commands..." |
xfred222@13689 | 95 echo -n "Do you want to set Bash to default (y/N) ? : " |
gokhlayeh@7635 | 96 read -t 30 anser |
xfred222@13689 | 97 if [ "$anser" == "y" ]; then |
pankso@14 | 98 echo "" |
xfred222@13689 | 99 echo "Setting bash as default for all users" |
xfred222@13689 | 100 sed -i "s/:\/bin\/sh$/:\/bin\/bash/g" /etc/passwd |
xfred222@13689 | 101 sed -i "s/:\/bin\/ksh$/:\/bin\/bash/g" /etc/passwd |
xfred222@13689 | 102 sed -i "s/:\/bin\/zsh$/:\/bin\/bash/g" /etc/passwd |
xfred222@13689 | 103 sed -i "s/:\/bin\/csh$/:\/bin\/bash/g" /etc/passwd |
xfred222@13689 | 104 echo "Creating .bashrc file for all users" |
xfred222@13689 | 105 for i in `ls -d /home/*` |
xfred222@13689 | 106 do |
xfred222@13689 | 107 cp /etc/bashrc $i/.bashrc |
xfred222@13689 | 108 done |
xfred222@13689 | 109 cp /etc/bashrc /root/.bashrc |
xfred222@13689 | 110 cp /etc/bashrc /etc/skel/.bashrc |
pankso@14 | 111 fi |
pankso@14 | 112 } |
pankso@2156 | 113 |
xfred222@13689 | 114 |
pankso@2156 | 115 pre_remove() |
pankso@2156 | 116 { |
slaxemulator@9610 | 117 local root |
slaxemulator@9610 | 118 root=$1 |
xfred222@13689 | 119 echo "Setting back sh as default for all users" |
xfred222@13689 | 120 sed -i "s/:\/bin\/bash$/:\/bin\/sh/g" /etc/passwd |
mojo@15805 | 121 if [ -f /etc/skel/.bashrc ]; then |
xfred222@13689 | 122 rm /etc/skel/.bashrc |
mojo@15805 | 123 fi |
pankso@2156 | 124 } |