diff options
Diffstat (limited to 'main/snort')
-rw-r--r-- | main/snort/APKBUILD | 40 | ||||
-rw-r--r-- | main/snort/nocxx.patch | 15 | ||||
-rw-r--r-- | main/snort/snort.confd | 16 | ||||
-rw-r--r-- | main/snort/snort.initd | 31 | ||||
-rw-r--r-- | main/snort/snort.pre-install | 4 |
5 files changed, 106 insertions, 0 deletions
diff --git a/main/snort/APKBUILD b/main/snort/APKBUILD new file mode 100644 index 000000000..35b482065 --- /dev/null +++ b/main/snort/APKBUILD @@ -0,0 +1,40 @@ +# Contributor: Michael Mason <ms13sp@gmail.com> +pkgname=snort +pkgver=2.8.4 +pkgrel=0 +pkgdesc="An open source network intrusion prevention and detection system" +url="http://www.snort.org/" +license="GPL" +depends="uclibc libpcap libnet" +makedepends="pcre-dev libpcap-dev libnet-dev" +install="$pkgname.pre-install" +subpackages="$pkgname-doc $pkgname-dev" +source="http://www.snort.org/dl/$pkgname-$pkgver.tar.gz + nocxx.patch + snort.initd + snort.confd + $install + " + +build() { + cd "$srcdir/$pkgname-$pkgver" + patch configure < ../nocxx.patch || return 1 + + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --enable-ipv6 \ + --enable-gre + make -j1 || return 1 + make -j1 DESTDIR="$pkgdir" install + + install -D -m 755 ../snort.initd "$pkgdir"/etc/init.d/snort + install -D -m 644 ../snort.confd "$pkgdir"/etc/conf.d/snort +} + +md5sums="193179da8db8aac5ee6b0a751ce7b76d snort-2.8.4.tar.gz +28513788ba4d556ccd538867dc6205ab nocxx.patch +b3207150805e7b948d958c6f86e70a5b snort.initd +446f8d2b3435b8a6be738da978670605 snort.confd +b9473b349cc9d21faf7b91b591f497d6 snort.pre-install" diff --git a/main/snort/nocxx.patch b/main/snort/nocxx.patch new file mode 100644 index 000000000..beb1ab900 --- /dev/null +++ b/main/snort/nocxx.patch @@ -0,0 +1,15 @@ +--- a/configure 2004-12-07 21:34:23.205172545 +0000 ++++ b/configure 2004-12-07 21:37:17.726654782 +0000 +@@ -5148,10 +5148,8 @@ + : + else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +-See \`config.log' for more details." >&5 +-echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } ++See \`config.log' for more details." >&5;} ++ { echo "C++ sucks, ignoring ..." >&5; }; } + fi + + ac_ext=cc diff --git a/main/snort/snort.confd b/main/snort/snort.confd new file mode 100644 index 000000000..d4d240ac9 --- /dev/null +++ b/main/snort/snort.confd @@ -0,0 +1,16 @@ +# Config file for /etc/init.d/snort + +# This tell snort which interface to listen on (any for every interface) +IFACE=eth0 + +# Make sure this matches your IFACE +PIDFILE=/var/run/snort_$IFACE.pid + +# You probably don't want to change this, but in case you do +LOGDIR="/var/log/snort" + +# Probably not this either +CONF=/etc/snort/snort.conf + +# This pulls in the options above +SNORT_OPTS="-D -u snort -i $IFACE -l $LOGDIR -c $CONF" diff --git a/main/snort/snort.initd b/main/snort/snort.initd new file mode 100644 index 000000000..a5c2b05c4 --- /dev/null +++ b/main/snort/snort.initd @@ -0,0 +1,31 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/net-analyzer/snort/files/snort.rc7,v 1.3 2007/04/22 06:21:15 dragonheart Exp $ + +depend() { + need net +} + +checkconfig() { + if [ ! -e $CONF ] ; then + eerror "You need a configuration file to run snort" + eerror "There is an example config in /etc/snort/snort.conf.distrib" + return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting snort" + start-stop-daemon --start --quiet --exec /usr/bin/snort \ + --pidfile ${PIDFILE} \ + -- ${SNORT_OPTS} >/dev/null 2>&1 + eend $? +} + +stop() { + ebegin "Stopping snort" + start-stop-daemon --stop --quiet --pidfile ${PIDFILE} + eend $? +} diff --git a/main/snort/snort.pre-install b/main/snort/snort.pre-install new file mode 100644 index 000000000..e1555163a --- /dev/null +++ b/main/snort/snort.pre-install @@ -0,0 +1,4 @@ +#!/bin/sh + +adduser -h /var/log/snort -s /bin/false -D snort 2>/dev/null +exit 0 |