summaryrefslogtreecommitdiff
path: root/source/l/mpfr/mpfr.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/l/mpfr/mpfr.SlackBuild')
-rwxr-xr-xsource/l/mpfr/mpfr.SlackBuild24
1 files changed, 19 insertions, 5 deletions
diff --git a/source/l/mpfr/mpfr.SlackBuild b/source/l/mpfr/mpfr.SlackBuild
index 588962bd..808cbdac 100755
--- a/source/l/mpfr/mpfr.SlackBuild
+++ b/source/l/mpfr/mpfr.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,10 +21,19 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=2.3.1
-ARCH=${ARCH:-x86_64}
+VERSION=${VERSION:-$(echo mpfr-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
NUMJOBS=${NUMJOBS:-" -j7 "}
if [ "$ARCH" = "i486" ]; then
@@ -36,6 +45,9 @@ elif [ "$ARCH" = "s390" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
CWD=$(pwd)
@@ -52,11 +64,11 @@ fi
cd $TMP
rm -rf mpfr-$VERSION
-tar xvf $CWD/mpfr-$VERSION.tar.bz2 || exit 1
+tar xvf $CWD/mpfr-$VERSION.tar.?z* || exit 1
cd mpfr-$VERSION
chown -R root:root .
for file in $CWD/patches/* ; do
- ( zcat $file 2> /dev/null | patch -p1 --verbose --batch 1> /dev/null 2> /dev/null || exit 1 )
+ ( zcat $file 2> /dev/null | patch -p1 --verbose --batch 2> /dev/null || exit 1 )
if [ ! $? = 0 ]; then
exit 1
fi
@@ -66,6 +78,7 @@ CFLAGS="$SLKCFLAGS" \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--infodir=/usr/info \
+ --docdir=/usr/doc/mpfr-$VERSION \
--enable-static=yes \
--enable-shared=yes \
$ARCH-slackware-linux
@@ -85,6 +98,7 @@ gzip -9 $PKG/usr/info/*
mkdir -p $PKG/usr/doc/mpfr-$VERSION
cp -a \
AUTHORS BUGS COPYING COPYING.LIB FAQ.html INSTALL NEWS README TODO VERSION \
+ examples \
$PKG/usr/doc/mpfr-$VERSION
mkdir -p $PKG/install