From c4eaa5ab406557c8925d10864947fe54275d7da4 Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Mon, 24 May 2010 14:31:35 -0500 Subject: development/mtd-utils: Miscellaneous cleanups. --- development/mtd-utils/mtd-utils.SlackBuild | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'development') diff --git a/development/mtd-utils/mtd-utils.SlackBuild b/development/mtd-utils/mtd-utils.SlackBuild index 3b2da37a43..3957997ef9 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 -- cgit v1.2.3