summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Robby Workman <rworkman@slackbuilds.org>2010-04-23 11:33:03 -0500
committer Robby Workman <rworkman@slackware.com>2010-04-23 11:33:03 -0500
commita59ea18100def174f7545135ba659d01ffdd9696 (patch)
treee49cb3acad35d14e03e0a64af4ba21607fd315b8
parent71113015d28d9178e3d013667c09f12d700345d2 (diff)
downloadtemplates-a59ea18100def174f7545135ba659d01ffdd9696.tar.gz
templates-a59ea18100def174f7545135ba659d01ffdd9696.tar.xz
template.SlackBuild: prep for 13.1
- add automatic ARCH detection - add a failover SLKCFLAGS and LIBDIRSUFFIX - add comment about manpage compression
-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