diff options
author | linimon <linimon@FreeBSD.org> | 2012-09-05 12:32:25 +0800 |
---|---|---|
committer | linimon <linimon@FreeBSD.org> | 2012-09-05 12:32:25 +0800 |
commit | ccca516cd984478bc6a78fbdef651226b6a67782 (patch) | |
tree | 9d6b78e53d5e1c358370eda281c7dc52cf53113c /Mk/bsd.pbi.mk | |
parent | 56b98c1a79dde876b94c19d76035b95a0e7136eb (diff) | |
download | freebsd-ports-gnome-ccca516cd984478bc6a78fbdef651226b6a67782.tar.gz freebsd-ports-gnome-ccca516cd984478bc6a78fbdef651226b6a67782.tar.zst freebsd-ports-gnome-ccca516cd984478bc6a78fbdef651226b6a67782.zip |
Add a "make pbi" and "make clean-pbi" target to the ports build system.
PR: ports/167825
Submitted by: kmoore
Diffstat (limited to 'Mk/bsd.pbi.mk')
-rw-r--r-- | Mk/bsd.pbi.mk | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Mk/bsd.pbi.mk b/Mk/bsd.pbi.mk new file mode 100644 index 000000000000..035cc5047aac --- /dev/null +++ b/Mk/bsd.pbi.mk @@ -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} |