Bug 184381 - [PATCH] security/bro: Fix pkg-fallout issue
Summary: [PATCH] security/bro: Fix pkg-fallout issue
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Antoine Brodin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-30 01:30 UTC by Craig Leres
Modified: 2013-12-01 07:38 UTC (History)
1 user (show)

See Also:


Attachments
patch.txt (455 bytes, text/plain)
2013-11-30 01:30 UTC, Craig Leres
no flags Details
patch.txt (645 bytes, text/plain; charset=us-ascii)
2013-11-30 01:40 UTC, Craig Leres
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Leres freebsd_committer freebsd_triage 2013-11-30 01:30:00 UTC
	Apparently pkgng processes pkg-plist differently than the
	older pkg_* tools. It looks like directories that are cleaned
	up with @dirrmtry statements must exist in the stage tree
	prior to "make package" but in this case it's the @exec at
	the end of this ports pkg-plist which runs "broctl install"
	that actually creates directories the at package install
	time. But that never happens when just building the package.

Fix: Since the @dirrmtry lines in the pkg-plist are needed, the
	attached patch creates them in the stage directory tree.

	I'm not using pkgng yet so I have no way to test this. I
	am able to test that this change does not break the port
	for 9.1-RELEASE or 8.2-RELEASE.
How-To-Repeat: 	PR report:

	    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/184194

	pkg-fallout reports:

	    [REL - 91amd64-default][security/bro] Failed for bro-2.2 in package
	    [REL - 91i386-default][security/bro] Failed for bro-2.2 in package
Comment 1 Craig Leres freebsd_committer freebsd_triage 2013-11-30 01:40:39 UTC
The patch I attached to this PR does not address pkg-fallout for FreeBSD
8.3-RELEASE:

    [REL - 83amd64-default][security/bro] Failed for bro-2.2 in configure
    [REL - 83i386-default][security/bro] Failed for bro-2.2 in configure

The basic problem is that Bro's binpac requires libmagic 5.04 or newer
but FreeBSD 8 shipped with 5.03.

The Makefile already has:

    .include <bsd.port.options.mk>

    .if ${PORT_OPTIONS:MBROCCOLI}
    LIB_DEPENDS+=   broccoli:${PORTSDIR}/security/broccoli
    .endif

Which should be sufficient based on my read of the porters handbook:


http://www.freebsd.org/doc/en/books/porters-handbook/makefile-depend.html

    5.8.1. LIB_DEPENDS

	This variable specifies the shared libraries this port
	depends on. It is a list of lib:dir tuples where lib is the
	name of the shared library, dir is the directory in which
	to find it in case it is not available. For example,

	    LIB_DEPENDS=   libjpeg.so:${PORTSDIR}/graphics/jpeg

	will check for a shared jpeg library with any version, and
	descend into the graphics/jpeg subdirectory of your ports
	tree to build and install it if it is not found.

	*The dependency is checked twice, once from within the build
	target and then from within the install target.* Also, the
	name of the dependency is put into the package so that
	pkg_add(1) will automatically install it if it is not on
	the user's system.

However it doesn't appear to actually work that way so the revised patch
(attached) adds a BUILD_DEPENDS for sysutils/file. This was tested on
8.2-RELEASE.

		Craig
Comment 2 Antoine Brodin freebsd_committer freebsd_triage 2013-11-30 09:47:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->antoine

Take
Comment 3 dfilter service freebsd_committer freebsd_triage 2013-12-01 07:29:25 UTC
Author: antoine
Date: Sun Dec  1 07:29:17 2013
New Revision: 335367
URL: http://svnweb.freebsd.org/changeset/ports/335367

Log:
  - Fix packaging with pkgng: create empty dirs to be packed in STAGEDIR
  - Fix build on FreeBSD 8: depend on libmagic ABI version from ports
  - While here, use new LIB_DEPENDS syntax
  
  PR:		ports/184194
  PR:		ports/184381
  Submitted by:	Craig Leres (maintainer)
  Reported by:	Mark Martinec and pkg-fallout

Modified:
  head/security/bro/Makefile

Modified: head/security/bro/Makefile
==============================================================================
--- head/security/bro/Makefile	Sun Dec  1 07:15:49 2013	(r335366)
+++ head/security/bro/Makefile	Sun Dec  1 07:29:17 2013	(r335367)
@@ -13,7 +13,7 @@ LICENSE=	BSD
 
 BUILD_DEPENDS=	bison:${PORTSDIR}/devel/bison \
 		swig:${PORTSDIR}/devel/swig13
-LIB_DEPENDS=	GeoIP:${PORTSDIR}/net/GeoIP
+LIB_DEPENDS=	libGeoIP.so:${PORTSDIR}/net/GeoIP
 
 USES=		cmake:outsource perl5
 USE_PYTHON=	yes
@@ -56,13 +56,13 @@ OPTIONS_EXCLUDE=NLS DOCS
 
 # Bro 2.2 requires libmagic >= 5.04
 .if ${OSVERSION} < 901000
-LIB_DEPENDS+=	magic:${PORTSDIR}/sysutils/file
+LIB_DEPENDS+=	libmagic.so.1:${PORTSDIR}/sysutils/file
 .endif
 
 .include <bsd.port.options.mk>
 
 .if ${PORT_OPTIONS:MBROCCOLI}
-LIB_DEPENDS+=	broccoli:${PORTSDIR}/security/broccoli
+LIB_DEPENDS+=	libbroccoli.so:${PORTSDIR}/security/broccoli
 .endif
 
 .if ${PORT_OPTIONS:MBROCTL}
@@ -111,8 +111,10 @@ RUN_DEPENDS+=	ipsumdump:${PORTSDIR}/net/
 .if ${PORT_OPTIONS:MBROCTL}
 post-stage::
 .if defined(BRO_PREFIX)
-	@${MKDIR} ${PREFIX}
+	@${MKDIR} ${STAGEDIR}${PREFIX}
 .endif
+	@${MKDIR} ${STAGEDIR}${PREFIX}/spool/installed-scripts-do-not-touch/auto
+	@${MKDIR} ${STAGEDIR}${PREFIX}/spool/installed-scripts-do-not-touch/site
 .for F in broctl.cfg
 	@${INSTALL_SCRIPT} ${INSTALL_WRKSRC}/aux/broctl/etc/${F} ${STAGEDIR}${PREFIX}/etc/${F}.example
 .endfor
_______________________________________________
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 4 Antoine Brodin freebsd_committer freebsd_triage 2013-12-01 07:37:41 UTC
State Changed
From-To: open->closed

Port fixed, thanks!