diff options
author | ale <ale@FreeBSD.org> | 2006-06-09 16:17:35 +0800 |
---|---|---|
committer | ale <ale@FreeBSD.org> | 2006-06-09 16:17:35 +0800 |
commit | 5557a95bef4ca835dd1ff7a2bc25d578965159ce (patch) | |
tree | a00876adc6e90f7939f83c9a586d654e1fd965e9 /sysutils | |
parent | 2f026cc2516957655bad28880dbdd83e3bbf512e (diff) | |
download | freebsd-ports-gnome-5557a95bef4ca835dd1ff7a2bc25d578965159ce.tar.gz freebsd-ports-gnome-5557a95bef4ca835dd1ff7a2bc25d578965159ce.tar.zst freebsd-ports-gnome-5557a95bef4ca835dd1ff7a2bc25d578965159ce.zip |
Update to 1.1 release:
- automatically modify make.conf on install/deinstall
Inspired by: James O'Gorman <james@netinertia.co.uk>
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/portconf/Makefile | 5 | ||||
-rw-r--r-- | sysutils/portconf/files/pkg-message.in | 28 | ||||
-rw-r--r-- | sysutils/portconf/pkg-deinstall | 15 | ||||
-rw-r--r-- | sysutils/portconf/pkg-install | 19 |
4 files changed, 47 insertions, 20 deletions
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 <bsd.port.mk> 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 |