From 3e5c2b2fefeef3ff413e0b3b598af2dc48be3adb Mon Sep 17 00:00:00 2001 From: Olli Hauer Date: Sat, 28 Sep 2013 16:54:24 +0000 Subject: - update to version 1.3.4 - add OPTIONS support - add stage support Changes: - support snort 2.9.5 - Removed the need for jpgraph to display the pie chart - Other code improvements --- security/snortreport/Makefile | 57 +++++++++++++------------- security/snortreport/distinfo | 4 +- security/snortreport/files/pkg-message.in | 7 ++++ security/snortreport/pkg-message | 7 ---- security/snortreport/pkg-plist | 67 ++++++++++++++++--------------- 5 files changed, 72 insertions(+), 70 deletions(-) create mode 100644 security/snortreport/files/pkg-message.in delete mode 100644 security/snortreport/pkg-message diff --git a/security/snortreport/Makefile b/security/snortreport/Makefile index 7f6edde828ff..6fd396f93581 100644 --- a/security/snortreport/Makefile +++ b/security/snortreport/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= snortreport -PORTVERSION= 1.3.3 -PORTREVISION= 1 +PORTVERSION= 1.3.4 CATEGORIES= security www MASTER_SITES= http://www.symmetrixtech.com/ids/ @@ -12,47 +11,49 @@ COMMENT= Add-on module for snort to generate real-time web reports LICENSE= GPLv2 -.if !defined(WITHOUT_JPGRAPH) -RUN_DEPENDS= ${LOCALBASE}/share/jpgraph/jpgraph.php:${PORTSDIR}/graphics/jpgraph2 -.endif +OPTIONS_DEFINE= BARNYARD JPGRAPH MYSQL PGSQL + +BARNYARD_DESC= Depend on Barnyard2 +JPGRAPH_DESC= Graphical charting + +BARNYARD_RUN_DEPENDS= barnyard2:${PORTSDIR}/security/barnyard2 +JPGRAPH_RUN_DEPENDS= ${LOCALBASE}/share/jpgraph/jpgraph.php:${PORTSDIR}/graphics/jpgraph2 +.include + +NO_BUILD= yes +SUB_FILES= pkg-message +PORTDOCS= INSTALL Performance.txt create_indexes.sql +FTYPES= css html js php phps png sample USE_PHP= yes WANT_PHP_WEB= yes -PKGMESSAGE= ${WRKDIR}/pkg-message -NO_BUILD= yes +.if ${PORT_OPTIONS:MMYSQL} +USE_PHP+= mysql +.endif + +.if ${PORT_OPTIONS:MPGSQL} +USE_PHP+= pgsql +.endif -NO_STAGE= yes pre-everything:: @${ECHO} "" @${ECHO} "You have to configure PHP either with MySQL or PostgreSQL" @${ECHO} "support in order to let snortreport collect its data." - @${ECHO} "Is is also suggested to compile support for GD in" - @${ECHO} "and have Jpgraph installed in order to view the charts." @${ECHO} "" -pre-patch: - @${SED} 's|%%PREFIX%%|${PREFIX}|g' \ - ${PKGDIR}/pkg-message > ${PKGMESSAGE} +post-patch: + ${MV} ${WRKSRC}/srconf.php ${WRKSRC}/srconf.php.sample do-install: - ${MKDIR} ${PREFIX}/www/snortreport - ${CP} -p ${WRKSRC}/*.php ${PREFIX}/www/snortreport - ${CP} -p ${WRKSRC}/*.css ${PREFIX}/www/snortreport - ${CP} -p ${WRKSRC}/*.png ${PREFIX}/www/snortreport - ${CP} -p ${WRKSRC}/*.html ${PREFIX}/www/snortreport - ${CP} -p ${WRKSRC}/*.phps ${PREFIX}/www/snortreport - ${CP} -p ${WRKSRC}/*.js ${PREFIX}/www/snortreport - ${CHOWN} -R www:www ${PREFIX}/www/snortreport +# srconf.conf contains snort database login credentials + ${INSTALL} -o ${WWWOWN} -g ${WWWGRP} -m 750 -d ${STAGEDIR}${WWWDIR} + ${INSTALL_DATA} ${FTYPES:S|^|${WRKSRC}/*|} ${STAGEDIR}${WWWDIR} post-install: -.if !defined(NOPORTDOCS) - ${INSTALL} -d -o ${DOCOWN} -g ${DOCGRP} ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/INSTALL ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/LICENSE ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/Performance.txt ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/create_indexes.sql ${DOCSDIR} +.if ${PORT_OPTIONS:MDOCS} + ${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} .endif - @${CAT} ${PKGMESSAGE} .include diff --git a/security/snortreport/distinfo b/security/snortreport/distinfo index 019ef091656b..ad41d4d58e77 100644 --- a/security/snortreport/distinfo +++ b/security/snortreport/distinfo @@ -1,2 +1,2 @@ -SHA256 (snortreport-1.3.3.tar.gz) = 9303e96eed0c3e92a238ab6652afa4920596fb56ffa4e344c5f1791bdc943acf -SIZE (snortreport-1.3.3.tar.gz) = 44589 +SHA256 (snortreport-1.3.4.tar.gz) = b57cc8e6cab84a91af7d5edd74950995d08bfad3a6fd9fa7069516d1caa096a9 +SIZE (snortreport-1.3.4.tar.gz) = 50861 diff --git a/security/snortreport/files/pkg-message.in b/security/snortreport/files/pkg-message.in new file mode 100644 index 000000000000..1f7c45df5fe4 --- /dev/null +++ b/security/snortreport/files/pkg-message.in @@ -0,0 +1,7 @@ +*************************************************************** +Snortreport has been installed in %%WWWDIR%%. +Change into this directory and make any necessary change to +the config file (srconf.php). +Also modify your web server configuration to let access to this +directory. +*************************************************************** diff --git a/security/snortreport/pkg-message b/security/snortreport/pkg-message deleted file mode 100644 index 6fa9c651fc19..000000000000 --- a/security/snortreport/pkg-message +++ /dev/null @@ -1,7 +0,0 @@ -*************************************************************** -Snortreport has been installed in %%PREFIX%%/www/snortreport. -Change into this directory and make any necessary change to -the config file (srconf.php). -Also modify your web server configuration to let access to this -directory. -*************************************************************** diff --git a/security/snortreport/pkg-plist b/security/snortreport/pkg-plist index ed6a0c3be74b..3831005c0184 100644 --- a/security/snortreport/pkg-plist +++ b/security/snortreport/pkg-plist @@ -1,33 +1,34 @@ -www/snortreport/DB.php -www/snortreport/DB_mysql.php -www/snortreport/DB_pgsql.php -www/snortreport/alertchart.php -www/snortreport/alerts.php -www/snortreport/default.css -www/snortreport/functions.php -www/snortreport/go.png -www/snortreport/index.php -www/snortreport/info-retrieval.php -www/snortreport/ipdetail.php -www/snortreport/menu.html -www/snortreport/nbtscan.php -www/snortreport/nmap.php -www/snortreport/nodata.png -www/snortreport/page_bottom.php -www/snortreport/page_top.php -www/snortreport/portscan.php -www/snortreport/profiling.phps -www/snortreport/psdetail.php -www/snortreport/sig-by-time-chart.php -www/snortreport/sigdetail.php -www/snortreport/srconf.php -www/snortreport/srlogo.png -www/snortreport/ssm.js -www/snortreport/ssmItems.js -www/snortreport/timespan.php -%%PORTDOCS%%%%DOCSDIR%%/INSTALL -%%PORTDOCS%%%%DOCSDIR%%/LICENSE -%%PORTDOCS%%%%DOCSDIR%%/Performance.txt -%%PORTDOCS%%%%DOCSDIR%%/create_indexes.sql -@dirrm www/snortreport -%%PORTDOCS%%@dirrm %%DOCSDIR%% +%%WWWDIR%%/DB.php +%%WWWDIR%%/DB_mysql.php +%%WWWDIR%%/DB_pgsql.php +%%WWWDIR%%/GlowStick_Histogram.php +%%WWWDIR%%/GlowStick_Piechart.php +%%WWWDIR%%/alertchart.php +%%WWWDIR%%/alerts.php +%%WWWDIR%%/default.css +%%WWWDIR%%/functions.php +%%WWWDIR%%/go.png +%%WWWDIR%%/histogram.php +%%WWWDIR%%/index.php +%%WWWDIR%%/info-retrieval.php +%%WWWDIR%%/ipdetail.php +%%WWWDIR%%/menu.html +%%WWWDIR%%/nbtscan.php +%%WWWDIR%%/nmap.php +%%WWWDIR%%/nodata.png +%%WWWDIR%%/page_bottom.php +%%WWWDIR%%/page_top.php +%%WWWDIR%%/png.php +%%WWWDIR%%/portscan.php +%%WWWDIR%%/profiling.phps +%%WWWDIR%%/psdetail.php +%%WWWDIR%%/sig-by-time-chart.php +%%WWWDIR%%/sigdetail.php +@unexec if cmp -s %D/%%WWWDIR%/srconf.php.sample %D/%%WWWDIR%%/srconf.php; then rm -f %D/%%WWWDIR%%/srconf.php; fi +%%WWWDIR%%/srconf.php.sample +@exec [ -f %D/%%WWWDIR%%/srconf.php ] || cp %D/%%WWWDIR%%/srconf.php.sample %D/%%WWWDIR%%/srconf.php +%%WWWDIR%%/srlogo.png +%%WWWDIR%%/ssm.js +%%WWWDIR%%/ssmItems.js +%%WWWDIR%%/timespan.php +@dirrmtry %%WWWDIR%% -- cgit v1.2.3