summaryrefslogtreecommitdiffstats
path: root/source/ap/bc/bc.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/bc/bc.SlackBuild')
-rwxr-xr-xsource/ap/bc/bc.SlackBuild45
1 files changed, 32 insertions, 13 deletions
diff --git a/source/ap/bc/bc.SlackBuild b/source/ap/bc/bc.SlackBuild
index 26e80aede..ac8bd4fe8 100755
--- a/source/ap/bc/bc.SlackBuild
+++ b/source/ap/bc/bc.SlackBuild
@@ -1,5 +1,5 @@
-#!/bin/sh
-# Copyright 2006, 2007, 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
+#!/bin/bash
+# Copyright 2006, 2007, 2008, 2009, 2010, 2017, 2018 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -19,29 +19,39 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=bc
-VERSION=${VERSION:-1.06.95}
-BUILD=${BUILD:-3}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) export ARCH=i486 ;;
+ i?86) export ARCH=i586 ;;
arm*) export ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) export ARCH=$( uname -m ) ;;
esac
fi
-CWD=$(pwd)
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
+NUMJOBS=${NUMJOBS:-" -j7 "}
+
TMP=${TMP:-/tmp}
PKG=$TMP/package-${PKGNAM}
rm -rf $PKG
mkdir -p $TMP $PKG
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
@@ -52,8 +62,8 @@ fi
cd $TMP
rm -rf ${PKGNAM}-${VERSION}
-tar xjvf $CWD/${PKGNAM}-$VERSION.tar.bz2 || exit 1
-cd ${PKGNAM}-$VERSION
+tar xvf $CWD/${PKGNAM}-$VERSION.tar.xz || exit 1
+cd ${PKGNAM}-$VERSION || exit 1
# Make sure ownerships and permissions are sane:
chown -R root:root .
@@ -69,13 +79,14 @@ CFLAGS="$SLKCFLAGS" \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/man \
+ --infodir=/usr/info \
--with-readline \
--program-prefix= \
--program-suffix= \
- --build=$ARCH-slackware-linux
+ --build=$ARCH-slackware-linux || exit 1
# Build and install:
-make -j4 || exit 1
+make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
# Strip binaries:
@@ -110,9 +121,17 @@ fi
# Add a documentation directory:
mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
cp -a \
- AUTHORS COPYING COPYING.LIB Examples FAQ INSTALL NEWS README Test \
+ AUTHORS* ChangeLog COPYING* Examples FAQ* INSTALL NEWS* README* Test \
$PKG/usr/doc/${PKGNAM}-$VERSION
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
+
mkdir -p $PKG/install
#zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc