summaryrefslogtreecommitdiffstats
path: root/testing/source/bash/bash.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'testing/source/bash/bash.SlackBuild')
-rwxr-xr-xtesting/source/bash/bash.SlackBuild80
1 files changed, 80 insertions, 0 deletions
diff --git a/testing/source/bash/bash.SlackBuild b/testing/source/bash/bash.SlackBuild
new file mode 100755
index 000000000..fba2b632f
--- /dev/null
+++ b/testing/source/bash/bash.SlackBuild
@@ -0,0 +1,80 @@
+#!/bin/sh
+# Set initial variables:
+CWD=`pwd`
+if [ "$TMP" = "" ]; then
+ TMP=/tmp
+fi
+PKG=$TMP/package-bash
+
+VERSION=4.0
+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 -mtune=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/bash-${VERSION}-patches ; /bin/ls bash40-??? | tail -1 | cut -f 2 -d - 2> /dev/null )"
+if [ "$PATCHLEVEL" = "" ]; then
+ PATCHLEVEL=0
+fi
+
+cd $TMP
+rm -rf bash-$VERSION
+tar xjvf $CWD/bash-$VERSION.tar.bz2 || exit 1
+cd bash-$VERSION || exit 1
+chown -R root:root .
+find . -perm 664 | xargs chmod 644
+find . -perm 775 | xargs chmod 755
+
+if [ -d $CWD/bash-${VERSION}-patches ]; then
+ ( cd $CWD/bash-${VERSION}-patches ; cat bash40-??? ) | patch -p0 --verbose || exit 1
+fi
+
+CFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --mandir=/usr/man \
+ --infodir=/usr/info \
+ --build=$ARCH-slackware-linux
+make -j4 || make || exit 1
+make install DESTDIR=$PKG
+mv $PKG/usr/share/doc $PKG/usr
+mkdir -p $PKG/bin
+mv $PKG/usr/bin/bash $PKG/bin/bash4.new
+strip --strip-unneeded $PKG/bin/bash4.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.txz
+