summaryrefslogtreecommitdiff
path: root/source/l/parted/parted.SlackBuild.static
diff options
context:
space:
mode:
Diffstat (limited to 'source/l/parted/parted.SlackBuild.static')
-rwxr-xr-xsource/l/parted/parted.SlackBuild.static52
1 files changed, 38 insertions, 14 deletions
diff --git a/source/l/parted/parted.SlackBuild.static b/source/l/parted/parted.SlackBuild.static
index 4c89bbb0..feb3b361 100755
--- a/source/l/parted/parted.SlackBuild.static
+++ b/source/l/parted/parted.SlackBuild.static
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008 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
@@ -20,17 +20,26 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
PKGNAM=parted
-VERSION=${VERSION:-1.8.8}
-ARCH=${ARCH:-x86_64}
-NUMJOBS=${NUMJOBS:" -j7 "}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-1}
+
+NUMJOBS=${NUMJOBS:-" -j7 "}
+
+# 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"
@@ -41,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 .
@@ -66,17 +80,19 @@ CFLAGS="$SLKCFLAGS" \
--infodir=/usr/info \
--enable-shared=no \
--enable-static=yes \
- --with-readline \
--enable-device-mapper=yes \
+ --with-readline \
--build=$ARCH-slackware-linux
-CFLAGS="$SLKCFLAGS" make $NUMJOBS || make || exit 1
+make $NUMJOBS || make || exit 1
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:
@@ -109,10 +125,18 @@ 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
# Build the package:
cd $PKG
-/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.tgz
+/sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz