Need help with a port

Doug Barton dougb at FreeBSD.org
Sat Dec 19 08:13:19 UTC 2009


I've looked at your port, and FWIW I don't see anything wrong with
your suggested fix. I have attached a patch with some small tweaks to
what you proposed, as well as some changes to the rc.d script.

Regarding the latter:
1. A $FreeBSD$ cvs id is effectively mandatory
2. We prefer that local scripts REQUIRE: LOGIN unless there is a good
reason to run before it
3. Duplicating the documentation in the rc.d script is not desirable.
4. The s#%%RC_SUBR%%#/etc/rc.subr# change will happen soon to all
ports anyway
5. load_rc_config is supposed to come AFTER rcvar
6. I added a required_files for the conf file, since it is included in
command_args
7. It is not necessary or desirable to include $name_flags in
command_args.

Please test this version of the port. If you're satisfied with the
changes I will commit it for you.


Doug

-- 

	Improve the effectiveness of your Internet presence with
	a domain name makeover!    http://SupersetSolutions.com/

-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/security/barnyard2/Makefile,v
retrieving revision 1.1
diff -u -r1.1 Makefile
--- Makefile	9 Sep 2009 01:42:43 -0000	1.1
+++ Makefile	19 Dec 2009 08:07:18 -0000
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	barnyard2
-PORTVERSION=	1.6
+PORTVERSION=	1.7
 CATEGORIES=	security
 MASTER_SITES=	http://www.securixlive.com/download/barnyard2/
 
@@ -39,8 +39,10 @@
 CONFIGURE_ARGS+=	--with-postgresql
 .endif
 
-post-install:
+post-patch:
+	${CHMOD} 755 ${WRKSRC}/install-sh
 
+post-install:
 .for f in barnyard2.conf
 	${INSTALL_DATA} ${WRKSRC}/etc/${f} ${PREFIX}/etc/${f}-sample
 	[ -f ${PREFIX}/etc/${f} ] || \
@@ -48,7 +50,6 @@
 .endfor
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
-#	cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
 	cd ${WRKSRC}/doc && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
 .endif
 
Index: distinfo
===================================================================
RCS file: /home/pcvs/ports/security/barnyard2/distinfo,v
retrieving revision 1.1
diff -u -r1.1 distinfo
--- distinfo	9 Sep 2009 01:42:43 -0000	1.1
+++ distinfo	19 Dec 2009 08:07:18 -0000
@@ -1,3 +1,3 @@
-MD5 (barnyard2-1.6.tar.gz) = fe49fae09f585677af7dda53f3f4bedf
-SHA256 (barnyard2-1.6.tar.gz) = c8b9b58d48b420634c502d27f21cbdaf42df0205abeb2970f9ee7e114744433b
-SIZE (barnyard2-1.6.tar.gz) = 631471
+MD5 (barnyard2-1.7.tar.gz) = 6801649c45287799354e0a458af737ef
+SHA256 (barnyard2-1.7.tar.gz) = a9bd56c2887111f3c114e82fc9277ee759a5005374081136e76d950ff390fd1b
+SIZE (barnyard2-1.7.tar.gz) = 652605
Index: files/barnyard2.sh.in
===================================================================
RCS file: /home/pcvs/ports/security/barnyard2/files/barnyard2.sh.in,v
retrieving revision 1.1
diff -u -r1.1 barnyard2.sh.in
--- files/barnyard2.sh.in	9 Sep 2009 01:42:44 -0000	1.1
+++ files/barnyard2.sh.in	19 Dec 2009 08:07:18 -0000
@@ -1,9 +1,9 @@
 #!/bin/sh
 # 
+# $FreeBSD$
 
 # PROVIDE: barnyard2
-# REQUIRE: DAEMON
-# BEFORE: LOGIN
+# REQUIRE: LOGIN
 # KEYWORD: shutdown
 
 # Add the following lines to /etc/rc.conf to enable barnyard2:
@@ -13,59 +13,20 @@
 #				Default: -D
 # barnyard2_conf (str):		Barnyard configuration file
 #				Default: %%PREFIX%%/etc/barnyard2.conf
-#
-# USAGE: barnyard2 [-options]
-#
-# General Options:
-#        -?         Show this information
-#        -c <file>  Use configuration file <file>
-#        -g <gname> Run barnyard gid as <gname> group (or gid) after initialization
-#        -m <umask> Set umask = <umask>
-#        -q         Quiet. Don't show banner and status report
-#        -u <uname> Run barnyard uid as <uname> user (or uid) after initialization
-#        -v         Be verbose
-#        -C <file>  Read the classification map from <file>
-#        -D         Run barnyard in background (daemon) mode
-#        -G <file>  Read the gen-msg map from <file>
-#        -L <dir>   Write output files in <dir>
-#        -R <file>  Read the reference map from <file>
-#        -S <file>  Read the sid-msg map from <file>
-#        -T         Test and report on the current configuration
-#        -U         Use UTC for timestamps
-#        -V         Show version and exit
-#
-# Continual Processing Options:
-#        -a <dir>   Archive processed files to <dir>
-#        -f <base>  Use <base> as the base filename pattern
-#        -d <dir>   Spool files from <dir>
-#        -n         Only process new events
-#        -w <file>  Enable bookmarking using <file>
-#
-# Batch Processing Mode Options:
-#        -o         Enable batch processing mode
-#
-# Longname options and their corresponding single char version
-#   --reference <file>              Same as -R
-#   --classification <file>         Same as -C
-#   --gen-msg <file>                Same as -G
-#   --sid-msg <file>                Same as -S
-#   --pid-path <path>               Specify the path for the barnyard PID file
-#   --create-pidfile                Create PID file, even when not in Daemon mode
-#   --nolock-pidfile                Do not try to lock barnyard PID file
-#   --help                          Same as -?
-#   --version                       Same as -V
 
-. %%RC_SUBR%%
+. /etc/rc.subr
 
-name="barnyard2"
-load_rc_config $name
+name=barnyard2
 rcvar=`set_rcvar`
-# set some defaults
+
+load_rc_config $name
 : ${barnyard2_enable="NO"}
 : ${barnyard2_conf="%%PREFIX%%/etc/barnyard2.conf"}
 : ${barnyard2_flags="-D"}
 
+required_files="${barnyard2_conf}"
+
 command="%%PREFIX%%/bin/barnyard2"
-command_args="-c ${barnyard2_conf} ${barnyard2_flags}"
+command_args="-c ${barnyard2_conf}"
 
 run_rc_command "$1"
Index: files/pkg-message.in
===================================================================
RCS file: /home/pcvs/ports/security/barnyard2/files/pkg-message.in,v
retrieving revision 1.2
diff -u -r1.2 pkg-message.in
--- files/pkg-message.in	4 Nov 2009 07:42:59 -0000	1.2
+++ files/pkg-message.in	19 Dec 2009 08:07:18 -0000
@@ -1,16 +1,3 @@
-************************************************************************
-**************************WARNING****WARNING****************************
-**************************WARNING****WARNING****************************
-
-This version of barnyard2 does not correctly parse the waldo file.  As a
-result, each time barnyard2 is restarted, all alerts remaining in the 
-snort log directory will be reinserted into the database.  If this is a
-a problem for you, consider using security/barnyard2-devel, which has
-resolved this problem.
-
-**************************WARNING****WARNING****************************
-**************************WARNING****WARNING****************************
- 
 Read the notes in the barnyard2.conf file for how to configure 
 %%PREFIX%%/etc/barnyard2.conf after installation.  For addtional information
 see the Securixlive FAQ at http://www.securixlive.com/barnyard2/faq.php.


More information about the freebsd-ports mailing list