Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Aug 2003 21:48:32 +0200
From:      Oliver Eikemeier <eikemeier@fillmore-labs.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        Jun Kuriyama <kuriyama@FreeBSD.org>
Subject:   ports/55680: [PATCH] Mk/bsd.port.mk: add OpenLDAP support
Message-ID:  <3F3FDC10.1000305@fillmore-labs.com>
Resent-Message-ID: <200308171950.h7HJoGZV000939@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         55680
>Category:       ports
>Synopsis:       [PATCH] Mk/bsd.port.mk: add OpenLDAP support
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 17 12:50:16 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Oliver Eikemeier
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
Fillmore Labs - http://www.fillmore-labs.com
>Environment:
System: FreeBSD nuuk.fillmore-labs.com 4.8-STABLE

>Description:

This is a followup to PR 54436, a patch for bsd.port.mk that enables
ports that rely on the OpenLDAP client libraries to use USE_OPENLDAP=yes.
It was part of PR 54436 and is analogous to PR 55597.

More and more ports contain switching logic between the various OpenLDAP
ports, with different parameters. Moreover, if a port contains no
switching logic but depends on OpenLDAP 2.0 and another on OpenLDAP 2.1,
these ports become incompatible, because OpenLDAP 2.0 and OpenLDAP 2.1 are
mutually exclusive.

USE_OPENLDAP should remedy this situation.

If a port uses the OpenLDAP libraries a required a minumum OpenLDAP version,
the following usage is suggested:

USE_OPENLDAP=	yes
.if defined(WANT_OPENLDAP_VER) && ${WANT_OPENLDAP_VER} == 12
BROKEN=		"this port requires OpenLDAP >= 2.0"
.endif

An USE_OPENLDAP_VER switch is provided, but its usage is discouraged, and
it is not documented.

>How-To-Repeat:
>Fix:

--- bsd.port.mk.patch begins here ---
--- Mk/bsd.port.mk.orig	Sat Aug 16 00:57:58 2003
+++ Mk/bsd.port.mk	Sun Aug 17 21:24:45 2003
@@ -341,6 +341,11 @@
 # USE_SDL		- Says that the port uses the sdl libraries.
 # USE_XPM		- Says that the port uses the xpm graphics libraries.
 ##
+# USE_OPENLDAP			- Says that the port uses the OpenLDAP libraries
+#				- Implies WANT_OPENLDAP_VER?=21.
+# WANT_OPENLDAP_VER		- legal values are: 12, 20, 21 and 22
+#				- If set to an unknown value, the port is marked BROKEN.
+##
 # USE_OPENSSL	- Says that the port relies on the OpenSSL package.
 #				  Default: not set.
 ##
@@ -1330,6 +1335,29 @@
 LIBTOOLIZE?=	${LIBTOOL_LIBEXECDIR}/libtoolize
 
 # END LIBTOOL
+######################################################################
+
+######################################################################
+# OpenLDAP
+
+.if defined(USE_OPENLDAP_VER)
+USE_OPENLDAP?=		yes
+WANT_OPENLDAP_VER=	${USE_OPENLDAP_VER}
+.endif
+
+.if defined(USE_OPENLDAP)
+WANT_OPENLDAP_VER?=	21
+.if ${WANT_OPENLDAP_VER} == 12
+LIB_DEPENDS+=		ldap.1:${PORTSDIR}/net/openldap12
+.elif ${WANT_OPENLDAP_VER} == 20 || ${WANT_OPENLDAP_VER} == 21 || \
+			${WANT_OPENLDAP_VER} == 22
+LIB_DEPENDS+=		ldap.2:${PORTSDIR}/net/openldap${WANT_OPENLDAP_VER}-client
+.else
+BROKEN=			"unknown OpenLDAP version: ${WANT_OPENLDAP_VER}"
+.endif
+.endif
+
+# END OpenLDAP
 ######################################################################
 
 .if defined(USE_GCC) && ${USE_GCC} == 2.95 && ( ${OSVERSION} < 400012 || ${OSVERSION} > 500034 )
--- bsd.port.mk.patch ends here ---

The logic should not be in net/openldap20-server/bsd.openldap.mk, it is
too misleading:

USE_OPENLDAP=yes
.include "${.CURDIR}/..../net/openldap20-server/bsd.openldap.mk"

results in a dependency on net/openldap21-client. Remove the file
and the references (thsi can be done before bsd.port.mk is modified):

rm net/openldap20-server/bsd.openldap.mk

--- openldap-servers.patch begins here ---
diff -u net/openldap20-server/Makefile.orig net/openldap20-server/Makefile
--- net/openldap20-server/Makefile.orig	Sun Aug 17 21:33:31 2003
+++ net/openldap20-server/Makefile	Sun Aug 17 21:33:59 2003
@@ -227,5 +227,4 @@
 .endif
 	@${CAT} ${PKGMESSAGE}
 
-.include "${.CURDIR}/../openldap20-server/bsd.openldap.mk"
 .include <bsd.port.post.mk>
diff -u net/openldap21-server/Makefile.orig net/openldap21-server/Makefile
--- net/openldap21-server/Makefile.orig	Sun Aug 17 21:33:31 2003
+++ net/openldap21-server/Makefile	Sun Aug 17 21:34:05 2003
@@ -240,5 +240,4 @@
 .endif
 	@${CAT} ${PKGMESSAGE}
 
-.include "${.CURDIR}/../openldap20-server/bsd.openldap.mk"
 .include <bsd.port.post.mk>
diff -u net/openldap22-server/Makefile.orig net/openldap22-server/Makefile
--- net/openldap22-server/Makefile.orig	Sun Aug 17 21:33:31 2003
+++ net/openldap22-server/Makefile	Sun Aug 17 21:34:12 2003
@@ -250,5 +250,4 @@
 .endif
 	@${CAT} ${PKGMESSAGE}
 
-.include "${.CURDIR}/../openldap20-server/bsd.openldap.mk"
 .include <bsd.port.post.mk>
--- openldap-servers.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F3FDC10.1000305>