aboutsummaryrefslogtreecommitdiff
path: root/net/libs/libnids
diff options
context:
space:
mode:
authorrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>2009-06-25 16:29:30 +0000
committerrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>2009-06-25 16:29:30 +0000
commit44fb62ee3f410f9b3ed1388292e4d05c814acd1c (patch)
tree36fb377d5d06a403009322701b1e79cf54467d92 /net/libs/libnids
parentf46190a42e77d6d92a2f4c3f7eab380fccd08ae0 (diff)
downloadslackbuilds-44fb62ee3f410f9b3ed1388292e4d05c814acd1c.tar.gz
slackbuilds-44fb62ee3f410f9b3ed1388292e4d05c814acd1c.tar.bz2
libnet: adding libnet; libnids: adding libnids
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@2216 370017ae-e619-0410-ac65-c121f96126d4
Diffstat (limited to 'net/libs/libnids')
-rw-r--r--net/libs/libnids/Manifest24
-rw-r--r--net/libs/libnids/libnids-1.23.diff27
-rw-r--r--net/libs/libnids/libnids.SlackBuild307
3 files changed, 358 insertions, 0 deletions
diff --git a/net/libs/libnids/Manifest b/net/libs/libnids/Manifest
new file mode 100644
index 00000000..93af5aaa
--- /dev/null
+++ b/net/libs/libnids/Manifest
@@ -0,0 +1,24 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+DIST libnids-1.23.tar.gz 140975 MD5 af35e8ef403a0ca95df2da94db856428 RMD160 38994ad04f688291315bfcde38d8795e7a4c4226 SHA1 105bff0d0d35ab95ec90cce98cfb409f64ed44b4 SHA256 755cd72483c2cdccbc6634c00de9e2d8666419fd80da36a2bdb3f81657130643 SHA512 b718a80315de8bb26495c96f18dbd40d86dbbed7140acdfdbaad239149f7f4565dc66eacc88d85686b7ef7048a55e44f638cb4574402606db657888d62cdea64
+MKBUILD libnids.mkbuild 5262 MD5 a9d0eae9454dbec18e74841fc77e12ea RMD160 f8a6799cc8a771b10c5aa6b5903560c66a5e3c83 SHA1 39d036b5b6c43989662c45ed85d0df2946ec248a SHA256 4e65c52f18decd012cc08aaa1ccf0d2c7e103374e4a63f25d254b32185e0fea9 SHA512 66e8f2f758d15bc51d028617d788287be012f87d7a2c4311093662565c52f6f742110fde1de9de99ab7ce703ac1ddf2ecb35d0ed259dc6372120c3c6e0e0e1c1
+PATCH libnids-1.23.diff 1481 MD5 413e29bf5f9b545089b55758622b2183 RMD160 66b123f36c5b9b22ac2ea6741687c2ff4822d090 SHA1 d9e86670d947264b9b3fe037aae937d79f60ed1a SHA256 3e2225e2e0a748b23c6b3f72b3e423d511f73632af745c31c7bc75dae662e8cc SHA512 716852c16bab87a821436238048ba30f042b20929bfc0614b96533d5f013f19b57330a2e8215ec3425fa4a2543500b2eaad75a61fe2fc75e219b8a0deec8083c
+SLACKBUILD libnids.SlackBuild 10011 MD5 037bc4839bfff7779814216482bbd58c RMD160 c80e4ee3081e64933fe18247eeaf0e01bd7d7493 SHA1 3fd18d23e6e7c410ead3298a679d5198ba81ccfd SHA256 72556c05e608e1d05d6232ec931151ed604739bd769c188d359d81860c3bfb67 SHA512 8348c353f9365f23756f827498ce4da389eb1ab24cc1731c48e03593f7cac85ab36d8bd4db36d75b42fae9d3d97eae9d92021d102fe25b395eae9409e908ffc7
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBCAAGBQJKQ6MOAAoJEEHL93ESzgeiLGIP/iXDV8Q7xaz6KDsItlr2R3eX
+mvS8HA6ldo3D6dHe/4sILiVR5VJgV6ETc/rHOrLZLrmLjAMshC/kRwxJ0iS+gWb+
+1fTG8Rsx2ydVEQkz7oWQOp57T7R0SzZw7Wh8RnRVzB97BoxNVj4A7wBl6MY/Wmy2
+fuxfofh07S9agkzjut5/4p3EHs30HVZobSfIcqNMl2viCrKjaKGopofLGsAxc9Iu
+fJKJd2OD1+MRJQVlxEzx1Kj4/zOdc128YHDoTsYZ8hAtG1rNKDVT/SsXFX/GEGGD
+FKpG6/5OY+JRJeuxg2k4aq2bh8wV/ukLOxzjfQ2TMu42/D2BzR0alJl0SLlKKYI3
+4Obh3isGfIcKCj7ZSmkMwTOrG8QsMlZmLEQOz1tlrgYSgfxFBuRMvGVyPyh67DXI
+Da5dcF+Nr2bI09cZXCwHiAMMOAl2Gpg7ucpk5iwa407I0jbTe4mCU1cutnuCkR7Z
+0ntaoeEGTXB2dhorrtT91Dy3rD3gcFB9rjoZwI2cyiQFQEeybvESqIG/RmJFgRYn
+ZvkzNhzxpSSFGUC0sCHXzySi9+tUBhhYTxTeIqzsb/y8xfNvPYLNogA2iPVvGUkf
+BisK4ZGKSP/gTWpC86wixahfPXWJ4qnPR6upmyKJ6pK774SNR9vUJhtUultvihoY
+QTfEjfN8uUudahlQFrgT
+=yQZB
+-----END PGP SIGNATURE-----
diff --git a/net/libs/libnids/libnids-1.23.diff b/net/libs/libnids/libnids-1.23.diff
new file mode 100644
index 00000000..e44cb6d9
--- /dev/null
+++ b/net/libs/libnids/libnids-1.23.diff
@@ -0,0 +1,27 @@
+diff -Naur libnids-1.23.orig/src/Makefile.in libnids-1.23/src/Makefile.in
+--- libnids-1.23.orig/src/Makefile.in 2008-02-21 07:40:19.000000000 -0300
++++ libnids-1.23/src/Makefile.in 2009-06-25 13:09:07.000000000 -0300
+@@ -68,15 +68,15 @@
+ $(CC) -shared -Wl,-soname,$(LIBSHARED) -o $(LIBSHARED) $(OBJS_SHARED) $(LIBS) $(LNETLIB) $(PCAPLIB)
+
+ _install install: $(LIBSTATIC)
+- ../mkinstalldirs $(install_prefix)$(libdir)
+- ../mkinstalldirs $(install_prefix)$(includedir)
+- ../mkinstalldirs $(install_prefix)$(mandir)/man3
+- $(INSTALL) -c -m 644 libnids.a $(install_prefix)$(libdir)
+- $(INSTALL) -c -m 644 nids.h $(install_prefix)$(includedir)
+- $(INSTALL) -c -m 644 libnids.3 $(install_prefix)$(mandir)/man3
++ ../mkinstalldirs $(DESTDIR)/$(install_prefix)$(libdir)
++ ../mkinstalldirs $(DESTDIR)/$(install_prefix)$(includedir)
++ ../mkinstalldirs $(DESTDIR)/$(install_prefix)$(mandir)/man3
++ $(INSTALL) -c -m 644 libnids.a $(DESTDIR)/$(install_prefix)$(libdir)
++ $(INSTALL) -c -m 644 nids.h $(DESTDIR)/$(install_prefix)$(includedir)
++ $(INSTALL) -c -m 644 libnids.3 $(DESTDIR)/$(install_prefix)$(mandir)/man3
+ _installshared installshared: install $(LIBSHARED)
+- $(INSTALL) -c -m 755 $(LIBSHARED) $(install_prefix)$(libdir)
+- ln -s -f $(LIBSHARED) $(install_prefix)$(libdir)/libnids.so
++ $(INSTALL) -c -m 755 $(LIBSHARED) $(DESTDIR)/$(install_prefix)$(libdir)
++ ln -s -f $(LIBSHARED) $(DESTDIR)/$(install_prefix)$(libdir)/libnids.so
+
+ clean:
+ rm -f *.o *~ $(LIBSTATIC) $(LIBSHARED)
diff --git a/net/libs/libnids/libnids.SlackBuild b/net/libs/libnids/libnids.SlackBuild
new file mode 100644
index 00000000..d0910f68
--- /dev/null
+++ b/net/libs/libnids/libnids.SlackBuild
@@ -0,0 +1,307 @@
+#!/bin/bash
+#
+# libnids.SlackBuild is free software; you can redistribute
+# it and/or modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the License,
+# or any later version.
+#
+# libnids.SlackBuild is distributed in the hope that it will
+# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# slackbuild for libnids, by Silvio Rhatto
+# requires:
+# tested: libnids-1.23
+# model: generic.mkSlackBuild $Rev: 805 $
+#
+
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
+ source ~/.slackbuildrc
+elif [ -f /etc/slackbuildrc ]; then
+ source /etc/slackbuildrc
+fi
+
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="libnids"
+PKG_NAME="libnids"
+ARCH=${ARCH:=i486}
+SRC_VERSION=${VERSION:=1.23}
+PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')"
+BUILD=${BUILD:=1rha}
+SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME
+TMP=${TMP:=/tmp}
+PKG=${PKG:=$TMP/package-$PKG_NAME}
+REPOS=${REPOS:=$TMP}
+SLACKBUILD_PATH=${SLACKBUILD_PATH:="net/libs/libnids"}
+PREFIX=${PREFIX:=/usr}
+PKG_WORK="$TMP/$SRC_NAME"
+CONF_OPTIONS=${CONF_OPTIONS:=""}
+NUMJOBS=${NUMJOBS:=""}
+
+# Set system libraries' path and optmization flags based on $ARCH
+LIBDIR="$PREFIX/lib"
+
+if [ "$ARCH" = "i386" ]; then
+ SLKCFLAGS="-O2 -march=i386 -mtune=i686"
+elif [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686"
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIR="$PREFIX/lib64"
+ LDFLAGS="-L/lib64 -L/usr/lib64"
+fi
+
+# Set error codes (used by createpkg)
+ERROR_WGET=31; ERROR_MAKE=32; ERROR_INSTALL=33
+ERROR_MD5=34; ERROR_CONF=35; ERROR_HELP=36
+ERROR_TAR=37; ERROR_MKPKG=38; ERROR_GPG=39
+ERROR_PATCH=40; ERROR_VCS=41; ERROR_MKDIR=42
+ERROR_MANIFEST=43;
+
+# Clean up any leftovers of previous builds
+rm -rf "$PKG_WORK" 2> /dev/null
+rm -rf "$PKG" 2> /dev/null
+
+# Create directories if necessary
+mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR
+mkdir -p "$PKG" || exit $ERROR_MKDIR
+mkdir -p "$REPOS" || exit $ERROR_MKDIR
+mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR
+
+# Dowload source if necessary
+SRC="$SRC_NAME-$VERSION.tar.gz"
+URL="http://downloads.sourceforge.net/libnids/$SRC"
+
+if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then
+ wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
+fi
+
+# Import minimized signing key from
+if echo [[SIGNING KEY URL]] | grep -q -v "SIGNING KEY URL"; then
+ lynx -dump [[SIGNING KEY URL]] | gpg --import || exit $ERROR_GPG
+elif echo 6F5C037F | grep -q -v "SIGNING KEY ID"; then
+ gpg --recv-keys 6F5C037F || exit $ERROR_GPG
+else
+ gpg --import << EOKEY || exit $ERROR_GPG
+[[SIGNING KEY]]
+EOKEY
+fi
+
+# Download source's signature if necessary and check it
+if echo http://downloads.sourceforge.net/libnids/libnids-1.23.tar.gz.asc | grep -q -v "SIGNING URL"; then
+ SIGNATURE="`basename http://downloads.sourceforge.net/libnids/libnids-1.23.tar.gz.asc`"
+ if [ ! -s "$SRC_DIR/$SIGNATURE" ]; then
+ wget "http://downloads.sourceforge.net/libnids/libnids-1.23.tar.gz.asc" -O "$SRC_DIR/$SIGNATURE" || exit $ERROR_WGET
+ fi
+else
+ if [ -s "$SRC_DIR/$SRC.sig" ]; then
+ SIGNATURE="$SRC.sig"
+ elif [ -s "$SRC_DIR/$SRC.asc" ]; then
+ SIGNATURE="$SRC.asc"
+ else
+ echo Trying to get signature file from $URL.sig...
+ if wget "$URL.sig" -O "$SRC_DIR/$SRC.sig"; then
+ SIGNATURE="$SRC.sig"
+ else
+ rm $SRC_DIR/$SRC.sig
+ echo Trying to get signature file from $URL.asc...
+ if wget "$URL.asc" -O "$SRC_DIR/$SRC.asc"; then
+ SIGNATURE="$SRC.asc"
+ else
+ rm $SRC_DIR/$SRC.asc
+ echo "Error getting source's signature file"
+ exit $ERROR_GPG
+ fi
+ fi
+ fi
+fi
+
+echo Checking $SRC_DIR/$SRC with gpg using $SRC_DIR/$SIGNATURE...
+gpg --verify "$SRC_DIR/$SIGNATURE" "$SRC_DIR/$SRC" || exit $ERROR_GPG
+echo Success.
+
+# Check Manifest file
+if [ -e "$CWD/Manifest" ]; then
+
+ # Manifest signature checking
+ if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" $CWD/Manifest; then
+ echo "Checking Manifest signature..."
+ gpg --verify $CWD/Manifest
+ if [ "$?" != "0" ]; then
+ exit $ERROR_MANIFEST
+ fi
+ fi
+
+ MANIFEST_LINES="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | wc -l`"
+
+ for ((MANIFEST_COUNT=1; MANIFEST_COUNT <= $MANIFEST_LINES; MANIFEST_COUNT++)); do
+
+ MANIFEST_LINE="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | head -n $MANIFEST_COUNT | tail -n 1`"
+ MANIFEST_FILE="`echo $MANIFEST_LINE | awk '{ print $2 }'`"
+ MANIFEST_FILE_TYPE="`echo $MANIFEST_LINE | awk '{ print $1 }'`"
+
+ if [ -e "$SRC_DIR/$MANIFEST_FILE" ]; then
+ MANIFEST_FILE="$SRC_DIR/$MANIFEST_FILE"
+ else
+ MANIFEST_FILE="`find $CWD -name $MANIFEST_FILE`"
+ fi
+
+ if [ ! -e "$MANIFEST_FILE" ] || [ -d "$MANIFEST_FILE" ]; then
+ continue
+ fi
+
+ echo "Checking Manifest for $MANIFEST_FILE_TYPE $MANIFEST_FILE integrity..."
+
+ SIZE_SRC="`wc -c $MANIFEST_FILE | awk '{ print $1 }'`"
+ SIZE_MANIFEST="`echo $MANIFEST_LINE | awk '{ print $3 }'`"
+
+ # Check source code size
+ if [ "$SIZE_SRC" != "$SIZE_MANIFEST" ]; then
+ echo "SIZE Manifest: $SIZE_MANIFEST; SIZE $SRC: $SIZE_SRC"
+ exit $ERROR_MANIFEST
+ else
+ echo "Size match."
+ fi
+
+ # Check source code integrity
+ for ALGO in md5 rmd160 sha1 sha256 sha512; do
+ if [ $ALGO = "rmd160" ]; then
+ ALGO_SRC="`openssl rmd160 $MANIFEST_FILE | awk '{ print $2 }'`"
+ else
+ ALGO_SRC="`"$ALGO"sum $MANIFEST_FILE | awk '{ print $1 }'`"
+ fi
+ ALGO="`echo $ALGO | tr '[:lower:]' '[:upper:]'`"
+ ALGO_MANIFEST=$(echo $MANIFEST_LINE | sed "s/.* $ALGO //" | awk '{ print $1 }')
+ if [ "$ALGO_SRC" != "$ALGO_MANIFEST" ]; then
+ echo "$ALGO Manifest: $ALGO_MANIFEST; $ALGO $SRC: $ALGO_SRC"
+ exit $ERROR_MANIFEST
+ else
+ echo "$ALGO match."
+ fi
+ done
+
+ done
+
+else
+ exit $ERROR_MANIFEST
+fi
+
+# Untar
+cd "$PKG_WORK"
+tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR
+PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`"
+cd "$PKG_SRC"
+
+# Patch source
+patches=" [[PATCH URLS]]
+ $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff
+ $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff"
+for patch in $patches; do
+ patch="`basename $patch`"
+ if [ -f "$CWD/$patch" ]; then
+ patch -Np1 < "$CWD/$patch" || exit $ERROR_PATCH
+ elif [ -f "$CWD/patches/$patch" ]; then
+ patch -Np1 < "$CWD/patches/$patch" || exit $ERROR_PATCH
+ elif [ -f "$CWD/$patch.gz" ]; then
+ gzip -dc "$CWD/$patch.gz" | patch -Np1 || exit $ERROR_PATCH
+ elif [ -f "$CWD/patches/$patch.gz" ]; then
+ gzip -dc "$CWD/patches/$patch.gz" | patch -Np1 || exit $ERROR_PATCH
+ elif [ -f "$SRC_DIR/$patch" ]; then
+ if [ "`basename $patch .gz`" != "$patch" ]; then
+ gzip -dc $SRC_DIR/$patch | patch -Np1 || exit $ERROR_PATCH
+ elif [ "`basename $patch .bz2`" != "$patch" ]; then
+ bzip2 -dc $SRC_DIR/$patch | patch -Np1 || exit $ERROR_PATCH
+ else
+ patch -Np1 < "$SRC_DIR/$patch" || exit $ERROR_PATCH
+ fi
+ fi
+done
+
+# Configure
+CFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS" \
+ ./configure \
+ --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+make install DESTDIR="$PKG" || exit $ERROR_INSTALL
+
+# Strip binaries
+( cd "$PKG"
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
+ xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Compress and link manpages
+if [ -d "$PKG/$PREFIX/man" ]; then
+ ( cd "$PKG/$PREFIX/man"
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.?
+ )
+ done
+ )
+fi
+
+# Install documentation
+DOCS="CHANGES COPYING CREDITS MISC README"
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+for doc in $DOCS; do
+ if [ -f "$doc" ]; then
+ cp -a $doc "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+ fi
+done
+
+# Add package description (slack-desc)
+mkdir -p "$PKG/install" || exit $ERROR_MKDIR
+cat << EODESC > "$PKG/install/slack-desc"
+# 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------------------------------------------------------|
+libnids: libnids
+libnids:
+libnids: Libnids is a library that provides the functionality of one
+libnids: of the NIDS (Network Intrusion Detection System) components,
+libnids: namely E-component. Libnids code watches all local network
+libnids: traffic, cooks received datagrams a bit, and provides convenient
+libnids: information about them to the NIDS analyzing modules. Libnids
+libnids: performs assembly of TCP segments into TCP streams, IP
+libnids: defragmentation, and TCP port scan detection.
+libnids:
+libnids:
+EODESC
+
+# Build the package
+cd "$PKG"
+mkdir -p $REPOS/$SLACKBUILD_PATH
+makepkg -l y -c n "$REPOS/$SLACKBUILD_PATH/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
+
+# Delete source and build directories if requested
+if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then
+ rm -rf "$PKG_WORK" "$PKG"
+fi