summaryrefslogtreecommitdiffstats
path: root/source/l/parted/parted.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/l/parted/parted.SlackBuild')
-rwxr-xr-xsource/l/parted/parted.SlackBuild43
1 files changed, 33 insertions, 10 deletions
diff --git a/source/l/parted/parted.SlackBuild b/source/l/parted/parted.SlackBuild
index e4a9e5926..27e02b557 100755
--- a/source/l/parted/parted.SlackBuild
+++ b/source/l/parted/parted.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,16 +22,24 @@
PKGNAM=parted
-VERSION=${VERSION:-1.8.8}
-ARCH=${ARCH:-x86_64}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-1}
+
NUMJOBS=${NUMJOBS:-" -j7 "}
-BUILD=${BUILD:-3}
+
+# 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}
PKG=$TMP/package-${PKGNAM}
-rm -rf $PKG
-mkdir -p $TMP $PKG
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-march=i486 -mtune=i686 -fgnu89-inline"
@@ -42,14 +50,19 @@ elif [ "$ARCH" = "s390" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC -fgnu89-inline"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
+rm -rf $PKG
+mkdir -p $TMP $PKG
cd $TMP
rm -rf ${PKGNAM}-${VERSION}
-tar xvf $CWD/${PKGNAM}-$VERSION.tar.?z* || exit 1
+tar xvf $CWD/${PKGNAM}-$VERSION.tar.?z || exit 1
cd ${PKGNAM}-$VERSION
-zcat $CWD/parted.configure.diff.gz | patch -p0 --verbose --backup --suffix=.orig || exit 1
+zcat $CWD/parted.configure.diff.gz | patch -p1 || exit 1
# Make sure ownerships and permissions are sane:
chown -R root:root .
@@ -76,8 +89,10 @@ make install DESTDIR=$PKG
# Strip binaries:
( cd $PKG
- find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
- find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null
)
# Compress and link manpages, if any:
@@ -110,6 +125,14 @@ cp -a \
doc/{API,FAT} doc/USER.jp \
$PKG/usr/doc/parted-$VERSION
+# 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
+
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc