summaryrefslogtreecommitdiffstats
path: root/source/n/ipset/ipset.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/ipset/ipset.SlackBuild')
-rwxr-xr-xsource/n/ipset/ipset.SlackBuild28
1 files changed, 20 insertions, 8 deletions
diff --git a/source/n/ipset/ipset.SlackBuild b/source/n/ipset/ipset.SlackBuild
index 438ebe5cc..3cad37b5c 100755
--- a/source/n/ipset/ipset.SlackBuild
+++ b/source/n/ipset/ipset.SlackBuild
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for ipset
-# Copyright 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2013, 2018 Patrick J. Volkerding, Sebeka, Minnesota, USA
# Copyright 2013 Robby Workman, Northport, Alabama, USA
# All rights reserved.
#
@@ -23,8 +23,10 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PKGNAM=ipset
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}
NUMJOBS=${NUMJOBS:-" -j7 "}
@@ -32,15 +34,23 @@ 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" = "s390" ]; then
SLKCFLAGS="-O2"
@@ -53,7 +63,6 @@ else
LIBDIRSUFFIX=""
fi
-CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
@@ -62,7 +71,7 @@ mkdir -p $TMP $PKG
cd $TMP
rm -rf $PKGNAM-$VERSION
-tar xf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
+tar xf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
cd $PKGNAM-$VERSION || exit 1
chown -R root:root .
@@ -87,6 +96,9 @@ CXXFLAGS="$SLKCFLAGS" \
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
+# Don't ship .la files:
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true