source: npl/system/libnfnetlink/libnfnetlink.SlackBuild.orig @ 105afb5

Last change on this file since 105afb5 was a87727a, checked in by Edwin Eefting <edwin@datux.nl>, 4 years ago

conntrack_tools and deps

  • Property mode set to 100755
File size: 3.3 KB
Line 
1#!/bin/bash
2
3# Slackware build script for libnfnetlink
4
5# Copyright 2006-2013  Robby Workman, Northport, Alabama, USA
6# All rights reserved.
7#
8# Redistribution and use of this script, with or without modification, is
9# permitted provided that the following conditions are met:
10#
11# 1. Redistributions of this script must retain the above copyright
12#    notice, this list of conditions and the following disclaimer.
13#
14# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
15# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25cd $(dirname $0) ; CWD=$(pwd)
26
27PKGNAM=libnfnetlink
28VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
29BUILD=${BUILD:-4}
30
31NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
32
33# Automatically determine the architecture we're building on:
34if [ -z "$ARCH" ]; then
35  case "$( uname -m )" in
36    i?86) export ARCH=i586 ;;
37    arm*) export ARCH=arm ;;
38    # Unless $ARCH is already set, use uname -m for all other archs:
39       *) export ARCH=$( uname -m ) ;;
40  esac
41fi
42
43# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
44# the name of the created package would be, and then exit. This information
45# could be useful to other scripts.
46if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
47  echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
48  exit 0
49fi
50
51TMP=${TMP:-/tmp}
52PKG=$TMP/package-$PKGNAM
53
54if [ "$ARCH" = "i586" ]; then
55  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
56  LIBDIRSUFFIX=""
57elif [ "$ARCH" = "i686" ]; then
58  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
59  LIBDIRSUFFIX=""
60elif [ "$ARCH" = "x86_64" ]; then
61  SLKCFLAGS="-O2 -fPIC"
62  LIBDIRSUFFIX="64"
63else
64  SLKCFLAGS="-O2"
65  LIBDIRSUFFIX=""
66fi
67
68rm -rf $PKG
69mkdir -p $TMP $PKG
70cd $TMP
71rm -rf $PKGNAM-$VERSION
72tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
73cd $PKGNAM-$VERSION || exit 1
74chown -R root:root .
75find . \
76 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
77 -exec chmod 755 {} \+ -o \
78 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
79 -exec chmod 644 {} \+
80
81CFLAGS="$SLKCFLAGS" \
82CXXFLAGS="$SLKCFLAGS" \
83./configure \
84  --prefix=/usr \
85  --libdir=/usr/lib${LIBDIRSUFFIX} \
86  --docdir=/usr/doc/$PKGNAM-$VERSION \
87  --enable-static=no \
88  --build=$ARCH-slackware-linux || exit 1
89
90make $NUMJOBS || make || exit 1
91make install DESTDIR=$PKG || exit 1
92
93rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la
94
95find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
96  grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
97
98mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
99cp -a COPYING* README* $PKG/usr/doc/$PKGNAM-$VERSION
100
101mkdir -p $PKG/install
102cat $CWD/slack-desc > $PKG/install/slack-desc
103
104cd $PKG
105/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
Note: See TracBrowser for help on using the repository browser.