ports/165800: [PATCH] security/snort Honor NOPORTEXAMPLES env var

Michael Scheidell scheidell at FreeBSD.org
Wed Mar 7 02:20:11 UTC 2012


>Number:         165800
>Category:       ports
>Synopsis:       [PATCH] security/snort Honor NOPORTEXAMPLES env var
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 07 02:20:10 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Michael Scheidell
>Release:        FreeBSD 7.4-RELEASE-p3 i386
>Organization:
SECNAP Network Security
>Environment:

>Description:

I appoligize for not seeing this earlier when I send in the patches for noportdocs.
I had assumed noportdocs also kept examples out.  I guess it didn't.

anyway, this patch to Makefile and pkg-plist eliminates 270K of examples if OP defines noportexamples in env.
it uses the pre-defined %%PORTEXAMPLES%% plist sub from ../Mk/* to help keep the plist_files in order.

>How-To-Repeat:

make -DNOPORTEXAMPLES install
du -ch /usr/local/share/examples/snort
270K	/usr/local/share/examples/snort
270K	total

>Fix:

logs:
with patch, and portexamples:
http://lorie.secnap.net/tb/logs/7-scheidell_I386/snort-2.9.2.1_2.log
with patch and noportexamples:
http://lorie.secnap.net/tb/logs/7-SECNAP_AMD64/snort-2.9.2.1_2.log

- Honor NOPORTEXAMPLES env var
- No PORTREVISION bump

--- snort.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/security/snort/Makefile,v
retrieving revision 1.148
diff -u -r1.148 Makefile
--- Makefile	14 Feb 2012 12:45:29 -0000	1.148
+++ Makefile	7 Mar 2012 02:11:30 -0000
@@ -227,17 +227,23 @@
 post-install:
 	@${LIBTOOL} --finish ${LOCALBASE}/lib/snort/dynamicpreprocessor
 	[ -d ${CONFIG_DIR} ] || ${MKDIR} ${CONFIG_DIR}
+.if !defined(NOPORTEXAMPLES)
 	[ -d ${EXAMPLESDIR} ] || ${MKDIR} ${EXAMPLESDIR}
+.endif
 	[ -d ${RULES_DIR} ] || ${MKDIR} ${RULES_DIR}
 	[ -d ${LOGS_DIR} ] || ${MKDIR} ${LOGS_DIR}
 .for f in ${CONFIG_FILES}
 	${INSTALL_DATA} ${WRKSRC}/etc/${f} ${CONFIG_DIR}/${f}-sample
+.if !defined(NOPORTEXAMPLES)
 	${INSTALL_DATA} ${WRKSRC}/etc/${f} ${EXAMPLESDIR}/${f}-sample
+.endif
 	@if [ ! -f ${CONFIG_DIR}/${f} ]; then \
 		${CP} -p ${CONFIG_DIR}/${f}-sample ${CONFIG_DIR}/${f} ; \
 	fi
 .endfor
+.if !defined(NOPORTEXAMPLES)
 	${INSTALL_DATA} ${WRKSRC}/schemas/create* ${EXAMPLESDIR}
+.endif
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
 	cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
Index: pkg-plist
===================================================================
RCS file: /home/pcvs/ports/security/snort/pkg-plist,v
retrieving revision 1.40
diff -u -r1.40 pkg-plist
--- pkg-plist	15 Dec 2011 00:50:34 -0000	1.40
+++ pkg-plist	7 Mar 2012 02:11:30 -0000
@@ -175,18 +175,18 @@
 %%DYNAMIC%%lib/snort/dynamicpreprocessor/lib_sfdynamic_preprocessor_example.la
 %%DYNAMIC%%@dirrmtry lib/snort/dynamicpreprocessor
 %%DYNAMIC%%@dirrmtry lib/snort
-%%EXAMPLESDIR%%/classification.config-sample
-%%EXAMPLESDIR%%/create_db2
-%%EXAMPLESDIR%%/create_mssql
-%%EXAMPLESDIR%%/create_mysql
-%%EXAMPLESDIR%%/create_oracle.sql
-%%EXAMPLESDIR%%/create_postgresql
-%%EXAMPLESDIR%%/gen-msg.map-sample
-%%EXAMPLESDIR%%/reference.config-sample
-%%EXAMPLESDIR%%/snort.conf-sample
-%%EXAMPLESDIR%%/threshold.conf-sample
-%%EXAMPLESDIR%%/unicode.map-sample
- at dirrm %%EXAMPLESDIR%%
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/classification.config-sample
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/create_db2
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/create_mssql
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/create_mysql
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/create_oracle.sql
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/create_postgresql
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/gen-msg.map-sample
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/reference.config-sample
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/snort.conf-sample
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/threshold.conf-sample
+%%PORTEXAMPLES%%%%EXAMPLESDIR%%/unicode.map-sample
+%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
 %%PORTDOCS%%%%DOCSDIR%%/AUTHORS
 %%PORTDOCS%%%%DOCSDIR%%/BUGS
 %%PORTDOCS%%%%DOCSDIR%%/CREDITS
--- snort.patch ends here ---

______________________________________________________________________
This email has been scanned and certified safe by SpammerTrap(r). 
For Information please see http://www.spammertrap.com/
______________________________________________________________________  
  
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list