# $Id$ PNAME="bash" PVER="5.0" PBUILD="r1" PATCH_LEVEL="" PCAT="app-shells" DESCRIPTION="The standard GNU Bourne again shell." HOMEPAGE="http://www.gnu.org/software/bash/bash.html" DEPEND=">= sys-libs/ncurses-6.1 >= sys-libs/readline-8.0" SRCFILE="${PNAME}-${PVER}.tar.gz" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" sminclude mtools SRC_URI=( gnu://${PNAME}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/dot.bashrc mirror://${PNAME}/dot.bash_profile mirror://${PNAME}/dot.bash_logout mirror://${PNAME}/bashrc mirror://${PNAME}/bash_logout $(for ((i=1;i <= PATCH_LEVEL; i++)) do ver=00${i} [[ ${i} -ge 10 ]] && ver=0${i} [[ ${i} -ge 100 ]] && ver=${i} echo "gnu://${PNAME}/${PNAME}-${PVER}-patches/${PNAME}${PVER/./}-${ver}" echo "mirror://${PNAME}/${PNAME}${PVER/./}-${ver}" done) mirror://${PNAME}/${PNAME}-3.0-parallel-build.patch mirror://${PNAME}/${PNAME}-3.0-trap-fg-signals.patch ) [[ ! -z ${PATCH_LEVEL} ]] && UP2PVER="${PVER}.${PATCH_LEVEL}" UP2DATE="updatecmd_gnu ${PNAME} gz" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # apply all upstream patches local i local ver for ((i=1; i <= PATCH_LEVEL; i++)) do ver=00${i} [[ ${i} -ge 10 ]] && ver=0${i} [[ ${i} -ge 100 ]] && ver=${i} mpatch ${PNAME}${PVER/./}-${ver} || die done # fix parallel make mpatch ${PNAME}-3.0-parallel-build.patch || die # other redhat patches: # don't barf on handled signals in scripts mpatch ${PNAME}-3.0-trap-fg-signals.patch || die # enable SSH_SOURCE_BASHRC sed -i 's:^.*\(#define SSH_SOURCE_BASHRC\).*$:\1:' config-top.h || die # location of the default mail directory # (not using config-top.h but config.h.in to suppress annoying warnings) sed -i 's:^\(#define DEFAULT_MAIL_DIRECTORY\).*:\1 "/usr/spool/mail":' config.h.in || die # run the startup files echo '#define NON_INTERACTIVE_LOGIN_SHELLS' >> config-top.h || die # location of system-wide bashrc echo '#define SYS_BASHRC "/etc/bash/bashrc"' >> config-top.h || die # location of system-wide bash_logout echo '#define SYS_BASH_LOGOUT "/etc/bash/bash_logout"' >> config-top.h || die # Force pgrp synchronization # (https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653) # # The session will hang cases where you 'su' (not 'su -') and # then run a piped command in emacs. # This problem seem to happen due to scheduler changes kernel # side - although reproduceble with later 2.4 kernels, it is # especially easy with 2.6 kernels. echo '#define PGRP_PIPE 1' >> config-bot.h || die } src_compile() { cd ${SRCDIR} mconfigure \ --disable-profiling \ --enable-readline \ --with-curses \ --without-gnu-malloc \ --with-installed-readline \ || die # on x86_64 parallel is broken; patch not work mmake -j1 || die } src_install() { cd ${SRCDIR} make DESTDIR=${BINDIR} install || die # some needed symlinks mlink bash /usr/bin/sh || die mlink bash /usr/bin/rbash || die # install skeletons for i in bashrc bash_profile bash_logout do minstalletc dot.${i} .${i} /etc/skel || die done # install global rcs minstalletc bashrc bashrc /etc/bash || die minstalletc bash_logout bash_logout /etc/bash || die minstalldocs ABOUT-NLS AUTHORS CHANGES COMPAT COPYING MANIFEST \ NEWS NOTES POSIX RBASH README || die } postinstall() { # install skeletons for root, as bash is our default shell if [[ ! -f ${MROOT}/root/.bashrc ]] then install -m0644 ${MROOT}/etc/skel/.bashrc ${MROOT}/root fi if [[ ! -f ${MROOT}/root/.bash_profile ]] then install -m0644 ${MROOT}/etc/skel/.bash_profile ${MROOT}/root fi if [[ ! -f ${MROOT}/root/.bash_logout ]] then install -m0644 ${MROOT}/etc/skel/.bash_logout ${MROOT}/root fi }