summaryrefslogtreecommitdiffstats
path: root/source/a/hdparm
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/hdparm')
-rwxr-xr-xsource/a/hdparm/hdparm.SlackBuild27
1 files changed, 23 insertions, 4 deletions
diff --git a/source/a/hdparm/hdparm.SlackBuild b/source/a/hdparm/hdparm.SlackBuild
index fbb2a2f71..951436d16 100755
--- a/source/a/hdparm/hdparm.SlackBuild
+++ b/source/a/hdparm/hdparm.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,9 +20,20 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=${VERSION:-9.27}
-ARCH=${ARCH:-x86_64}
+PKGNAM=hdparm
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}
+
+# 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}
CWD=$(pwd)
@@ -34,7 +45,7 @@ mkdir -p $TMP $PKG
cd $TMP
rm -rf hdparm-$VERSION
-tar xvf $CWD/hdparm-$VERSION.tar.bz2 || exit 1
+tar xvf $CWD/hdparm-$VERSION.tar.?z* || exit 1
cd hdparm-$VERSION || exit 1
chown -R root:root .
make $NUMJOBS || make || exit 1
@@ -54,6 +65,14 @@ cp -a \
# I'm also not sure why I'm putting a binary in the docs, but...
rm -f $PKG/usr/doc/hdparm-$VERSION/contrib/fix_standby.c
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
+
find $PKG | xargs file | grep -e "executable" -e "shared object" \
| grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null