From ac3065b8aab2c831175f7cc1d67a6fcaa6ac6c20 Mon Sep 17 00:00:00 2001 From: Alex Dupre Date: Fri, 9 Jun 2006 08:17:35 +0000 Subject: Update to 1.1 release: - automatically modify make.conf on install/deinstall Inspired by: James O'Gorman --- ports-mgmt/portconf/Makefile | 5 ++++- ports-mgmt/portconf/files/pkg-message.in | 28 +++++++++------------------- ports-mgmt/portconf/pkg-deinstall | 15 +++++++++++++++ ports-mgmt/portconf/pkg-install | 19 +++++++++++++++++++ sysutils/portconf/Makefile | 5 ++++- sysutils/portconf/files/pkg-message.in | 28 +++++++++------------------- sysutils/portconf/pkg-deinstall | 15 +++++++++++++++ sysutils/portconf/pkg-install | 19 +++++++++++++++++++ 8 files changed, 94 insertions(+), 40 deletions(-) create mode 100644 ports-mgmt/portconf/pkg-deinstall create mode 100644 ports-mgmt/portconf/pkg-install create mode 100644 sysutils/portconf/pkg-deinstall create mode 100644 sysutils/portconf/pkg-install diff --git a/ports-mgmt/portconf/Makefile b/ports-mgmt/portconf/Makefile index 447b73b227e9..7fe720d2cff9 100644 --- a/ports-mgmt/portconf/Makefile +++ b/ports-mgmt/portconf/Makefile @@ -8,7 +8,7 @@ # PORTNAME= portconf -PORTVERSION= 1.0 +PORTVERSION= 1.1 CATEGORIES= sysutils MASTER_SITES= # none DISTFILES= # none @@ -26,6 +26,9 @@ do-fetch: do-install: @${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}.sh ${PREFIX}/libexec/${PORTNAME} +.if !defined(PACKAGE_BUILDING) + @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL +.endif @${CAT} ${PKGMESSAGE} .include diff --git a/ports-mgmt/portconf/files/pkg-message.in b/ports-mgmt/portconf/files/pkg-message.in index 378c54735cf4..3858fba21893 100644 --- a/ports-mgmt/portconf/files/pkg-message.in +++ b/ports-mgmt/portconf/files/pkg-message.in @@ -1,27 +1,17 @@ -************************************************************************ +********************************************************* -To enable port-specific make variables, add the following lines -into your /etc/make.conf file: - -=============================== cut here =============================== -.if !empty(.CURDIR:M/usr/ports*) && exists(%%PREFIX%%/libexec/portconf) -_PORTCONF!=%%PREFIX%%/libexec/portconf -.for i in ${_PORTCONF:S/|/ /g} -${i:S/%/ /g} -.endfor -.endif -======================================================================== - -and create the %%PREFIX%%/etc/ports.conf configuration file +To set port-specific make variables, create the +%%PREFIX%%/etc/ports.conf configuration file with the following syntax: ------------------------------------------------------------------------- +--------------------------------------------------------- editors/openoffice*: WITH_CCACHE|LOCALIZED_LANG=it www/firefox-i18n: WITHOUT_SWITCHER | FIREFOX_I18N=fr it x11/fakeport: CONFIGURE_ARGS=--with-modules="aaa bbb ccc" ------------------------------------------------------------------------- +--------------------------------------------------------- -Global port directory patterns and blanks around the pipe "|" symbol -are allowed. Values shouldn't be quoted even if they contain spaces. +Global port directory patterns and blanks around the +pipe "|" symbol are allowed. +Values shouldn't be quoted even if they contain spaces. -************************************************************************ +********************************************************* diff --git a/ports-mgmt/portconf/pkg-deinstall b/ports-mgmt/portconf/pkg-deinstall new file mode 100644 index 000000000000..5646b09dab71 --- /dev/null +++ b/ports-mgmt/portconf/pkg-deinstall @@ -0,0 +1,15 @@ +#!/bin/sh + +MAKE_CONF=/etc/make.conf + +if [ "$2" = "POST-DEINSTALL" ]; then +echo -n "Cleaning up ${MAKE_CONF}..." +if [ -f ${MAKE_CONF} ]; then + sed -i"" -e "/# Begin portconf settings/,/# End portconf settings/d" \ + ${MAKE_CONF} + if [ ! -s ${MAKE_CONF} ]; then + rm ${MAKE_CONF} + fi +fi +echo " Done." +fi diff --git a/ports-mgmt/portconf/pkg-install b/ports-mgmt/portconf/pkg-install new file mode 100644 index 000000000000..7c3938211b01 --- /dev/null +++ b/ports-mgmt/portconf/pkg-install @@ -0,0 +1,19 @@ +#!/bin/sh + +MAKE_CONF=/etc/make.conf + +if [ "$2" = "POST-INSTALL" ]; then +echo -n "Spamming ${MAKE_CONF}..." +cat >> ${MAKE_CONF} << EOF +# Begin portconf settings +# Do not touch these lines +.if !empty(.CURDIR:M/usr/ports*) && exists(${PKG_PREFIX}/libexec/portconf) +_PORTCONF!=${PKG_PREFIX}/libexec/portconf +.for i in \${_PORTCONF:S/|/ /g} +\${i:S/%/ /g} +.endfor +.endif +# End portconf settings +EOF +echo " Done." +fi diff --git a/sysutils/portconf/Makefile b/sysutils/portconf/Makefile index 447b73b227e9..7fe720d2cff9 100644 --- a/sysutils/portconf/Makefile +++ b/sysutils/portconf/Makefile @@ -8,7 +8,7 @@ # PORTNAME= portconf -PORTVERSION= 1.0 +PORTVERSION= 1.1 CATEGORIES= sysutils MASTER_SITES= # none DISTFILES= # none @@ -26,6 +26,9 @@ do-fetch: do-install: @${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}.sh ${PREFIX}/libexec/${PORTNAME} +.if !defined(PACKAGE_BUILDING) + @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL +.endif @${CAT} ${PKGMESSAGE} .include diff --git a/sysutils/portconf/files/pkg-message.in b/sysutils/portconf/files/pkg-message.in index 378c54735cf4..3858fba21893 100644 --- a/sysutils/portconf/files/pkg-message.in +++ b/sysutils/portconf/files/pkg-message.in @@ -1,27 +1,17 @@ -************************************************************************ +********************************************************* -To enable port-specific make variables, add the following lines -into your /etc/make.conf file: - -=============================== cut here =============================== -.if !empty(.CURDIR:M/usr/ports*) && exists(%%PREFIX%%/libexec/portconf) -_PORTCONF!=%%PREFIX%%/libexec/portconf -.for i in ${_PORTCONF:S/|/ /g} -${i:S/%/ /g} -.endfor -.endif -======================================================================== - -and create the %%PREFIX%%/etc/ports.conf configuration file +To set port-specific make variables, create the +%%PREFIX%%/etc/ports.conf configuration file with the following syntax: ------------------------------------------------------------------------- +--------------------------------------------------------- editors/openoffice*: WITH_CCACHE|LOCALIZED_LANG=it www/firefox-i18n: WITHOUT_SWITCHER | FIREFOX_I18N=fr it x11/fakeport: CONFIGURE_ARGS=--with-modules="aaa bbb ccc" ------------------------------------------------------------------------- +--------------------------------------------------------- -Global port directory patterns and blanks around the pipe "|" symbol -are allowed. Values shouldn't be quoted even if they contain spaces. +Global port directory patterns and blanks around the +pipe "|" symbol are allowed. +Values shouldn't be quoted even if they contain spaces. -************************************************************************ +********************************************************* diff --git a/sysutils/portconf/pkg-deinstall b/sysutils/portconf/pkg-deinstall new file mode 100644 index 000000000000..5646b09dab71 --- /dev/null +++ b/sysutils/portconf/pkg-deinstall @@ -0,0 +1,15 @@ +#!/bin/sh + +MAKE_CONF=/etc/make.conf + +if [ "$2" = "POST-DEINSTALL" ]; then +echo -n "Cleaning up ${MAKE_CONF}..." +if [ -f ${MAKE_CONF} ]; then + sed -i"" -e "/# Begin portconf settings/,/# End portconf settings/d" \ + ${MAKE_CONF} + if [ ! -s ${MAKE_CONF} ]; then + rm ${MAKE_CONF} + fi +fi +echo " Done." +fi diff --git a/sysutils/portconf/pkg-install b/sysutils/portconf/pkg-install new file mode 100644 index 000000000000..7c3938211b01 --- /dev/null +++ b/sysutils/portconf/pkg-install @@ -0,0 +1,19 @@ +#!/bin/sh + +MAKE_CONF=/etc/make.conf + +if [ "$2" = "POST-INSTALL" ]; then +echo -n "Spamming ${MAKE_CONF}..." +cat >> ${MAKE_CONF} << EOF +# Begin portconf settings +# Do not touch these lines +.if !empty(.CURDIR:M/usr/ports*) && exists(${PKG_PREFIX}/libexec/portconf) +_PORTCONF!=${PKG_PREFIX}/libexec/portconf +.for i in \${_PORTCONF:S/|/ /g} +\${i:S/%/ /g} +.endfor +.endif +# End portconf settings +EOF +echo " Done." +fi -- cgit v1.2.3