From eikemeier@fillmore-labs.com  Mon Nov  3 08:30:40 2003
Return-Path: <eikemeier@fillmore-labs.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 57D8216A4CF; Mon,  3 Nov 2003 08:30:40 -0800 (PST)
Received: from mx2.fillmore-labs.com (lima.fillmore-labs.com [62.138.193.83])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 1A95A43FE1; Mon,  3 Nov 2003 08:30:39 -0800 (PST)
	(envelope-from eikemeier@fillmore-labs.com)
Received: from atlantis.development.fillmore-labs.com ([192.168.130.243] helo=fillmore-labs.com)
	by mx2.fillmore-labs.com with asmtp (TLSv1:AES256-SHA:256)
	(Exim 4.24; FreeBSD 4.9)
	id 1AGhbC-0007B7-1u; Mon, 03 Nov 2003 17:30:38 +0100
Message-Id: <3FA682B0.6060207@fillmore-labs.com>
Date: Mon, 03 Nov 2003 17:30:40 +0100
From: Oliver Eikemeier <eikemeier@fillmore-labs.com>
To: FreeBSD-gnats-submit@FreeBSD.org,
	FreeBSD Ports Management Team <portmgr@freebsd.org>
Subject: [PATCH] bsd.port.mk: include dynamically generated scripts/message
 into packages

>Number:         58885
>Category:       ports
>Synopsis:       [PATCH] bsd.port.mk: include dynamically generated scripts/message into packages
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 03 08:40:19 PST 2003
>Closed-Date:    Fri Nov 07 00:58:30 PST 2003
>Last-Modified:  Sun Mar 17 02:07:58 UTC 2013
>Originator:     Oliver Eikemeier
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
Fillmore Labs - http://www.fillmore-labs.com
>Environment:
System: FreeBSD nuuk.fillmore-labs.com 5.1-CURRENT

>Description:

If a port creates pkg-install, pkg-deinstall, pkg-req or pkg-message dynamically, i.e.:

  PKGMESSAGE=${WRKDIR}/pkg-message
  	${SED} -e "s,%%PREFIX%%,${PREFIX},g" ${PKGDIR}/pkg-message >${PKGMESSAGE}

`make package' does not include these files, because bsd.port.mk tests for their
existence before the build step is performed.

>How-To-Repeat:

cd /usr/ports/security/cyrus-sasl2; make package
pkg_info -i 'cyrus-sasl-2*'
pkg_info -i /usr/ports/packages/All/cyrus-sasl-2.*

>Fix:

A workaround is to use

  make install; make package

because for the second call the dynamically generated files exist.

Bento does not do this. The following patch is ugly, but may help:

--- bsd.port.mk.patch begins here ---
--- bsd.port.mk	3 Sep 2003 19:50:24 -0000	1.468
+++ bsd.port.mk	3 Nov 2003 16:13:06 -0000
@@ -1803,19 +1803,11 @@
 DISABLE_CONFLICTS=     YES
 .endif
 .if !defined(PKG_ARGS)
-PKG_ARGS=		-v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`${MAKE} package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | sort -u`" ${EXTRA_PKG_ARGS}
-.if exists(${PKGINSTALL})
-PKG_ARGS+=		-i ${PKGINSTALL}
-.endif
-.if exists(${PKGDEINSTALL})
-PKG_ARGS+=		-k ${PKGDEINSTALL}
-.endif
-.if exists(${PKGREQ})
-PKG_ARGS+=		-r ${PKGREQ}
-.endif
-.if exists(${PKGMESSAGE})
-PKG_ARGS+=		-D ${PKGMESSAGE}
-.endif
+PKG_ARGS=		-v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${MAKE} package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | sort -u`" ${EXTRA_PKG_ARGS}
+PKG_ARGS+=		`[ -f "${PKGINSTALL}" ] && ${ECHO_CMD} -n -i "${PKGINSTALL}"`
+PKG_ARGS+=		`[ -f "${PKGDEINSTALL}" ] && ${ECHO_CMD} -n -k "${PKGDEINSTALL}"`
+PKG_ARGS+=		`[ -f "${PKGREQ}" ] && ${ECHO_CMD} -n -r "${PKGREQ}"`
+PKG_ARGS+=		`[ -f "${PKGMESSAGE}" ] && ${ECHO_CMD} -n -D "${PKGMESSAGE}"`
 .if !defined(NO_MTREE)
 PKG_ARGS+=		-m ${MTREE_FILE}
 .endif
--- bsd.port.mk.patch ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr  
Responsible-Changed-By: krion 
Responsible-Changed-When: Mon Nov 3 11:18:54 PST 2003 
Responsible-Changed-Why:  
portmgr territory 

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

From: Oliver Eikemeier <eikemeier@fillmore-labs.com>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/58885: [PATCH] bsd.port.mk: include dynamically generated
 scripts/message into packages
Date: Tue, 04 Nov 2003 17:34:21 +0100

 May fix PR 57870
 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21885 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=51588 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=55325 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57778 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=55674 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Fixed with the comment made in the follow-up.  Thanks for reporting. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56096 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56355 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56533 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57272 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed with the additional check of INSTALL_AS_USER.  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57378 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57403 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57438 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57488 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57928 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58232 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58317 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Final version committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=32604 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57529 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56582 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=48377 
State-Changed-From-To: analyzed->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56960 
State-Changed-From-To: open->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Nov 7 00:52:50 PST 2003 
State-Changed-Why:  
The patch we discussed was committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58885 
>Unformatted:
