From 6f7cc613db545eaeaf713d8c693528e7bf3c784c Mon Sep 17 00:00:00 2001 From: Stefan Fiedler Date: Fri, 2 Nov 2007 13:24:48 +0000 Subject: [PATCH] Stefan Fiedler: bash: complete rewrite based on CLFS sysroot and multilib builds bash: copy and adapt code for forked packages from trunk bash: fix installation of multiple versions and adjust build stages diff -Ndur package/base/bash/bash.conf package/base/bash/bash.conf [2007100300370817950] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@8754 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/base/bash/bash.conf | 86 ++++++++++++++++++--------------- package/base/bash/postconfig.in | 2 +- 2 files changed, 47 insertions(+), 41 deletions(-) diff --git a/package/base/bash/bash.conf b/package/base/bash/bash.conf index bcf9debaa..1e007bd45 100644 --- a/package/base/bash/bash.conf +++ b/package/base/bash/bash.conf @@ -1,3 +1,4 @@ +#!/bin/bash # --- ROCK-COPYRIGHT-NOTE-BEGIN --- # # This copyright note is auto-generated by ./scripts/Create-CopyPatch. @@ -20,54 +21,59 @@ # # --- ROCK-COPYRIGHT-NOTE-END --- -pkg_bash_postmake() { - [ -f $root/usr/bin/bash -a $stagelevel != 0 ] && \ - mv -v $root/usr/bin/bash $root/bin/$xpkg - if [ $xpkg = $ROCKCFG_PKG_BASH_DEFAULT ]; then - ln -sfv $ROCKCFG_PKG_BASH_DEFAULT $root/bin/bash - ln -sfv $ROCKCFG_PKG_BASH_DEFAULT $root/bin/sh - - echo "Creating 'usr/bin/which' and 'bin/sh' ..." - echo -e '#!/bin/bash\ntype -p "$@"' > $root/usr/bin/which - chmod +x $root/usr/bin/which - fi - - if [ "$ROCKCFG_CREATE_DOCS" != 0 ] ; then - echo "Unpacking bash documentation ..." - tar $taropt $archdir/bash-doc-$pkg_bash_docver.tar.bz2 - fi -} - -if [ $xpkg != $ROCKCFG_PKG_BASH_DEFAULT ]; then - var_append INSTALL_WRAPPER_FILTER "|" \ - 'sed "s,share/man/man1/bash.1\$,share/man/man1/'$xpkg'.1,"' - var_append INSTALL_WRAPPER_FILTER "|" \ - 'sed "s,share/man/man1/bashbug.1\$,share/man/man1/'${xpkg/bash/bashbug}'.1,"' - var_append INSTALL_WRAPPER_FILTER "|" \ - 'sed "s,share/info/bash.info\$,share/info/'$xpkg'.info,"' - var_append INSTALL_WRAPPER_FILTER "|" \ - 'sed "s,bin/bashbug\$,bin/'${xpkg/bash/bashbug}',"' -fi - -premake="cat /dev/null > lib/malloc/malloc.c" +patchfiles="`ls $confdir/$xpkg/*.patch 2>/dev/null | tr '\n' ' '` $patchfiles" # From http://www.linuxfromscratch.org/lfs/view/stable/chapter05/bash.html: # This option turns off the use of Bash's memory allocation (malloc) function # which is known to cause segmentation faults. By turning this option off, # Bash will use the malloc functions from Glibc which are more stable. -var_append confopt " " "--without-bash-malloc" +var_append extraconfopt " " "--without-bash-malloc" -if [ $xpkg = bash2 ]; then - [ $stagelevel -eq 1 ] && confopt="$confopt --disable-readline" -else - [ $stagelevel -eq 1 ] && var_append patchfiles " " "$confdir/readline.diff" -fi +pkginstalled readline && var_append extraconfopt " " "--with-installed-readline" -patchfiles="`ls $confdir/$xpkg/*.patch 2>/dev/null | tr '\n' ' '` $patchfiles" +if [ $stagelevel -le 2 ] ; then + hook_add preconf 5 "bash_preconf" + bash_preconf() { + echo "bash_cv_sys_named_pipes=yes" > config.cache + # If not set in cross-builds, bash would use its own implementation + # of getcwd, which causes problems for stage 3 builds. + echo "bash_cv_getcwd_malloc=yes" >> config.cache + } + var_append extraconfopt " " "--cache-file=config.cache" +fi -[ "$ROCKCFG_PKG_BASH_PROGCOMP" = 0 ] && confopt="$confopt --disable-progcomp" -[ "$ROCKCFG_PKG_BASH_HELP_CMD" = 0 ] && confopt="$confopt --disable-help-builtin" +var_append INSTALL_WRAPPER_FILTER "|" \ + 'sed "s,share/man/man1/bash.1\$,share/man/man1/'$xpkg'.1,"' +var_append INSTALL_WRAPPER_FILTER "|" \ + 'sed "s,share/man/man1/bashbug.1\$,share/man/man1/'${xpkg/bash/bashbug}'.1,"' +var_append INSTALL_WRAPPER_FILTER "|" \ + 'sed "s,share/info/bash.info\$,share/info/'$xpkg'.info,"' +var_append INSTALL_WRAPPER_FILTER "|" \ + 'sed "s,bin/bashbug\$,bin/'${xpkg/bash/bashbug}',"' +var_append INSTALL_WRAPPER_FILTER "|" \ + 'sed "s,usr/bin/bash\$,bin/'$xpkg',"' -pkg_bash_docver=$ver postmake="pkg_bash_postmake" +pkg_bash_postmake() { + if [ $xpkg = "$ROCKCFG_PKG_BASH_DEFAULT" ]; then + echo "Creating 'usr/bin/which' and 'bin/sh' ..." + + # Using the filters here would create recursive symlinks. + INSTALL_WRAPPER_FILTER= + ln -sfv $xpkg $root/bin/bash + ln -sfv $xpkg $root/bin/sh + ln -sfv $xpkg.1 $root/usr/share/man/man1/bash.1 + ln -sfv $xpkg.info $root/usr/share/info/bash.info + ln -sfv ${xpkg/bash/bashbug} $root/usr/bin/bashbug + ln -sfv ${xpkg/bash/bashbug}.1 $root/usr/share/man/man1/bashbug.1 + + echo -e '#!/bin/bash\ntype -p "$@"' > $root/usr/bin/which + chmod +x $root/usr/bin/which + fi + + if [ "$ROCKCFG_CREATE_DOCS" != 0 ] ; then + echo "Unpacking bash documentation ..." + tar $taropt $archdir/bash-doc-$ver.tar.bz2 + fi +} diff --git a/package/base/bash/postconfig.in b/package/base/bash/postconfig.in index 38b4a05bb..a83dee59e 100644 --- a/package/base/bash/postconfig.in +++ b/package/base/bash/postconfig.in @@ -1,5 +1,5 @@ # We rely on bash so heavily that it makes no sense to disable default bash, imho. # Enable default bash and build non-default bash in stages 5 and 9. -pkgfilter sed -e "/ bash=[^ ]* / { h ; s,^\(.\) [^ ]\{9\}\(.\) ,\1 -X---5---\2 , } ; \ +pkgfilter sed -e "/ bash=[^ ]* / { h ; s,^\(. \)[^ ]\{9\}\(.\) ,\1--X--5---\2 , } ; \ / bash=$ROCKCFG_PKG_BASH_DEFAULT / { x ; s,^. ,X , }"