2012-05-23 08:17:49 +00:00
|
|
|
# -*- tab-width: 4; -*-
|
2008-07-21 22:29:22 +00:00
|
|
|
# ex: ts=4
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
.if defined(_POSTMKINCLUDED) && !defined(Ldap_Post_Include)
|
|
|
|
|
2009-07-16 23:18:22 +00:00
|
|
|
Ldap_Post_Include= bsd.ldap.mk
|
|
|
|
Database_Include_MAINTAINER= ports@FreeBSD.org
|
2008-07-21 22:29:22 +00:00
|
|
|
|
2009-07-16 23:18:22 +00:00
|
|
|
# For including this file define macro USE_OPENLDAP. Defining macro like
|
|
|
|
# USE_OPENLDAP_VER or WANT_OPENLDAP_VER will include this file too.
|
2008-07-21 22:29:22 +00:00
|
|
|
#
|
|
|
|
##
|
2009-07-16 23:18:22 +00:00
|
|
|
# USE_OPENLDAP - Add OpenLDAP client dependency.
|
2008-07-21 22:29:22 +00:00
|
|
|
# If no version is given (by the maintainer via the port or
|
|
|
|
# by the user via defined variable), try to find the
|
|
|
|
# currently installed version. Fall back to default if
|
|
|
|
# necessary (OpenLDAP 2.4 = 24).
|
|
|
|
# DEFAULT_OPENLDAP_VER
|
|
|
|
# - OpenLDAP default version. Can be overriden within a port.
|
|
|
|
# Default: 24.
|
|
|
|
# WANT_OPENLDAP_VER
|
|
|
|
# - Maintainer can set an arbitrary version of OpenLDAP by using it.
|
2012-12-12 20:09:55 +00:00
|
|
|
# WANT_OPENLDAP_SASL
|
2017-01-08 21:20:57 +00:00
|
|
|
# - User-defined variable to depend upon SASL-enabled OpenLDAP
|
|
|
|
# client. Must NOT be set in a port Makefile.
|
2008-07-21 22:29:22 +00:00
|
|
|
# IGNORE_OPENLDAP_OPENLDAP
|
|
|
|
# - This variable can be defined if the ports doesn't support
|
|
|
|
# one or more version of OpenLDAP.
|
|
|
|
# WITH_OPENLDAP_VER
|
|
|
|
# - User defined variable to set OpenLDAP version.
|
|
|
|
# OPENLDAP_VER
|
|
|
|
# - Detected OpenLDAP version.
|
|
|
|
|
|
|
|
.if defined(USE_OPENLDAP)
|
2008-07-22 01:59:22 +00:00
|
|
|
DEFAULT_OPENLDAP_VER?= 24
|
2008-07-21 22:29:22 +00:00
|
|
|
# OpenLDAP client versions currently supported
|
2014-07-24 18:34:16 +00:00
|
|
|
OPENLDAP23_LIB= libldap-2.3.so.2
|
|
|
|
OPENLDAP24_LIB= libldap-2.4.so.2
|
2008-07-21 22:29:22 +00:00
|
|
|
|
|
|
|
.if exists(${LOCALBASE}/bin/ldapwhoami)
|
|
|
|
_OPENLDAP_VER!= ${LOCALBASE}/bin/ldapwhoami -VV 2>&1 | ${GREP} ldapwhoami | ${SED} -E 's/.*OpenLDAP: ldapwhoami (2)\.(3|4).*/\1\2/'
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(WANT_OPENLDAP_VER)
|
|
|
|
.if defined(WITH_OPENLDAP_VER) && ${WITH_OPENLDAP_VER} != ${WANT_OPENLDAP_VER}
|
2016-08-26 08:42:27 +00:00
|
|
|
IGNORE= cannot install: the port wants openldap${WANT_OPENLDAP_VER}-client and you try to install openldap${WITH_OPENLDAP_VER}-client
|
2008-07-21 22:29:22 +00:00
|
|
|
.endif
|
|
|
|
OPENLDAP_VER= ${WANT_OPENLDAP_VER}
|
|
|
|
.elif defined(WITH_OPENLDAP_VER)
|
|
|
|
OPENLDAP_VER= ${WITH_OPENLDAP_VER}
|
|
|
|
.else
|
|
|
|
.if defined(_OPENLDAP_VER)
|
|
|
|
OPENLDAP_VER= ${_OPENLDAP_VER}
|
|
|
|
.else
|
|
|
|
OPENLDAP_VER= ${DEFAULT_OPENLDAP_VER}
|
|
|
|
.endif
|
|
|
|
.endif # WANT_OPENLDAP_VER
|
|
|
|
|
|
|
|
.if defined(_OPENLDAP_VER)
|
|
|
|
.if ${_OPENLDAP_VER} != ${OPENLDAP_VER}
|
|
|
|
IGNORE= cannot install: OpenLDAP versions mismatch: openldap${_OPENLDAP_VER}-client is installed and wanted version is openldap${OPENLDAP_VER}-client
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
CFLAGS+= -DLDAP_DEPRECATED
|
|
|
|
|
2013-05-02 17:12:43 +00:00
|
|
|
_OPENLDAP_CLIENT_PKG!= ${PKG_INFO} -Ex openldap.\*-client 2>/dev/null; ${ECHO_CMD}
|
2010-04-19 21:38:17 +00:00
|
|
|
_OPENLDAP_FLAVOUR= ${_OPENLDAP_CLIENT_PKG:C/openldap//:C/-client-.*//}
|
|
|
|
|
2008-07-21 22:29:22 +00:00
|
|
|
.if defined(WANT_OPENLDAP_SASL)
|
2010-04-19 21:38:17 +00:00
|
|
|
.if !empty(_OPENLDAP_CLIENT_PKG) && empty(_OPENLDAP_FLAVOUR)
|
|
|
|
IGNORE= cannot install: SASL support requested and ${_OPENLDAP_CLIENT_PKG} is installed
|
|
|
|
.endif
|
2008-07-21 22:29:22 +00:00
|
|
|
_OPENLDAP_FLAVOUR= -sasl
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# And now we are checking if we can use it
|
2014-07-24 18:34:16 +00:00
|
|
|
.if defined(OPENLDAP${OPENLDAP_VER}_LIB)
|
2008-07-21 22:29:22 +00:00
|
|
|
# compatability shim
|
|
|
|
.if defined(BROKEN_WITH_OPENLDAP)
|
|
|
|
IGNORE_WITH_OPENLDAP=${BROKEN_WITH_OPENLDAP}
|
|
|
|
.endif
|
|
|
|
.if defined(IGNORE_WITH_OPENLDAP)
|
|
|
|
. for VER in ${IGNORE_WITH_OPENLDAP}
|
|
|
|
. if (${OPENLDAP_VER} == "${VER}")
|
|
|
|
IGNORE= cannot install: doesn't work with OpenLDAP version: ${OPENLDAP_VER} (Doesn't support OpenLDAP ${IGNORE_WITH_OPENLDAP})
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.endif # IGNORE_WITH_OPENLDAP
|
2016-03-27 01:23:25 +00:00
|
|
|
LIB_DEPENDS+= ${OPENLDAP${OPENLDAP_VER}_LIB}:net/openldap${OPENLDAP_VER}${_OPENLDAP_FLAVOUR}-client
|
2008-07-21 22:29:22 +00:00
|
|
|
.else
|
|
|
|
IGNORE= cannot install: unknown OpenLDAP version: ${OPENLDAP_VER}
|
|
|
|
.endif # Check for correct libs
|
|
|
|
|
|
|
|
.endif # defined(USE_OPENLDAP)
|
|
|
|
|
|
|
|
.endif # defined(_POSTMKINCLUDED) && !defined(Ldap_Post_Include)
|