#!/bin/bash # --- ROCK-COPYRIGHT-NOTE-BEGIN --- # # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # Please add additional copyright information _after_ the line containing # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by # the ./scripts/Create-CopyPatch script. Do not edit this copyright text! # # ROCK Linux: rock-src/package/base/bash/bash.conf # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. A copy of the GNU General Public # License can be found at Documentation/COPYING. # # Many people helped and are helping developing ROCK Linux. Please # have a look at https://www.rocklinux.org/ and the Documentation/TEAM # file for details. # # --- ROCK-COPYRIGHT-NOTE-END --- patchfiles="`ls $confdir/$xpkg/*.patch 2>/dev/null | tr '\n' ' '` $patchfiles" # From https://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 extraconfopt " " "--without-bash-malloc" pkginstalled readline && var_append extraconfopt " " "--with-installed-readline" 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 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',"' 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 }