summaryrefslogtreecommitdiff
path: root/source/a/less/less.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/less/less.SlackBuild')
-rwxr-xr-xsource/a/less/less.SlackBuild31
1 files changed, 20 insertions, 11 deletions
diff --git a/source/a/less/less.SlackBuild b/source/a/less/less.SlackBuild
index 64335957..49a15eed 100755
--- a/source/a/less/less.SlackBuild
+++ b/source/a/less/less.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2009 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2005-2010 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,19 +21,22 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-CWD=$(pwd)
-TMP=${TMP:-/tmp}
-PKG=$TMP/package-less
+VERSION=${VERSION:-$(echo less-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-1}
-VERSION=${VERSION:-418}
-ARCH=${ARCH:-x86_64}
-BUILD=${BUILD:-3}
+# 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" = "i386" ]; then
- SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
-elif [ "$ARCH" = "i486" ]; then
+if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
@@ -45,14 +48,20 @@ elif [ "$ARCH" = "arm" ]; then
elif [ "$ARCH" = "armel" ]; then
SLKCFLAGS="-O2 -march=armv4t"
LIBDIRSUFFIX=""
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-less
rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf less-$VERSION
-tar xvf $CWD/less-$VERSION.tar.bz2 || exit 1
+tar xvf $CWD/less-$VERSION.tar.?z* || exit 1
cd less-$VERSION
zcat $CWD/less.sysconfdir.diff.gz | patch -p1 --verbose || exit 1