Bug 185455

Summary: [PATCH] security/bro: Fix pkg-fallout issue,
Product: Ports & Packages Reporter: Craig Leres <leres>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: leres
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch.txt none

Description Craig Leres freebsd_committer freebsd_triage 2014-01-04 01:10:00 UTC
	This updates the Makefile to match recent changes to the
	security/broccoli port:

	    - Convert to new-new OPTIONS framework
	    - Use new *_DEPENDS formats

	Also included is a patch that attempts to solve recent
	current and 10 pkg-fallout issues. I wasn't able to reproduce
	the error using either the lang/clang33 or lang/clang-devel
	compilers but the Bro developement team provide the patch
	and claim it should work.

How-To-Repeat: 	pkg-fallout reports:

	    [REL - head-amd64-default][security/bro] Failed for bro-2.2 in build
	    [REL - head-i386-default][security/bro] Failed for bro-2.2 in build
	    [REL - 10amd64-default][security/bro] Failed for bro-2.2 in build
	    [REL - 10amd64-default][security/bro] Failed for bro-2.2 in build
Comment 1 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-01-06 19:27:46 UTC
A few comments:

 - The LIB_DEPENDS change is incorrect; libraries are still supposed to
   be specified as just "libfoo.so".

 - The SQLite.cc change also needs to be applied to
   src/input/readers/Raw.cc and src/input/readers/SQLite.cc. Please
   upstream that as you see fit.

 - The patch you've added should probably be renamed as it lacks "src-"
   in its name.

 - You didn't manage to reproduce the build failures locally because
   it's an issue caused by libc++, not clang. If you build with clang
   but still use libstdc++, everything works as expected.

I'm going to commit a patch with the changes I've mentioned above.
Comment 2 dfilter service freebsd_committer freebsd_triage 2014-01-06 19:32:01 UTC
Author: rakuco
Date: Mon Jan  6 19:31:52 2014
New Revision: 338927
URL: http://svnweb.freebsd.org/changeset/ports/338927

Log:
  - Fix the build with libc++.
  - Convert to new-new OPTIONS framework.
  - Use new *_DEPENDS formats.
  - Fix LICENSE.
  
  PR:		ports/185455
  Submitted by:	Craig Leres <leres@ee.lbl.gov> (maintainer)

Added:
  head/security/bro/files/patch-src-input-readers-Raw.cc   (contents, props changed)
  head/security/bro/files/patch-src-input-readers-SQLite.cc   (contents, props changed)
  head/security/bro/files/patch-src-logging-writers-SQLite.cc   (contents, props changed)
Modified:
  head/security/bro/Makefile

Modified: head/security/bro/Makefile
==============================================================================
--- head/security/bro/Makefile	Mon Jan  6 19:31:43 2014	(r338926)
+++ head/security/bro/Makefile	Mon Jan  6 19:31:52 2014	(r338927)
@@ -3,16 +3,17 @@
 
 PORTNAME=	bro
 PORTVERSION=	2.2
+PORTREVISION=	1
 CATEGORIES=	security
 MASTER_SITES=	http://www.bro.org/downloads/release/
 
 MAINTAINER=	leres@ee.lbl.gov
 COMMENT=	System for detecting network intruders in real-time
 
-LICENSE=	BSD
+LICENSE=	BSD3CLAUSE
 
-BUILD_DEPENDS=	bison:${PORTSDIR}/devel/bison \
-		swig:${PORTSDIR}/devel/swig13
+BUILD_DEPENDS=	${LOCALBASE}/bin/bison:${PORTSDIR}/devel/bison \
+		${LOCALBASE}/bin/swig:${PORTSDIR}/devel/swig13
 LIB_DEPENDS=	libGeoIP.so:${PORTSDIR}/net/GeoIP
 
 USES=		cmake:outsource perl5
@@ -24,7 +25,10 @@ NO_MTREE=	yes
 .if defined(BRO_PREFIX)
 PREFIX=${BRO_PREFIX}
 PLIST_SUB+=	CLEANUP_PREFIX=""
-NEED_ROOT=	yes
+.if ! defined(WITH_PKGNG) && ! exists(${BRO_PREFIX})
+NEED_ROOT=      yes
+.endif
+NO_MTREE=	yes
 .else
 PLIST_SUB+=	CLEANUP_PREFIX="@comment "
 .endif
@@ -74,35 +78,35 @@ IGNORE=		the BROCTL option requires BROC
 .if empty(PORT_OPTIONS:MIPSUMDUMP)
 IGNORE=		the BROCTL option requires IPSUMDUMP
 .endif
-BUILD_DEPENDS+=		bash:${PORTSDIR}/shells/bash
-RUN_DEPENDS+=		bash:${PORTSDIR}/shells/bash
-PLIST_SUB+=		BROCTL=""
-USE_LDCONFIG=		yes
-CMAKE_ARGS+=		-D INSTALL_BROCTL:BOOL=true
+BUILD_DEPENDS+=	${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash
+RUN_DEPENDS+=	${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash
+PLIST_SUB+=	BROCTL=""
+USE_LDCONFIG=	yes
+CMAKE_ARGS+=	-D INSTALL_BROCTL:BOOL=true
 .else
-CMAKE_ARGS+=		-D INSTALL_BROCTL:BOOL=false
-PLIST_SUB+=		BROCTL="@comment "
+CMAKE_ARGS+=	-D INSTALL_BROCTL:BOOL=false
+PLIST_SUB+=	BROCTL="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MDEBUG}
-CMAKE_ARGS+=		-D ENABLE_DEBUG:BOOL=true
+CMAKE_ARGS+=	-D ENABLE_DEBUG:BOOL=true
 .else
-CMAKE_ARGS+=		-D ENABLE_DEBUG:BOOL=false
+CMAKE_ARGS+=	-D ENABLE_DEBUG:BOOL=false
 .endif
 
 .if ${PORT_OPTIONS:MLBL_HF}
-RUN_DEPENDS+=	hf:${PORTSDIR}/sysutils/lbl-hf
+RUN_DEPENDS+=	${LOCALBASE}/bin/hf:${PORTSDIR}/sysutils/lbl-hf
 .endif
 
 .if ${PORT_OPTIONS:MLBL_CF}
-RUN_DEPENDS+=	cf:${PORTSDIR}/sysutils/lbl-cf
+RUN_DEPENDS+=	${LOCALBASE}/bin/cf:${PORTSDIR}/sysutils/lbl-cf
 .endif
 
 .if ${PORT_OPTIONS:MPERFTOOLS}
-CMAKE_ARGS+=		-D ENABLE_PERFTOOLS:BOOL=true
-RUN_DEPENDS+=	pprof:${PORTSDIR}/devel/google-perftools
+CMAKE_ARGS+=	-D ENABLE_PERFTOOLS:BOOL=true
+RUN_DEPENDS+=	${LOCALBASE}/bin/pprof:${PORTSDIR}/devel/google-perftools
 .else
-CMAKE_ARGS+=		-D ENABLE_PERFTOOLS:BOOL=false
+CMAKE_ARGS+=	-D ENABLE_PERFTOOLS:BOOL=false
 .endif
 
 .if ${PORT_OPTIONS:MIPSUMDUMP}
@@ -111,8 +115,9 @@ RUN_DEPENDS+=	ipsumdump:${PORTSDIR}/net/
 .endif
 
 .if ${PORT_OPTIONS:MBROCTL}
-post-stage::
-.if defined(BRO_PREFIX)
+post-install:
+.if defined(BRO_PREFIX) && !defined(WITH_PKGNG) && !exists(${BRO_PREFIX})
+	# pkg_install needs PREFIX in order to make a package from STAGEDIR/PREFIX
 	@${MKDIR} ${PREFIX}
 .endif
 	@${MKDIR} ${STAGEDIR}${PREFIX}/spool/installed-scripts-do-not-touch/auto
@@ -121,7 +126,7 @@ post-stage::
 	@${INSTALL_SCRIPT} ${INSTALL_WRKSRC}/aux/broctl/etc/${F} ${STAGEDIR}${PREFIX}/etc/${F}.example
 .endfor
 .for F in networks.cfg node.cfg
-	@${INSTALL_SCRIPT} ${WRKSRC}/aux/broctl/etc/${F} ${STAGEDIR}${PREFIX}/etc/${F}.example
+	@${MV} ${WRKSRC}/aux/broctl/etc/${F} ${STAGEDIR}${PREFIX}/etc/${F}.example
 .endfor
 .endif
 

Added: head/security/bro/files/patch-src-input-readers-Raw.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/bro/files/patch-src-input-readers-Raw.cc	Mon Jan  6 19:31:52 2014	(r338927)
@@ -0,0 +1,11 @@
+--- src/input/readers/Raw.cc.orig	2014-01-06 21:04:06.000000000 +0200
++++ src/input/readers/Raw.cc	2014-01-06 21:04:13.000000000 +0200
+@@ -352,7 +352,7 @@
+ 		fname = source.substr(0, fname.length() - 1);
+ 		}
+ 
+-	map<const char*, const char*>::const_iterator it = info.config.find("stdin"); // data that is sent to the child process
++	ReaderInfo::config_map::const_iterator it = info.config.find("stdin"); // data that is sent to the child process
+ 	if ( it != info.config.end() )
+ 		{
+ 		stdin_string = it->second;

Added: head/security/bro/files/patch-src-input-readers-SQLite.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/bro/files/patch-src-input-readers-SQLite.cc	Mon Jan  6 19:31:52 2014	(r338927)
@@ -0,0 +1,11 @@
+--- src/input/readers/SQLite.cc.orig	2014-01-06 21:07:44.000000000 +0200
++++ src/input/readers/SQLite.cc	2014-01-06 21:08:00.000000000 +0200
+@@ -85,7 +85,7 @@
+ 	fullpath.append(".sqlite");
+ 
+ 	string query;
+-	map<const char*, const char*>::const_iterator it = info.config.find("query");
++	ReaderInfo::config_map::const_iterator it = info.config.find("query");
+ 	if ( it == info.config.end() )
+ 		{
+ 		Error(Fmt("No query specified when setting up SQLite data source. Aborting.", info.source));

Added: head/security/bro/files/patch-src-logging-writers-SQLite.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/bro/files/patch-src-logging-writers-SQLite.cc	Mon Jan  6 19:31:52 2014	(r338927)
@@ -0,0 +1,11 @@
+--- src/logging/writers/SQLite.cc.orig	2014-01-06 21:08:34.000000000 +0200
++++ src/logging/writers/SQLite.cc	2014-01-06 21:08:45.000000000 +0200
+@@ -126,7 +126,7 @@
+ 	fullpath.append(".sqlite");
+ 	string tablename;
+ 
+-	map<const char*, const char*>::const_iterator it = info.config.find("tablename");
++	WriterInfo::config_map::const_iterator it = info.config.find("tablename");
+ 	if ( it == info.config.end() )
+ 		{
+ 		MsgThread::Info(Fmt("tablename configuration option not found. Defaulting to path %s", info.path));
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-01-06 19:32:39 UTC
State Changed
From-To: open->closed

Committed, with minor changes. Thanks!
Comment 4 Craig Leres freebsd_committer freebsd_triage 2014-01-06 23:11:05 UTC
On 01/06/14 11:27, Raphael Kubo da Costa wrote:

>  - The SQLite.cc change also needs to be applied to
>    src/input/readers/Raw.cc and src/input/readers/SQLite.cc. Please
>    upstream that as you see fit.

Done.

>  - You didn't manage to reproduce the build failures locally because
>    it's an issue caused by libc++, not clang. If you build with clang
>    but still use libstdc++, everything works as expected.
> 
> I'm going to commit a patch with the changes I've mentioned above.

Thanks for the help (and the explanations!)

		Craig
Comment 5 dfilter service freebsd_committer freebsd_triage 2014-01-08 13:15:44 UTC
Author: bapt
Date: Wed Jan  8 13:15:36 2014
New Revision: 339118
URL: http://svnweb.freebsd.org/changeset/ports/339118

Log:
  MFH: r338927
  
  - Fix the build with libc++.
  - Convert to new-new OPTIONS framework.
  - Use new *_DEPENDS formats.
  - Fix LICENSE.
  
  PR:		ports/185455
  Submitted by:	Craig Leres <leres@ee.lbl.gov> (maintainer)

Added:
  branches/2014Q1/security/bro/files/patch-src-input-readers-Raw.cc
     - copied unchanged from r338927, head/security/bro/files/patch-src-input-readers-Raw.cc
  branches/2014Q1/security/bro/files/patch-src-input-readers-SQLite.cc
     - copied unchanged from r338927, head/security/bro/files/patch-src-input-readers-SQLite.cc
  branches/2014Q1/security/bro/files/patch-src-logging-writers-SQLite.cc
     - copied unchanged from r338927, head/security/bro/files/patch-src-logging-writers-SQLite.cc
Modified:
  branches/2014Q1/security/bro/Makefile
Directory Properties:
  branches/2014Q1/   (props changed)

Modified: branches/2014Q1/security/bro/Makefile
==============================================================================
--- branches/2014Q1/security/bro/Makefile	Wed Jan  8 13:12:54 2014	(r339117)
+++ branches/2014Q1/security/bro/Makefile	Wed Jan  8 13:15:36 2014	(r339118)
@@ -3,16 +3,17 @@
 
 PORTNAME=	bro
 PORTVERSION=	2.2
+PORTREVISION=	1
 CATEGORIES=	security
 MASTER_SITES=	http://www.bro.org/downloads/release/
 
 MAINTAINER=	leres@ee.lbl.gov
 COMMENT=	System for detecting network intruders in real-time
 
-LICENSE=	BSD
+LICENSE=	BSD3CLAUSE
 
-BUILD_DEPENDS=	bison:${PORTSDIR}/devel/bison \
-		swig:${PORTSDIR}/devel/swig13
+BUILD_DEPENDS=	${LOCALBASE}/bin/bison:${PORTSDIR}/devel/bison \
+		${LOCALBASE}/bin/swig:${PORTSDIR}/devel/swig13
 LIB_DEPENDS=	libGeoIP.so:${PORTSDIR}/net/GeoIP
 
 USES=		cmake:outsource perl5
@@ -24,7 +25,10 @@ NO_MTREE=	yes
 .if defined(BRO_PREFIX)
 PREFIX=${BRO_PREFIX}
 PLIST_SUB+=	CLEANUP_PREFIX=""
-NEED_ROOT=	yes
+.if ! defined(WITH_PKGNG) && ! exists(${BRO_PREFIX})
+NEED_ROOT=      yes
+.endif
+NO_MTREE=	yes
 .else
 PLIST_SUB+=	CLEANUP_PREFIX="@comment "
 .endif
@@ -74,35 +78,35 @@ IGNORE=		the BROCTL option requires BROC
 .if empty(PORT_OPTIONS:MIPSUMDUMP)
 IGNORE=		the BROCTL option requires IPSUMDUMP
 .endif
-BUILD_DEPENDS+=		bash:${PORTSDIR}/shells/bash
-RUN_DEPENDS+=		bash:${PORTSDIR}/shells/bash
-PLIST_SUB+=		BROCTL=""
-USE_LDCONFIG=		yes
-CMAKE_ARGS+=		-D INSTALL_BROCTL:BOOL=true
+BUILD_DEPENDS+=	${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash
+RUN_DEPENDS+=	${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash
+PLIST_SUB+=	BROCTL=""
+USE_LDCONFIG=	yes
+CMAKE_ARGS+=	-D INSTALL_BROCTL:BOOL=true
 .else
-CMAKE_ARGS+=		-D INSTALL_BROCTL:BOOL=false
-PLIST_SUB+=		BROCTL="@comment "
+CMAKE_ARGS+=	-D INSTALL_BROCTL:BOOL=false
+PLIST_SUB+=	BROCTL="@comment "
 .endif
 
 .if ${PORT_OPTIONS:MDEBUG}
-CMAKE_ARGS+=		-D ENABLE_DEBUG:BOOL=true
+CMAKE_ARGS+=	-D ENABLE_DEBUG:BOOL=true
 .else
-CMAKE_ARGS+=		-D ENABLE_DEBUG:BOOL=false
+CMAKE_ARGS+=	-D ENABLE_DEBUG:BOOL=false
 .endif
 
 .if ${PORT_OPTIONS:MLBL_HF}
-RUN_DEPENDS+=	hf:${PORTSDIR}/sysutils/lbl-hf
+RUN_DEPENDS+=	${LOCALBASE}/bin/hf:${PORTSDIR}/sysutils/lbl-hf
 .endif
 
 .if ${PORT_OPTIONS:MLBL_CF}
-RUN_DEPENDS+=	cf:${PORTSDIR}/sysutils/lbl-cf
+RUN_DEPENDS+=	${LOCALBASE}/bin/cf:${PORTSDIR}/sysutils/lbl-cf
 .endif
 
 .if ${PORT_OPTIONS:MPERFTOOLS}
-CMAKE_ARGS+=		-D ENABLE_PERFTOOLS:BOOL=true
-RUN_DEPENDS+=	pprof:${PORTSDIR}/devel/google-perftools
+CMAKE_ARGS+=	-D ENABLE_PERFTOOLS:BOOL=true
+RUN_DEPENDS+=	${LOCALBASE}/bin/pprof:${PORTSDIR}/devel/google-perftools
 .else
-CMAKE_ARGS+=		-D ENABLE_PERFTOOLS:BOOL=false
+CMAKE_ARGS+=	-D ENABLE_PERFTOOLS:BOOL=false
 .endif
 
 .if ${PORT_OPTIONS:MIPSUMDUMP}
@@ -111,8 +115,9 @@ RUN_DEPENDS+=	ipsumdump:${PORTSDIR}/net/
 .endif
 
 .if ${PORT_OPTIONS:MBROCTL}
-post-stage::
-.if defined(BRO_PREFIX)
+post-install:
+.if defined(BRO_PREFIX) && !defined(WITH_PKGNG) && !exists(${BRO_PREFIX})
+	# pkg_install needs PREFIX in order to make a package from STAGEDIR/PREFIX
 	@${MKDIR} ${PREFIX}
 .endif
 	@${MKDIR} ${STAGEDIR}${PREFIX}/spool/installed-scripts-do-not-touch/auto
@@ -121,7 +126,7 @@ post-stage::
 	@${INSTALL_SCRIPT} ${INSTALL_WRKSRC}/aux/broctl/etc/${F} ${STAGEDIR}${PREFIX}/etc/${F}.example
 .endfor
 .for F in networks.cfg node.cfg
-	@${INSTALL_SCRIPT} ${WRKSRC}/aux/broctl/etc/${F} ${STAGEDIR}${PREFIX}/etc/${F}.example
+	@${MV} ${WRKSRC}/aux/broctl/etc/${F} ${STAGEDIR}${PREFIX}/etc/${F}.example
 .endfor
 .endif
 

Copied: branches/2014Q1/security/bro/files/patch-src-input-readers-Raw.cc (from r338927, head/security/bro/files/patch-src-input-readers-Raw.cc)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2014Q1/security/bro/files/patch-src-input-readers-Raw.cc	Wed Jan  8 13:15:36 2014	(r339118, copy of r338927, head/security/bro/files/patch-src-input-readers-Raw.cc)
@@ -0,0 +1,11 @@
+--- src/input/readers/Raw.cc.orig	2014-01-06 21:04:06.000000000 +0200
++++ src/input/readers/Raw.cc	2014-01-06 21:04:13.000000000 +0200
+@@ -352,7 +352,7 @@
+ 		fname = source.substr(0, fname.length() - 1);
+ 		}
+ 
+-	map<const char*, const char*>::const_iterator it = info.config.find("stdin"); // data that is sent to the child process
++	ReaderInfo::config_map::const_iterator it = info.config.find("stdin"); // data that is sent to the child process
+ 	if ( it != info.config.end() )
+ 		{
+ 		stdin_string = it->second;

Copied: branches/2014Q1/security/bro/files/patch-src-input-readers-SQLite.cc (from r338927, head/security/bro/files/patch-src-input-readers-SQLite.cc)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2014Q1/security/bro/files/patch-src-input-readers-SQLite.cc	Wed Jan  8 13:15:36 2014	(r339118, copy of r338927, head/security/bro/files/patch-src-input-readers-SQLite.cc)
@@ -0,0 +1,11 @@
+--- src/input/readers/SQLite.cc.orig	2014-01-06 21:07:44.000000000 +0200
++++ src/input/readers/SQLite.cc	2014-01-06 21:08:00.000000000 +0200
+@@ -85,7 +85,7 @@
+ 	fullpath.append(".sqlite");
+ 
+ 	string query;
+-	map<const char*, const char*>::const_iterator it = info.config.find("query");
++	ReaderInfo::config_map::const_iterator it = info.config.find("query");
+ 	if ( it == info.config.end() )
+ 		{
+ 		Error(Fmt("No query specified when setting up SQLite data source. Aborting.", info.source));

Copied: branches/2014Q1/security/bro/files/patch-src-logging-writers-SQLite.cc (from r338927, head/security/bro/files/patch-src-logging-writers-SQLite.cc)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2014Q1/security/bro/files/patch-src-logging-writers-SQLite.cc	Wed Jan  8 13:15:36 2014	(r339118, copy of r338927, head/security/bro/files/patch-src-logging-writers-SQLite.cc)
@@ -0,0 +1,11 @@
+--- src/logging/writers/SQLite.cc.orig	2014-01-06 21:08:34.000000000 +0200
++++ src/logging/writers/SQLite.cc	2014-01-06 21:08:45.000000000 +0200
+@@ -126,7 +126,7 @@
+ 	fullpath.append(".sqlite");
+ 	string tablename;
+ 
+-	map<const char*, const char*>::const_iterator it = info.config.find("tablename");
++	WriterInfo::config_map::const_iterator it = info.config.find("tablename");
+ 	if ( it == info.config.end() )
+ 		{
+ 		MsgThread::Info(Fmt("tablename configuration option not found. Defaulting to path %s", info.path));
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"