source: npl/system/libmnl/libmnl.SlackBuild.orig @ f9ce31e

perl-5.22
Last change on this file since f9ce31e was 6a55355, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

upgraded because of better ipv6 support

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