aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/portconf
diff options
context:
space:
mode:
authorale <ale@FreeBSD.org>2006-06-08 15:30:10 +0800
committerale <ale@FreeBSD.org>2006-06-08 15:30:10 +0800
commite52d55d5a673e3e789993262964d19f6e89fd668 (patch)
tree3c33d31ab59b1eeb8aa1decb935aa5a977c0c969 /sysutils/portconf
parentd590da635dbf0d8b0ad2733e30d79af34d6f6180 (diff)
downloadfreebsd-ports-gnome-e52d55d5a673e3e789993262964d19f6e89fd668.tar.gz
freebsd-ports-gnome-e52d55d5a673e3e789993262964d19f6e89fd668.tar.zst
freebsd-ports-gnome-e52d55d5a673e3e789993262964d19f6e89fd668.zip
Portconf is a simple framework to set ports options in an
universal way. Knobs set to specific ports are honorated by portmaster, portupgrade, portmanager and 'make install'.
Diffstat (limited to 'sysutils/portconf')
-rw-r--r--sysutils/portconf/Makefile31
-rw-r--r--sysutils/portconf/files/pkg-message.in28
-rw-r--r--sysutils/portconf/files/portconf.sh.in44
-rw-r--r--sysutils/portconf/pkg-descr6
4 files changed, 109 insertions, 0 deletions
diff --git a/sysutils/portconf/Makefile b/sysutils/portconf/Makefile
new file mode 100644
index 000000000000..447b73b227e9
--- /dev/null
+++ b/sysutils/portconf/Makefile
@@ -0,0 +1,31 @@
+# New ports collection makefile for: portconf
+# Date created: 7 Jun 2006
+# Whom: Alex Dupre <ale@FreeBSD.org>
+#
+# $FreeBSD$
+#
+# This port is self contained in the files directory.
+#
+
+PORTNAME= portconf
+PORTVERSION= 1.0
+CATEGORIES= sysutils
+MASTER_SITES= # none
+DISTFILES= # none
+
+MAINTAINER= ale@FreeBSD.org
+COMMENT= A universal tool to set specific port knobs
+
+NO_BUILD= yes
+SUB_FILES= pkg-message ${PORTNAME}.sh
+
+PLIST_FILES= libexec/${PORTNAME}
+
+do-fetch:
+ @${DO_NADA}
+
+do-install:
+ @${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}.sh ${PREFIX}/libexec/${PORTNAME}
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/sysutils/portconf/files/pkg-message.in b/sysutils/portconf/files/pkg-message.in
new file mode 100644
index 000000000000..34e74cbf9968
--- /dev/null
+++ b/sysutils/portconf/files/pkg-message.in
@@ -0,0 +1,28 @@
+*********************************************************
+
+To enable port-specific make variables, add the following
+lines into your /etc/make.conf file:
+
+============== cut here ==============
+.if !empty(.CURDIR:M/usr/ports*)
+_PORTCONF!=%%PREFIX%%/libexec/portconf
+.for i in ${_PORTCONF:S/|/ /g}
+${i:S/%/ /g}
+.endfor
+.endif
+======================================
+
+and 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.
+
+*********************************************************
diff --git a/sysutils/portconf/files/portconf.sh.in b/sysutils/portconf/files/portconf.sh.in
new file mode 100644
index 000000000000..7f71512b76d2
--- /dev/null
+++ b/sysutils/portconf/files/portconf.sh.in
@@ -0,0 +1,44 @@
+#! /bin/sh
+#
+# Copyright (c) 2006 Florent Thoumie <flz@FreeBSD.org>,
+# Alex Dupre <ale@FreeBSD.org>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+_conf=%%PREFIX%%/etc/ports.conf
+if [ ! -r "${_conf}" ]; then
+ exit
+fi
+_pwd=`pwd`
+cat "${_conf}" | while read _line; do
+ if [ -z "${_line}" ]; then
+ continue
+ fi
+ _port=${_line%%:*}
+ if [ "${_pwd%%${_port}}" != "${_pwd}" ]; then
+ echo ${_line#*:} | sed -E 's/([A-Z0-9_]+)(=([^|]+))?/\1=\3/g;s/ *\| */|/g;s/ /%/g'
+ fi
+done
diff --git a/sysutils/portconf/pkg-descr b/sysutils/portconf/pkg-descr
new file mode 100644
index 000000000000..3fdc8ae1310d
--- /dev/null
+++ b/sysutils/portconf/pkg-descr
@@ -0,0 +1,6 @@
+Portconf is a simple framework to set ports options in an
+universal way. Knobs set to specific ports are honorated
+by portmaster, portupgrade, portmanager and 'make install'.
+
+- Alex Dupre
+ale@FreeBSD.org