summaryrefslogtreecommitdiff
path: root/network/snort/snort.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'network/snort/snort.SlackBuild')
-rw-r--r--network/snort/snort.SlackBuild98
1 files changed, 68 insertions, 30 deletions
diff --git a/network/snort/snort.SlackBuild b/network/snort/snort.SlackBuild
index d12fa64d25..7168c20f76 100644
--- a/network/snort/snort.SlackBuild
+++ b/network/snort/snort.SlackBuild
@@ -1,5 +1,7 @@
#!/bin/sh
-# Copyright 2006, Alan Hicks, Lizella, GA
+
+# Copyright 2006-2009, Alan Hicks, Lizella, GA,
+# Copyright 2009, Thomas York, Beech Grove, In.
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,65 +24,101 @@
# Modified by the SlackBuilds.org project
PRGNAM=snort
-VERSION=2.6.1.5
+VERSION=2.8.4.1
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
-PKG=$TMP/pkg-$PRGNAM
+PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
fi
+set -e
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
-cd $TMP || exit 1
+cd $TMP
rm -rf $PRGNAM-$VERSION
-tar xzvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
-cd $PRGNAM-$VERSION || exit 1
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
-# Fix ownership and permissions inside the source tarball.
-# It's appalling how many projects have 777 permissions or
-# even suid, sgid, and sticky bits set on things.
chown -R root:root .
-chmod -R u+w,go+r-w,a-s .
+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 {} \;
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
+ --mandir=/usr/man \
--localstatedir=/var \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
--enable-pthread \
--enable-linux-smp-stats \
- --with-mysql=/usr \
- --disable-dynamicplugin \
- || exit 1
-
-make || exit 1
-make install-strip DESTDIR=$PKG || exit 1
-
-if [ -d $PKG/usr/man ]; then
- ( 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
- )
-fi
+ --with-mysql-libraries=/usr/lib${LIBDIRSUFFIX}/mysql \
+ --with-mysql-includes=/usr/include/mysql \
+ --build=$ARCH-slackware-linux
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a COPYING ChangeLog LICENSE RELEASE.NOTES doc/* $PKG/usr/doc/$PRGNAM-$VERSION/
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+make
+make install-strip DESTDIR=$PKG
-# Setup a sane config directory - snort won't do this on its own
-mkdir -p $PKG/etc/snort
-cat etc/snort.conf > $PKG/etc/snort/snort.conf.new
-cat etc/reference.config > $PKG/etc/snort/reference.config.new
+( 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
+)
+
+# Set up a sane config directory - snort won't do this on its own
+mkdir -p $PKG/etc/$PRGNAM
+# Fix paths for libraries in snort.conf
+sed -e 's%usr/local%usr%g' etc/snort.conf > $PKG/etc/snort/snort.conf.new
cat etc/threshold.conf > $PKG/etc/snort/threshold.conf.new
+cat etc/reference.config > $PKG/etc/snort/reference.config.new
+cat etc/classification.config > $PKG/etc/snort/classification.config.new
+cat etc/attribute_table.dtd > $PKG/etc/snort/attribute_table.dtd.new
+cat etc/gen-msg.map > $PKG/etc/snort/gen-msg.map.new
+cat etc/sid-msg.map > $PKG/etc/snort/sid-msg.map.new
+cat etc/unicode.map > $PKG/etc/snort/unicode.map.new
+
+# Create default, empty directory for rules
+mkdir -p $PKG/etc/snort/rules
+mkdir -p $PKG/etc/snort/preproc_rules
+
+# Include the rc.snort file
+mkdir -p $PKG/etc/rc.d
+cat $CWD/rc.snort > $PKG/etc/rc.d/rc.snort.new
+chmod 0755 $PKG/etc/rc.d/rc.snort.new
+
+# Create directory for logging
+mkdir -p $PKG/var/log/snort
+
+# Bundle the SQL schemas and install the docs
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/schemas
+for file in schemas/create_*; do
+ cat $file > $PKG/usr/doc/$PRGNAM-$VERSION/$file
+done
+cp -a COPYING ChangeLog LICENSE RELEASE.NOTES doc/* \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE
+find $PKG/usr/doc -name "Makefile*" -exec rm -f {} \;
+rm -rf $PKG/usr/share
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc