From nobody@FreeBSD.org  Wed Jun 17 10:34:46 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 12F93106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 17 Jun 2009 10:34:46 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 00FC88FC19
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 17 Jun 2009 10:34:46 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HAYjck052239
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 17 Jun 2009 10:34:45 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n5HAYjlV052238;
	Wed, 17 Jun 2009 10:34:45 GMT
	(envelope-from nobody)
Message-Id: <200906171034.n5HAYjlV052238@www.freebsd.org>
Date: Wed, 17 Jun 2009 10:34:45 GMT
From: Yuri Pankov <yuri.pankov@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH]: bsd.ldap.mk: Detect flavour of installed openldap-client
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         135664
>Category:       ports
>Synopsis:       [PATCH]: bsd.ldap.mk: Detect flavour of installed openldap-client
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    delphij
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 17 10:40:01 UTC 2009
>Closed-Date:    Mon Apr 19 21:38:59 UTC 2010
>Last-Modified:  Mon Apr 19 21:40:04 UTC 2010
>Originator:     Yuri Pankov
>Release:        7.2-RELEASE
>Organization:
>Environment:
>Description:
Try to detect flavour of installed openldap-client package. This should at least fix dependency recording in case when we have openldap-sasl-client installed and we don't set WANT_OPENLDAP_SASL (WANT_* variables aren't supposed to be user-settable, are they?) (security/sudo, for example, building sudo using -DWITH_LDAP when we have openldap-sasl-client installed results in missing dependency).

Depends on ports/135663 (uses PKG_INFO).
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: bsd.ldap.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.ldap.mk,v
retrieving revision 1.4
diff -u -r1.4 bsd.ldap.mk
--- bsd.ldap.mk	17 Feb 2009 02:54:37 -0000	1.4
+++ bsd.ldap.mk	17 Jun 2009 10:24:32 -0000
@@ -69,7 +69,8 @@
 .if defined(WANT_OPENLDAP_SASL)
 _OPENLDAP_FLAVOUR=	-sasl
 .else
-_OPENLDAP_FLAVOUR=
+# We should try to detect flavour of already installed openldap-client
+_OPENLDAP_FLAVOUR!=	${PKG_INFO} -Ex openldap.\*-client | ${SED} -e 's/openldap\(-sasl\)*-client-.*/\1/'
 .endif
 
 # And now we are checking if we can use it


>Release-Note:
>Audit-Trail:

From: Yuri Pankov <yuri.pankov@gmail.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/135664: [PATCH]: bsd.ldap.mk: Detect flavour of installed
 openldap-client
Date: Wed, 17 Jun 2009 20:05:41 +0400

 This is a multi-part message in MIME format.
 --------------090807030809090105010109
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Improved version of the patch.
 
 --------------090807030809090105010109
 Content-Type: text/plain;
  name="bsd.ldap.mk.diff.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="bsd.ldap.mk.diff.txt"
 
 Index: bsd.ldap.mk
 ===================================================================
 RCS file: /home/ncvs/ports/Mk/bsd.ldap.mk,v
 retrieving revision 1.4
 diff -u -r1.4 bsd.ldap.mk
 --- bsd.ldap.mk	17 Feb 2009 02:54:37 -0000	1.4
 +++ bsd.ldap.mk	17 Jun 2009 16:01:53 -0000
 @@ -66,10 +66,14 @@
  
  CFLAGS+=	-DLDAP_DEPRECATED
  
 +_OPENLDAP_CLIENT_PKG!=	${PKG_INFO} -Ex openldap.\*-client || ${TRUE}
 +_OPENLDAP_FLAVOUR=	${_OPENLDAP_CLIENT_PKG:C/openldap//:C/-client-.*//}
 +
  .if defined(WANT_OPENLDAP_SASL)
 +.if !empty(_OPENLDAP_CLIENT_PKG) && empty(_OPENLDAP_FLAVOUR)
 +IGNORE= cannot install: SASL support requested and ${_OPENLDAP_CLIENT_PKG} is installed
 +.endif
  _OPENLDAP_FLAVOUR=	-sasl
 -.else
 -_OPENLDAP_FLAVOUR=
  .endif
  
  # And now we are checking if we can use it
 
 --------------090807030809090105010109--
Responsible-Changed-From-To: freebsd-ports-bugs->delphij 
Responsible-Changed-By: pgollucci 
Responsible-Changed-When: Wed Jul 8 03:25:32 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135664 
Responsible-Changed-From-To: delphij->portmgr 
Responsible-Changed-By: delphij 
Responsible-Changed-When: Thu Oct 1 00:01:22 UTC 2009 
Responsible-Changed-Why:  
Over to portmgr@ as this needs a exp-run. 

To portmgr: Please test 

http://www.freebsd.org/cgi/query-pr.cgi?prp=135664-2-diff&n=/patch-2.diff 

in the next exp-run, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135664 

From: Tyler Spires <tyler@spiresfamily.com>
To: bug-followup@FreeBSD.org, yuri.pankov@gmail.com
Cc:  
Subject: Re: ports/135664: [PATCH]: bsd.ldap.mk: Detect flavour of installed
 openldap-client
Date: Fri, 20 Nov 2009 18:55:11 -0500

 I applied this patch to a 7.2 environment with openldap-2.4.19 and the 
 patch worked.
 
 Please add this to the ports tree.
 
 -Tyler
Responsible-Changed-From-To: portmgr->pav 
Responsible-Changed-By: pav 
Responsible-Changed-When: Fri Apr 16 09:34:37 UTC 2010 
Responsible-Changed-Why:  
Take for an exp-run 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135664 
Responsible-Changed-From-To: pav->delphij 
Responsible-Changed-By: pav 
Responsible-Changed-When: Mon Apr 19 21:14:42 UTC 2010 
Responsible-Changed-Why:  
Tested without an issue, okay to commit 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135664 
State-Changed-From-To: open->closed 
State-Changed-By: delphij 
State-Changed-When: Mon Apr 19 21:38:35 UTC 2010 
State-Changed-Why:  
Finally committed!  Thanks for your submission and sorry for 
the delay. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=135664 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/135664: commit references a PR
Date: Mon, 19 Apr 2010 21:38:40 +0000 (UTC)

 delphij     2010-04-19 21:38:17 UTC
 
   FreeBSD ports repository
 
   Modified files:
     Mk                   bsd.ldap.mk 
   Log:
   Automatically detect flavour of installed OpenLDAP client library.
   
   PR:             ports/135664
   Submitted by:   Yuri Pankov <yuri.pankov gmail com>
   Tested with:    exprun (by pav)
   
   Revision  Changes    Path
   1.7       +7 -3      ports/Mk/bsd.ldap.mk
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
