summaryrefslogtreecommitdiff
path: root/ports-mgmt/portconf
diff options
context:
space:
mode:
authorAlex Dupre <ale@FreeBSD.org>2006-06-09 08:17:35 +0000
committerAlex Dupre <ale@FreeBSD.org>2006-06-09 08:17:35 +0000
commitac3065b8aab2c831175f7cc1d67a6fcaa6ac6c20 (patch)
treefdf53e3a31ba1fb6f290e6c2b89d6ea4234190f5 /ports-mgmt/portconf
parentReorder the contents of the Makefile (diff)
Update to 1.1 release:
- automatically modify make.conf on install/deinstall Inspired by: James O'Gorman <james@netinertia.co.uk>
Notes
Notes: svn path=/head/; revision=164888
Diffstat (limited to 'ports-mgmt/portconf')
-rw-r--r--ports-mgmt/portconf/Makefile5
-rw-r--r--ports-mgmt/portconf/files/pkg-message.in28
-rw-r--r--ports-mgmt/portconf/pkg-deinstall15
-rw-r--r--ports-mgmt/portconf/pkg-install19
4 files changed, 47 insertions, 20 deletions
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 <bsd.port.mk>
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