summaryrefslogtreecommitdiffstats
path: root/source/l/libcap/libcap.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/l/libcap/libcap.SlackBuild')
-rwxr-xr-xsource/l/libcap/libcap.SlackBuild30
1 files changed, 21 insertions, 9 deletions
diff --git a/source/l/libcap/libcap.SlackBuild b/source/l/libcap/libcap.SlackBuild
index 796da7784..1439dabfa 100755
--- a/source/l/libcap/libcap.SlackBuild
+++ b/source/l/libcap/libcap.SlackBuild
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
-# Copyright 2009, 2010, 2011 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2009, 2010, 2011, 2018 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,25 +22,34 @@
# Originally written by Menno Duursma
+cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=libcap
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.bz2 | cut -d - -f 2 | rev | cut -f 3- -d . | rev)}
-BUILD=${BUILD:-1}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | cut -d - -f 2 | rev | cut -f 3- -d . | rev)}
+BUILD=${BUILD:-2}
NUMJOBS=${NUMJOBS:-" -j7 "}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) export ARCH=i486 ;;
+ i?86) export ARCH=i586 ;;
arm*) export ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) export ARCH=$( uname -m ) ;;
esac
fi
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -56,7 +65,6 @@ elif [ "$ARCH" = "armel" ]; then
LIBDIRSUFFIX=""
fi
-CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
@@ -64,7 +72,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf $PKGNAM-$VERSION
-tar xvf $CWD/$PKGNAM-$VERSION.tar.bz2 || exit 1
+tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
cd $PKGNAM-$VERSION || exit 1
zcat $CWD/libcap.capability.h.fix.broken.includes.diff.gz | patch -p1 || exit 1
@@ -79,6 +87,10 @@ find . \
# Set the CFLAGS
sed -i.orig "s/^\(DEBUG =\).*/\1$SLKCFLAGS/" Make.Rules
+# Disable broken gperf support:
+sed 's@^BUILD_GPERF@#\0@' -i Make.Rules
+
+
make DYNAMIC=yes $NUMJOBS || make DYNAMIC=yes || exit 1
make install FAKEROOT=$PKG man_prefix=/usr || exit 1
chmod 755 $PKG/lib${LIBDIRSUFFIX}/libcap.so*