aboutsummaryrefslogtreecommitdiff
path: root/Mk/Uses
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2013-03-15 22:03:42 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2013-03-15 22:03:42 +0000
commit63f96859ce0b25a7057110abdd77cff71ff45681 (patch)
treed72ad8a21ce169d4163dc3bde69207c34ac21e0d /Mk/Uses
parent4cf78eacbab3fd0188059a00356e6e23e76e547b (diff)
downloadports-63f96859ce0b25a7057110abdd77cff71ff45681.tar.gz
ports-63f96859ce0b25a7057110abdd77cff71ff45681.zip
- Convert USE_QMAIL_RUN, USE_QMAIL_BUILD and WANT_QMAIL into USES feature
bapt contributed to the qmail.mk as well - Trim headers USES= qmail:run will add qmail into RUN_DEPENDS USES= qmail:build will add qmail into BUILD_DEPENDS USES= qmail[:both] will add qmail into both RUN and BUILD DEPENDS USES= qmail:vars will set QMAIL_PREFIX With hat: portmgr
Notes
Notes: svn path=/head/; revision=314324
Diffstat (limited to 'Mk/Uses')
-rw-r--r--Mk/Uses/qmail.mk64
1 files changed, 64 insertions, 0 deletions
diff --git a/Mk/Uses/qmail.mk b/Mk/Uses/qmail.mk
new file mode 100644
index 000000000000..60d02f11a8d5
--- /dev/null
+++ b/Mk/Uses/qmail.mk
@@ -0,0 +1,64 @@
+# $FreeBSD$
+#
+# MAINTAINER= bdrewery@FreeBSD.org
+#
+# Feature: qmail
+# Usage: USES=qmail or USES=qmail:ARGS
+# Valid ARGS: both (default, implicit), run, build, vars
+#
+# Ports can use the following vars:
+#
+# QMAIL_PREFIX - Define it if qmail is installed in a different PREFIX.
+# Default: /var/qmail
+#
+# QMAIL_SLAVEPORT - Define it if you install a slaveport of qmail, to
+# prevent stale dependencies. Valid slaveports are:
+# ldap, mysql, spamcontrol and tls.
+#
+
+.if !defined(_INCLUDE_QMAIL_MK)
+_INCLUDE_QMAIL_MK= yes
+
+QMAIL_PREFIX?= /var/qmail
+
+.if !defined(qmail_ARGS)
+qmail_ARGS= both
+.endif
+
+.if ${qmail_ARGS} == "build"
+BUILD_DEPENDS+= ${_QMAIL_DEPENDS}
+.elif ${qmail_ARGS} == "run"
+RUN_DEPENDS+= ${_QMAIL_DEPENDS}
+.elif ${qmail_ARGS} == "both"
+BUILD_DEPENDS+= ${_QMAIL_DEPENDS}
+RUN_DEPENDS+= ${_QMAIL_DEPENDS}
+.elif ${qmail_ARGS} == "vars"
+.else
+IGNORE= USES=qmail - invalid args: [${qmail_ARGS}] specified
+.endif
+
+.if ${qmail_ARGS} != "vars"
+
+_QMAIL_VALID_SLAVEPORTS= ldap mysql spamcontrol tls
+
+. if defined(QMAIL_SLAVEPORT)
+. for slave in ${_QMAIL_VALID_SLAVEPORTS}
+. if ${QMAIL_SLAVEPORT:L} == ${slave}
+_QMAIL_SLAVEPORT_OKAY= true
+. endif
+. endfor
+
+. if !defined(_QMAIL_SLAVEPORT_OKAY)
+IGNORE= Invalid QMAIL_SLAVEPORT value. Only one can be set, valid values are: ${_QMAIL_VALID_SLAVEPORTS}
+. endif
+. endif
+
+. if defined(QMAIL_SLAVEPORT)
+_QMAIL_DEPENDS= ${QMAIL_PREFIX}/bin/qmail-send:${PORTSDIR}/mail/qmail-${QMAIL_SLAVEPORT:L}
+. else
+_QMAIL_DEPENDS= ${QMAIL_PREFIX}/bin/qmail-send:${PORTSDIR}/mail/qmail
+. endif
+
+.endif
+
+.endif