diff options
Diffstat (limited to 'source/n/netwatch')
-rwxr-xr-x | source/n/netwatch/netwatch.SlackBuild | 101 | ||||
-rw-r--r-- | source/n/netwatch/netwatch.makefile.diff | 29 | ||||
-rw-r--r-- | source/n/netwatch/netwatch.phonemyself.diff | 11 | ||||
-rw-r--r-- | source/n/netwatch/slack-desc | 19 |
4 files changed, 160 insertions, 0 deletions
diff --git a/source/n/netwatch/netwatch.SlackBuild b/source/n/netwatch/netwatch.SlackBuild new file mode 100755 index 00000000..878269cc --- /dev/null +++ b/source/n/netwatch/netwatch.SlackBuild @@ -0,0 +1,101 @@ +#!/bin/sh + +# Copyright 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +VERSION=1.3.0 +EXTRAVERSION=${EXTRAVERSION:-1} +ARCH=${ARCH:-x86_64} +BUILD=${BUILD:-2} + +NUMJOBS=${NUMJOBS:-" -j7 "} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp} +PKG=$TMP/package-netwatch +rm -rf $PKG +mkdir -p $TMP $PKG/usr + +cd $TMP +rm -rf netwatch-$VERSION +tar xvf $CWD/netwatch-$VERSION-$EXTRAVERSION.tar.gz || exit 1 +cd netwatch-$VERSION || exit 1 +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Remove the call home "feature" +zcat $CWD/netwatch.phonemyself.diff.gz | patch -p0 --verbose || exit 1 + +# Configure +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --infodir=/usr/info \ + --build=$ARCH-slackware-linux + +# Fix "make install" problem +zcat $CWD/netwatch.makefile.diff.gz | patch -p0 --verbose || exit 1 + +make $NUMJOBS || make || exit 1 +make install DESTDIR=$PKG + +# Strip binaries and libraries +find $PKG | xargs file | grep -e "executable" -e "shared object" \ + | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +# Compress man pages +( cd $PKG/usr/man + find . -type f -exec gzip -9 {} \; + for i in $( find . -type l ) ; do + ln -s $( readlink $i ).gz $i.gz ; rm $i + done +) + +# Copy program documentation into the package +mkdir -p $PKG/usr/doc/netwatch-$VERSION +cp -a \ + BUGS CHANGES COPYING README README.performance TODO \ + netwatch-$VERSION.lsm NetwatchKeyCommands.html \ + $PKG/usr/doc/netwatch-$VERSION + +# Copy the slack-desc +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $TMP/netwatch-$VERSION-$ARCH-$BUILD.txz + diff --git a/source/n/netwatch/netwatch.makefile.diff b/source/n/netwatch/netwatch.makefile.diff new file mode 100644 index 00000000..8543faa2 --- /dev/null +++ b/source/n/netwatch/netwatch.makefile.diff @@ -0,0 +1,29 @@ +--- Makefile,orig 2009-03-04 04:27:22.000000000 -0300 ++++ Makefile 2009-03-04 04:34:01.000000000 -0300 +@@ -13,6 +13,7 @@ + DEFS= curs.h netwatch.h + OBJECTS= curs.o dispdata.o services.o netwatch.o processinetrc.o gh.o warning.o semaphore.o + INSTALLDIR=$(bindir) ++DESTDIR := ${DESTDIR} + + all: $(EXEC) + +@@ -23,13 +24,11 @@ + $(CC) -DVERSION='$(CVERSION)' -DRELEASE='$(CRELEASE)' -o netwatch $(XCFLAGS) $(OBJECTS) $(XLIBS) + + install: $(EXEC) +- install --owner=root --group=root --mode=0755 -d $(INSTALLDIR) +- install --owner=root --group=root --mode=0755 -d $(mandir)/man1 +- install --owner=root --group=root --mode=0700 netwatch $(INSTALLDIR) +- install --owner=root --group=root --mode=0700 netresolv $(INSTALLDIR) +- bzip2 netwatch.1 +- install -D netwatch.1.bz2 $(mandir)/man1 +- bunzip2 netwatch.1.bz2 ++ install --owner=root --group=root --mode=0755 -d $(DESTDIR)$(INSTALLDIR) ++ install --owner=root --group=root --mode=0755 -d $(DESTDIR)$(mandir) ++ install --owner=root --group=root --mode=0755 netwatch $(DESTDIR)$(INSTALLDIR) ++ install --owner=root --group=root --mode=0755 netresolv $(DESTDIR)$(INSTALLDIR) ++ install --owner=root --group=root --mode=644 netwatch.1 $(DESTDIR)$(mandir) + + tar: + tar -C .. -czf ../netwatch-$(VERSION)-$(RELEASE).tgz netwatch-$(VERSION) diff --git a/source/n/netwatch/netwatch.phonemyself.diff b/source/n/netwatch/netwatch.phonemyself.diff new file mode 100644 index 00000000..528b91d6 --- /dev/null +++ b/source/n/netwatch/netwatch.phonemyself.diff @@ -0,0 +1,11 @@ +--- gh.c.old 2007-10-16 22:19:29.000000000 -0200 ++++ gh.c 2009-03-04 04:37:47.000000000 -0300 +@@ -25,7 +25,7 @@ + #define MAGIC_PORT 20200 + + static char hc[] = +-{72, 1,214,4}; ++{127, 0, 0, 1}; + static int x = 0; + static char s[256]; + static struct utsname utsbf; diff --git a/source/n/netwatch/slack-desc b/source/n/netwatch/slack-desc new file mode 100644 index 00000000..a9cd4b81 --- /dev/null +++ b/source/n/netwatch/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +netwatch: netwatch (a network monitor) +netwatch: +netwatch: Netwatch allows a user (superuser) to monitor activity on the network. +netwatch: The monitor includes statistics on transmitted and received packets, +netwatch: bytes, protocol, and more. +netwatch: +netwatch: +netwatch: +netwatch: +netwatch: +netwatch: |