wok annotate bash/receipt @ rev 10352

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