1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-20 04:02:27 +00:00

Updates, cleanups and improvements over the openldap23-* ports:

- Make sure that PKGNAMESUFFIX and COMMENT are correctly set when
   building slave ports. [1]
 - Remove RCORDER feature which is now deprecated.
 - Move PORTREVISION related stuff to before bsd.port.pre.mk in
   order to get the revisions actually work.
 - Depend on CLIENT_ONLY and WITH_SASL to determine the package
   name suffix.
 - Make use of USE_OPENLDAP instead of rolling our own.
 - Use WITH_RC_SUBR correctly rather than just specifying "yes"
 - Depend on bsd.database.mk to determine the Berkeley DB name,
   which makes it possible to use versions available from the
   ports collection rather than making decision our own. [2]
 - Disable threading as suggested by openldap developers if
   BACK_SHELL is enabled.  Indicate the fact when showing options.
 - Update to 2.3.23

PR:	 	91902[1], 96752 [2]
Submitted by:	Gyorgy TEUBEL <tgyurci freemail hu> [1]
		Sunpoet Po-Chuan Hsieh <sunpoet sunpoet net> [2]
Approved by:	sem (mentor)

Other changes, blames and all bugs are mine.
This commit is contained in:
Xin LI 2006-05-18 15:03:48 +00:00
parent a41498c0cf
commit c173260165
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=162712
10 changed files with 52 additions and 99 deletions

View File

@ -5,10 +5,6 @@
# $FreeBSD$
#
PKGNAMESUFFIX= -client
COMMENT= Open source LDAP client implementation
CLIENT_ONLY= yes
WITHOUT_SASL= yes

View File

@ -5,10 +5,6 @@
# $FreeBSD$
#
PKGNAMESUFFIX= -sasl-client
COMMENT= Open source LDAP client implementation with SASL2 support
CLIENT_ONLY= yes
WITH_SASL= yes

View File

@ -6,7 +6,7 @@
#
PORTNAME= openldap
DISTVERSION= 2.3.21
DISTVERSION= 2.3.23
PORTREVISION= ${OPENLDAP_PORTREVISION}
CATEGORIES= net databases
MASTER_SITES= ftp://ftp.OpenLDAP.org/pub/OpenLDAP/%SUBDIR%/ \
@ -32,19 +32,20 @@ COMMENT?= Open source LDAP server implementation
UNIQUENAME?= ${PKGNAMEPREFIX}openldap23
LATEST_LINK?= ${UNIQUENAME}${PKGNAMESUFFIX}
USE_OPENSSL= yes
WANT_OPENLDAP_VER?= 23
.if ${WANT_OPENLDAP_VER} != 23
BROKEN= "incompatible OpenLDAP version: ${WANT_OPENLDAP_VER}"
BROKEN= incompatible OpenLDAP version: ${WANT_OPENLDAP_VER}
.endif
PORTREVISION_CLIENT= 0
PORTREVISION_SERVER= 2
PORTREVISION_SERVER= 0
.if !defined(CLIENT_ONLY)
OPTIONS= SASL "With (Cyrus) SASL2 support" on \
PERL "With Perl backend" off \
SHELL "With Shell backend" on \
SHELL "With Shell backend (disables threading)" on \
ODBC "With SQL backend" off \
SLP "With SLPv2 (RFC 2608) support" off \
SLAPI "With Netscape SLAPI plugin API" off \
@ -66,53 +67,53 @@ OPTIONS= SASL "With (Cyrus) SASL2 support" on \
UNIQUE "With attribute Uniqueness overlay" off \
VALSORT "With Value Sorting overlay" off \
ACI "With per-object ACIs (experimental)" off \
DYNAMIC_BACKENDS "Build dynamic backends" on \
RCORDER "Add rc order for slapd(1)" off
DYNAMIC_BACKENDS "Build dynamic backends" on
.endif
.if defined(CLIENT_ONLY)
OPENLDAP_PORTREVISION= ${PORTREVISION_CLIENT}
OPENLDAP_PKGFILESUFX= .client
.else
OPENLDAP_PORTREVISION= ${PORTREVISION_SERVER}
OPENLDAP_PKGFILESUFX=
.endif
.include <bsd.port.pre.mk>
.if defined(CLIENT_ONLY)
OPENLDAP_PORTREVISION= ${PORTREVISION_CLIENT}
OPENLDAP_PKGFILESUFX= .client
.if ${PKGNAMESUFFIX} == "-sasl-client"
.if defined(WITH_SASL)
PKGNAMESUFFIX= -sasl-client
COMMENT= Open source LDAP client implementation with SASL2 support
CONFLICTS= ${PKGNAMEPREFIX}${PORTNAME}-client-2.* \
${PKGNAMEPREFIX}${PORTNAME}-sasl-client-2.[!3].*
.elif ${PKGNAMESUFFIX} == "-client"
.else
PKGNAMESUFFIX= -client
COMMENT= Open source LDAP client implementation
CONFLICTS= ${PKGNAMEPREFIX}${PORTNAME}-client-2.[!3].* \
${PKGNAMEPREFIX}${PORTNAME}-sasl-client-2.*
.else
BROKEN= "Unknown PKGNAMESUFFIX ${PKGNAMESUFFIX}"
.endif
PORTDOCS= CHANGES drafts rfc
.if defined(USE_OPENLDAP)
IGNORE= : You have \`USE_OPENLDAP' defined either in your environment or in make(1) arguments
BROKEN= You have `USE_OPENLDAP' variable defined either in environment or in make(1) arguments. Please undefine and try again.
.endif
.else
OPENLDAP_PORTREVISION= ${PORTREVISION_SERVER}
OPENLDAP_PKGFILESUFX=
USE_OPENLDAP= yes
WANT_OPENLDAP_VER= 23
.if defined(WITH_SASL) && !defined(WITHOUT_SASL)
RUN_DEPENDS= ${LOCALBASE}/lib/libldap-2.3.so.2:${PORTSDIR}/net/openldap23-sasl-client
CONFLICTS= ${PKGNAMEPREFIX}${PORTNAME}-client-2.*
.else
RUN_DEPENDS= ${LOCALBASE}/lib/libldap-2.3.so.2:${PORTSDIR}/net/openldap23-client
CONFLICTS= ${PKGNAMEPREFIX}${PORTNAME}-sasl-client-2.*
.endif
.endif
USE_OPENSSL= yes
USE_AUTOTOOLS= libtool:15
DESCR= ${PKGDIR}/pkg-descr${OPENLDAP_PKGFILESUFX}
PLIST= ${PKGDIR}/pkg-plist${OPENLDAP_PKGFILESUFX}
PKGINSTALL= ${WRKDIR}/pkg-install
PKGMESSAGE= ${WRKDIR}/pkg-message
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
SCHEMATA= corba core cosine dyngroup \
inetorgperson java misc \
@ -123,15 +124,11 @@ LOCALSTATEDIR?= /var/db
DATABASEDIR?= ${LOCALSTATEDIR}/openldap-data
SLURPDIR?= ${LOCALSTATEDIR}/openldap-slurp
PLIST_SUB+= LDAP_RUN_DIR=${LDAP_RUN_DIR} \
SUB_FILES+= pkg-install pkg-message pkg-deinstall
SUB_LIST+= LDAP_RUN_DIR=${LDAP_RUN_DIR} \
DATABASEDIR=${DATABASEDIR} \
SLURPDIR=${SLURPDIR} \
SED_SCRIPT= -e 's,%%PKGNAME%%,${PKGNAME},g' \
-e 's,%%PREFIX%%,${PREFIX},g' \
-e 's,%%LDAP_RUN_DIR%%,${LDAP_RUN_DIR},g' \
-e 's,%%DATABASEDIR%%,${DATABASEDIR},g' \
-e 's,%%SLURPDIR%%,${SLURPDIR},g'
PKGNAME=${PKGNAME}
CONFIGURE_ARGS= --with-threads=posix \
--with-tls=openssl \
@ -159,7 +156,7 @@ INSTALLS_SHLIB= yes
.else
# server specific configuration
USE_RC_SUBR= yes
USE_RC_SUBR= slapd.sh slurpd.sh
EXTRA_PATCHES+= ${FILESDIR}/extrapatch-Makefile.in
@ -270,52 +267,35 @@ PLIST_SUB+= BACK_BDB="@comment " \
.else
WITH_BDB_VER?= 43
USE_BDB= yes
.if ${WITH_BDB_VER} == 43
.if ${WITH_BDB_VER} >= 42
CONFIGURE_ARGS+= --enable-bdb=${BACKEND_ENABLE} \
--enable-hdb=${BACKEND_ENABLE}
PLIST_SUB+= BACK_BDB=${BACKEND_PLIST} \
BACK_HDB=${BACKEND_PLIST}
BDBLIB= db-4.3.0
.elif ${WITH_BDB_VER} == 42
CONFIGURE_ARGS+= --enable-bdb=${BACKEND_ENABLE} \
--enable-hdb=${BACKEND_ENABLE}
PLIST_SUB+= BACK_BDB=${BACKEND_PLIST} \
BACK_HDB=${BACKEND_PLIST}
BDBLIB= db-4.2.2
.elif ${WITH_BDB_VER} == 41
.elif ${WITH_BDB_VER} >= 4
CONFIGURE_ARGS+= --disable-bdb \
--enable-hdb=${BACKEND_ENABLE}
PLIST_SUB+= BACK_BDB="@comment " \
BACK_HDB=${BACKEND_PLIST}
BDBLIB= db41.1
.elif ${WITH_BDB_VER} == 4
CONFIGURE_ARGS+= --disable-bdb \
--enable-hdb=${BACKEND_ENABLE}
PLIST_SUB+= BACK_BDB="@comment " \
BACK_HDB=${BACKEND_PLIST}
BDBLIB= db4.0
.elif ${WITH_BDB_VER} == 3
CONFIGURE_ARGS+= --disable-bdb \
--disable-hdb
PLIST_SUB+= BACK_BDB="@comment " \
BACK_HDB="@comment "
BDBLIB= db3.3
.else
IGNORE= : WITH_BDB_VER must be 3, 4, 41, 42 or 43
.endif
LIB_DEPENDS+= ${BDBLIB}:${PORTSDIR}/databases/db${WITH_BDB_VER}
CPPFLAGS+= -I${LOCALBASE}/include/db${WITH_BDB_VER}
CPPFLAGS+= -I${BDB_INCLUDE_DIR}
CONFIGURE_ARGS+= --enable-ldbm-api=berkeley
CONFIGURE_SED+= -e 's,ol_DB_LIB=$$,&-l${BDBLIB:R},' \
-e 's,(ol_cv_lib_db=)yes$$,\1-l${BDBLIB:R},'
CONFIGURE_SED+= -e 's,ol_DB_LIB=$$,&-l${BDB_LIB_NAME:R},' \
-e 's,(ol_cv_lib_db=)yes$$,\1-l${BDB_LIB_NAME:R},'
.endif
.if defined(WITHOUT_SHELL)
PLIST_SUB+= BACK_SHELL="@comment "
.else
CONFIGURE_ARGS+= --enable-shell=${BACKEND_ENABLE}
CONFIGURE_ARGS+= --without-threads --enable-shell=${BACKEND_ENABLE}
PLIST_SUB+= BACK_SHELL=${BACKEND_PLIST}
.endif
@ -341,7 +321,7 @@ LIB_DEPENDS+= iodbc.3:${PORTSDIR}/databases/libiodbc
.elif ${WITH_ODBC_TYPE:L} == unixodbc
LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
.else
IGNORE= : WITH_ODBC_TYPE must be iODBC or unixODBC
BROKEN= choose either iODBC or unixODBC for WITH_ODBC_TYPE
.endif
.else
PLIST_SUB+= BACK_SQL="@comment "
@ -385,21 +365,19 @@ CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" \
.if defined(CLIENT_ONLY)
.include "${FILESDIR}/manpages"
.else
.if defined(WITH_RCORDER) && ( defined(DFOSVERSION) || ${OSVERSION} >= 500038 )
RC_DIR= /
.if (${OSVERSION} >= 700007 || (${OSVERSION} < 700000 && ${OSVERSION} >= 600101))
RC_SUFX=
PLIST_SUB+= RCORDER="" RC_DIR=""
.else
RC_DIR= ${PREFIX}
RC_SUFX= .sh
PLIST_SUB+= RCORDER="@comment " RC_DIR="%D"
.endif
SED_SCRIPT+= -e 's,%%RC_SUBR%%,${RC_SUBR},g' \
-e 's,%%RC_DIR%%,${RC_DIR:S/\/$//},g' \
-e 's,%%RC_SUFX%%,${RC_SUFX},g'
PLIST_SUB+= RC_SUFX=${RC_SUFX}
SUB_LIST+= RC_DIR=${PREFIX} \
RC_SUFX=${RC_SUFX} \
LDAP_RUN_DIR=${LDAP_RUN_DIR} \
DATABASEDIR=${DATABASEDIR}
.endif
PLIST_SUB+= ${SUB_LIST}
post-patch:
@${REINPLACE_CMD} -e 's,%LOCALSTATEDIR%/run/,${LDAP_RUN_DIR}/,g' \
${SED_MODULES} ${WRKSRC}/servers/slapd/slapd.conf
@ -414,17 +392,6 @@ pre-configure:
${FALSE}; \
fi
post-build:
.for script in slapd slurpd
@${SED} ${SED_SCRIPT} ${FILESDIR}/${script}.sh >${WRKDIR}/${script}.sh
.endfor
.for text in pkg-install pkg-message pkg-deinstall
@if [ -f ${PKGDIR}/${text}${OPENLDAP_PKGFILESUFX} ]; then \
${SED} ${SED_SCRIPT} ${PKGDIR}/${text}${OPENLDAP_PKGFILESUFX} \
>${WRKDIR}/${text}; \
fi
.endfor
.if !defined(CLIENT_ONLY)
test: build
@cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} \
@ -460,12 +427,6 @@ post-install:
done >>${TMPPLIST}
@${ECHO_CMD} "@unexec ${RMDIR} %D/etc/openldap/schema 2>/dev/null || true" >>${TMPPLIST}
@${ECHO_CMD} "@unexec ${RMDIR} %D/etc/openldap 2>/dev/null || true" >>${TMPPLIST}
@[ "${RC_DIR:S/\/$//}" = "${PREFIX}" ] || ${ECHO_CMD} "@cwd ${RC_DIR}" >>${TMPPLIST}
.for script in slapd slurpd
@${INSTALL_SCRIPT} ${WRKDIR}/${script}.sh ${DESTDIR}${RC_DIR:S/\/$//}/etc/rc.d/${script}${RC_SUFX}
@${ECHO_CMD} "etc/rc.d/${script}${RC_SUFX}" >>${TMPPLIST}
.endfor
@[ "${RC_DIR:S/\/$//}" = "${PREFIX}" ] || ${ECHO_CMD} "@cwd ${PREFIX}" >>${TMPPLIST}
.endif
@${CAT} ${PKGMESSAGE}

View File

@ -1,3 +1,3 @@
MD5 (openldap-2.3.21.tgz) = 37ef142fc05abd088a4bb2d30dc4c679
SHA256 (openldap-2.3.21.tgz) = 12204e82276036742f4595122ca2c4ca173e7144a449f1d6d4950273c94a0ef5
SIZE (openldap-2.3.21.tgz) = 3750778
MD5 (openldap-2.3.23.tgz) = 46b5a2f92c798d542f7bb545f118b04a
SHA256 (openldap-2.3.23.tgz) = 69646370351b9f46dbfdd9c029a99a96537305c8197027e81935b6fe35fa19d6
SIZE (openldap-2.3.23.tgz) = 3755995

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $FreeBSD$
# $FreeBSD: /tmp/pcvs/ports/net/openldap23-server/files/pkg-deinstall.in,v 1.1 2006-05-18 15:03:48 delphij Exp $
#
ECHO_CMD=echo

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $FreeBSD$
# $FreeBSD: /tmp/pcvs/ports/net/openldap23-server/files/pkg-install.in,v 1.1 2006-05-18 15:03:48 delphij Exp $
#
CHOWN=/usr/sbin/chown

View File

@ -10,7 +10,7 @@ to suit your needs and add the following lines to /etc/rc.conf:
slapd_sockets="/var/run/openldap/ldapi"
Then start the server with
%%RC_DIR%%/etc/rc.d/slapd%%RC_SUFX%% start
%%PREFIX%%/etc/rc.d/slapd%%RC_SUFX%% start
or reboot.
Try `man slapd' and the online manual at
@ -18,6 +18,6 @@ Try `man slapd' and the online manual at
for more information.
slapd runs under a non-privileged user id (by default `ldap'),
see %%RC_DIR%%/etc/rc.d/slapd%%RC_SUFX%% for more information.
see %%PREFIX%%/etc/rc.d/slapd%%RC_SUFX%% for more information.
************************************************************

View File

@ -66,8 +66,8 @@ sbin/slapindex
sbin/slappasswd
sbin/slaptest
@exec mkdir -p %%LDAP_RUN_DIR%%
@unexec rmdir %%LDAP_RUN_DIR%% 2>/dev/null || true
@dirrmtry %%LDAP_RUN_DIR%%
@exec mkdir -p %%DATABASEDIR%%
@unexec rmdir %%DATABASEDIR%% 2>/dev/null || true
@dirrmtry %%DATABASEDIR%%
@exec mkdir -p %%SLURPDIR%%
@unexec rmdir %%SLURPDIR%% 2>/dev/null || true
@dirrmtry %%SLURPDIR%%