aboutsummaryrefslogtreecommitdiff
path: root/ports-mgmt/portconf
diff options
context:
space:
mode:
authorAlex Dupre <ale@FreeBSD.org>2006-06-08 07:30:10 +0000
committerAlex Dupre <ale@FreeBSD.org>2006-06-08 07:30:10 +0000
commitb3ed2e3caf08c19370e7df8b9848fda49ec89558 (patch)
tree983a5af321711c702a4e91e745d5b9aa3b16ee79 /ports-mgmt/portconf
parent26f2454ec2c9a920547582b4d4f5187178e8a8b2 (diff)
downloadports-b3ed2e3caf08c19370e7df8b9848fda49ec89558.tar.gz
ports-b3ed2e3caf08c19370e7df8b9848fda49ec89558.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'.
Notes
Notes: svn path=/head/; revision=164795
Diffstat (limited to 'ports-mgmt/portconf')
-rw-r--r--ports-mgmt/portconf/Makefile31
-rw-r--r--ports-mgmt/portconf/files/pkg-message.in28
-rw-r--r--ports-mgmt/portconf/files/portconf.sh.in44
-rw-r--r--ports-mgmt/portconf/pkg-descr6
4 files changed, 109 insertions, 0 deletions
diff --git a/ports-mgmt/portconf/Makefile b/ports-mgmt/portconf/Makefile
new file mode 100644
index 000000000000..447b73b227e9
--- /dev/null
+++ b/ports-mgmt/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/ports-mgmt/portconf/files/pkg-message.in b/ports-mgmt/portconf/files/pkg-message.in
new file mode 100644
index 000000000000..34e74cbf9968
--- /dev/null
+++ b/ports-mgmt/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/ports-mgmt/portconf/files/portconf.sh.in b/ports-mgmt/portconf/files/portconf.sh.in
new file mode 100644
index 000000000000..7f71512b76d2
--- /dev/null
+++ b/ports-mgmt/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/ports-mgmt/portconf/pkg-descr b/ports-mgmt/portconf/pkg-descr
new file mode 100644
index 000000000000..3fdc8ae1310d
--- /dev/null
+++ b/ports-mgmt/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