source: npl/internetserver/ebtables/ebtables.SlackBuild.orig @ 6e790ab

Last change on this file since 6e790ab was 480e6a7, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

update ebtables to 2.0.10

  • Property mode set to 100755
File size: 3.1 KB
Line 
1#!/bin/sh
2
3# Slackware build script for ebtables
4
5# Copyright 2011, mario <mario@slackverse.org>
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
25PKGNAM=ebtables
26VERSION=${VERSION:-2.0.10}
27BUILD=${BUILD:-1}
28
29if [ -z "$ARCH" ]; then
30  case "$( uname -m )" in
31    i?86) ARCH=i486 ;;
32    arm*) ARCH=arm ;;
33       *) ARCH=$( uname -m ) ;;
34  esac
35fi
36
37CWD=$(pwd)
38TMP=${TMP:-/tmp}
39PKG=$TMP/package-$PKGNAM
40
41if [ "$ARCH" = "i486" ]; then
42  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
43  LIBDIRSUFFIX=""
44elif [ "$ARCH" = "i686" ]; then
45  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
46  LIBDIRSUFFIX=""
47elif [ "$ARCH" = "x86_64" ]; then
48  SLKCFLAGS="-O2 -fPIC"
49  LIBDIRSUFFIX="64"
50else
51  SLKCFLAGS="-O2"
52  LIBDIRSUFFIX=""
53fi
54
55rm -rf $PKG
56mkdir -p $TMP $PKG
57cd $TMP
58rm -rf $PKGNAM-v$VERSION-4
59tar xvf $CWD/$PKGNAM-v$VERSION-4.tar.xz || exit 1
60cd $PKGNAM-v$VERSION-4 || exit 1
61chown -R root:root .
62find . \
63 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
64 -exec chmod 755 {} \; -o \
65 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
66 -exec chmod 644 {} \;
67
68# Set our CFLAGS and avoid a "warning-as-error" that breaks build
69sed -i \
70  -e "s|-fPIC -O3|${SLKCFLAGS}|" \
71  -e "s|-Wunused|-Wno-error=unused-but-set-variable|" \
72  Makefile
73
74make -j 4 || exit 1
75
76make install \
77  DESTDIR=$PKG \
78  LIBDIR=/usr/lib${LIBDIRSUFFIX} \
79  MANDIR=/usr/man \
80  BINDIR=/usr/sbin \
81  ETCDIR=/etc \
82  INITDIR=/etc/rc.d/init.d \
83  SYSCONFIGDIR=/etc/sysconfig || exit 1
84
85find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
86  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
87
88find $PKG/usr/man -type f -exec gzip -9 {} \;
89for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
90
91mv $PKG/etc/ethertypes $PKG/etc/ethertypes.new
92
93# Remove Red Hat junk:
94rm -rf $PKG/etc/rc.d $PKG/etc/sysconfig
95
96mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
97cp -a COPYING* ChangeLog INSTALL THANKS $PKG/usr/doc/$PKGNAM-$VERSION
98
99mkdir -p $PKG/install
100cat $CWD/slack-desc > $PKG/install/slack-desc
101zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
102
103cd $PKG
104/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
Note: See TracBrowser for help on using the repository browser.