Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Sep 2021 21:06:23 GMT
From:      Xin LI <delphij@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 53fec214c68a - main - net/openldap25-server: OpenLDAP 2.5.7
Message-ID:  <202109052106.185L6Nvw053374@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by delphij:

URL: https://cgit.FreeBSD.org/ports/commit/?id=53fec214c68a54ed9307c26634668a620cdb7304

commit 53fec214c68a54ed9307c26634668a620cdb7304
Author:     Xin LI <delphij@FreeBSD.org>
AuthorDate: 2021-09-05 21:05:56 +0000
Commit:     Xin LI <delphij@FreeBSD.org>
CommitDate: 2021-09-05 21:05:57 +0000

    net/openldap25-server: OpenLDAP 2.5.7
---
 Mk/bsd.ldap.mk                                     |   3 +-
 net/Makefile                                       |   2 +
 net/openldap25-client/Makefile                     |   7 +
 net/openldap25-server/Makefile                     | 434 +++++++++++++++++++++
 net/openldap25-server/distinfo                     |   3 +
 net/openldap25-server/files/extrapatch-Makefile.in |  17 +
 ...xtrapatch-outlook-servers__slapd__schema_prep.c |  15 +
 net/openldap25-server/files/patch-ITS7548          | 103 +++++
 net/openldap25-server/files/patch-build__top.mk    |  11 +
 net/openldap25-server/files/patch-configure        |  32 ++
 .../patch-contrib_slapd-modules_passwd_sha2_sha2.h |  24 ++
 .../patch-contrib_slapd-modules_smbk5pwd_Makefile  |  11 +
 .../files/patch-include__ldap_defaults.h           |  11 +
 .../files/patch-libraries__libldap__Makefile.in    |  17 +
 .../files/patch-libraries_libldap_tls__o.c         |  20 +
 .../files/patch-servers_slapd_Makefile.in          |  67 ++++
 .../files/patch-servers_slapd_daemon.c             |  14 +
 net/openldap25-server/files/pkg-deinstall.in       |  32 ++
 net/openldap25-server/files/pkg-message.client.in  |  15 +
 net/openldap25-server/files/pkg-message.in         |  37 ++
 net/openldap25-server/files/slapd.in               | 217 +++++++++++
 net/openldap25-server/pkg-descr                    |  11 +
 net/openldap25-server/pkg-descr.client             |  11 +
 net/openldap25-server/pkg-plist                    | 318 +++++++++++++++
 net/openldap25-server/pkg-plist.client             | 232 +++++++++++
 25 files changed, 1663 insertions(+), 1 deletion(-)

diff --git a/Mk/bsd.ldap.mk b/Mk/bsd.ldap.mk
index 6967fcd2d48e..a6f37dd99b10 100644
--- a/Mk/bsd.ldap.mk
+++ b/Mk/bsd.ldap.mk
@@ -32,9 +32,10 @@ Database_Include_MAINTAINER=		ports@FreeBSD.org
 DEFAULT_OPENLDAP_VER?=	24
 # OpenLDAP client versions currently supported
 OPENLDAP24_LIB=		libldap-2.4.so.2
+OPENLDAP25_LIB=		libldap-2.5.so.0
 
 .if exists(${LOCALBASE}/bin/ldapwhoami)
-_OPENLDAP_VER!=	${LOCALBASE}/bin/ldapwhoami -VV 2>&1 | ${GREP} ldapwhoami | ${SED} -E 's/.*OpenLDAP: ldapwhoami (2)\.(3|4).*/\1\2/'
+_OPENLDAP_VER!=	${LOCALBASE}/bin/ldapwhoami -VV 2>&1 | ${GREP} ldapwhoami | ${SED} -E 's/.*OpenLDAP: ldapwhoami (2)\.([0-9]).*/\1\2/'
 .endif
 
 .if defined(WANT_OPENLDAP_VER)
diff --git a/net/Makefile b/net/Makefile
index 0ea1cf03a895..99a56b96f33a 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -547,6 +547,8 @@
     SUBDIR += openbgpd6
     SUBDIR += openldap24-client
     SUBDIR += openldap24-server
+    SUBDIR += openldap25-client
+    SUBDIR += openldap25-server
     SUBDIR += openmdns
     SUBDIR += openmpi
     SUBDIR += openmpi3
diff --git a/net/openldap25-client/Makefile b/net/openldap25-client/Makefile
new file mode 100644
index 000000000000..f0f4ddbf3c66
--- /dev/null
+++ b/net/openldap25-client/Makefile
@@ -0,0 +1,7 @@
+# Created by: Xin LI <delphij@FreeBSD.org>
+
+CLIENT_ONLY=		yes
+
+MASTERDIR=		${.CURDIR}/../openldap25-server
+
+.include "${MASTERDIR}/Makefile"
diff --git a/net/openldap25-server/Makefile b/net/openldap25-server/Makefile
new file mode 100644
index 000000000000..3f637cb8ac75
--- /dev/null
+++ b/net/openldap25-server/Makefile
@@ -0,0 +1,434 @@
+# Created by: Xin LI <delphij@FreeBSD.org>
+
+PORTNAME=		openldap
+DISTVERSION=		2.5.7
+PORTREVISION=		${OPENLDAP_PORTREVISION}
+CATEGORIES=		net databases
+MASTER_SITES=		https://www.openldap.org/software/download/OpenLDAP/%SUBDIR%/ \
+			http://gpl.savoirfairelinux.net/pub/mirrors/openldap/%SUBDIR%/ \
+			http://repository.linagora.org/OpenLDAP/%SUBDIR%/ \
+			http://mirror.eu.oneandone.net/software/openldap/%SUBDIR%/ \
+			ftp://ftp.ntua.gr/mirror/OpenLDAP/%SUBDIR%/ \
+			https://mirror-hk.koddos.net/OpenLDAP/%SUBDIR%/ \
+			ftp://ftp.dti.ad.jp/pub/net/OpenLDAP/%SUBDIR%/ \
+			https://mirror.koddos.net/OpenLDAP/%SUBDIR%/ \
+			https://mirror.lyrahosting.com/OpenLDAP/%SUBDIR%/ \
+			ftp://ftp.OpenLDAP.org/pub/OpenLDAP/%SUBDIR%/ \
+			http://www.openldap.org/software/download/OpenLDAP/%SUBDIR%/
+MASTER_SITE_SUBDIR=	openldap-release
+.if defined(CLIENT_ONLY)
+PKGNAMESUFFIX=		-client
+.else
+PKGNAMESUFFIX=		-server
+.endif
+
+MAINTAINER=		delphij@FreeBSD.org
+.if defined(CLIENT_ONLY)
+COMMENT=		Open source LDAP client implementation
+.else
+COMMENT=		Open source LDAP server implementation
+.endif
+
+LICENSE=		OPENLDAP
+LICENSE_NAME=		OpenLDAP Public License
+LICENSE_FILE=		${WRKSRC}/LICENSE
+LICENSE_PERMS=		dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
+
+# :keepla because port uses lt_dlopen
+USES=			cpe gmake libtool:keepla localbase ssl tar:tgz
+
+CONFLICTS=		${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-2.[0-46-9].*
+
+GNU_CONFIGURE=		yes
+
+PORTREVISION_CLIENT=	0
+PORTREVISION_SERVER=	0
+OPENLDAP_SHLIB_MAJOR=	0
+OPENLDAP_SHLIB_MINOR=	1.2
+OPENLDAP_MAJOR=		${DISTVERSION:R}
+
+OPTIONS_DEFINE=		DEBUG
+OPTIONS_DEFAULT+=	DEBUG
+
+.if defined(CLIENT_ONLY)
+OPTIONS_DEFINE+=	DOCS FETCH
+.else
+OPTIONS_GROUP=		BKNDS OVLYS
+BKNDS_DESC=		OpenLDAP backends
+BKNDS_DEFAULTS=		ASYNCMETA DNSSRV MDB PASSWD RELAY SOCK
+OPTIONS_GROUP_BKNDS+=	${BKNDS_DEFAULTS}
+OPTIONS_GROUP_BKNDS+=	PERL SQL
+
+OVLYS_DESC=		OpenLDAP overlays
+OPTIONS_GROUP_OVLYS+=	ACCESSLOG
+OPTIONS_GROUP_OVLYS+=	ADDPARTIAL
+OPTIONS_GROUP_OVLYS+=	ALLOP
+OPTIONS_GROUP_OVLYS+=	AUTOCA
+OPTIONS_GROUP_OVLYS+=	AUDITLOG
+OPTIONS_GROUP_OVLYS+=	AUTOGROUP
+OPTIONS_GROUP_OVLYS+=	CLOAK
+OPTIONS_GROUP_OVLYS+=	COLLECT
+OPTIONS_GROUP_OVLYS+=	CONSTRAINT
+OPTIONS_GROUP_OVLYS+=	DDS
+OPTIONS_GROUP_OVLYS+=	DENYOP
+OPTIONS_GROUP_OVLYS+=	DEREF
+OPTIONS_GROUP_OVLYS+=	DYNGROUP
+OPTIONS_GROUP_OVLYS+=	DYNLIST
+OPTIONS_GROUP_OVLYS+=	HOMEDIR
+OPTIONS_GROUP_OVLYS+=	LASTBIND
+OPTIONS_GROUP_OVLYS+=	LASTMOD
+OPTIONS_GROUP_OVLYS+=	MEMBEROF
+OPTIONS_GROUP_OVLYS+=	NOPS
+OPTIONS_GROUP_OVLYS+=	OTP
+OPTIONS_GROUP_OVLYS+=	PROXYCACHE
+OPTIONS_GROUP_OVLYS+=	PPOLICY
+OPTIONS_GROUP_OVLYS+=	REFINT
+OPTIONS_GROUP_OVLYS+=	REMOTEAUTH
+OPTIONS_GROUP_OVLYS+=	RETCODE
+OPTIONS_GROUP_OVLYS+=	RWM
+OPTIONS_GROUP_OVLYS+=	SEQMOD
+OPTIONS_GROUP_OVLYS+=	SHA2
+OPTIONS_GROUP_OVLYS+=	SMBPWD
+OPTIONS_GROUP_OVLYS+=	SSSVLV
+OPTIONS_GROUP_OVLYS+=	SYNCPROV
+OPTIONS_GROUP_OVLYS+=	TRACE
+OPTIONS_GROUP_OVLYS+=	TRANSLUCENT
+OPTIONS_GROUP_OVLYS+=	UNIQUE
+OPTIONS_GROUP_OVLYS+=	VALSORT
+
+OPTIONS_DEFINE+=	DYNACL ACI
+OPTIONS_DEFINE+=	RLOOKUPS SLP SLAPI
+OPTIONS_DEFINE+=	PBKDF2
+OPTIONS_DEFINE+=	OUTLOOK
+OPTIONS_DEFINE+=	ARGON2
+OPTIONS_DEFINE+=	LLOADD
+
+OPTIONS_DEFAULT+=	${BKNDS_DEFAULTS}
+OPTIONS_DEFAULT+=	${OPTIONS_GROUP_OVLYS}
+OPTIONS_DEFAULT+=	ARGON2 LLOADD
+
+OPTIONS_SUB=		yes
+
+ACI_DESC=		Per-object ACI (experimental)
+ARGON2_DESC=		Argon2 password hashing module
+DYNACL_DESC=		Run-time loadable ACL (experimental)
+FETCH_DESC=		Enable fetch(3) support
+GSSAPI_DESC=		With GSSAPI support
+LLOADD_DESC=		Enable load balancer
+OUTLOOK_DESC=		Force caseIgnoreOrderingMatch on name attribute (experimental)
+RLOOKUPS_DESC=		With reverse lookups of client hostnames
+SLAPI_DESC=		With Netscape SLAPI plugin API (experimental)
+SLP_DESC=		With SLPv2 (RFC 2608) support
+
+ASYNCMETA_DESC=		With asynchronous metadirectory backend
+DNSSRV_DESC=		With Dnssrv backend
+MDB_DESC=		With Memory-Mapped DB backend
+SQL_DESC=		With SQL backend
+PASSWD_DESC=		With Passwd backend
+PERL_DESC=		With Perl backend
+RELAY_DESC=		With Relay backend
+SOCK_DESC=		With Sock backend
+
+ACCESSLOG_DESC=		With In-Directory Access Logging overlay
+AUDITLOG_DESC=		With Audit Logging overlay
+AUTOCA_DESC=		With Automatic Certificate Authority overlay
+COLLECT_DESC=		With Collect overy Services overlay
+CONSTRAINT_DESC=	With Attribute Constraint overlay
+DDS_DESC=		With Dynamic Directory Services overlay
+DEREF_DESC=		With Dereference overlay
+DYNGROUP_DESC=		With Dynamic Group overlay
+DYNLIST_DESC=		With Dynamic List overlay
+HOMEDIR_DESC=		With Home Directory Management overlay
+MEMBEROF_DESC=		With Reverse Group Membership overlay
+NOPS_DESC=		With nops overlay
+OTP_DESC=		With OTP 2-factor authentication overlay
+PPOLICY_DESC=		With Password Policy overlay
+PROXYCACHE_DESC=	With Proxy Cache overlay
+REFINT_DESC=		With Referential Integrity overlay
+REMOTEAUTH_DESC=	With Deferred Authentication overlay
+RETCODE_DESC=		With Return Code testing overlay
+RWM_DESC=		With Rewrite/Remap overlay
+SEQMOD_DESC=		With Sequential Modify overlay
+SSSVLV_DESC=		With ServerSideSort/VLV overlay
+SYNCPROV_DESC=		With Syncrepl Provider overlay
+TRANSLUCENT_DESC=	With Translucent Proxy overlay
+UNIQUE_DESC=		With attribute Uniqueness overlay
+VALSORT_DESC=		With Value Sorting overlay
+
+ADDPARTIAL_DESC=	With addpartial overlay (experimental)
+ALLOP_DESC=		With allop overlay (experimental)
+AUTOGROUP_DESC=		With autogroup overlay (experimental)
+CLOAK_DESC=		With cloak overlay (experimental)
+DENYOP_DESC=		With denyop overlay (experimental)
+LASTBIND_DESC=		With lastbind overlay
+LASTMOD_DESC=		With lastmod overlay (experimental)
+TRACE_DESC=		With Trace overlay
+
+PBKDF2_DESC=		With PBKDF2 hash password support
+SHA2_DESC=		With SHA2 Password hashes overlay
+SMBPWD_DESC=		With Samba Password hashes overlay
+
+ACCESSLOG_CONFIGURE_ENABLE=	accesslog=mod
+ACI_CONFIGURE_ENABLE=		aci
+ARGON2_CONFIGURE_ENABLE=	argon2
+ARGON2_CONFIGURE_WITH=		argon2=libsodium
+ARGON2_LIB_DEPENDS=		libsodium.so:security/libsodium
+ASYNCMETA_CONFIGURE_ENABLE=	asyncmeta=mod
+AUDITLOG_CONFIGURE_ENABLE=	auditlog=mod
+AUTOCA_CONFIGURE_ENABLE=	autoca=mod
+COLLECT_CONFIGURE_ENABLE=	collect=mod
+CONSTRAINT_CONFIGURE_ENABLE=	constraint=mod
+DDS_CONFIGURE_ENABLE=		dds=mod
+DEBUG_CONFIGURE_ENABLE=		debug
+DEREF_CONFIGURE_ENABLE=		deref=mod
+DNSSRV_CONFIGURE_ENABLE=	dnssrv=mod
+DYNACL_CONFIGURE_ENABLE=	dynacl
+DYNGROUP_CONFIGURE_ENABLE=	dyngroup=mod
+DYNLIST_CONFIGURE_ENABLE=	dynlist=mod
+FETCH_CONFIGURE_WITH=		fetch
+HOMEDIR_CONFIGURE_ENABLE=	homedir=mod
+LLOADD_CONFIGURE_ENABLE=	balancer=mod
+LLOADD_LIB_DEPENDS=		libevent.so:devel/libevent
+MDB_CONFIGURE_ENABLE=		mdb=mod
+MEMBEROF_CONFIGURE_ENABLE=	memberof=mod
+OTP_CONFIGURE_ENABLE=		otp=mod
+PASSWD_CONFIGURE_ENABLE=	passwd=mod
+PERL_CONFIGURE_ENABLE=		perl=mod
+PERL_CONFIGURE_ENV=		PERLBIN="${PERL}"
+PERL_USES=			perl5
+PPOLICY_CONFIGURE_ENABLE=	ppolicy=mod
+PROXYCACHE_CONFIGURE_ENABLE=	proxycache=mod
+REFINT_CONFIGURE_ENABLE=	refint=mod
+RELAY_CONFIGURE_ENABLE=		relay=mod
+REMOTEAUTH_CONFIGURE_ENABLE=	remoteauth=mod
+RETCODE_CONFIGURE_ENABLE=	retcode=mod
+RLOOKUPS_CONFIGURE_ENABLE=	rlookups
+RWM_CONFIGURE_ENABLE=		rwm=mod
+SEQMOD_CONFIGURE_ENABLE=	seqmod=mod
+SLAPI_CONFIGURE_ENABLE=		slapi
+SLAPI_USE=			LDCONFIG
+SLP_CONFIGURE_ENABLE=		slp
+SLP_LIB_DEPENDS=		libslp.so:net/openslp
+SOCK_CONFIGURE_ENABLE=		sock=mod
+SQL_CONFIGURE_ENABLE=		sql=mod
+SQL_LDFLAGS=			-L${LOCALBASE}/lib
+SQL_LIB_DEPENDS=		libodbc.so:databases/unixODBC
+SSSVLV_CONFIGURE_ENABLE=	sssvlv=mod
+SYNCPROV_CONFIGURE_ENABLE=	syncprov=mod
+TRANSLUCENT_CONFIGURE_ENABLE=	translucent=mod
+UNIQUE_CONFIGURE_ENABLE=	unique=mod
+VALSORT_CONFIGURE_ENABLE=	valsort=mod
+
+# Force using caseIgnoreOrderingMatch on 'name' attribute.
+# This may be a violation of RFC 4519 2.18 definition.
+# See http://www.openldap.org/lists/openldap-technical/201211/msg00175.html
+OUTLOOK_EXTRA_PATCHES=		${FILESDIR}/extrapatch-outlook-servers__slapd__schema_prep.c
+.endif
+
+CONFIGURE_SED=		-e 's,uuid/uuid.h,xxuuid/uuid.h,g'
+
+.include <bsd.port.options.mk>
+
+.if defined(CLIENT_ONLY)
+OPENLDAP_PORTREVISION=	${PORTREVISION_CLIENT}
+OPENLDAP_PKGFILESUFX=	.client
+
+PORTDOCS=		CHANGES drafts rfc
+
+CONFIGURE_ARGS+=	--disable-slapd \
+			--disable-monitor \
+			--disable-relay \
+			--disable-syncprov
+USE_LDCONFIG=		yes
+.else
+OPENLDAP_PORTREVISION=	${PORTREVISION_SERVER}
+OPENLDAP_PKGFILESUFX=
+
+LIB_DEPENDS+=		libicudata.so:devel/icu \
+			libldap.so:net/openldap25-client \
+			libltdl.so:devel/libltdl
+
+SUB_LIST+=		RC_DIR=${PREFIX} \
+			LDAP_RUN_DIR=${LDAP_RUN_DIR} \
+			DATABASEDIR=${DATABASEDIR}
+
+USERS=			ldap
+GROUPS=			ldap
+LDAP_USER?=		ldap
+LDAP_GROUP?=		ldap
+USE_LDCONFIG=		${PREFIX}/libexec/openldap
+SUB_FILES+=		pkg-deinstall
+USE_RC_SUBR=		slapd
+
+EXTRA_PATCHES+=		${FILESDIR}/extrapatch-Makefile.in
+
+LDFLAGS+=		-L${LOCALBASE}/lib
+
+SED_MODULES=		-e 's,mandir = \$$(exec_prefix)/share/man,mandir = $$(exec_prefix)/man,' \
+			-e 's/\(moduleload[ 	]*back_[a-z]*\)\.la/\1/' \
+			-e 's/\# *\(modulepath\)/\1/'
+
+CONFIGURE_ARGS+=	--enable-modules \
+			--localstatedir=${LOCALSTATEDIR} \
+			--enable-crypt \
+			--enable-ldap=mod \
+			--enable-meta=mod \
+			--enable-null=mod
+.endif
+
+LDAP_RUN_DIR?=		/var/run/openldap
+LOCALSTATEDIR?=		/var/db
+DATABASEDIR?=		${LOCALSTATEDIR}/openldap-data
+BACKUPDIR?=		/var/backups/openldap
+
+DESCR=			${PKGDIR}/pkg-descr${OPENLDAP_PKGFILESUFX}
+PLIST=			${PKGDIR}/pkg-plist${OPENLDAP_PKGFILESUFX}
+
+SUB_FILES+=		pkg-message${OPENLDAP_PKGFILESUFX}
+PKGMESSAGE=		${WRKSRC}/pkg-message${OPENLDAP_PKGFILESUFX}
+
+SUB_LIST+=		LDAP_RUN_DIR=${LDAP_RUN_DIR} \
+			LDAP_USER=${LDAP_USER} \
+			LDAP_GROUP=${LDAP_GROUP} \
+			BACKUPDIR=${BACKUPDIR} \
+			DATABASEDIR=${DATABASEDIR} \
+			PORTNAME=${PORTNAME} \
+			PKGNAME=${PKGNAME} \
+			PKGNAMESUFFIX=${PKGNAMESUFFIX}
+
+CONFIGURE_ARGS+=	--with-threads=posix \
+			--with-tls=openssl \
+			--enable-dynamic
+
+LIB_DEPENDS+=		libsasl2.so:security/cyrus-sasl2
+CONFIGURE_ARGS+=	--with-cyrus-sasl --enable-spasswd
+MAKE_ENV+=		STRIP=${STRIP}
+
+CPPFLAGS+=		-I${LOCALBASE}/include
+LIBS+=			-L${LOCALBASE}/lib
+
+PLIST_SUB+=		${SUB_LIST}
+PLIST_SUB+=		SHLIB_MAJOR=${OPENLDAP_SHLIB_MAJOR}
+PLIST_SUB+=		SHLIB_MINOR=${OPENLDAP_SHLIB_MINOR}
+PLIST_SUB+=		OPENLDAP_MAJOR=${OPENLDAP_MAJOR}
+
+.include <bsd.port.pre.mk>
+
+.if ${PORT_OPTIONS:MFETCH} && (defined(OPENSSL_INSTALLED) && ${OPENSSL_INSTALLED} != "" || ${SSL_DEFAULT} != base)
+BROKEN=	using OpenSSL from ports and OPTION FETCH together is not supported
+. endif
+
+.if ${PORT_OPTIONS:MADDPARTIAL}
+CONTRIB_MODULES+=	slapd-modules/addpartial
+CONTRIB_CLEANFILES+=	addpartial.a
+.endif
+.if ${PORT_OPTIONS:MALLOP}
+CONTRIB_MODULES+=	slapd-modules/allop
+CONTRIB_CLEANFILES+=	allop.a
+.endif
+.if ${PORT_OPTIONS:MAUTOGROUP}
+CONTRIB_MODULES+=	slapd-modules/autogroup
+CONTRIB_CLEANFILES+=	autogroup.a
+.endif
+.if ${PORT_OPTIONS:MCLOAK}
+CONTRIB_MODULES+=	slapd-modules/cloak
+CONTRIB_CLEANFILES+=	cloak.a
+.endif
+.if ${PORT_OPTIONS:MDENYOP}
+CONTRIB_MODULES+=	slapd-modules/denyop
+CONTRIB_CLEANFILES+=	denyop.a
+.endif
+.if ${PORT_OPTIONS:MLASTBIND}
+CONTRIB_MODULES+=	slapd-modules/lastbind
+CONTRIB_CLEANFILES+=	lastbind.a
+.endif
+.if ${PORT_OPTIONS:MLASTMOD}
+CONTRIB_MODULES+=	slapd-modules/lastmod
+CONTRIB_CLEANFILES+=	lastmod.a
+.endif
+.if ${PORT_OPTIONS:MNOPS}
+CONTRIB_MODULES+=	slapd-modules/nops
+CONTRIB_CLEANFILES+=	nops.a
+.endif
+.if ${PORT_OPTIONS:MTRACE}
+CONTRIB_MODULES+=	slapd-modules/trace
+CONTRIB_CLEANFILES+=	trace.a
+.endif
+.if ${PORT_OPTIONS:MSHA2}
+CONTRIB_MODULES+=	slapd-modules/passwd/sha2
+CONTRIB_CLEANFILES+=	pw-sha2.a
+.endif
+.if ${PORT_OPTIONS:MPBKDF2}
+CONTRIB_MODULES+=	slapd-modules/passwd/pbkdf2
+CONTRIB_CLEANFILES+=	pw-pbkdf2.a
+.endif
+.if ${PORT_OPTIONS:MSMBPWD}
+CONTRIB_MODULES+=	slapd-modules/smbk5pwd
+CONTRIB_CLEANFILES+=	smbk5pwd.a
+.endif
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|%LOCALSTATEDIR%/run/|${LDAP_RUN_DIR}/|g' \
+		${SED_MODULES} ${WRKSRC}/servers/slapd/slapd.conf
+	@${REINPLACE_CMD} -e 's|^OPT =.*|OPT = ${CFLAGS}|g' \
+		-e 's|^CC =.*|CC = ${CC}|g' \
+		${SED_MODULES} ${WRKSRC}/contrib/slapd-modules/*/Makefile \
+		${WRKSRC}/contrib/slapd-modules/*/*/Makefile
+.if defined(CONFIGURE_SED)
+	@${REINPLACE_CMD} -E ${CONFIGURE_SED} \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
+.endif
+
+.if !defined(CLIENT_ONLY)
+test: build
+	@(cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} \
+		${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} test)
+
+post-build:
+.for module in ${CONTRIB_MODULES}
+	@(cd ${BUILD_WRKSRC}/contrib/${module} && \
+		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} \
+		${MAKE_ARGS} prefix="${PREFIX}" all)
+.endfor
+.endif
+
+pre-install:
+.if !defined(CLIENT_ONLY)
+	${MKDIR} ${STAGEDIR}${DATABASEDIR}
+.endif
+
+post-install:
+.if defined(CLIENT_ONLY)
+	${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/CHANGES ${STAGEDIR}${DOCSDIR}
+	for dir in drafts rfc; do \
+		${MKDIR} ${STAGEDIR}${DOCSDIR}/$${dir}; \
+		${INSTALL_DATA} ${WRKSRC}/doc/$${dir}/* ${STAGEDIR}${DOCSDIR}/$${dir}; \
+	done
+	for prog in ldapcompare ldapdelete ldapexop ldapmodify ldapmodrdn ldappasswd ldapsearch ldapurl ldapvc ldapwhoami; do\
+		${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/$${prog}; \
+	done
+	for library in lber ldap; do \
+		${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lib$${library}-${OPENLDAP_MAJOR}.so.${OPENLDAP_SHLIB_MAJOR}; \
+	done
+.else
+	${MKDIR} ${STAGEDIR}${LDAP_RUN_DIR}
+.for module in ${CONTRIB_MODULES}
+	(cd ${WRKSRC}/contrib/${module} && \
+		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} \
+		${MAKE_ARGS} prefix="${PREFIX}" install)
+.endfor
+.for cleanfile in ${CONTRIB_CLEANFILES}
+	${RM} ${STAGEDIR}${PREFIX}/libexec/openldap/${cleanfile}
+.endfor
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/openldap/*.so
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/slapd
+	${MKDIR} ${STAGEDIR}${PREFIX}/libexec/openldap
+.endif # defined(CLIENT_ONLY)
+
+post-install-SLAPI-on:
+	for library in slapi; do \
+		${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lib$${library}-${OPENLDAP_MAJOR}.so.${OPENLDAP_SHLIB_MAJOR}; \
+	done
+
+.include <bsd.port.post.mk>
diff --git a/net/openldap25-server/distinfo b/net/openldap25-server/distinfo
new file mode 100644
index 000000000000..6d66224ada8d
--- /dev/null
+++ b/net/openldap25-server/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1629993141
+SHA256 (openldap-2.5.7.tgz) = ea9757001bc36295037f0030ede16810a1bb7438bbe8f871a35cc2a2b439d9ab
+SIZE (openldap-2.5.7.tgz) = 6426051
diff --git a/net/openldap25-server/files/extrapatch-Makefile.in b/net/openldap25-server/files/extrapatch-Makefile.in
new file mode 100644
index 000000000000..b1de5e09f0db
--- /dev/null
+++ b/net/openldap25-server/files/extrapatch-Makefile.in
@@ -0,0 +1,17 @@
+--- Makefile.in.orig	Mon Apr  7 22:23:24 2003
++++ Makefile.in	Thu Jul 10 17:43:35 2003
+@@ -13,9 +13,11 @@
+ ## top-level directory of the distribution or, alternatively, at
+ ## <http://www.OpenLDAP.org/license.html>.
+ 
+-SUBDIRS= include libraries clients servers tests doc
+-CLEANDIRS=
+-INSTALLDIRS= 
++SUBDIRS=
++ALLDIRS= include libraries clients servers tests doc
++CLEANDIRS= include libraries clients servers tests doc
++DEPENDDIRS= include libraries clients servers tests doc
++INSTALLDIRS=  servers doc
+ 
+ makefiles:	FORCE
+ 	./config.status
diff --git a/net/openldap25-server/files/extrapatch-outlook-servers__slapd__schema_prep.c b/net/openldap25-server/files/extrapatch-outlook-servers__slapd__schema_prep.c
new file mode 100644
index 000000000000..508bc5be8202
--- /dev/null
+++ b/net/openldap25-server/files/extrapatch-outlook-servers__slapd__schema_prep.c
@@ -0,0 +1,15 @@
+#
+# This patch is obtained from:
+#
+# http://www.openldap.org/lists/openldap-technical/201212/msg00055.html
+#
+--- servers/slapd/schema_prep.c.orig	2014-09-18 18:48:49.000000000 -0700
++++ servers/slapd/schema_prep.c	2015-03-31 17:26:23.439844478 -0700
+@@ -908,6 +908,7 @@
+ 			"DESC 'RFC4519: common supertype of name attributes' "
+ 			"EQUALITY caseIgnoreMatch "
+ 			"SUBSTR caseIgnoreSubstringsMatch "
++			"ORDERING caseIgnoreOrderingMatch "
+ 			"SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )",
+ 		NULL, SLAP_AT_ABSTRACT,
+ 		NULL, NULL,
diff --git a/net/openldap25-server/files/patch-ITS7548 b/net/openldap25-server/files/patch-ITS7548
new file mode 100644
index 000000000000..edfd3cc80667
--- /dev/null
+++ b/net/openldap25-server/files/patch-ITS7548
@@ -0,0 +1,103 @@
+--- build/man.mk.orig	2021-07-27 17:44:47 UTC
++++ build/man.mk
+@@ -18,10 +18,12 @@
+ 
+ MANDIR=$(mandir)/man$(MANSECT)
+ TMP_SUFFIX=tmp
++ifeq ($(strip $(PAGES)),)
++PAGES=`cd $(srcdir); echo *.$(MANSECT)`
++endif
+ 
+ all-common:
+-	PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \
+-	for page in $$PAGES; do \
++	for page in ${PAGES}; do \
+ 		$(SED) -e "s%LDVERSION%$(VERSION)%" \
+ 			-e 's%ETCDIR%$(sysconfdir)%g' \
+ 			-e 's%LOCALSTATEDIR%$(localstatedir)%' \
+@@ -39,8 +41,7 @@ all-common:
+ 
+ install-common:
+ 	-$(MKDIR) $(DESTDIR)$(MANDIR)
+-	PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \
+-	for page in $$PAGES; do \
++	for page in ${PAGES}; do \
+ 		echo "installing $$page in $(DESTDIR)$(MANDIR)"; \
+ 		$(RM) $(DESTDIR)$(MANDIR)/$$page; \
+ 		$(INSTALL) $(INSTALLFLAGS) -m 644 $$page.$(TMP_SUFFIX) $(DESTDIR)$(MANDIR)/$$page; \
+--- doc/man/Makefile.in.orig	2021-07-27 17:44:47 UTC
++++ doc/man/Makefile.in
+@@ -13,4 +13,10 @@
+ ## top-level directory of the distribution or, alternatively, at
+ ## <http://www.OpenLDAP.org/license.html>.
+ 
+-SUBDIRS= man1 man3 man5 man8
++BUILD_SRV = @BUILD_SLAPD@
++
++ifeq (${BUILD_SRV},no)
++  SUBDIRS= man1 man3 man5
++else
++  SUBDIRS= man5 man8
++endif
+--- doc/man/man5/Makefile.in.orig	2021-07-27 17:44:47 UTC
++++ doc/man/man5/Makefile.in
+@@ -14,3 +14,59 @@
+ ## <http://www.OpenLDAP.org/license.html>.
+ 
+ MANSECT=5
++
++BUILD_SRV = @BUILD_SLAPD@
++
++ifeq (${BUILD_SRV},no)
++PAGES=	ldap.conf.${MANSECT}		\
++	ldif.${MANSECT}
++else
++PAGES=	lloadd.conf.${MANSECT}		\
++	slapd-asyncmeta.${MANSECT}	\
++	slapd-config.${MANSECT}		\
++	slapd-dnssrv.${MANSECT}		\
++	slapd-ldap.${MANSECT}		\
++	slapd-ldif.${MANSECT}		\
++	slapd-mdb.${MANSECT}		\
++	slapd-meta.${MANSECT}		\
++	slapd-monitor.${MANSECT}	\
++	slapd-ndb.${MANSECT}		\
++	slapd-null.${MANSECT}		\
++	slapd-passwd.${MANSECT}		\
++	slapd-perl.${MANSECT}		\
++	slapd-relay.${MANSECT}		\
++	slapd-sock.${MANSECT}		\
++	slapd-sql.${MANSECT}		\
++	slapd-wt.${MANSECT}		\
++	slapd.access.${MANSECT}		\
++	slapd.backends.${MANSECT}	\
++	slapd.conf.${MANSECT}		\
++	slapd.overlays.${MANSECT}	\
++	slapd.plugin.${MANSECT}		\
++	slapo-accesslog.${MANSECT}	\
++	slapo-auditlog.${MANSECT}	\
++	slapo-autoca.${MANSECT}		\
++	slapo-chain.${MANSECT}		\
++	slapo-collect.${MANSECT}	\
++	slapo-constraint.${MANSECT}	\
++	slapo-dds.${MANSECT}		\
++	slapo-deref.${MANSECT}		\
++	slapo-dyngroup.${MANSECT}	\
++	slapo-dynlist.${MANSECT}	\
++	slapo-homedir.${MANSECT}	\
++	slapo-memberof.${MANSECT}	\
++	slapo-otp.${MANSECT}		\
++	slapo-pbind.${MANSECT}		\
++	slapo-pcache.${MANSECT}		\
++	slapo-ppolicy.${MANSECT}	\
++	slapo-refint.${MANSECT}		\
++	slapo-remoteauth.${MANSECT}	\
++	slapo-retcode.${MANSECT}	\
++	slapo-rwm.${MANSECT}		\
++	slapo-sssvlv.${MANSECT}		\
++	slapo-syncprov.${MANSECT}	\
++	slapo-translucent.${MANSECT}	\
++	slapo-unique.${MANSECT}		\
++	slapo-valsort.${MANSECT}	\
++	slappw-argon2.${MANSECT}
++endif
diff --git a/net/openldap25-server/files/patch-build__top.mk b/net/openldap25-server/files/patch-build__top.mk
new file mode 100644
index 000000000000..7468883924a0
--- /dev/null
+++ b/net/openldap25-server/files/patch-build__top.mk
@@ -0,0 +1,11 @@
+--- build/top.mk.orig	2021-07-27 17:44:47 UTC
++++ build/top.mk
+@@ -60,8 +60,6 @@ INSTALL_PROGRAM = $(INSTALL)
+ INSTALL_DATA = $(INSTALL) -m 644
+ INSTALL_SCRIPT = $(INSTALL)
+ 
+-STRIP_OPTS = -s
+-
+ LINT = lint
+ 5LINT = 5lint
+ 
diff --git a/net/openldap25-server/files/patch-configure b/net/openldap25-server/files/patch-configure
new file mode 100644
index 000000000000..97d8af90e78e
--- /dev/null
+++ b/net/openldap25-server/files/patch-configure
@@ -0,0 +1,32 @@
+--- configure.orig	2021-07-27 17:44:47 UTC
++++ configure
+@@ -16827,9 +16827,9 @@ $as_echo "#define HAVE_UUID_TO_STR 1" >>confdefs.h
+ fi
+ 
+ if test $have_uuid = no ; then
+-	for ac_header in uuid/uuid.h
++	for ac_header in xxuuid/uuid.h
+ do :
+-  ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
++  ac_fn_c_check_header_mongrel "$LINENO" "xxuuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
+ if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
+   cat >>confdefs.h <<_ACEOF
+ #define HAVE_UUID_UUID_H 1
+@@ -22127,7 +22127,7 @@ if ${ac_cv_lib_iodbc_SQLDriverConnect+:} false; then :
+   $as_echo_n "(cached) " >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-liodbc  $LIBS"
++LIBS="-liodbc  $LIBS $LTHREAD_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+@@ -22175,7 +22175,7 @@ if ${ac_cv_lib_odbc_SQLDriverConnect+:} false; then :
+   $as_echo_n "(cached) " >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lodbc  $LIBS"
++LIBS="-lodbc  $LIBS $LTHREAD_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
diff --git a/net/openldap25-server/files/patch-contrib_slapd-modules_passwd_sha2_sha2.h b/net/openldap25-server/files/patch-contrib_slapd-modules_passwd_sha2_sha2.h
new file mode 100644
index 000000000000..e03f4ba2b873
--- /dev/null
+++ b/net/openldap25-server/files/patch-contrib_slapd-modules_passwd_sha2_sha2.h
@@ -0,0 +1,24 @@
+--- contrib/slapd-modules/passwd/sha2/sha2.h.orig	2021-07-27 17:44:47 UTC
++++ contrib/slapd-modules/passwd/sha2/sha2.h
+@@ -142,6 +142,21 @@ typedef struct _SHA512_CTX {
+ 
+ typedef SHA512_CTX SHA384_CTX;
+ 
++#define	SHA256_Init	_sha2_SHA256_Init
++#define	SHA256_Update	_sha2_SHA256_Update
++#define	SHA256_Final	_sha2_SHA256_Final
++#define	SHA256_End	_sha2_SHA256_End
++#define	SHA256_Data	_sha2_SHA256_Data
++#define	SHA384_Init	_sha2_SHA384_Init
++#define	SHA384_Update	_sha2_SHA384_Update
++#define	SHA384_Final	_sha2_SHA384_Final
++#define	SHA384_End	_sha2_SHA384_End
++#define	SHA384_Data	_sha2_SHA384_Data
++#define	SHA512_Init	_sha2_SHA512_Init
++#define	SHA512_Update	_sha2_SHA512_Update
++#define	SHA512_Final	_sha2_SHA512_Final
++#define	SHA512_End	_sha2_SHA512_End
++#define	SHA512_Data	_sha2_SHA512_Data
+ 
+ /*** SHA-256/384/512 Function Prototypes ******************************/
+ /* avoid symbol clash with other crypto libs */
diff --git a/net/openldap25-server/files/patch-contrib_slapd-modules_smbk5pwd_Makefile b/net/openldap25-server/files/patch-contrib_slapd-modules_smbk5pwd_Makefile
new file mode 100644
index 000000000000..455ff8aec560
--- /dev/null
+++ b/net/openldap25-server/files/patch-contrib_slapd-modules_smbk5pwd_Makefile
@@ -0,0 +1,11 @@
+--- contrib/slapd-modules/smbk5pwd/Makefile.orig	2021-07-27 17:44:47 UTC
++++ contrib/slapd-modules/smbk5pwd/Makefile
+@@ -30,7 +30,7 @@
+ # Omit DO_KRB5, DO_SAMBA or DO_SHADOW if you don't want to support it.
+ DEFS = -DDO_KRB5 -DDO_SAMBA -DDO_SHADOW
+ INCS = $(LDAP_INC) $(HEIMDAL_INC) $(SSL_INC)
+-LIBS = $(LDAP_LIB) $(HEIMDAL_LIB) $(SSL_LIB)
++LIBS = $(LDAP_LIB) $(SSL_LIB)
+ 
+ PROGRAMS = smbk5pwd.la
+ LTVER = 0:0:0
diff --git a/net/openldap25-server/files/patch-include__ldap_defaults.h b/net/openldap25-server/files/patch-include__ldap_defaults.h
new file mode 100644
index 000000000000..b14af6f6ab27
--- /dev/null
+++ b/net/openldap25-server/files/patch-include__ldap_defaults.h
@@ -0,0 +1,11 @@
+--- include/ldap_defaults.h.orig	2021-07-27 17:44:47 UTC
++++ include/ldap_defaults.h
+@@ -39,7 +39,7 @@
+ #define LDAP_ENV_PREFIX "LDAP"
+ 
+ /* default ldapi:// socket */
+-#define LDAPI_SOCK LDAP_RUNDIR LDAP_DIRSEP "run" LDAP_DIRSEP "ldapi"
++#define LDAPI_SOCK "/var/run" LDAP_DIRSEP "openldap" LDAP_DIRSEP "ldapi"
+ 
+ /*
+  * SLAPD DEFINITIONS
diff --git a/net/openldap25-server/files/patch-libraries__libldap__Makefile.in b/net/openldap25-server/files/patch-libraries__libldap__Makefile.in
new file mode 100644
index 000000000000..551b567191b2
--- /dev/null
+++ b/net/openldap25-server/files/patch-libraries__libldap__Makefile.in
@@ -0,0 +1,17 @@
+--- libraries/libldap/Makefile.in.orig	2021-07-27 17:44:47 UTC
++++ libraries/libldap/Makefile.in
+@@ -86,13 +86,6 @@ install-local: $(CFFILES) FORCE
+ 	$(LTFINISH) $(DESTDIR)$(libdir)
+ 	-$(MKDIR) $(DESTDIR)$(sysconfdir)
+ 	@for i in $(CFFILES); do \
+-		if test ! -f $(DESTDIR)$(sysconfdir)/$$i; then \
+-			echo "installing $$i in $(sysconfdir)"; \
+-			echo "$(INSTALL) $(INSTALLFLAGS) -m 644  $(srcdir)/$$i $(DESTDIR)$(sysconfdir)/$$i"; \
+-			$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/$$i $(DESTDIR)$(sysconfdir)/$$i; \
+-		else \
+-			echo "PRESERVING EXISTING CONFIGURATION FILE $(sysconfdir)/$$i" ; \
+-		fi; \
+-		$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/$$i $(DESTDIR)$(sysconfdir)/$$i.default; \
++		$(INSTALL) $(INSTALLFLAGS) -m 644 $(srcdir)/$$i $(DESTDIR)$(sysconfdir)/$$i.sample; \
+ 	done
+ 
diff --git a/net/openldap25-server/files/patch-libraries_libldap_tls__o.c b/net/openldap25-server/files/patch-libraries_libldap_tls__o.c
new file mode 100644
index 000000000000..3c9bccd4dc15
--- /dev/null
+++ b/net/openldap25-server/files/patch-libraries_libldap_tls__o.c
@@ -0,0 +1,20 @@
+--- libraries/libldap/tls_o.c.orig	2021-07-27 17:44:47 UTC
++++ libraries/libldap/tls_o.c
+@@ -275,7 +275,7 @@ tlso_ctx_free ( tls_ctx *ctx )
+ 	SSL_CTX_free( c );
+ }
+ 
+-#if OPENSSL_VERSION_NUMBER >= 0x10101000
++#if OPENSSL_VERSION_NUMBER >= 0x10101000 && !defined(OPENSSL_NO_TLS1_3)
+ static char *
+ tlso_stecpy( char *dst, const char *src, const char *end )
+ {
+@@ -411,7 +411,7 @@ tlso_ctx_init( struct ldapoptions *lo, struct ldaptls 
+ 	}
+ 
+ 	if ( lo->ldo_tls_ciphersuite ) {
+-#if OPENSSL_VERSION_NUMBER >= 0x10101000
++#if OPENSSL_VERSION_NUMBER >= 0x10101000 && !defined(OPENSSL_NO_TLS1_3)
+ 		tlso_ctx_cipher13( ctx, lt->lt_ciphersuite );
+ #endif
+ 		if ( !SSL_CTX_set_cipher_list( ctx, lt->lt_ciphersuite ) )
diff --git a/net/openldap25-server/files/patch-servers_slapd_Makefile.in b/net/openldap25-server/files/patch-servers_slapd_Makefile.in
new file mode 100644
index 000000000000..d4d16458b30b
--- /dev/null
+++ b/net/openldap25-server/files/patch-servers_slapd_Makefile.in
@@ -0,0 +1,67 @@
+--- servers/slapd/Makefile.in.orig	2021-07-27 17:44:47 UTC
++++ servers/slapd/Makefile.in
+@@ -374,7 +374,6 @@ install-local-srv: install-slapd install-tools \
+ 
+ install-slapd: FORCE
+ 	-$(MKDIR) $(DESTDIR)$(libexecdir)
+-	-$(MKDIR) $(DESTDIR)$(localstatedir)/run
+ 	$(LTINSTALL) $(INSTALLFLAGS) $(STRIP_OPTS) -m 755 \
+ 		slapd$(EXEEXT) $(DESTDIR)$(libexecdir)
+ 	@for i in $(SUBDIRS); do \
+@@ -413,48 +412,27 @@ all-cffiles: slapd $(SLAPD_DYNAMIC_BACKENDS) dynamic_o
+ 	touch all-cffiles
+ 
+ install-schema: FORCE
+-	@if test -d $(DESTDIR)$(schemadir) ; then \
+-		echo "MOVING EXISTING SCHEMA DIR to $(DESTDIR)$(schemadir).$$$$" ; \
+-		mv $(DESTDIR)$(schemadir) $(DESTDIR)$(schemadir).$$$$ ; \
+-	fi
+ 	$(MKDIR) $(DESTDIR)$(schemadir)
+ 	@SD=$(DESTDIR)$(schemadir) ; \
+-	files=`cd $(srcdir)/schema ; echo README *.ldif *.schema` ; \
++	files=`cd $(srcdir)/schema ; echo README *.ldif` ; \
+ 	for i in $$files ; do \
+ 		echo $(INSTALL) $(INSTALLFLAGS) -m 444 schema/$$i $$SD/$$i ; \
+ 		$(INSTALL) $(INSTALLFLAGS) -m 444 $(srcdir)/schema/$$i $$SD/$$i ; \
++	done ; \
++	files=`cd $(srcdir)/schema ; echo *.schema` ; \
++	for i in $$files ; do \
++		echo $(INSTALL) $(INSTALLFLAGS) -m 444 schema/$$i $$SD/$$i ; \
++		$(INSTALL) $(INSTALLFLAGS) -m 444 $(srcdir)/schema/$$i $$SD/$$i.sample ; \
+ 	done
+ 
+ install-conf: FORCE
+ 	@-$(MKDIR) $(DESTDIR)$(sysconfdir)
+-	$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.conf.tmp $(DESTDIR)$(sysconfdir)/slapd.conf.default
+-	if test ! -f $(DESTDIR)$(sysconfdir)/slapd.conf; then \
+-		echo "installing slapd.conf in $(sysconfdir)"; \
+-		echo "$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.conf.tmp $(DESTDIR)$(sysconfdir)/slapd.conf"; \
+-		$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.conf.tmp $(DESTDIR)$(sysconfdir)/slapd.conf; \
+-	else \
+-		echo "PRESERVING EXISTING CONFIGURATION FILE $(DESTDIR)$(sysconfdir)/slapd.conf" ; \
+-	fi
+-	$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.ldif.tmp $(DESTDIR)$(sysconfdir)/slapd.ldif.default
+-	if test ! -f $(DESTDIR)$(sysconfdir)/slapd.ldif; then \
+-		echo "installing slapd.ldif in $(sysconfdir)"; \
+-		echo "$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.ldif.tmp $(DESTDIR)$(sysconfdir)/slapd.ldif"; \
+-		$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.ldif.tmp $(DESTDIR)$(sysconfdir)/slapd.ldif; \
+-	else \
+-		echo "PRESERVING EXISTING CONFIGURATION FILE $(DESTDIR)$(sysconfdir)/slapd.ldif" ; \
+-	fi
+-	if test -n "$(systemdsystemunitdir)" && test ! -f $(DESTDIR)$(systemdsystemunitdir)/slapd.service; then \
+-		$(MKDIR) $(DESTDIR)$(systemdsystemunitdir); \
+-		echo "installing slapd.service in $(systemdsystemunitdir)"; \
+-		echo "$(INSTALL) $(INSTALLFLAGS) -m 644 slapd.service.tmp $(DESTDIR)$(systemdsystemunitdir)/slapd.service"; \
+-		$(INSTALL) $(INSTALLFLAGS) -m 644 slapd.service.tmp $(DESTDIR)$(systemdsystemunitdir)/slapd.service; \
+-	fi
++	$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.conf.tmp $(DESTDIR)$(sysconfdir)/slapd.conf.sample
++	$(INSTALL) $(INSTALLFLAGS) -m 600 slapd.ldif.tmp $(DESTDIR)$(sysconfdir)/slapd.ldif.sample
+ 
+ install-db-config: FORCE
+ 	@-$(MKDIR) $(DESTDIR)$(localstatedir) $(DESTDIR)$(sysconfdir)
+ 	@-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/openldap-data
+-	$(INSTALL) $(INSTALLFLAGS) -m 600 $(srcdir)/DB_CONFIG \
+-		$(DESTDIR)$(localstatedir)/openldap-data/DB_CONFIG.example
+ 	$(INSTALL) $(INSTALLFLAGS) -m 600 $(srcdir)/DB_CONFIG \
+ 		$(DESTDIR)$(sysconfdir)/DB_CONFIG.example
+ 
diff --git a/net/openldap25-server/files/patch-servers_slapd_daemon.c b/net/openldap25-server/files/patch-servers_slapd_daemon.c
new file mode 100644
index 000000000000..6e6228b2e629
--- /dev/null
+++ b/net/openldap25-server/files/patch-servers_slapd_daemon.c
@@ -0,0 +1,14 @@
+--- servers/slapd/daemon.c.orig	2021-08-18 17:11:41 UTC
++++ servers/slapd/daemon.c
+@@ -228,10 +228,9 @@ static slap_daemon_st *slap_daemon;
+ } while (0)
+ 
+ /* a kqueue fd obtained before a fork can't be used in child process.
+- * close it and reacquire it.
++ * reacquire it.
+  */
+ # define SLAP_SOCK_INIT2() do { \
+-	close(slap_daemon[0].sd_kq); \
+ 	slap_daemon[0].sd_kq = kqueue(); \
+ } while (0)
+ 
diff --git a/net/openldap25-server/files/pkg-deinstall.in b/net/openldap25-server/files/pkg-deinstall.in
new file mode 100644
index 000000000000..1557b33873af
--- /dev/null
+++ b/net/openldap25-server/files/pkg-deinstall.in
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+ECHO_CMD=echo
+
+if [ -f "%%PREFIX%%/etc/openldap/slapd.conf" ]; then
+  DBDIR=`awk '$1 == "directory" {print $2}' "%%PREFIX%%/etc/openldap/slapd.conf"`
+fi
+
+case $2 in
+POST-DEINSTALL)
+  ${ECHO_CMD}
+  ${ECHO_CMD} "The OpenLDAP server package has been deleted."
+  ${ECHO_CMD} "If you're *not* upgrading and won't be using"
+  ${ECHO_CMD} "it any longer, you may want to issue the"
+  ${ECHO_CMD} "following commands:"
+  ${ECHO_CMD}
+  if ([ "${DBDIR}" ] && [ -d "${DBDIR}" ]) || ([ ! "${DBDIR}" ] && [ -d %%DATABASEDIR%% ]); then
+    ${ECHO_CMD} "- to delete the OpenLDAP database permanently (losing all data):"
+    if [ "${DBDIR}" ] && [ -d "${DBDIR}" ]; then
+      ${ECHO_CMD} "  rm -Rf ${DBDIR}"
+    else
+      ${ECHO_CMD} "  rm -Rf %%DATABASEDIR%%"
+    fi
+    ${ECHO_CMD}
+  fi
+  ${ECHO_CMD} "- to remove the OpenLDAP user:"
+  ${ECHO_CMD} "  pw userdel ldap"
+  ${ECHO_CMD}
+  ${ECHO_CMD} "If you are upgrading, don't forget to restart slapd."
+  ${ECHO_CMD}
+  ;;
+esac
diff --git a/net/openldap25-server/files/pkg-message.client.in b/net/openldap25-server/files/pkg-message.client.in
new file mode 100644
index 000000000000..1ae2cf27dd22
--- /dev/null
+++ b/net/openldap25-server/files/pkg-message.client.in
*** 878 LINES SKIPPED ***



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