aboutsummaryrefslogtreecommitdiff
path: root/template.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'template.SlackBuild')
-rw-r--r--template.SlackBuild16
1 files changed, 14 insertions, 2 deletions
diff --git a/template.SlackBuild b/template.SlackBuild
index 51727f7..76a72d3 100644
--- a/template.SlackBuild
+++ b/template.SlackBuild
@@ -36,10 +36,19 @@
PRGNAM=appname # replace with name of program
VERSION=${VERSION:-1.4.1} # replace with version of program
-ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo} # the "_SBo" is required
+# 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
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo} # For consistency's sake, use this
PKG=$TMP/package-$PRGNAM
@@ -54,6 +63,9 @@ elif [ "$ARCH" = "i686" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
set -e # Exit on most errors
@@ -102,7 +114,7 @@ find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
# Compress man pages
# If the man pages are installed to /usr/share/man instead, you'll need to either
# add the --mandir=/usr/man flag to configure or move them manually after the
-# make install process is run. If there are no manpages, remove this...
+# make install process is run.
( 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