diff options
author | kris <kris@FreeBSD.org> | 2002-10-06 17:48:09 +0800 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2002-10-06 17:48:09 +0800 |
commit | 658128bebe9264e8047b86dd446b90c74011409b (patch) | |
tree | 5ffb1761d56c7d23307afcc735a09d16f5e33ace /security | |
parent | f460fcf9e8bc9426f354f0333c513dc81c9f0776 (diff) | |
download | freebsd-ports-graphics-658128bebe9264e8047b86dd446b90c74011409b.tar.gz freebsd-ports-graphics-658128bebe9264e8047b86dd446b90c74011409b.tar.zst freebsd-ports-graphics-658128bebe9264e8047b86dd446b90c74011409b.zip |
Update to snort 1.9.0. Tweak the default config files so it can actually
find its installed ruleset [1]. Install config files by default if there is
not already one present, and remove on deinstall if they are unchanged
from the default.
Submitted by: The Anarcat <anarcat@anarcat.dyndns.org> [1] (based on)
PR: ports/33887 [1]
Diffstat (limited to 'security')
-rw-r--r-- | security/snort/Makefile | 41 | ||||
-rw-r--r-- | security/snort/distinfo | 2 | ||||
-rw-r--r-- | security/snort/files/patch-snort.c | 22 | ||||
-rw-r--r-- | security/snort/files/patch-snort.conf | 27 | ||||
-rw-r--r-- | security/snort/pkg-message | 17 | ||||
-rw-r--r-- | security/snort/pkg-plist | 42 |
6 files changed, 110 insertions, 41 deletions
diff --git a/security/snort/Makefile b/security/snort/Makefile index 2cf7ff7e7fb..ee09b4d8ec2 100644 --- a/security/snort/Makefile +++ b/security/snort/Makefile @@ -6,7 +6,7 @@ # PORTNAME= snort -PORTVERSION= 1.8.7 +PORTVERSION= 1.9.0 CATEGORIES= security MASTER_SITES= http://www.snort.org/dl/ @@ -43,6 +43,10 @@ LDFLAGS+= -lssl -lcrypto .endif CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}" +USE_REINPLACE= yes + +post-patch: + ${REINPLACE_CMD} "s,%%PREFIX%%,${PREFIX}," ${WRKSRC}/src/snort.c pre-configure: @${ECHO} "" @@ -50,14 +54,35 @@ pre-configure: @${ECHO} "to get additional support." @${ECHO} "" +DOCS= AUTHORS NEWS README.csv BUGS README README.database \ + CREDITS README.SNMP README.xml README.FLEXRESP RULES.todo FAQ \ + SnortUsersManual.pdf README.PLUGINS USAGE + post-install: ${MKDIR} ${DATADIR} - ${INSTALL_DATA} ${WRKSRC}/CREDITS ${DATADIR} - ${INSTALL_DATA} ${WRKSRC}/RULES.SAMPLE ${DATADIR} - ${INSTALL_DATA} ${WRKSRC}/USAGE ${DATADIR} - ${INSTALL_DATA} ${WRKSRC}/*.rules ${DATADIR} - ${INSTALL_DATA} ${WRKSRC}/classification.config ${PREFIX}/etc/classification.config-sample - ${INSTALL_DATA} ${WRKSRC}/snort.conf ${PREFIX}/etc/snort.conf-sample - @${SED} -e 's#/usr/local#${PREFIX}#g' ${PKGMESSAGE} +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} +.for i in ${DOCS} + ${INSTALL_DATA} ${WRKSRC}/doc/${i} ${DOCSDIR} +.endfor +.endif + @${INSTALL_DATA} ${WRKSRC}/rules/*.rules ${DATADIR}; \ + ${INSTALL_DATA} ${WRKSRC}/etc/classification.config ${DATADIR}/classification.config-sample; \ + if [ ! -f ${DATADIR}/classification.config ]; then \ + ${CP} ${DATADIR}/classification.config-sample \ + ${DATADIR}/classification.config; \ + fi; \ + ${INSTALL_DATA} ${WRKSRC}/etc/reference.config \ + ${DATADIR}/reference.config-sample; \ + if [ ! -f ${DATADIR}/reference.config ]; then \ + ${CP} ${DATADIR}/reference.config-sample \ + ${DATADIR}/reference.config; \ + fi; \ + ${INSTALL_DATA} ${WRKSRC}/etc/snort.conf \ + ${PREFIX}/etc/snort.conf-sample; \ + if [ ! -f ${PREFIX}/etc/snort.conf ]; then \ + ${CP} ${PREFIX}/etc/snort.conf-sample \ + ${PREFIX}/etc/snort.conf; \ + fi .include <bsd.port.mk> diff --git a/security/snort/distinfo b/security/snort/distinfo index c5913bbc577..fbed31a4e2e 100644 --- a/security/snort/distinfo +++ b/security/snort/distinfo @@ -1 +1 @@ -MD5 (snort-1.8.7.tar.gz) = 29c81d0bc243edb21ba4ab33ee80457e +MD5 (snort-1.9.0.tar.gz) = bcd3cbd0e6982345871d02fe60444c5c diff --git a/security/snort/files/patch-snort.c b/security/snort/files/patch-snort.c index b299c7e6074..0cf8de8354d 100644 --- a/security/snort/files/patch-snort.c +++ b/security/snort/files/patch-snort.c @@ -1,11 +1,11 @@ ---- snort.c.orig Fri Jun 28 10:22:59 2002 -+++ snort.c Sat Jul 13 11:13:16 2002 -@@ -1694,7 +1694,7 @@ - difftime.tv_sec = endtime.tv_sec - starttime.tv_sec; - difftime.tv_usec = endtime.tv_usec - starttime.tv_usec; - -- printf("Run time for packet processing was %u.%u seconds\n", -+ printf("Run time for packet processing was %lu.%lu seconds\n", - difftime.tv_sec, difftime.tv_usec); - - CleanExit(SIGQUIT); +--- src/snort.c.orig Sun Oct 6 02:14:32 2002 ++++ src/snort.c Sun Oct 6 02:14:18 2002 +@@ -2193,7 +2193,7 @@ + struct stat st; + int found; + int i; +- char *conf_files[]={"/etc/snort.conf", "./snort.conf", NULL}; ++ char *conf_files[]={"%%PREFIX%%/etc/snort.conf", "./snort.conf", NULL}; + char *fname = NULL; + char *home_dir; + char *tmp; diff --git a/security/snort/files/patch-snort.conf b/security/snort/files/patch-snort.conf new file mode 100644 index 00000000000..8ba82ff36a9 --- /dev/null +++ b/security/snort/files/patch-snort.conf @@ -0,0 +1,27 @@ +--- etc/snort.conf.orig Tue Aug 13 20:17:58 2002 ++++ etc/snort.conf Sun Oct 6 02:21:52 2002 +@@ -99,7 +99,7 @@ + var AIM_SERVERS [64.12.24.0/24,64.12.25.0/24,64.12.26.14/24,64.12.28.0/24,64.12.29.0/24,64.12.161.0/24,64.12.163.0/24,205.188.5.0/24,205.188.9.0/24] + + # Path to your rules files (this can be a relative path) +-var RULE_PATH ../rules ++var RULE_PATH ../share/snort + + ################################################### + # Step #2: Configure preprocessors +@@ -533,13 +533,13 @@ + # Include classification & priority settings + # + +-include classification.config ++include ../share/snort/classification.config + + # + # Include reference systems + # + +-include reference.config ++include ../share/snort/reference.config + + #################################################################### + # Step #4: Customize your rule set diff --git a/security/snort/pkg-message b/security/snort/pkg-message deleted file mode 100644 index 9ffcbbc1721..00000000000 --- a/security/snort/pkg-message +++ /dev/null @@ -1,17 +0,0 @@ - -*********************************************************** -Copy - - /usr/local/etc/snort.conf-sample -to - /usr/local/etc/snort.conf - -and - - /usr/local/etc/classification.config-sample -to - /usr/local/etc/classification.config - -and edit them to fit your needs. -*********************************************************** - diff --git a/security/snort/pkg-plist b/security/snort/pkg-plist index 11ebe3e367f..c7e3ff87387 100644 --- a/security/snort/pkg-plist +++ b/security/snort/pkg-plist @@ -1,40 +1,74 @@ bin/snort -etc/classification.config-sample +@unexec if [ -f %D/etc/snort.conf ] && cmp -s %D/etc/snort.conf %D/etc/snort.conf-sample; then rm -f %D/etc/snort.conf; fi etc/snort.conf-sample -share/snort/CREDITS -share/snort/RULES.SAMPLE -share/snort/USAGE +@exec [ -f %B/snort.conf ] || cp %B/%f %B/snort.conf +%%PORTDOCS%%share/doc/snort/AUTHORS +%%PORTDOCS%%share/doc/snort/NEWS +%%PORTDOCS%%share/doc/snort/README.csv +%%PORTDOCS%%share/doc/snort/BUGS +%%PORTDOCS%%share/doc/snort/README +%%PORTDOCS%%share/doc/snort/README.database +%%PORTDOCS%%share/doc/snort/CREDITS +%%PORTDOCS%%share/doc/snort/README.SNMP +%%PORTDOCS%%share/doc/snort/README.xml +%%PORTDOCS%%share/doc/snort/README.FLEXRESP +%%PORTDOCS%%share/doc/snort/RULES.todo +%%PORTDOCS%%share/doc/snort/FAQ +%%PORTDOCS%%share/doc/snort/SnortUsersManual.pdf +%%PORTDOCS%%share/doc/snort/README.PLUGINS +%%PORTDOCS%%share/doc/snort/USAGE share/snort/attack-responses.rules share/snort/backdoor.rules share/snort/bad-traffic.rules +share/snort/chat.rules +@unexec if [ -f %B/classification.config ] && cmp -s %B/classification.config %B/classification.config-sample; then rm -f %B/classification.config; fi +share/snort/classification.config-sample +@exec [ -f %B/classification.config ] || cp %B/%f %B/classification.config share/snort/ddos.rules +share/snort/deleted.rules share/snort/dns.rules share/snort/dos.rules +share/snort/experimental.rules share/snort/exploit.rules share/snort/finger.rules share/snort/ftp.rules share/snort/icmp-info.rules share/snort/icmp.rules +share/snort/imap.rules share/snort/info.rules share/snort/local.rules share/snort/misc.rules +share/snort/multimedia.rules +share/snort/mysql.rules share/snort/netbios.rules +share/snort/nntp.rules +share/snort/oracle.rules +share/snort/other-ids.rules +share/snort/p2p.rules share/snort/policy.rules +share/snort/pop3.rules share/snort/porn.rules +@unexec if [ -f %B/reference.config ] && cmp -s %B/reference.config %B/reference.config-sample; then rm -f %B/reference.config; fi +share/snort/reference.config-sample +@exec [ -f %B/reference.config ] || cp %B/%f %B/reference.config share/snort/rpc.rules share/snort/rservices.rules share/snort/scan.rules share/snort/shellcode.rules share/snort/smtp.rules +share/snort/snmp.rules share/snort/sql.rules share/snort/telnet.rules share/snort/tftp.rules share/snort/virus.rules share/snort/web-attacks.rules share/snort/web-cgi.rules +share/snort/web-client.rules share/snort/web-coldfusion.rules share/snort/web-frontpage.rules share/snort/web-iis.rules share/snort/web-misc.rules +share/snort/web-php.rules share/snort/x11.rules +%%PORTDOCS%%@dirrm share/doc/snort @dirrm share/snort |