diff options
-rw-r--r-- | security/snort/Makefile | 10 | ||||
-rw-r--r-- | security/snort/distinfo | 8 | ||||
-rw-r--r-- | security/snort/files/snort.sh | 36 | ||||
-rw-r--r-- | security/snort/files/snort.sh.sample | 21 | ||||
-rw-r--r-- | security/snort/pkg-message | 16 | ||||
-rw-r--r-- | security/snort/pkg-plist | 3 |
6 files changed, 66 insertions, 28 deletions
diff --git a/security/snort/Makefile b/security/snort/Makefile index 7c6b13f01027..fbd462e7b944 100644 --- a/security/snort/Makefile +++ b/security/snort/Makefile @@ -6,7 +6,7 @@ # PORTNAME= snort -PORTVERSION= 2.1.2 +PORTVERSION= 2.1.3 CATEGORIES= security MASTER_SITES= http://www.snort.org/dl/ @@ -64,8 +64,13 @@ MAN8= snort.8 DOCS= ChangeLog doc/AUTHORS doc/BUGS doc/CREDITS doc/FAQ doc/NEWS \ doc/README* doc/TODO doc/USAGE doc/snort_manual.pdf +USE_RC_SUBR= yes +RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} + post-patch: ${REINPLACE_CMD} "s,%%PREFIX%%,${PREFIX}," ${WRKSRC}/src/snort.c + @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/snort.sh > ${WRKDIR}/snort.sh pre-configure: @${ECHO} "" @@ -85,7 +90,7 @@ post-install: ${DATADIR}/reference.config-sample [ -f ${DATADIR}/reference.config ] || \ ${CP} ${DATADIR}/reference.config-sample ${DATADIR}/reference.config - ${INSTALL_DATA} ${FILESDIR}/snort.sh.sample ${PREFIX}/etc/rc.d + ${INSTALL_SCRIPT} -m 751 ${WRKDIR}/snort.sh ${PREFIX}/etc/rc.d/snort.sh .for f in snort.conf unicode.map threshold.conf ${INSTALL_DATA} ${WRKSRC}/etc/${f} ${PREFIX}/etc/${f}-sample [ -f ${PREFIX}/etc/${f} ] || \ @@ -95,5 +100,6 @@ post-install: @${MKDIR} ${DOCSDIR} cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR} .endif + @${CAT} ${PKGMESSAGE} .include <bsd.port.mk> diff --git a/security/snort/distinfo b/security/snort/distinfo index 5c7381657a12..a975e5113299 100644 --- a/security/snort/distinfo +++ b/security/snort/distinfo @@ -1,4 +1,4 @@ -MD5 (snort-2.1.2.tar.gz) = f01ae080f1571fd3e8d282dcae51f528 -SIZE (snort-2.1.2.tar.gz) = 2315827 -MD5 (snort-2.1.2.tar.gz.asc) = 98034dfa0a3e8015a6dcb692feaf2892 -SIZE (snort-2.1.2.tar.gz.asc) = 189 +MD5 (snort-2.1.3.tar.gz) = 76a538d27c23d51dbed43b04c06114e1 +SIZE (snort-2.1.3.tar.gz) = 2379344 +MD5 (snort-2.1.3.tar.gz.asc) = 9c0a4261e9016a820f969ee44fef4b95 +SIZE (snort-2.1.3.tar.gz.asc) = 189 diff --git a/security/snort/files/snort.sh b/security/snort/files/snort.sh new file mode 100644 index 000000000000..d737bfd76385 --- /dev/null +++ b/security/snort/files/snort.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# $Id$ + +# PROVIDE: snort +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: FreeBSD shutdown + +# Add the following lines to /etc/rc.conf to enable snort: +# snort_enable (bool): Set to YES to enable snort +# Default: NO +# snort_flags (str): Extra flags passed to snort +# Default: -Dq +# snort_interface (str): Network interface to sniff +# Default: "" +# snort_conf (str): Snort configuration file +# Default: ${PREFIX}/etc/snort.conf +# + +. %%RC_SUBR%% + +name="snort" +rcvar=`set_rcvar` + +command="%%PREFIX%%/bin/snort" + +load_rc_config $name + +[ -z "$snort_enable" ] && snort_enable="NO" +[ -z "$snort_conf" ] && snort_conf="%%PREFIX%%/etc/snort.conf" +[ -z "$snort_flags" ] && snort_flags="-Dq" + +[ -n "$snort_interface" ] && snort_flags="$snort_flags -i $snort_interface" +[ -n "$snort_conf" ] && snort_flags="$snort_flags -c $snort_conf" + +run_rc_command "$1" diff --git a/security/snort/files/snort.sh.sample b/security/snort/files/snort.sh.sample deleted file mode 100644 index b1bb94874977..000000000000 --- a/security/snort/files/snort.sh.sample +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 -fi - -case "$1" in -start) - ${PREFIX}/bin/snort -Dqc ${PREFIX}/etc/snort.conf > /dev/null && echo -n " snort" - ;; -stop) - kill `cat /var/run/snort_*.pid` - ;; -restart) - killall -1 `cat /var/run/snort_*.pid` - ;; -*) - echo "Usage: snort.sh [start|stop|restart]" - ;; -esac diff --git a/security/snort/pkg-message b/security/snort/pkg-message new file mode 100644 index 000000000000..7a4949ff8ac2 --- /dev/null +++ b/security/snort/pkg-message @@ -0,0 +1,16 @@ + *********************************** + * !!!!!!!!!!! WARNING !!!!!!!!!!! * + *********************************** + +snort now uses rcNG startup scripts and must be enabled via /etc/rc.conf + +Available variables: + + snort_enable (bool): Set to YES to enable snort + Default: NO + snort_flags (str): Extra flags passed to snort + Default: -Dq + snort_interface (str): Network interface to sniff + Default: "" + snort_conf (str): Snort configuration file + Default: ${PREFIX}/etc/snort.conf diff --git a/security/snort/pkg-plist b/security/snort/pkg-plist index 0aa409143428..e18dd25e5902 100644 --- a/security/snort/pkg-plist +++ b/security/snort/pkg-plist @@ -9,7 +9,7 @@ etc/unicode.map-sample @unexec if [ -f %D/etc/threshold.conf ] && cmp -s %D/etc/threshold.conf %D/etc/threshold.conf-sample; then rm -f %D/etc/threshold.conf; fi etc/threshold.conf-sample @exec [ -f %B/threshold.conf ] || cp %B/%f %B/threshold.conf -etc/rc.d/snort.sh.sample +etc/rc.d/snort.sh %%PORTDOCS%%%%DOCSDIR%%/AUTHORS %%PORTDOCS%%%%DOCSDIR%%/BUGS %%PORTDOCS%%%%DOCSDIR%%/CREDITS @@ -24,6 +24,7 @@ etc/rc.d/snort.sh.sample %%PORTDOCS%%%%DOCSDIR%%/README.alert_order %%PORTDOCS%%%%DOCSDIR%%/README.csv %%PORTDOCS%%%%DOCSDIR%%/README.database +%%PORTDOCS%%%%DOCSDIR%%/README.event_queue %%PORTDOCS%%%%DOCSDIR%%/README.flow %%PORTDOCS%%%%DOCSDIR%%/README.flowbits %%PORTDOCS%%%%DOCSDIR%%/README.flow-portscan |