source: npl/overig/netcat_openbsd/netcat-openbsd.SlackBuild.orig @ e856512

Last change on this file since e856512 was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 2.9 KB
Line 
1#!/bin/sh
2
3# Slackware build script for netcat-openbsd
4#
5# Copyright 2010, 2014 Slax-Dude <jmfl {at} sapo [dot] pt>
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
25PRGNAM=netcat-openbsd
26VERSION=${VERSION:-1.105}
27BUILD=${BUILD:-2}
28TAG=${TAG:-_SBo}
29
30DEBVER=7
31
32if [ -z "$ARCH" ]; then
33  case "$( uname -m )" in
34    i?86) ARCH=i486 ;;
35    arm*) ARCH=arm ;;
36       *) ARCH=$( uname -m ) ;;
37  esac
38fi
39
40CWD=$(pwd)
41TMP=${TMP:-/tmp/SBo}
42PKG=$TMP/package-$PRGNAM
43OUTPUT=${OUTPUT:-/tmp}
44
45if [ "$ARCH" = "i486" ]; then
46  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
47  LIBDIRSUFFIX=""
48elif [ "$ARCH" = "i686" ]; then
49  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
50  LIBDIRSUFFIX=""
51elif [ "$ARCH" = "x86_64" ]; then
52  SLKCFLAGS="-O2 -fPIC"
53  LIBDIRSUFFIX="64"
54else
55  SLKCFLAGS="-O2"
56  LIBDIRSUFFIX=""
57fi
58
59# Exit if netcat is in the system, but not if netcat-openbsd is there (thx ponce)
60if [ -x /usr/bin/nc ] &&  [ ! -h /usr/bin/nc ]; then
61  echo "  You must remove nc before installing this!"
62  exit 1
63fi
64
65set -e
66
67rm -rf $PKG
68
69mkdir -p $TMP $PKG $OUTPUT
70cd $TMP
71rm -rf $PRGNAM-$VERSION
72tar xvf $CWD/$PRGNAM\_$VERSION.orig.tar.gz
73cd $PRGNAM-$VERSION
74chown -R root:root .
75find -L . \
76 \( -perm 777 -o -perm 775 -o -perm 750 -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
81# Apply Debian patches
82for i in $CWD/patches/* ; do patch -p1 < $i ; done
83
84make CFLAGS="$SLKCFLAGS -DDEBIAN_VERSION=\"\\\"$DEBVER\\\"\""
85
86mkdir -p $PKG/usr/bin/ $PKG/usr/man/man1/
87install -s -m 0755 nc $PKG/usr/bin/nc.openbsd
88ln -s /usr/bin/nc.openbsd $PKG/usr/bin/nc
89gzip -9c nc.1 > $PKG/usr/man/man1/nc.openbsd.1.gz
90
91#mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
92#cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
93
94mkdir -p $PKG/install
95cat $CWD/slack-desc > $PKG/install/slack-desc
96
97cd $PKG
98/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
Note: See TracBrowser for help on using the repository browser.