source: npl/internet/conntrack_tools/conntrack-tools.SlackBuild.orig @ a87727a

Last change on this file since a87727a 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.5 KB
Line 
1#!/bin/bash
2
3# Slackware build script for conntrack-tools
4
5# Copyright 2006-2015  Robby Workman, Tuscaloosa, 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=conntrack-tools
28VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
29BUILD=${BUILD:-3}
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.?z || 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  --sysconfdir=/etc/conntrackd \
87  --mandir=/usr/man \
88  --docdir=/usr/doc/$PKGNAM-$VERSION \
89  --enable-static=no \
90  --build=$ARCH-slackware-linux || exit 1
91
92make $NUMJOBS || make || exit 1
93make install DESTDIR=$PKG || exit 1
94
95rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la
96
97mkdir -p $PKG/etc/conntrackd
98cat doc/stats/conntrackd.conf > $PKG/etc/conntrackd/conntrackd.conf.sample
99
100find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
101  grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
102
103find $PKG/usr/man -type f -exec gzip -9 {} \+
104
105mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
106cp -a AUTHORS COPYING* INSTALL TODO doc/sync doc/manual \
107  $PKG/usr/doc/$PKGNAM-$VERSION
108
109mkdir -p $PKG/install
110cat $CWD/slack-desc > $PKG/install/slack-desc
111
112cd $PKG
113/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
Note: See TracBrowser for help on using the repository browser.