From nobody@FreeBSD.org  Sat May 12 15:20:07 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id C210A1065670
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 12 May 2012 15:20:07 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 94E938FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 12 May 2012 15:20:07 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q4CFK72L048788
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 12 May 2012 15:20:07 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q4CFK7e5048787;
	Sat, 12 May 2012 15:20:07 GMT
	(envelope-from nobody)
Message-Id: <201205121520.q4CFK7e5048787@red.freebsd.org>
Date: Sat, 12 May 2012 15:20:07 GMT
From: Kris Moore <kmoore@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ports: Mk/bsd.pbi.mk inclusion
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         167825
>Category:       ports
>Synopsis:       ports: Mk/bsd.pbi.mk inclusion
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    linimon
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 12 15:30:09 UTC 2012
>Closed-Date:    Wed Sep 05 04:32:58 UTC 2012
>Last-Modified:  Wed Sep  5 04:40:05 UTC 2012
>Originator:     Kris Moore
>Release:        9.0-Release
>Organization:
iXsystems
>Environment:
>Description:
The included patch adds a "make pbi" and "make clean-pbi" target to the ports build system. Requesting portmgr to review and commit if OK. 
>How-To-Repeat:

>Fix:

Add bsd.pbi.mk to /usr/ports/Mk and add the following to bsd.port.mk:

.include "${PORTSDIR}/Mk/bsd.pbi.mk"

Patch attached with submission follows:

# $Id$
#
# Creates a PBI file from a port with just 'make pbi'
#
#

_PBIMAKEPORT=	pbi_makeport
_PBICREATE=	pbi_create
_PBIDIR=	pbi
_PBICONF=	${_PBIDIR}/pbi.conf
_PBIBUILDDIR=	/usr/local/pbi/${PORTNAME}-${ARCH}
PBIPWD=		`pwd`
_PBIPORT=		`pwd | cut -d '/' -f4-`

.PHONY: check-pbimanager pbi pbi-makeport pbi-generate pbi-create \
	clean-pbi clean-pbibuild

_PBIMANAGER_PKG!=which pbi_info || ${TRUE}

check-pbimanager:
.if empty(_PBIMANAGER_PKG)
	@(cd ${PORTSDIR}/ports-mgmt/pbi-manager && ${MAKE} install clean)
.endif

pbi: pbi-generate

pbi-generate: check-pbimanager
	@if [ ! -d ${PWD}/pbi ]; then					\
		${ECHO_MSG} "===> Generating meta-data for ${PORTNAME}";	\
		${MKDIR} ${_PBIDIR};					\
		${MKDIR} ${_PBIDIR}/resources ${_PBIDIR}/scripts 	\
			${_PBIDIR}/xdg-desktop ${_PBIDIR}/xdg-menu 	\
			${_PBIDIR}/xgd-mime;				\
		${ECHO_CMD} "PBI_PROGNAME=\"${PORTNAME}\"" > ${_PBICONF};\
		${ECHO_CMD} "PBI_MAKEPORT=\"${_PBIPORT}\"" >> ${_PBICONF};\
		PROGWEB=`cat ${DESCR} | awk '/^WWW:/ { print $$2; }'`;	\
		${ECHO_CMD} "PBI_PROGWEB=\"$${PROGWEB}\"" >> ${_PBICONF};\
		${ECHO_CMD} "PBI_PROGAUTHOR=\"The ${PORTNAME} team\""	\
			 >> ${_PBICONF};				\
		${ECHO_CMD} "PBI_UPDATEURL=\"http://update.pbidir.com\""\
			 >> ${_PBICONF};				\
		${ECHO_CMD} "export PBI_PROGNAME PBI_MAKEPORT "		\
			"PBI_PROGWEB " 					\
			"PBI_PROGAUTHOR PBI_UPDATEURL "	\
			"PBI_MKPORTBEFORE PBI_MKPORTAFTER PBI_MAKEOPTS"	\
			 >> ${_PBICONF};				\
	fi
	@${ECHO_MSG} "==> Generating PBI file"
	@${_PBIMAKEPORT} -c ${PBIPWD}/pbi -o ${PBIPWD} ${_PBIPORT}

clean-pbi:
	@${ECHO_MSG} "===> Cleaning PBI for ${PORTNAME}"
	@${RM} -rf ${_PBIDIR}


>Release-Note:
>Audit-Trail:

From: Chris Rees <crees@FreeBSD.org>
To: Kris Moore <kmoore@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: ports/167825: ports: Mk/bsd.pbi.mk inclusion
Date: Sat, 12 May 2012 16:32:43 +0100

 Can we make this conditional on a WITH_PBI_TARGETS or something?
 
 Chris
Responsible-Changed-From-To: freebsd-ports-bugs->linimon 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat May 12 16:55:17 UTC 2012 
Responsible-Changed-Why:  
take. 

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

From: Kris Moore <kris@pcbsd.org>
To: Chris Rees <crees@FreeBSD.org>
Cc: Kris Moore <kmoore@freebsd.org>, bug-followup@freebsd.org
Subject: Re: ports/167825: ports: Mk/bsd.pbi.mk inclusion
Date: Sun, 13 May 2012 08:18:42 -0400

 On 05/12/2012 11:32, Chris Rees wrote:
 > Can we make this conditional on a WITH_PBI_TARGETS or something?
 >
 > Chris
 
 I'm not sure that's quite the best way to do this. All this adds is a
 "make pbi" target, which wont install the applications to the system,
 it'll just do the chroot build, create a .pbi file, and cleanup.
 Otherwise it won't touch anything any other builds do.
 
 -- 
 Kris Moore
 PC-BSD Software
 iXsystems
 

From: Chris Rees <crees@FreeBSD.org>
To: Kris Moore <kris@pcbsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: ports/167825: ports: Mk/bsd.pbi.mk inclusion
Date: Sun, 13 May 2012 13:37:27 +0100

 Sure, but it introduces at least one != into every call of make in the tree.
 
 Also, from your point of view you're then free to mess with that file
 without portmgr approval.
 
 Chris
 

From: Kris Moore <kris@pcbsd.org>
To: Chris Rees <crees@FreeBSD.org>
Cc: bug-followup@freebsd.org
Subject: Re: ports/167825: ports: Mk/bsd.pbi.mk inclusion
Date: Mon, 14 May 2012 12:09:28 -0400

 This is a multi-part message in MIME format.
 --------------040309010409060505070708
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 On 05/13/2012 08:39, Chris Rees wrote:
 >
 > Also, from your point of view you're then free to mess with that file
 > without portmgr approval.
 >
 
 Attached is an updated version, which gets rid of the != and cleans up
 the mk file a bit. It should now only be doing anything if the target
 "pbi" or "clean-pbi" is explicitly called.
 
 -- 
 Kris Moore
 PC-BSD Software
 iXsystems
 
 
 --------------040309010409060505070708
 Content-Type: text/plain;
  name="bsd.pbi.mk"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="bsd.pbi.mk"
 
 # $Id$
 #
 # Creates a PBI file from a port with just 'make pbi'
 #
 #
 
 _PBIMAKEPORT=	pbi_makeport
 _PBICREATE=	pbi_create
 _PBIDIR=	pbi
 _PBICONF=	${_PBIDIR}/pbi.conf
 
 .PHONY: check-pbimanager pbi pbi-makeport pbi-generate pbi-create \
 	clean-pbi clean-pbibuild
 
 
 check-pbimanager:
 
 	@set -- chk=""; \
 	if [ -z "`which pbi_info`" ] ; then \
 		cd ${PORTSDIR}/ports-mgmt/pbi-manager && make install clean; \
 	fi
 
 pbi: pbi-generate
 
 pbi-generate: check-pbimanager
 	@_PBIPORT=`pwd | cut -d "/" -f4-`; \
 	if [ ! -d ${PWD}/pbi ] ; then					\
 		${ECHO_MSG} "===> Generating meta-data for ${PORTNAME}";	\
 		${MKDIR} ${_PBIDIR};					\
 		${MKDIR} ${_PBIDIR}/resources ${_PBIDIR}/scripts 	\
 			${_PBIDIR}/xdg-desktop ${_PBIDIR}/xdg-menu 	\
 			${_PBIDIR}/xgd-mime;				\
 		${ECHO_CMD} "PBI_PROGNAME=\"${PORTNAME}\"" > ${_PBICONF};\
 		${ECHO_CMD} "PBI_MAKEPORT=\"$${_PBIPORT}\"" >> ${_PBICONF};\
 		PROGWEB=`cat ${DESCR} | awk '/^WWW:/ { print $$2; }'`;	\
 		${ECHO_CMD} "PBI_PROGWEB=\"$${PROGWEB}\"" >> ${_PBICONF};\
 		${ECHO_CMD} "PBI_PROGAUTHOR=\"The ${PORTNAME} team\""	\
 			 >> ${_PBICONF};				\
 		${ECHO_CMD} "PBI_UPDATEURL=\"http://update.pbidir.com\""\
 			 >> ${_PBICONF};				\
 		${ECHO_CMD} "export PBI_PROGNAME PBI_MAKEPORT "		\
 			"PBI_PROGWEB " 					\
 			"PBI_PROGAUTHOR PBI_UPDATEURL "	\
 			"PBI_MKPORTBEFORE PBI_MKPORTAFTER PBI_MAKEOPTS"	\
 			 >> ${_PBICONF};				\
 	fi
 	@${ECHO_MSG} "==> Generating PBI file"
 	@${_PBIMAKEPORT} -c ${PWD}/pbi -o ${PWD} $${_PBIPORT}
 
 clean-pbi:
 	@${ECHO_MSG} "===> Cleaning PBI for ${PORTNAME}"
 	@${RM} -rf ${_PBIDIR}
 
 --------------040309010409060505070708--

From: Chris Rees <crees@FreeBSD.org>
To: Kris Moore <kris@pcbsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: ports/167825: ports: Mk/bsd.pbi.mk inclusion
Date: Sun, 24 Jun 2012 10:11:17 +0100

 Just to be clear, Kris's followup patch addresses my biggest concern,
 so I'm happy with it!
 
 I hadn't replied before because I didn't want to appear as though I
 were approving it; it's not my place for that.
 
 I'm sorry if it caused a delay.
 
 Thanks!
 
 Chris
State-Changed-From-To: open->analyzed 
State-Changed-By: linimon 
State-Changed-When: Sat Aug 4 04:05:06 UTC 2012 
State-Changed-Why:  
exp starting up. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=167825 
State-Changed-From-To: analyzed->closed 
State-Changed-By: linimon 
State-Changed-When: Wed Sep 5 04:31:17 UTC 2012 
State-Changed-Why:  
Committed, thanks.  Sorry it fell onto the back burner for so long. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/167825: commit references a PR
Date: Wed,  5 Sep 2012 04:32:40 +0000 (UTC)

 Author: linimon
 Date: Wed Sep  5 04:32:25 2012
 New Revision: 303683
 URL: http://svn.freebsd.org/changeset/ports/303683
 
 Log:
   Add a "make pbi" and "make clean-pbi" target to the ports build system.
   
   PR:		ports/167825
   Submitted by:	kmoore
 
 Added:
   head/Mk/bsd.pbi.mk   (contents, props changed)
 Modified:
   head/Mk/bsd.port.mk
 
 Added: head/Mk/bsd.pbi.mk
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/Mk/bsd.pbi.mk	Wed Sep  5 04:32:25 2012	(r303683)
 @@ -0,0 +1,51 @@
 +# $FreeBSD$
 +#
 +# Creates a PBI file from a port with just 'make pbi'
 +#
 +PBI_MAINTAINER=		kmoore@FreeBSD.org
 +
 +_PBIMAKEPORT=	pbi_makeport
 +_PBICREATE=	pbi_create
 +_PBIDIR=	pbi
 +_PBICONF=	${_PBIDIR}/pbi.conf
 +
 +.PHONY: check-pbimanager pbi pbi-makeport pbi-generate pbi-create \
 +	clean-pbi clean-pbibuild
 +
 +check-pbimanager:
 +
 +	@set -- chk=""; \
 +	if [ -z "`which pbi_info`" ] ; then \
 +		cd ${PORTSDIR}/ports-mgmt/pbi-manager && make install clean; \
 +	fi
 +
 +pbi: pbi-generate
 +
 +pbi-generate: check-pbimanager
 +	@_PBIPORT=`pwd | cut -d "/" -f4-`; \
 +	if [ ! -d ${PWD}/pbi ] ; then					\
 +		${ECHO_MSG} "===> Generating meta-data for ${PORTNAME}";	\
 +		${MKDIR} ${_PBIDIR};					\
 +		${MKDIR} ${_PBIDIR}/resources ${_PBIDIR}/scripts 	\
 +			${_PBIDIR}/xdg-desktop ${_PBIDIR}/xdg-menu 	\
 +			${_PBIDIR}/xgd-mime;				\
 +		${ECHO_CMD} "PBI_PROGNAME=\"${PORTNAME}\"" > ${_PBICONF};\
 +		${ECHO_CMD} "PBI_MAKEPORT=\"$${_PBIPORT}\"" >> ${_PBICONF};\
 +		PROGWEB=`cat ${DESCR} | awk '/^WWW:/ { print $$2; }'`;	\
 +		${ECHO_CMD} "PBI_PROGWEB=\"$${PROGWEB}\"" >> ${_PBICONF};\
 +		${ECHO_CMD} "PBI_PROGAUTHOR=\"The ${PORTNAME} team\""	\
 +			 >> ${_PBICONF};				\
 +		${ECHO_CMD} "PBI_UPDATEURL=\"http://update.pbidir.com\""\
 +			 >> ${_PBICONF};				\
 +		${ECHO_CMD} "export PBI_PROGNAME PBI_MAKEPORT "		\
 +			"PBI_PROGWEB " 					\
 +			"PBI_PROGAUTHOR PBI_UPDATEURL "	\
 +			"PBI_MKPORTBEFORE PBI_MKPORTAFTER PBI_MAKEOPTS"	\
 +			 >> ${_PBICONF};				\
 +	fi
 +	@${ECHO_MSG} "==> Generating PBI file"
 +	@${_PBIMAKEPORT} -c ${PWD}/pbi -o ${PWD} $${_PBIPORT}
 +
 +clean-pbi:
 +	@${ECHO_MSG} "===> Cleaning PBI for ${PORTNAME}"
 +	@${RM} -rf ${_PBIDIR}
 
 Modified: head/Mk/bsd.port.mk
 ==============================================================================
 --- head/Mk/bsd.port.mk	Wed Sep  5 02:30:38 2012	(r303682)
 +++ head/Mk/bsd.port.mk	Wed Sep  5 04:32:25 2012	(r303683)
 @@ -1496,6 +1496,8 @@ PKGCOMPATDIR?=		${LOCALBASE}/lib/compat/
  .include "${PORTSDIR}/Mk/bsd.ncurses.mk"
  .endif
  
 +.include "${PORTSDIR}/Mk/bsd.pbi.mk"
 +
  # You can force skipping these test by defining IGNORE_PATH_CHECKS
  .if !defined(IGNORE_PATH_CHECKS)
  .if (${PREFIX:C,(^.).*,\1,} != "/")
 _______________________________________________
 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"
 
>Unformatted:
