aboutsummaryrefslogtreecommitdiff
path: root/development/mtd-utils/mtd-utils.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'development/mtd-utils/mtd-utils.SlackBuild')
-rw-r--r--development/mtd-utils/mtd-utils.SlackBuild21
1 files changed, 16 insertions, 5 deletions
diff --git a/development/mtd-utils/mtd-utils.SlackBuild b/development/mtd-utils/mtd-utils.SlackBuild
index 3b2da37a43cfd..3957997ef916c 100644
--- a/development/mtd-utils/mtd-utils.SlackBuild
+++ b/development/mtd-utils/mtd-utils.SlackBuild
@@ -6,10 +6,19 @@
PRGNAM=mtd-utils
VERSION=${VERSION:-1.2.0}
-ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+# 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}
PKG=$TMP/package-$PRGNAM
@@ -17,11 +26,16 @@ OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX=64
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
set -e
@@ -49,10 +63,7 @@ make install \
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 {} \;
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a COPYING $PKG/usr/doc/$PRGNAM-$VERSION