Browse Source

Stefan Fiedler:


			
			
				rocklinux
			
			
		
Stefan Fiedler 17 years ago
parent
commit
6f7cc613db
2 changed files with 47 additions and 41 deletions
  1. +46
    -40
      package/base/bash/bash.conf
  2. +1
    -1
      package/base/bash/postconfig.in

+ 46
- 40
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
}

+ 1
- 1
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 , }"

Loading…
Cancel
Save