aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/Uses
diff options
context:
space:
mode:
authorantoine <antoine@FreeBSD.org>2014-01-05 07:36:50 +0800
committerantoine <antoine@FreeBSD.org>2014-01-05 07:36:50 +0800
commit2b7f430660d2cc842d271c3958716dac9c633238 (patch)
treed650a1468fe26d1dbab068dd90b7f8c33696eafe /Mk/Uses
parent4a49ebe16b3d7f7ccb6796591962601d270e56f9 (diff)
downloadfreebsd-ports-gnome-2b7f430660d2cc842d271c3958716dac9c633238.tar.gz
freebsd-ports-gnome-2b7f430660d2cc842d271c3958716dac9c633238.tar.zst
freebsd-ports-gnome-2b7f430660d2cc842d271c3958716dac9c633238.zip
Add new USES=fam that will replace USE_FAM=yes
The conversion is easy: USE_FAM=yes -> USES=fam USE_FAM=yes and WANT_FAM_SYSTEM=fam -> USES=fam:fam USE_FAM=yes and WANT_FAM_SYSTEM=gamin -> USES=fam:gamin Approved by: portmgr (bapt)
Diffstat (limited to 'Mk/Uses')
-rw-r--r--Mk/Uses/fam.mk63
1 files changed, 63 insertions, 0 deletions
diff --git a/Mk/Uses/fam.mk b/Mk/Uses/fam.mk
new file mode 100644
index 000000000000..852196e88c0e
--- /dev/null
+++ b/Mk/Uses/fam.mk
@@ -0,0 +1,63 @@
+# $FreeBSD$
+#
+# Handle dependency on File Alteration Monitor
+#
+# MAINTAINER: portmgr@FreeBSD.org
+#
+# Feature: fam
+# Usage: USES=fam or USES=fam:ARG
+# Valid ARG: gamin, fam
+#
+# User-specified File Alteration Monitor wish:
+# Usage: WITH_FAM_SYSTEM=ARG
+# Valid ARG: gamin (default), fam
+#
+#
+.if !defined(_INCLUDE_USES_FAM_MK)
+_INCLUDE_USES_FAM_MK= yes
+
+_fam_DEPENDS= libfam.so.0:${PORTSDIR}/devel/fam
+_gamin_DEPENDS= libfam.so.0:${PORTSDIR}/devel/gamin
+
+_FAM_SYSTEMS= fam gamin
+_DEFAULT_FAM= gamin
+
+.if exists(${LOCALBASE}/libexec/gam_server)
+_HAVE_FAM= gamin
+.elif exists(${LOCALBASE}/bin/fam)
+_HAVE_FAM= fam
+.endif
+
+# Sanity checks
+.if defined(WITH_FAM_SYSTEM) && defined(_HAVE_FAM) && ${_HAVE_FAM} != ${WITH_FAM_SYSTEM}
+IGNORE= FAM mismatch: ${_HAVE_FAM} is installed, but ${WITH_FAM_SYSTEM} desired
+.endif
+
+.if defined(fam_ARGS)
+.for _fam_ARGS in ${fam_ARGS}
+. if ! ${_FAM_SYSTEMS:M${_fam_ARGS}}
+IGNORE= Incorrect 'USES+= fam:${fam_ARGS}' usage: argument [${_fam_ARGS}] is not recognized
+. endif
+.endfor
+. if defined(_HAVE_FAM) && ${_HAVE_FAM} != ${fam_ARGS}
+IGNORE= FAM mismatch: port wants to use ${fam_ARGS} while you have ${_HAVE_FAM}
+. endif
+. if defined(WITH_FAM_SYSTEM) && ${WITH_FAM_SYSTEM} != ${fam_ARGS}
+IGNORE= FAM mismatch: port wants to use ${fam_ARGS} while you wish to use ${WITH_FAM_SYSTEM}
+. endif
+.endif
+
+# Proceed
+.if defined(fam_ARGS)
+_USE_FAM= ${fam_ARGS}
+.elif defined(_HAVE_FAM)
+_USE_FAM= ${_HAVE_FAM}
+.elif defined(WITH_FAM_SYSTEM)
+_USE_FAM= ${WITH_FAM_SYSTEM}
+.else
+_USE_FAM= ${_DEFAULT_FAM}
+.endif
+
+LIB_DEPENDS+= ${_${_USE_FAM}_DEPENDS}
+
+.endif