#!/bin/sh set -e # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-bash VERSION=3.1 ARCH=${ARCH:-x86_64} BUILD=${BUILD:-1} if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mcpu=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi rm -rf $PKG mkdir -p $PKG # Determine bash patchlevel: PATCHLEVEL=`( cd $CWD/patches ; /bin/ls *gz | tail -1 | cut -f 2 -d - | cut -f 1 -d . 2> /dev/null )` if [ "$PATCHLEVEL" = "" ]; then PATCHLEVEL=0 fi cd $TMP rm -rf bash-$VERSION tar xzvf $CWD/bash-$VERSION.tar.gz cd bash-$VERSION chown -R root:root . find . -perm 664 | xargs chmod 644 find . -perm 775 | xargs chmod 755 for patch in $CWD/patches/bash* ; do zcat $patch | patch -p0 --verbose || exit 1 done CFLAGS="$SLKCFLAGS" \ ./configure --prefix=/usr $ARCH-slackware-linux make -j3 make install DESTDIR=$PKG mkdir -p $PKG/bin mv $PKG/usr/bin/bash $PKG/bin/bash2.new strip --strip-unneeded $PKG/bin/bash2.new # We don't include the "bashbug" script. rm -rf $PKG/usr/bin $PKG/usr/man/man1/bashbug.1 gzip -9 $PKG/usr/man/man1/* mkdir -p $PKG/usr/doc/bash-$VERSION cp -a AUTHORS CHANGES COMPAT COPYING INSTALL MANIFEST NEWS NOTES \ README Y2K doc/FAQ doc/INTRO $PKG/usr/doc/bash-$VERSION cd doc groff -ms -Tascii article.ms > $PKG/usr/doc/bash-$VERSION/article.txt # bash.1 is already installed by "make install" for page in builtins.1 rbash.1 ; do cat $page | gzip -9c > $PKG/usr/man/man1/$page.gz done rm -f $PKG/usr/info/dir gzip -9 $PKG/usr/info/* mkdir -p $PKG/install zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh cat $CWD/slack-desc > $PKG/install/slack-desc # Build the package: cd $PKG makepkg -l y -c n $TMP/bash-$VERSION.$PATCHLEVEL-$ARCH-$BUILD.tgz # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/bash-$VERSION rm -rf $PKG fi