From chris@aims.com.au  Fri Jul 20 22:03:18 2001
Return-Path: <chris@aims.com.au>
Received: from postoffice.aims.com.au (advanc2.lnk.telstra.net [139.130.119.73])
	by hub.freebsd.org (Postfix) with ESMTP id 63EFA37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 20 Jul 2001 22:02:52 -0700 (PDT)
	(envelope-from chris@aims.com.au)
Received: from postoffice.aims.com.au (nts-ts1.aims.private [192.168.10.2])
	by postoffice.aims.com.au  with ESMTP id f6L52bV42721
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 21 Jul 2001 15:02:37 +1000 (EST)
	(envelope-from chris@aims.com.au)
Received: from ntsts1 by aims.com.au
	with SMTP (MDaemon.v3.5.3.R)
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 21 Jul 2001 15:01:06 +1000
Message-Id: <200107210458.f6L4wdI87414@dbserver1.aims.private>
Date: Sat, 21 Jul 2001 15:01:04 +1000
From: chris@aims.com.au
Reply-To: <chris@aims.com.au>
To: <FreeBSD-gnats-submit@freebsd.org>
Subject: [PATCH] www/php4: OpenLDAP version selection
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         29118
>Category:       ports
>Synopsis:       [PATCH] www/php4: OpenLDAP version selection
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dirk
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 20 22:10:00 PDT 2001
>Closed-Date:    Wed Aug 8 14:20:36 PDT 2001
>Last-Modified:  Wed Aug 08 14:20:49 PDT 2001
>Originator:     Chris Knight
>Release:        FreeBSD 4.3-RELEASE i386
>Organization:
AIMS Independent Computer Professionals
>Environment:
System: FreeBSD dbserver1.aims.private 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Tue Apr 24 16:52:12 EST 2001
root@dbserver1.aims.private:/usr/obj/usr/src/sys/DBSERVER i386

>Description:
	A patch to select either OpenLDAPv1 or OpenLDAPv2 libraries. Useful for
	people who run OpenLDAPv2, then decide that they want a PHP interface
	and don't want their OpenLDAP configuration spammed by the OpenLDAPv1
	install. Guess who learnt this the hard way...
	Inspired by the SybaseCT/SybaseDB selection code.

>How-To-Repeat:
	N/A
>Fix:

--- ports/www/mod_php4/scripts/configure.php.old	Tue Jun 26 07:06:09 2001
+++ ports/www/mod_php4/scripts/configure.php	Sat Jul 21 14:38:21 2001
@@ -26,7 +26,8 @@
 SybaseCT	"Sybase/MS-SQL database support (CT-lib)" OFF \
 Interbase	"Interbase 6 database support (Firebird)" OFF \
 dBase		"dBase database support" OFF \
-OpenLDAP	"OpenLDAP support" OFF \
+OpenLDAP	"OpenLDAP 1.x support" OFF \
+OpenLDAP2	"OpenLDAP 2.x support" OFF \
 OpenSSL		"OpenSSL support" OFF \
 SNMP		"SNMP support" OFF \
 XML		"XML support" OFF \
@@ -160,9 +161,29 @@
 			echo "LIB_DEPENDS+=	ldap.1:\${PORTSDIR}/net/openldap"
 			echo "LIB_DEPENDS+=	lber.1:\${PORTSDIR}/net/openldap"
 			echo "CONFIGURE_ARGS+=--with-ldap=\${PREFIX}"
+			if [ "$OPENLDAP2" ]; then
+				echo "OpenLDAP and OpenLDAP2 are mutually exclusive." > /dev/stderr
+				rm -f ${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc
+				exit 1
+			fi
+			if [ -f /usr/lib/libkrb.a -a -f /usr/lib/libdes.a -a ! -L /usr/lib/libdes.a ]; then
+				LIBS="${LIBS} -lkrb -ldes -L\${PREFIX}/lib"
+			fi
+			OPENLDAP=1
+			;;
+		\"OpenLDAP2\")
+			echo "LIB_DEPENDS+=	ldap.2:\${PORTSDIR}/net/openldap2"
+			echo "LIB_DEPENDS+=	lber.2:\${PORTSDIR}/net/openldap2"
+			echo "CONFIGURE_ARGS+=--with-ldap=\${PREFIX}"
+			if [ "$OPENLDAP" ]; then
+				echo "OpenLDAP and OpenLDAP2 are mutually exclusive." > /dev/stderr
+				rm -f ${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc
+				exit 1
+			fi
 			if [ -f /usr/lib/libkrb.a -a -f /usr/lib/libdes.a -a ! -L /usr/lib/libdes.a ]; then
 				LIBS="${LIBS} -lkrb -ldes -L\${PREFIX}/lib"
 			fi
+			OPENLDAP2=1
 			;;
 		\"OpenSSL\")
 			echo "USE_OPENSSL=yes"


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->dirk 
Responsible-Changed-By: lioux 
Responsible-Changed-When: Sat Jul 21 10:39:50 PDT 2001 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29118 
State-Changed-From-To: open->closed 
State-Changed-By: dirk 
State-Changed-When: Wed Aug 8 14:20:36 PDT 2001 
State-Changed-Why:  
Patch committed. Thanks! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29118 
>Unformatted:
