summaryrefslogtreecommitdiff
path: root/development
diff options
context:
space:
mode:
authorRobby Workman <rworkman@slackbuilds.org>2010-06-13 03:53:15 -0500
committerRobby Workman <rworkman@slackbuilds.org>2010-06-13 14:52:38 -0500
commit06fd065b97fe67f2191e85a77b801f5144ecbc06 (patch)
tree3c0cce830c3753c4c70242f14db2a98430210c29 /development
parent5cb3e0727c82746bf3db23908980667b1f75d5d0 (diff)
downloadslackbuilds-06fd065b97fe67f2191e85a77b801f5144ecbc06.tar.gz
development/ghc: Miscellaneous cleanups.
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'development')
-rw-r--r--development/ghc/ghc.SlackBuild29
1 files changed, 18 insertions, 11 deletions
diff --git a/development/ghc/ghc.SlackBuild b/development/ghc/ghc.SlackBuild
index 34475373e5..ccff30012f 100644
--- a/development/ghc/ghc.SlackBuild
+++ b/development/ghc/ghc.SlackBuild
@@ -7,29 +7,39 @@
PRGNAM=ghc
VERSION=${VERSION:-6.12.1}
-ARCH=${ARCH:-i486}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-TARARCH=i386
-if [ "$ARCH" = "i386" ]; then
- SLKCFLAGS="-O2 -march=i386 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "i486" ]; then
+if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
+ TARARCH=i386
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
+ TARARCH=i386
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
TARARCH="x86_64"
+else
+ printf "$ARCH is not supported...\n"
+ exit 1
fi
set -e
@@ -60,10 +70,7 @@ make install DESTDIR=$PKG
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-( cd $PKG/usr/man
- find . -type f -exec gzip -9 {} \;
- for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
-)
+find $PKG/usr/man -type f -exec gzip -9 {} \;
cp -a INSTALL LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild