ports/54177: [MAINTAINER-PATCH] port net/openldap22: use ports libtool, enable perl backend, misc. tweaks

Oliver Eikemeier eikemeier at fillmore-labs.com
Mon Jul 7 11:30:03 UTC 2003


>Number:         54177
>Category:       ports
>Synopsis:       [MAINTAINER-PATCH] port net/openldap22: use ports libtool, enable perl backend, misc. tweaks
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 07 04:30:01 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:

- now *really* use libtool from ports instead of the included one
- build -dynamic for better compatibility with libltdl
  <http://www.gnu.org/manual/libtool/html_chapter/libtool_10.html#SEC52>:
  "Avoid using the -static [...] when linking programs with libltdl."
- grap back-perl fixes from OpenLDAP CVS to let FreeBSD port users
  test the perl backend
- dynamically create pkg-plist in pre-install instead of post-install
  to simplify things and guard against changes in bsd.port.mk
- bump portrevision
- miscellaneous style fixes:
  honor DESTDIR
  use rmdir instead of /bin/rmdir in @unexec
  spaces => tab

>How-To-Repeat:
>Fix:

--- openldap22-2.2.0a_2.patch begins here ---
diff -Nur openldap22/Makefile.orig openldap22/Makefile
--- openldap22/Makefile.orig	Mon Jul  7 07:39:01 2003
+++ openldap22/Makefile	Mon Jul  7 11:42:47 2003
@@ -7,7 +7,7 @@
 
 PORTNAME=	openldap
 PORTVERSION=	${OPENLDAP_VERSION}.a
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net databases
 MASTER_SITES=	ftp://ftp.OpenLDAP.org/pub/OpenLDAP/%SUBDIR%/		\
 		http://public.planetmirror.com/pub/openldap/%SUBDIR%/	\
@@ -41,15 +41,17 @@
 USE_REINPLACE=		yes
 USE_LIBTOOL_VER=	14
 
+PLIST=			${WRKDIR}/pkg-plist
 PKGINSTALL=		${WRKDIR}/pkg-install
 PKGMESSAGE=		${WRKDIR}/pkg-message
 
-LOCALSTATEDIR?=		/var/db
-LDAP_RUN_DIR?=		/var/run/openldap
+LOCALSTATEDIR?=		${DESTDIR}/var/db
+LDAP_RUN_DIR?=		${DESTDIR}/var/run/openldap
 
 WITH_BDB_VER?=		41
 
-CONFIGURE_ARGS=		--with-threads \
+CONFIGURE_ARGS=		--enable-dynamic \
+			--with-threads \
 			--with-tls=openssl
 
 SED_SCRIPT=		-e 's,%%PREFIX%%,${PREFIX},g' \
@@ -61,7 +63,7 @@
 CONFIGURE_ARGS+=	--disable-slapd
 PLIST_SUB+=		SERVER="@comment " \
 			SLAPI="@comment "
-SED_SCRIPT+=            -e '/^%%SERVER%%/d'
+SED_SCRIPT+=		-e '/^%%SERVER%%/d'
 .else
 CONFIGURE_ARGS+=	--localstatedir=${LOCALSTATEDIR} \
 			--enable-lmpasswd \
@@ -93,7 +95,6 @@
 .endif
 
 .if defined(WITH_PERL)
-.error build with Perl backend broken: <http://www.openldap.org/its/index.cgi/Development?id=2513>
 USE_PERL5=	yes
 CONFIGURE_ARGS+=	--enable-perl
 .endif
@@ -114,7 +115,6 @@
 .if defined(WITH_SLAPI)
 LIB_DEPENDS+=		ltdl.4:${PORTSDIR}/devel/libltdl
 CONFIGURE_ARGS+=	--enable-slapi
-LIBS+=			-lltdl
 PLIST_SUB+=		SLAPI=""
 .else
 PLIST_SUB+=		SLAPI="@comment "
@@ -137,7 +137,7 @@
 			-I${LOCALBASE}/include
 LDFLAGS+=		-L${LOCALBASE}/lib
 
-CONFIGURE_TARGET=	--host=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
 CONFIGURE_ENV=		CPPFLAGS="${CPPFLAGS}" \
 			LDFLAGS="${LDFLAGS}" \
 			LIBS="${LIBS}"
@@ -167,6 +167,10 @@
 	@${REINPLACE_CMD} -e 's,%LOCALSTATEDIR%/slapd\.,${LDAP_RUN_DIR}/slapd.,g' \
 		${WRKSRC}/servers/slapd/slapd.conf
 
+pre-configure:
+	@${REINPLACE_CMD} -e '/^LIBTOOL=/s^\$$(top_builddir)/libtool^${LIBTOOL}^g' \
+		${WRKSRC}/configure
+
 post-build:
 .for script in slapd.sh slurpd.sh
 	@${SED} ${SED_SCRIPT} ${FILESDIR}/${script} >${WRKDIR}/${script}
@@ -175,6 +179,18 @@
 	@${SED} ${SED_SCRIPT} ${.CURDIR}/${text} >${WRKDIR}/${text}
 .endfor
 
+pre-install:
+	@${CP} ${.CURDIR}/pkg-plist ${PLIST}
+.if !defined(NOPORTDOCS)
+	@for dir in rfc drafts; do \
+		${FIND} ${WRKSRC}/doc/$${dir} -maxdepth 1 -type f \
+			| ${SED} -e "s,^${WRKSRC}/doc/,%%DOCSDIR%%/," \
+			>>${PLIST}; \
+		${ECHO_CMD} "@dirrm %%DOCSDIR%%/$${dir}" >>${PLIST}; \
+	done
+	@${ECHO_CMD} "@dirrm %%DOCSDIR%%" >>${PLIST}
+.endif
+
 post-install:
 .if !defined(CLIENT_ONLY)
 	@${INSTALL_SCRIPT} ${WRKDIR}/slapd.sh ${WRKDIR}/slurpd.sh ${PREFIX}/etc/rc.d
@@ -185,12 +201,8 @@
 	@for dir in rfc drafts; do \
 		${MKDIR} ${DOCSDIR}/$${dir}; \
 		${FIND} ${WRKSRC}/doc/$${dir} -maxdepth 1 -type f \
-			-exec ${INSTALL_DATA} {} ${DOCSDIR}/$${dir} \; -print \
-			| ${SED} -e "s,^${WRKSRC}/doc/,${DOCSDIR:S,^${PREFIX}/,,}/," \
-			>>${TMPPLIST}; \
-		${ECHO_CMD} "@dirrm ${DOCSDIR:S,^${PREFIX}/,,}/$${dir}" >>${TMPPLIST}; \
+			-exec ${INSTALL_DATA} {} ${DOCSDIR}/$${dir} \; ; \
 	done
-	@${ECHO_CMD} "@dirrm ${DOCSDIR:S,^${PREFIX}/,,}" >>${TMPPLIST}
 .endif
 	@${CAT} ${PKGMESSAGE}
 
diff -Nur openldap22/files/patch-build::ltmain.sh.orig openldap22/files/patch-build::ltmain.sh
--- openldap22/files/patch-build::ltmain.sh.orig	Wed Jul  2 16:49:57 2003
+++ openldap22/files/patch-build::ltmain.sh	Thu Jan  1 01:00:00 1970
@@ -1,15 +0,0 @@
---- build/ltmain.sh.orig	Sun Feb  9 23:24:29 2003
-+++ build/ltmain.sh	Fri Jun 20 21:37:02 2003
-@@ -4285,12 +4285,6 @@
- 	  IFS="$save_ifs"
- 	fi
- 
--	# Install the pseudo-library for information purposes.
--	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
--	instname="$dir/$name"i
--	$show "$install_prog $instname $destdir/$name"
--	$run eval "$install_prog $instname $destdir/$name" || exit $?
--
- 	# Maybe install the static library, too.
- 	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
- 	;;
diff -Nur openldap22/files/patch-build::top.mk.orig openldap22/files/patch-build::top.mk
--- openldap22/files/patch-build::top.mk.orig	Thu Jan  1 01:00:00 1970
+++ openldap22/files/patch-build::top.mk	Mon Jul  7 05:36:49 2003
@@ -0,0 +1,11 @@
+--- build/top.mk.orig	Mon Apr  7 22:23:26 2003
++++ build/top.mk	Mon Jul  7 05:35:52 2003
+@@ -192,6 +192,8 @@
+ SLAPD_LIBS = @SLAPD_LIBS@ @SLAPD_PERL_LDFLAGS@ @SLAPD_SQL_LDFLAGS@ @SLAPD_SQL_LIBS@ @SLAPD_SLP_LIBS@
+ SLURPD_LIBS = @SLURPD_LIBS@
+ 
++SLAPI_LIBS = @SLAPI_LIBS@
++
+ # Our Defaults
+ CC = $(AC_CC)
+ DEFS = $(LDAP_INCPATH) $(XINCPATH) $(XDEFS) $(AC_DEFS) $(DEFINES)
diff -Nur openldap22/files/patch-libraries::liblunicode::ucstr.c.orig openldap22/files/patch-libraries::liblunicode::ucstr.c
--- openldap22/files/patch-libraries::liblunicode::ucstr.c.orig	Mon Jul  7 07:39:01 2003
+++ openldap22/files/patch-libraries::liblunicode::ucstr.c	Sun Jul  6 02:52:24 2003
@@ -1,11 +1,11 @@
 --- libraries/liblunicode/ucstr.c.orig	Fri Apr 11 03:57:10 2003
-+++ libraries/liblunicode/ucstr.c	Sat Jul  5 10:53:04 2003
-@@ -15,6 +15,8 @@
++++ libraries/liblunicode/ucstr.c	Sun Jul  6 02:50:32 2003
+@@ -10,7 +10,7 @@
+ #include <ac/string.h>
+ #include <ac/stdlib.h>
+ 
+-#include <lber.h>
++#include <lber_pvt.h>
+ 
  #include <ldap_utf8.h>
  #include <ldap_pvt_uc.h>
- 
-+#include "lber_pvt.h"
-+
- #define	malloc(x)	ber_memalloc_x(x,ctx)
- #define	realloc(x,y)	ber_memrealloc_x(x,y,ctx)
- #define	free(x)		ber_memfree_x(x,ctx)
diff -Nur openldap22/files/patch-servers::slapd::back-perl.orig openldap22/files/patch-servers::slapd::back-perl
--- openldap22/files/patch-servers::slapd::back-perl.orig	Thu Jan  1 01:00:00 1970
+++ openldap22/files/patch-servers::slapd::back-perl	Mon Jul  7 02:29:21 2003
@@ -0,0 +1,302 @@
+diff -Nur servers/slapd/back-perl/add.c.orig servers/slapd/back-perl/add.c
+--- servers/slapd/back-perl/add.c.orig	Sun May 25 03:56:59 2003
++++ servers/slapd/back-perl/add.c	Thu Jun  5 11:44:06 2003
+@@ -13,17 +13,19 @@
+  *	 in file LICENSE in the top-level directory of the distribution.
+  */
+ 
+-#include "portable.h"
+-
+-#include <stdio.h>
++#include <EXTERN.h>
++#include <perl.h>
++#undef _ /* #defined used by both Perl and ac/localize.h */
+ 
+-#include "slap.h"
+ #ifdef HAVE_WIN32_ASPERL
+ #include "asperl_undefs.h"
+ #endif
+ 
+-#include <EXTERN.h>
+-#include <perl.h>
++#include "portable.h"
++
++#include <stdio.h>
++
++#include "slap.h"
+ 
+ #include "perl_back.h"
+ 
+diff -Nur servers/slapd/back-perl/bind.c.orig servers/slapd/back-perl/bind.c
+--- servers/slapd/back-perl/bind.c.orig	Sun May 25 03:56:59 2003
++++ servers/slapd/back-perl/bind.c	Thu Jun  5 11:44:06 2003
+@@ -13,18 +13,19 @@
+  *	 in file LICENSE in the top-level directory of the distribution.
+  */
+ 
+-#include "portable.h"
+-/* init.c - initialize Perl backend */
+-	
+-#include <stdio.h>
++#include <EXTERN.h>
++#include <perl.h>
++#undef _ /* #defined used by both Perl and ac/localize.h */
+ 
+-#include "slap.h"
+ #ifdef HAVE_WIN32_ASPERL
+ #include "asperl_undefs.h"
+ #endif
+ 
+-#include <EXTERN.h>
+-#include <perl.h>
++#include "portable.h"
++	
++#include <stdio.h>
++
++#include "slap.h"
+ 
+ #include "perl_back.h"
+ 
+diff -Nur servers/slapd/back-perl/close.c.orig servers/slapd/back-perl/close.c
+--- servers/slapd/back-perl/close.c.orig	Sun May 25 03:56:59 2003
++++ servers/slapd/back-perl/close.c	Thu Jun  5 11:44:06 2003
+@@ -13,18 +13,19 @@
+  *	 in file LICENSE in the top-level directory of the distribution.
+  */
+ 
+-#include "portable.h"
+-/* init.c - initialize shell backend */
+-	
+-#include <stdio.h>
++#include <EXTERN.h>
++#include <perl.h>
++#undef _ /* #defined used by both Perl and ac/localize.h */
+ 
+-#include "slap.h"
+ #ifdef HAVE_WIN32_ASPERL
+ #include "asperl_undefs.h"
+ #endif
+ 
+-#include <EXTERN.h>
+-#include <perl.h>
++#include "portable.h"
++	
++#include <stdio.h>
++
++#include "slap.h"
+ 
+ #include "perl_back.h"
+ 
+diff -Nur servers/slapd/back-perl/compare.c.orig servers/slapd/back-perl/compare.c
+--- servers/slapd/back-perl/compare.c.orig	Sun May 25 03:56:59 2003
++++ servers/slapd/back-perl/compare.c	Thu Jun  5 11:44:06 2003
+@@ -13,17 +13,19 @@
+  *	 in file LICENSE in the top-level directory of the distribution.
+  */
+ 
+-#include "portable.h"
+-
+-#include <stdio.h>
++#include <EXTERN.h>
++#include <perl.h>
++#undef _ /* #defined used by both Perl and ac/localize.h */
+ 
+-#include "slap.h"
+ #ifdef HAVE_WIN32_ASPERL
+ #include "asperl_undefs.h"
+ #endif
+ 
+-#include <EXTERN.h>
+-#include <perl.h>
++#include "portable.h"
++
++#include <stdio.h>
++
++#include "slap.h"
+ 
+ #include "lutil.h"
+ #include "perl_back.h"
+diff -Nur servers/slapd/back-perl/config.c.orig servers/slapd/back-perl/config.c
+--- servers/slapd/back-perl/config.c.orig	Sun May 25 03:56:59 2003
++++ servers/slapd/back-perl/config.c	Thu Jun  5 11:44:06 2003
+@@ -13,17 +13,19 @@
+  *	 in file LICENSE in the top-level directory of the distribution.
+  */
+ 
+-#include "portable.h"
+-	
+-#include <stdio.h>
++#include <EXTERN.h>
++#include <perl.h>
++#undef _ /* #defined used by both Perl and ac/localize.h */
+ 
+-#include "slap.h"
+ #ifdef HAVE_WIN32_ASPERL
+ #include "asperl_undefs.h"
+ #endif
+ 
+-#include <EXTERN.h>
+-#include <perl.h>
++#include "portable.h"
++	
++#include <stdio.h>
++
++#include "slap.h"
+ 
+ #include "perl_back.h"
+ 
+diff -Nur servers/slapd/back-perl/delete.c.orig servers/slapd/back-perl/delete.c
+--- servers/slapd/back-perl/delete.c.orig	Sun May 25 03:56:59 2003
++++ servers/slapd/back-perl/delete.c	Thu Jun  5 11:44:06 2003
+@@ -13,17 +13,19 @@
+  *	 in file LICENSE in the top-level directory of the distribution.
+  */
+ 
+-#include "portable.h"
+-
+-#include <stdio.h>
++#include <EXTERN.h>
++#include <perl.h>
++#undef _ /* #defined used by both Perl and ac/localize.h */
+ 
+-#include "slap.h"
+ #ifdef HAVE_WIN32_ASPERL
+ #include "asperl_undefs.h"
+ #endif
+ 
+-#include <EXTERN.h>
+-#include <perl.h>
++#include "portable.h"
++
++#include <stdio.h>
++
++#include "slap.h"
+ 
+ #include "perl_back.h"
+ 
+diff -Nur servers/slapd/back-perl/init.c.orig servers/slapd/back-perl/init.c
+--- servers/slapd/back-perl/init.c.orig	Sun May 25 03:56:59 2003
++++ servers/slapd/back-perl/init.c	Thu Jun 12 22:25:21 2003
+@@ -13,18 +13,19 @@
+  *	 in file LICENSE in the top-level directory of the distribution.
+  */
+ 
+-#include "portable.h"
+- /* init.c - initialize shell backend */
+-	
+-#include <stdio.h>
++#include <EXTERN.h>
++#include <perl.h>
++#undef _ /* #defined used by both Perl and ac/localize.h */
+ 
+-#include "slap.h"
+ #ifdef HAVE_WIN32_ASPERL
+ #include "asperl_undefs.h"
+ #endif
+ 
+-#include <EXTERN.h>
+-#include <perl.h>
++#include "portable.h"
++	
++#include <stdio.h>
++
++#include "slap.h"
+ 
+ #include "perl_back.h"
+ 
+@@ -37,7 +38,7 @@
+ 
+ #ifdef SLAPD_PERL_DYNAMIC
+ 
+-int back_perl_LTX_init_module(int argc, char *argv[])
++int init_module(int argc, char *argv[])
+ {
+ 	BackendInfo bi;
+ 
+diff -Nur servers/slapd/back-perl/modify.c.orig servers/slapd/back-perl/modify.c
+--- servers/slapd/back-perl/modify.c.orig	Sun May 25 03:56:59 2003
++++ servers/slapd/back-perl/modify.c	Thu Jun  5 11:44:06 2003
+@@ -13,17 +13,19 @@
+  *	 in file LICENSE in the top-level directory of the distribution.
+  */
+ 
+-#include "portable.h"
+-
+-#include <stdio.h>
++#include <EXTERN.h>
++#include <perl.h>
++#undef _ /* #defined used by both Perl and ac/localize.h */
+ 
+-#include "slap.h"
+ #ifdef HAVE_WIN32_ASPERL
+ #include "asperl_undefs.h"
+ #endif
+ 
+-#include <EXTERN.h>
+-#include <perl.h>
++#include "portable.h"
++
++#include <stdio.h>
++
++#include "slap.h"
+ 
+ #include "perl_back.h"
+ 
+diff -Nur servers/slapd/back-perl/modrdn.c.orig servers/slapd/back-perl/modrdn.c
+--- servers/slapd/back-perl/modrdn.c.orig	Sun May 25 03:56:59 2003
++++ servers/slapd/back-perl/modrdn.c	Thu Jun  5 11:44:06 2003
+@@ -26,17 +26,19 @@
+  *
+  */
+ 
+-#include "portable.h"
+-
+-#include <stdio.h>
++#include <EXTERN.h>
++#include <perl.h>
++#undef _ /* #defined used by both Perl and ac/localize.h */
+ 
+-#include "slap.h"
+ #ifdef HAVE_WIN32_ASPERL
+ #include "asperl_undefs.h"
+ #endif
+ 
+-#include <EXTERN.h>
+-#include <perl.h>
++#include "portable.h"
++
++#include <stdio.h>
++
++#include "slap.h"
+ 
+ #include "perl_back.h"
+ 
+diff -Nur servers/slapd/back-perl/search.c.orig servers/slapd/back-perl/search.c
+--- servers/slapd/back-perl/search.c.orig	Sun May 25 03:56:59 2003
++++ servers/slapd/back-perl/search.c	Thu Jun  5 11:44:06 2003
+@@ -13,17 +13,19 @@
+  *	 in file LICENSE in the top-level directory of the distribution.
+  */
+ 
+-#include "portable.h"
+-
+-#include <stdio.h>
++#include <EXTERN.h>
++#include <perl.h>
++#undef _ /* #defined used by both Perl and ac/localize.h */
+ 
+-#include "slap.h"
+ #ifdef HAVE_WIN32_ASPERL
+ #include "asperl_undefs.h"
+ #endif
+ 
+-#include <EXTERN.h>
+-#include <perl.h>
++#include "portable.h"
++
++#include <stdio.h>
++
++#include "slap.h"
+ 
+ #include "perl_back.h"
+ 
diff -Nur openldap22/pkg-plist.orig openldap22/pkg-plist
--- openldap22/pkg-plist.orig	Wed Jul  2 16:49:56 2003
+++ openldap22/pkg-plist	Mon Jul  7 06:05:59 2003
@@ -39,8 +39,8 @@
 %%SERVER%%@unexec if cmp -s %D/etc/openldap/slapd.conf %D/etc/openldap/slapd.conf.default; then rm -f %D/etc/openldap/slapd.conf; fi
 %%SERVER%%etc/openldap/slapd.conf.default
 %%SERVER%%@exec [ -f %B/slapd.conf ] || cp %B/%f %B/slapd.conf
-%%SERVER%%@unexec /bin/rmdir %D/etc/openldap/schema 2>/dev/null || true
- at unexec /bin/rmdir %D/etc/openldap 2>/dev/null || true
+%%SERVER%%@unexec rmdir %D/etc/openldap/schema 2>/dev/null || true
+ at unexec rmdir %D/etc/openldap 2>/dev/null || true
 %%SERVER%%etc/rc.d/slapd.sh
 %%SERVER%%etc/rc.d/slurpd.sh
 include/lber.h
@@ -78,6 +78,6 @@
 share/openldap/ucdata/num.dat
 @dirrm share/openldap/ucdata
 @dirrm share/openldap
-%%SERVER%%@unexec /bin/rmdir %%LOCALSTATEDIR%%/openldap-slurp 2>/dev/null || true
-%%SERVER%%@unexec /bin/rmdir %%LOCALSTATEDIR%%/openldap-data 2>/dev/null || true
-%%SERVER%%@unexec /bin/rmdir %%LDAP_RUN_DIR%% 2>/dev/null || true
+%%SERVER%%@unexec rmdir %%LOCALSTATEDIR%%/openldap-slurp 2>/dev/null || true
+%%SERVER%%@unexec rmdir %%LOCALSTATEDIR%%/openldap-data 2>/dev/null || true
+%%SERVER%%@unexec rmdir %%LDAP_RUN_DIR%% 2>/dev/null || true
--- openldap22-2.2.0a_2.patch ends here ---

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



More information about the freebsd-ports-bugs mailing list