public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2015-09-20 16:39 Julian Ospald
  0 siblings, 0 replies; 187+ messages in thread
From: Julian Ospald @ 2015-09-20 16:39 UTC (permalink / raw
  To: gentoo-commits

commit:     a53b32f23bb9379d34bd536d5ab8007426d4ac47
Author:     Julian Ospald <hasufell <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 20 16:36:18 2015 +0000
Commit:     Julian Ospald <hasufell <AT> gentoo <DOT> org>
CommitDate: Sun Sep 20 16:38:05 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a53b32f2

net-nds/openldap: add libressl support

 net-nds/openldap/openldap-2.4.42-r1.ebuild | 819 +++++++++++++++++++++++++++++
 1 file changed, 819 insertions(+)

diff --git a/net-nds/openldap/openldap-2.4.42-r1.ebuild b/net-nds/openldap/openldap-2.4.42-r1.ebuild
new file mode 100644
index 0000000..5f46c6b
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.42-r1.ebuild
@@ -0,0 +1,819 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit db-use eutils flag-o-matic multilib multilib-minimal ssl-cert versionator toolchain-funcs autotools user systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="http://www.OpenLDAP.org/"
+
+# mirrors are mostly not working, using canonical URI
+SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
+		 mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
+IUSE_CONTRIB="smbkrb5passwd kerberos"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+REQUIRED_USE="cxx? ( sasl )
+	?? ( gnutls libressl )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+BDB_SLOTS='5.3 5.1 4.8 4.7 4.6 4.5 4.4'
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+CDEPEND="icu? ( dev-libs/icu:= )
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
+		)
+		gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
+		libressl? ( dev-libs/libressl[${MULTILIB_USEDEP}] )
+		>=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] ) )
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.14
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		slp? ( net-libs/openslp )
+		perl? ( dev-lang/perl[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? ( virtual/krb5 )
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20140508-r3
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+	)"
+DEPEND="${CDEPEND}
+	sys-apps/groff"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	openldap_datadirs=""
+	if [ -f "${EROOT}"/etc/openldap/slapd.conf ]; then
+		openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${EROOT}/etc/openldap/slapd.conf)"
+	fi
+	openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs}; do
+		CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
+		CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
+		if [ -d ${CURRENT_TAGDIR} ] &&	[ ${openldap_found_tag} == 0 ] ; then
+			einfo "- Checking ${each}..."
+			if [ -r ${CURRENT_TAG} ] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source ${CURRENT_TAG}
+				if [ "${OLDPF}" == "" ] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
+
+				[ $(openldap_filecount ${CURRENT_TAGDIR}) -gt 0 ] && have_files=1
+
+				# are we on the same branch?
+				if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[ $(openldap_filecount ${each}) -gt 0 ] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[ "${have_files}" == "1" ] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH=${EROOT}/usr/$(get_libdir)/openldap/slapd
+	if [ "${have_files}" == "1" -a -f "${SLAPD_PATH}" ]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in $BDB_SLOTS ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "$NEWVER" ]] && break
+			done
+		fi
+		local fail=0
+		if [ -z "${OLDVER}" -a -z "${NEWVER}" ]; then
+			:
+			# Nothing wrong here.
+		elif [ -z "${OLDVER}" -a -n "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [ -n "${OLDVER}" -a -z "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [ "${OLDVER}" != "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[ "${fail}" == "1" ] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [ "${FORCE_UPGRADE}" != "1" ]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version "net-nds/openldap" && built_with_use net-nds/openldap minimal ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+
+	enewgroup ldap 439
+	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		"${S}"/include/ldap_defaults.h
+
+	epatch "${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	epatch \
+		"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \
+		"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	epatch "${FILESDIR}"/${PN}-2.4.17-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	epatch "${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	epatch "${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	epatch "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	epatch "${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# bug #421463
+	#epatch "${FILESDIR}"/${PN}-2.4.33-gnutls.patch # merged upstream
+
+	# unbundle lmdb
+	epatch "${FILESDIR}"/${P}-mdb-unbundle.patch
+	rm -rf "${S}"/libraries/liblmdb
+
+	cd "${S}"/build || die
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed -i \
+		-e 's|/bin/sh|/bin/bash|g' \
+		"${S}"/tests/scripts/* || die "sed failed"
+
+	cd "${S}" || die
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	cd "${S}/contrib/slapd-modules/$1" || die
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(echo "SLAPD_OVER_${1}" | LC_ALL=C tr '[:lower:]' '[:upper:]')"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU usage is not configurable
+	export ac_cv_header_unicode_utypes_h="$(multilib_is_native_abi && use icu && echo yes || echo no)"
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir $BDB_SLOTS)
+			einfo "Using $DBINCLUDE for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			$(use_enable slp)
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	ECONF_SOURCE=${S} \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	cd "${BUILD_DIR}/contrib/ldapc++" || die
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake \
+				CC="${CC}" CXX="${CXX}"
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+		fi
+
+		if use kerberos ; then
+			build_contrib_module "kinit" "kinit.c" "kinit"
+			cd "${S}/contrib/slapd-modules/passwd" || die
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+		fi
+		# We could build pw-radius if GNURadius would install radlib.h
+		cd "${S}/contrib/slapd-modules/passwd" || die
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		build_contrib_module "nops" "nops.c" "nops-overlay"
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		# build slapi-plugins
+		cd "${S}/contrib/slapi-plugins/addrdnvalues" || die
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests || die "make tests failed"
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+	use static-libs || prune_libtool_files --all
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		newinitd "${FILESDIR}"/slapd-initd-2.4.40-r2 slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+		einfo "Install systemd service"
+		systemd_dounit "${FILESDIR}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		if [[ $(get_libdir) != lib ]]; then
+			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i \
+				"${ED}"/etc/init.d/slapd \
+				"${ED}"/usr/lib/systemd/system/slapd.service || die
+		fi
+		# If built without SLP, we don't need to be before avahi
+		use slp \
+			|| sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"etc/init.d/slapd
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la; do
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
+		chmod 0755 "${EROOT}"var/run/openldap
+		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
+		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://www.gentoo.org/doc/en/ldap-howto.xml)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2015-12-03 18:08 Tony Vroon
  0 siblings, 0 replies; 187+ messages in thread
From: Tony Vroon @ 2015-12-03 18:08 UTC (permalink / raw
  To: gentoo-commits

commit:     2964d03dd8a1ea01f0d5704d419b2c4bfc16c1db
Author:     Tony Vroon <chainsaw <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  3 18:07:14 2015 +0000
Commit:     Tony Vroon <chainsaw <AT> gentoo <DOT> org>
CommitDate: Thu Dec  3 18:08:22 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2964d03d

net-nds/openldap: version bump to 2.4.43

This is a bugfix release, closes bug #567446. Ebuild work by Lars "Poly-C" Wendler.

Suggested-By: Gavin Henry <ghenry <AT> suretec.co.uk>
Acked-By: Matthew prometheanfire Thode <prometheanfire <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.43.ebuild | 816 ++++++++++++++++++++++++++++++++
 1 file changed, 816 insertions(+)

diff --git a/net-nds/openldap/openldap-2.4.43.ebuild b/net-nds/openldap/openldap-2.4.43.ebuild
new file mode 100644
index 0000000..3b121db
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.43.ebuild
@@ -0,0 +1,816 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit db-use eutils flag-o-matic multilib multilib-minimal ssl-cert versionator toolchain-funcs autotools user systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="http://www.OpenLDAP.org/"
+
+# mirrors are mostly not working, using canonical URI
+SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
+		 mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
+IUSE_CONTRIB="smbkrb5passwd kerberos"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+REQUIRED_USE="cxx? ( sasl )
+	?? ( gnutls libressl )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+BDB_SLOTS='5.3 5.1 4.8 4.7 4.6 4.5 4.4'
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+CDEPEND="icu? ( dev-libs/icu:= )
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
+		)
+		gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
+		libressl? ( dev-libs/libressl[${MULTILIB_USEDEP}] )
+		>=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] ) )
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.14
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		slp? ( net-libs/openslp )
+		perl? ( dev-lang/perl[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? ( virtual/krb5 )
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20140508-r3
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+	)"
+DEPEND="${CDEPEND}
+	sys-apps/groff"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	openldap_datadirs=""
+	if [ -f "${EROOT}"/etc/openldap/slapd.conf ]; then
+		openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${EROOT}/etc/openldap/slapd.conf)"
+	fi
+	openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs}; do
+		CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
+		CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
+		if [ -d ${CURRENT_TAGDIR} ] &&	[ ${openldap_found_tag} == 0 ] ; then
+			einfo "- Checking ${each}..."
+			if [ -r ${CURRENT_TAG} ] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source ${CURRENT_TAG}
+				if [ "${OLDPF}" == "" ] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
+
+				[ $(openldap_filecount ${CURRENT_TAGDIR}) -gt 0 ] && have_files=1
+
+				# are we on the same branch?
+				if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[ $(openldap_filecount ${each}) -gt 0 ] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[ "${have_files}" == "1" ] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH=${EROOT}/usr/$(get_libdir)/openldap/slapd
+	if [ "${have_files}" == "1" -a -f "${SLAPD_PATH}" ]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in $BDB_SLOTS ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "$NEWVER" ]] && break
+			done
+		fi
+		local fail=0
+		if [ -z "${OLDVER}" -a -z "${NEWVER}" ]; then
+			:
+			# Nothing wrong here.
+		elif [ -z "${OLDVER}" -a -n "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [ -n "${OLDVER}" -a -z "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [ "${OLDVER}" != "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[ "${fail}" == "1" ] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [ "${FORCE_UPGRADE}" != "1" ]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version "net-nds/openldap" && built_with_use net-nds/openldap minimal ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+
+	enewgroup ldap 439
+	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		"${S}"/include/ldap_defaults.h
+
+	epatch "${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	epatch \
+		"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \
+		"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	epatch "${FILESDIR}"/${PN}-2.4.17-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	epatch "${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	epatch "${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	epatch "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	epatch "${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	epatch "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+	rm -rf "${S}"/libraries/liblmdb
+
+	cd "${S}"/build || die
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed -i \
+		-e 's|/bin/sh|/bin/bash|g' \
+		"${S}"/tests/scripts/* || die "sed failed"
+
+	cd "${S}" || die
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	cd "${S}/contrib/slapd-modules/$1" || die
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(echo "SLAPD_OVER_${1}" | LC_ALL=C tr '[:lower:]' '[:upper:]')"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU usage is not configurable
+	export ac_cv_header_unicode_utypes_h="$(multilib_is_native_abi && use icu && echo yes || echo no)"
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir $BDB_SLOTS)
+			einfo "Using $DBINCLUDE for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			$(use_enable slp)
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	ECONF_SOURCE=${S} \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	cd "${BUILD_DIR}/contrib/ldapc++" || die
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake \
+				CC="${CC}" CXX="${CXX}"
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+		fi
+
+		if use kerberos ; then
+			build_contrib_module "kinit" "kinit.c" "kinit"
+			cd "${S}/contrib/slapd-modules/passwd" || die
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+		fi
+		# We could build pw-radius if GNURadius would install radlib.h
+		cd "${S}/contrib/slapd-modules/passwd" || die
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		build_contrib_module "nops" "nops.c" "nops-overlay"
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		# build slapi-plugins
+		cd "${S}/contrib/slapi-plugins/addrdnvalues" || die
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests || die "make tests failed"
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+	use static-libs || prune_libtool_files --all
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		newinitd "${FILESDIR}"/slapd-initd-2.4.40-r2 slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+		einfo "Install systemd service"
+		systemd_dounit "${FILESDIR}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		if [[ $(get_libdir) != lib ]]; then
+			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i \
+				"${ED}"/etc/init.d/slapd \
+				"${ED}"/usr/lib/systemd/system/slapd.service || die
+		fi
+		# If built without SLP, we don't need to be before avahi
+		use slp \
+			|| sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"etc/init.d/slapd
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la; do
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
+		chmod 0755 "${EROOT}"var/run/openldap
+		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
+		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://www.gentoo.org/doc/en/ldap-howto.xml)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2015-12-03 18:08 Tony Vroon
  0 siblings, 0 replies; 187+ messages in thread
From: Tony Vroon @ 2015-12-03 18:08 UTC (permalink / raw
  To: gentoo-commits

commit:     7a92fb31181d7f801ccbf93a7947ef1704c75c48
Author:     Tony Vroon <chainsaw <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  3 18:08:09 2015 +0000
Commit:     Tony Vroon <chainsaw <AT> gentoo <DOT> org>
CommitDate: Thu Dec  3 18:08:23 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a92fb31

net-nds/openldap: version bump to 2.4.43

Let us not forget about the Manifest.

 net-nds/openldap/Manifest | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index f19bc7d..786b161 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -3,4 +3,5 @@ DIST openldap-2.4.38.tgz 5506085 SHA256 88209a3599ec5d9354fc09bbe29b99db1ffa1b61
 DIST openldap-2.4.39.tgz 5509060 SHA256 8267c87347103fef56b783b24877c0feda1063d3cb85d070e503d076584bf8a7 SHA512 7b5ef2a69f79f0901a06f8be4ab50afc3b3e98ab1ea74a421569443d32cb43d3cf773d3f028fb5fb39908c09ee172cb4770ecc5882754877a59d29bf8f8cc059 WHIRLPOOL 90ac4cff185855d569a8033a3e35a251d75e4a2805bcfa5ba5b3605ec88b2fc244b0e95aabd33c47c9846f29c95a17e1be43650442987f6abc043667e06f15cd
 DIST openldap-2.4.40.tgz 5641865 SHA256 d12611a5c25b6499293c2bb7b435dc2b174db73e83f5a8cb7e34f2ce5fa6dadb SHA512 c803c4a82878891d60414d64dcb54a7c3f08675106ba13f50cba06034a97b3eee1c238761dd5ddad97d8c3f6675d9bbbec176d0340eb4a3bcd808f940baabab5 WHIRLPOOL 82cb6033798ac69faf4a0d1f5d7716316f5fbfc67e0f3a013b5bae461a01e3029aa6fb7d510bc14eed4f40ef83632561a3fa39aebf2be2785e3d0e0038db048c
 DIST openldap-2.4.42.tgz 5645925 SHA256 eeb7b0e2c5852bfd2650e83909bb6152835c0b862fab10b63954dc1bcbba8e63 SHA512 52d6af7610c4fdc8f965ebea04d09c38f73773a02c2e484dc111100f3d472f8b2f766ca32d9c80f5815a57745095cc7c33ad62d9165eec5b9e252ae172e7782c WHIRLPOOL e151c63bfd10f5e96c60f216925315ed788d426ba2c15ee2793a4de4bb25d01717e7bb5144814a0e6a053a5d5a0aab75213a495aa47aa13f7c3e70716c01633e
+DIST openldap-2.4.43.tgz 5654057 SHA256 34d78e5598a2b0360d26a9050fcdbbe198c65493b013bb607839d5598b6978c8 SHA512 1306206bf22fcec2ccf4b91fd7eadf0207e7015f20d761a4055b0e0213fe1f4c275eec933d86220b03b558650439e74cdca07db05e8debb54d38be4e983b3631 WHIRLPOOL 0d4dc1c1f36f85c4711d0ec1d11107dac242f1d69b4f183e7762cc3ed3d7221c45bd44777e7441afe10156abc487da18f9bdf748244123dd62a241aefe7bca3f
 DIST rfc2307bis.schema-20140524 12262 SHA256 6cd8154ad86be1d6bb88a79c303dc10a49bce4ce7d21bb417a951d6496df30b1 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e WHIRLPOOL 40cef24529fb4bfc1661d03088eccdb17d9056d696b2bf0e698fa248d03f508ba776784bf8abbaffb5f4c2c59b59b29525b4be2babc978fed681e5e3c88073de


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2016-01-22  6:28 Matt Thode
  0 siblings, 0 replies; 187+ messages in thread
From: Matt Thode @ 2016-01-22  6:28 UTC (permalink / raw
  To: gentoo-commits

commit:     d893c73394c9ac779ddc21b839b92869a0562e64
Author:     Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 22 06:26:10 2016 +0000
Commit:     Matt Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Fri Jan 22 06:28:28 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d893c733

net-nds/openldap: fixing heimdal usage for bug 528048

Package-Manager: portage-2.2.26

 net-nds/openldap/metadata.xml              |   1 +
 net-nds/openldap/openldap-2.4.43-r1.ebuild | 821 +++++++++++++++++++++++++++++
 2 files changed, 822 insertions(+)

diff --git a/net-nds/openldap/metadata.xml b/net-nds/openldap/metadata.xml
index cf1698e..3008482 100644
--- a/net-nds/openldap/metadata.xml
+++ b/net-nds/openldap/metadata.xml
@@ -7,6 +7,7 @@
     </maintainer>
 	<use> 
 		<flag name='experimental'>Enable experimental backend options</flag>
+		<flag name='kinit'>Enable support for kerberos init</flag>
 		<flag name='odbc'>Enable ODBC and SQL backend options</flag>
 		<flag name='overlays'>Enable contributed OpenLDAP overlays</flag>
 		<flag name='smbkrb5passwd'>Enable overlay for syncing ldap, unix and

diff --git a/net-nds/openldap/openldap-2.4.43-r1.ebuild b/net-nds/openldap/openldap-2.4.43-r1.ebuild
new file mode 100644
index 0000000..cea4ffd
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.43-r1.ebuild
@@ -0,0 +1,821 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit db-use eutils flag-o-matic multilib multilib-minimal ssl-cert versionator toolchain-funcs autotools user systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="http://www.OpenLDAP.org/"
+
+# mirrors are mostly not working, using canonical URI
+SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
+		 mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+REQUIRED_USE="cxx? ( sasl )
+	?? ( gnutls libressl )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+BDB_SLOTS='5.3 5.1 4.8 4.7 4.6 4.5 4.4'
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+CDEPEND="icu? ( dev-libs/icu:= )
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
+		)
+		gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
+		libressl? ( dev-libs/libressl[${MULTILIB_USEDEP}] )
+		>=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] ) )
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.14
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		slp? ( net-libs/openslp )
+		perl? ( dev-lang/perl[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20140508-r3
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+	)"
+DEPEND="${CDEPEND}
+	sys-apps/groff"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	openldap_datadirs=""
+	if [ -f "${EROOT}"/etc/openldap/slapd.conf ]; then
+		openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${EROOT}/etc/openldap/slapd.conf)"
+	fi
+	openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs}; do
+		CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
+		CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
+		if [ -d ${CURRENT_TAGDIR} ] &&	[ ${openldap_found_tag} == 0 ] ; then
+			einfo "- Checking ${each}..."
+			if [ -r ${CURRENT_TAG} ] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source ${CURRENT_TAG}
+				if [ "${OLDPF}" == "" ] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
+
+				[ $(openldap_filecount ${CURRENT_TAGDIR}) -gt 0 ] && have_files=1
+
+				# are we on the same branch?
+				if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[ $(openldap_filecount ${each}) -gt 0 ] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[ "${have_files}" == "1" ] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH=${EROOT}/usr/$(get_libdir)/openldap/slapd
+	if [ "${have_files}" == "1" -a -f "${SLAPD_PATH}" ]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in $BDB_SLOTS ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "$NEWVER" ]] && break
+			done
+		fi
+		local fail=0
+		if [ -z "${OLDVER}" -a -z "${NEWVER}" ]; then
+			:
+			# Nothing wrong here.
+		elif [ -z "${OLDVER}" -a -n "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [ -n "${OLDVER}" -a -z "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [ "${OLDVER}" != "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[ "${fail}" == "1" ] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [ "${FORCE_UPGRADE}" != "1" ]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version "net-nds/openldap" && built_with_use net-nds/openldap minimal ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+
+	enewgroup ldap 439
+	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		"${S}"/include/ldap_defaults.h
+
+	epatch "${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	epatch \
+		"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \
+		"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	epatch "${FILESDIR}"/${PN}-2.4.17-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	epatch "${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	epatch "${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	epatch "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	epatch "${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	epatch "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+	rm -rf "${S}"/libraries/liblmdb
+
+	cd "${S}"/build || die
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed -i \
+		-e 's|/bin/sh|/bin/bash|g' \
+		"${S}"/tests/scripts/* || die "sed failed"
+
+	cd "${S}" || die
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	cd "${S}/contrib/slapd-modules/$1" || die
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(echo "SLAPD_OVER_${1}" | LC_ALL=C tr '[:lower:]' '[:upper:]')"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU usage is not configurable
+	export ac_cv_header_unicode_utypes_h="$(multilib_is_native_abi && use icu && echo yes || echo no)"
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir $BDB_SLOTS)
+			einfo "Using $DBINCLUDE for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			$(use_enable slp)
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	ECONF_SOURCE=${S} \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	cd "${BUILD_DIR}/contrib/ldapc++" || die
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake \
+				CC="${CC}" CXX="${CXX}"
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			cd "${S}/contrib/slapd-modules/passwd" || die
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+		fi
+		# We could build pw-radius if GNURadius would install radlib.h
+		cd "${S}/contrib/slapd-modules/passwd" || die
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		build_contrib_module "nops" "nops.c" "nops-overlay"
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		# build slapi-plugins
+		cd "${S}/contrib/slapi-plugins/addrdnvalues" || die
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests || die "make tests failed"
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+	use static-libs || prune_libtool_files --all
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		newinitd "${FILESDIR}"/slapd-initd-2.4.40-r2 slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+		einfo "Install systemd service"
+		systemd_dounit "${FILESDIR}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		if [[ $(get_libdir) != lib ]]; then
+			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i \
+				"${ED}"/etc/init.d/slapd \
+				"${ED}"/usr/lib/systemd/system/slapd.service || die
+		fi
+		# If built without SLP, we don't need to be before avahi
+		use slp \
+			|| sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"etc/init.d/slapd
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la; do
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
+		chmod 0755 "${EROOT}"var/run/openldap
+		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
+		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://www.gentoo.org/doc/en/ldap-howto.xml)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2016-03-03 21:08 Zac Medico
  0 siblings, 0 replies; 187+ messages in thread
From: Zac Medico @ 2016-03-03 21:08 UTC (permalink / raw
  To: gentoo-commits

commit:     74cd88d668dd203fc840427c7d3b643b8a88a41d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  3 21:07:59 2016 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar  3 21:08:34 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74cd88d6

net-nds/openldap: version bump to 2.4.44

Package-Manager: portage-2.2.27

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.4.44.ebuild | 821 ++++++++++++++++++++++++++++++++
 2 files changed, 822 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 786b161..d299ef0 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -4,4 +4,5 @@ DIST openldap-2.4.39.tgz 5509060 SHA256 8267c87347103fef56b783b24877c0feda1063d3
 DIST openldap-2.4.40.tgz 5641865 SHA256 d12611a5c25b6499293c2bb7b435dc2b174db73e83f5a8cb7e34f2ce5fa6dadb SHA512 c803c4a82878891d60414d64dcb54a7c3f08675106ba13f50cba06034a97b3eee1c238761dd5ddad97d8c3f6675d9bbbec176d0340eb4a3bcd808f940baabab5 WHIRLPOOL 82cb6033798ac69faf4a0d1f5d7716316f5fbfc67e0f3a013b5bae461a01e3029aa6fb7d510bc14eed4f40ef83632561a3fa39aebf2be2785e3d0e0038db048c
 DIST openldap-2.4.42.tgz 5645925 SHA256 eeb7b0e2c5852bfd2650e83909bb6152835c0b862fab10b63954dc1bcbba8e63 SHA512 52d6af7610c4fdc8f965ebea04d09c38f73773a02c2e484dc111100f3d472f8b2f766ca32d9c80f5815a57745095cc7c33ad62d9165eec5b9e252ae172e7782c WHIRLPOOL e151c63bfd10f5e96c60f216925315ed788d426ba2c15ee2793a4de4bb25d01717e7bb5144814a0e6a053a5d5a0aab75213a495aa47aa13f7c3e70716c01633e
 DIST openldap-2.4.43.tgz 5654057 SHA256 34d78e5598a2b0360d26a9050fcdbbe198c65493b013bb607839d5598b6978c8 SHA512 1306206bf22fcec2ccf4b91fd7eadf0207e7015f20d761a4055b0e0213fe1f4c275eec933d86220b03b558650439e74cdca07db05e8debb54d38be4e983b3631 WHIRLPOOL 0d4dc1c1f36f85c4711d0ec1d11107dac242f1d69b4f183e7762cc3ed3d7221c45bd44777e7441afe10156abc487da18f9bdf748244123dd62a241aefe7bca3f
+DIST openldap-2.4.44.tgz 5658830 SHA256 d7de6bf3c67009c95525dde3a0212cc110d0a70b92af2af8e3ee800e81b88400 SHA512 132eb81798f59a364c9246d08697e1c7ebb6c2c3b983f786b14ec0233df09696cbad33a1f35f3076348b5efb77665a076ab854a24122c31e8b58310b7c7fd136 WHIRLPOOL 37399793d681a6489c369d663772970c62a4e1e370d4dc306bcb6fa3b9cb680139c9d940d9218aaac4618f50a63bc391b10f2aec0a134f84094ce4f7378c88ff
 DIST rfc2307bis.schema-20140524 12262 SHA256 6cd8154ad86be1d6bb88a79c303dc10a49bce4ce7d21bb417a951d6496df30b1 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e WHIRLPOOL 40cef24529fb4bfc1661d03088eccdb17d9056d696b2bf0e698fa248d03f508ba776784bf8abbaffb5f4c2c59b59b29525b4be2babc978fed681e5e3c88073de

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
new file mode 100644
index 0000000..4e463cf
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -0,0 +1,821 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit db-use eutils flag-o-matic multilib multilib-minimal ssl-cert versionator toolchain-funcs autotools user systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="http://www.OpenLDAP.org/"
+
+# mirrors are mostly not working, using canonical URI
+SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
+		 mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+REQUIRED_USE="cxx? ( sasl )
+	?? ( gnutls libressl )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+BDB_SLOTS='5.3 5.1 4.8 4.7 4.6 4.5 4.4'
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+CDEPEND="icu? ( dev-libs/icu:= )
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
+		)
+		gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
+		libressl? ( dev-libs/libressl[${MULTILIB_USEDEP}] )
+		>=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] ) )
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.14:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		slp? ( net-libs/openslp )
+		perl? ( dev-lang/perl[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20140508-r3
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+	)"
+DEPEND="${CDEPEND}
+	sys-apps/groff"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	openldap_datadirs=""
+	if [ -f "${EROOT}"/etc/openldap/slapd.conf ]; then
+		openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${EROOT}/etc/openldap/slapd.conf)"
+	fi
+	openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs}; do
+		CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
+		CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
+		if [ -d ${CURRENT_TAGDIR} ] &&	[ ${openldap_found_tag} == 0 ] ; then
+			einfo "- Checking ${each}..."
+			if [ -r ${CURRENT_TAG} ] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source ${CURRENT_TAG}
+				if [ "${OLDPF}" == "" ] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
+
+				[ $(openldap_filecount ${CURRENT_TAGDIR}) -gt 0 ] && have_files=1
+
+				# are we on the same branch?
+				if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[ $(openldap_filecount ${each}) -gt 0 ] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[ "${have_files}" == "1" ] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH=${EROOT}/usr/$(get_libdir)/openldap/slapd
+	if [ "${have_files}" == "1" -a -f "${SLAPD_PATH}" ]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in $BDB_SLOTS ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "$NEWVER" ]] && break
+			done
+		fi
+		local fail=0
+		if [ -z "${OLDVER}" -a -z "${NEWVER}" ]; then
+			:
+			# Nothing wrong here.
+		elif [ -z "${OLDVER}" -a -n "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [ -n "${OLDVER}" -a -z "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [ "${OLDVER}" != "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[ "${fail}" == "1" ] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [ "${FORCE_UPGRADE}" != "1" ]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version "net-nds/openldap" && built_with_use net-nds/openldap minimal ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+
+	enewgroup ldap 439
+	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		"${S}"/include/ldap_defaults.h
+
+	epatch "${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	epatch \
+		"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \
+		"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	epatch "${FILESDIR}"/${PN}-2.4.17-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	epatch "${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	epatch "${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	epatch "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	epatch "${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	epatch "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+	rm -rf "${S}"/libraries/liblmdb
+
+	cd "${S}"/build || die
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed -i \
+		-e 's|/bin/sh|/bin/bash|g' \
+		"${S}"/tests/scripts/* || die "sed failed"
+
+	cd "${S}" || die
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	cd "${S}/contrib/slapd-modules/$1" || die
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(echo "SLAPD_OVER_${1}" | LC_ALL=C tr '[:lower:]' '[:upper:]')"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU usage is not configurable
+	export ac_cv_header_unicode_utypes_h="$(multilib_is_native_abi && use icu && echo yes || echo no)"
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir $BDB_SLOTS)
+			einfo "Using $DBINCLUDE for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			$(use_enable slp)
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	ECONF_SOURCE=${S} \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	cd "${BUILD_DIR}/contrib/ldapc++" || die
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake \
+				CC="${CC}" CXX="${CXX}"
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			cd "${S}/contrib/slapd-modules/passwd" || die
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+		fi
+		# We could build pw-radius if GNURadius would install radlib.h
+		cd "${S}/contrib/slapd-modules/passwd" || die
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		build_contrib_module "nops" "nops.c" "nops-overlay"
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		# build slapi-plugins
+		cd "${S}/contrib/slapi-plugins/addrdnvalues" || die
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests || die "make tests failed"
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+	use static-libs || prune_libtool_files --all
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		newinitd "${FILESDIR}"/slapd-initd-2.4.40-r2 slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+		einfo "Install systemd service"
+		systemd_dounit "${FILESDIR}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		if [[ $(get_libdir) != lib ]]; then
+			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i \
+				"${ED}"/etc/init.d/slapd \
+				"${ED}"/usr/lib/systemd/system/slapd.service || die
+		fi
+		# If built without SLP, we don't need to be before avahi
+		use slp \
+			|| sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"etc/init.d/slapd
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la; do
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
+		chmod 0755 "${EROOT}"var/run/openldap
+		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
+		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://www.gentoo.org/doc/en/ldap-howto.xml)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2016-09-29 21:36 Andreas Hüttel
  0 siblings, 0 replies; 187+ messages in thread
From: Andreas Hüttel @ 2016-09-29 21:36 UTC (permalink / raw
  To: gentoo-commits

commit:     c5d27eccfd826095496729385dbedc246174d27b
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 29 21:36:15 2016 +0000
Commit:     Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Thu Sep 29 21:36:15 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5d27ecc

net-nds/openldap: Add slot operator on Perl dependency where possible, bug 595388

Package-Manager: portage-2.3.0

 net-nds/openldap/openldap-2.4.38-r2.ebuild | 4 ++--
 net-nds/openldap/openldap-2.4.39.ebuild    | 4 ++--
 net-nds/openldap/openldap-2.4.40-r2.ebuild | 4 ++--
 net-nds/openldap/openldap-2.4.40-r4.ebuild | 4 ++--
 net-nds/openldap/openldap-2.4.40.ebuild    | 4 ++--
 net-nds/openldap/openldap-2.4.42-r1.ebuild | 4 ++--
 net-nds/openldap/openldap-2.4.42.ebuild    | 4 ++--
 net-nds/openldap/openldap-2.4.43-r1.ebuild | 2 +-
 net-nds/openldap/openldap-2.4.43.ebuild    | 4 ++--
 net-nds/openldap/openldap-2.4.44.ebuild    | 2 +-
 10 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.38-r2.ebuild b/net-nds/openldap/openldap-2.4.38-r2.ebuild
index 4832435..54cb2f6 100644
--- a/net-nds/openldap/openldap-2.4.38-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.38-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -42,7 +42,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )
 		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl[-build(-)] )
+		perl? ( dev-lang/perl:=[-build(-)] )
 		samba? ( dev-libs/openssl )
 		berkdb? ( sys-libs/db )
 		smbkrb5passwd? (

diff --git a/net-nds/openldap/openldap-2.4.39.ebuild b/net-nds/openldap/openldap-2.4.39.ebuild
index d87e8aa..354d070 100644
--- a/net-nds/openldap/openldap-2.4.39.ebuild
+++ b/net-nds/openldap/openldap-2.4.39.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -42,7 +42,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )
 		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl[-build(-)] )
+		perl? ( dev-lang/perl:=[-build(-)] )
 		samba? ( dev-libs/openssl )
 		berkdb? ( sys-libs/db )
 		smbkrb5passwd? (

diff --git a/net-nds/openldap/openldap-2.4.40-r2.ebuild b/net-nds/openldap/openldap-2.4.40-r2.ebuild
index fc83060..3aab68c 100644
--- a/net-nds/openldap/openldap-2.4.40-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.40-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -51,7 +51,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )
 		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl[-build(-)] )
+		perl? ( dev-lang/perl:=[-build(-)] )
 		samba? ( dev-libs/openssl )
 		berkdb? (
 			<sys-libs/db-6.0:=

diff --git a/net-nds/openldap/openldap-2.4.40-r4.ebuild b/net-nds/openldap/openldap-2.4.40-r4.ebuild
index 990d027..d7a9f34 100644
--- a/net-nds/openldap/openldap-2.4.40-r4.ebuild
+++ b/net-nds/openldap/openldap-2.4.40-r4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -51,7 +51,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )
 		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl[-build(-)] )
+		perl? ( dev-lang/perl:=[-build(-)] )
 		samba? ( dev-libs/openssl )
 		berkdb? (
 			<sys-libs/db-6.0:=

diff --git a/net-nds/openldap/openldap-2.4.40.ebuild b/net-nds/openldap/openldap-2.4.40.ebuild
index 758db48..d43fc01 100644
--- a/net-nds/openldap/openldap-2.4.40.ebuild
+++ b/net-nds/openldap/openldap-2.4.40.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -43,7 +43,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )
 		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl[-build(-)] )
+		perl? ( dev-lang/perl:=[-build(-)] )
 		samba? ( dev-libs/openssl )
 		berkdb? ( sys-libs/db )
 		smbkrb5passwd? (

diff --git a/net-nds/openldap/openldap-2.4.42-r1.ebuild b/net-nds/openldap/openldap-2.4.42-r1.ebuild
index 5f46c6b..d86a0f9 100644
--- a/net-nds/openldap/openldap-2.4.42-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.42-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -57,7 +57,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )
 		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl[-build(-)] )
+		perl? ( dev-lang/perl:=[-build(-)] )
 		samba? (
 			!libressl? ( dev-libs/openssl:0 )
 			libressl? ( dev-libs/libressl )

diff --git a/net-nds/openldap/openldap-2.4.42.ebuild b/net-nds/openldap/openldap-2.4.42.ebuild
index 35e79b6..2cabc23 100644
--- a/net-nds/openldap/openldap-2.4.42.ebuild
+++ b/net-nds/openldap/openldap-2.4.42.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -51,7 +51,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )
 		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl[-build(-)] )
+		perl? ( dev-lang/perl:=[-build(-)] )
 		samba? ( dev-libs/openssl )
 		berkdb? (
 			<sys-libs/db-6.0:=

diff --git a/net-nds/openldap/openldap-2.4.43-r1.ebuild b/net-nds/openldap/openldap-2.4.43-r1.ebuild
index cea4ffd..01b0bc4 100644
--- a/net-nds/openldap/openldap-2.4.43-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.43-r1.ebuild
@@ -57,7 +57,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )
 		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl[-build(-)] )
+		perl? ( dev-lang/perl:=[-build(-)] )
 		samba? (
 			!libressl? ( dev-libs/openssl:0 )
 			libressl? ( dev-libs/libressl )

diff --git a/net-nds/openldap/openldap-2.4.43.ebuild b/net-nds/openldap/openldap-2.4.43.ebuild
index 3b121db..978f7d1 100644
--- a/net-nds/openldap/openldap-2.4.43.ebuild
+++ b/net-nds/openldap/openldap-2.4.43.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -57,7 +57,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )
 		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl[-build(-)] )
+		perl? ( dev-lang/perl:=[-build(-)] )
 		samba? (
 			!libressl? ( dev-libs/openssl:0 )
 			libressl? ( dev-libs/libressl )

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index 4e463cf..1412f49 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -57,7 +57,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )
 		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl[-build(-)] )
+		perl? ( dev-lang/perl:=[-build(-)] )
 		samba? (
 			!libressl? ( dev-libs/openssl:0 )
 			libressl? ( dev-libs/libressl )


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2016-11-10  5:00 Mike Frysinger
  0 siblings, 0 replies; 187+ messages in thread
From: Mike Frysinger @ 2016-11-10  5:00 UTC (permalink / raw
  To: gentoo-commits

commit:     007731c32667ec22df59d8173b8b019229acb533
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 10 04:58:53 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 10 04:58:53 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=007731c3

net-nds/openldap: fix cross-compiling due to pthread tests #463966

 net-nds/openldap/openldap-2.4.38-r2.ebuild | 5 +++++
 net-nds/openldap/openldap-2.4.39.ebuild    | 5 +++++
 net-nds/openldap/openldap-2.4.40-r2.ebuild | 5 +++++
 net-nds/openldap/openldap-2.4.40-r4.ebuild | 5 +++++
 net-nds/openldap/openldap-2.4.40.ebuild    | 5 +++++
 net-nds/openldap/openldap-2.4.42-r1.ebuild | 5 +++++
 net-nds/openldap/openldap-2.4.42.ebuild    | 5 +++++
 net-nds/openldap/openldap-2.4.43-r1.ebuild | 5 +++++
 net-nds/openldap/openldap-2.4.43.ebuild    | 5 +++++
 net-nds/openldap/openldap-2.4.44.ebuild    | 5 +++++
 10 files changed, 50 insertions(+)

diff --git a/net-nds/openldap/openldap-2.4.38-r2.ebuild b/net-nds/openldap/openldap-2.4.38-r2.ebuild
index a24614b..1706a4a 100644
--- a/net-nds/openldap/openldap-2.4.38-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.38-r2.ebuild
@@ -448,6 +448,11 @@ multilib_src_configure() {
 		$(use_enable tcpd wrappers)
 	)
 
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
 	local ssl_lib="no"
 	if use ssl || ( ! use minimal && use samba ) ; then
 		ssl_lib="openssl"

diff --git a/net-nds/openldap/openldap-2.4.39.ebuild b/net-nds/openldap/openldap-2.4.39.ebuild
index 09e8f85..8386830 100644
--- a/net-nds/openldap/openldap-2.4.39.ebuild
+++ b/net-nds/openldap/openldap-2.4.39.ebuild
@@ -447,6 +447,11 @@ multilib_src_configure() {
 		$(use_enable tcpd wrappers)
 	)
 
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
 	local ssl_lib="no"
 	if use ssl || ( ! use minimal && use samba ) ; then
 		ssl_lib="openssl"

diff --git a/net-nds/openldap/openldap-2.4.40-r2.ebuild b/net-nds/openldap/openldap-2.4.40-r2.ebuild
index 3330f90..ffe3d74 100644
--- a/net-nds/openldap/openldap-2.4.40-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.40-r2.ebuild
@@ -472,6 +472,11 @@ multilib_src_configure() {
 		$(use_enable tcpd wrappers)
 	)
 
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
 	local ssl_lib="no"
 	if use ssl || ( ! use minimal && use samba ) ; then
 		ssl_lib="openssl"

diff --git a/net-nds/openldap/openldap-2.4.40-r4.ebuild b/net-nds/openldap/openldap-2.4.40-r4.ebuild
index b12340e..26c2ac1 100644
--- a/net-nds/openldap/openldap-2.4.40-r4.ebuild
+++ b/net-nds/openldap/openldap-2.4.40-r4.ebuild
@@ -472,6 +472,11 @@ multilib_src_configure() {
 		$(use_enable tcpd wrappers)
 	)
 
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
 	local ssl_lib="no"
 	if use ssl || ( ! use minimal && use samba ) ; then
 		ssl_lib="openssl"

diff --git a/net-nds/openldap/openldap-2.4.40.ebuild b/net-nds/openldap/openldap-2.4.40.ebuild
index 8268a01..5c7a172 100644
--- a/net-nds/openldap/openldap-2.4.40.ebuild
+++ b/net-nds/openldap/openldap-2.4.40.ebuild
@@ -460,6 +460,11 @@ multilib_src_configure() {
 		$(use_enable tcpd wrappers)
 	)
 
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
 	local ssl_lib="no"
 	if use ssl || ( ! use minimal && use samba ) ; then
 		ssl_lib="openssl"

diff --git a/net-nds/openldap/openldap-2.4.42-r1.ebuild b/net-nds/openldap/openldap-2.4.42-r1.ebuild
index 2803acd..0a41823 100644
--- a/net-nds/openldap/openldap-2.4.42-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.42-r1.ebuild
@@ -479,6 +479,11 @@ multilib_src_configure() {
 		$(use_enable tcpd wrappers)
 	)
 
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
 	local ssl_lib="no"
 	if use ssl || ( ! use minimal && use samba ) ; then
 		ssl_lib="openssl"

diff --git a/net-nds/openldap/openldap-2.4.42.ebuild b/net-nds/openldap/openldap-2.4.42.ebuild
index 9207343..586750b 100644
--- a/net-nds/openldap/openldap-2.4.42.ebuild
+++ b/net-nds/openldap/openldap-2.4.42.ebuild
@@ -469,6 +469,11 @@ multilib_src_configure() {
 		$(use_enable tcpd wrappers)
 	)
 
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
 	local ssl_lib="no"
 	if use ssl || ( ! use minimal && use samba ) ; then
 		ssl_lib="openssl"

diff --git a/net-nds/openldap/openldap-2.4.43-r1.ebuild b/net-nds/openldap/openldap-2.4.43-r1.ebuild
index dd87fea..bb12c53 100644
--- a/net-nds/openldap/openldap-2.4.43-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.43-r1.ebuild
@@ -479,6 +479,11 @@ multilib_src_configure() {
 		$(use_enable tcpd wrappers)
 	)
 
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
 	local ssl_lib="no"
 	if use ssl || ( ! use minimal && use samba ) ; then
 		ssl_lib="openssl"

diff --git a/net-nds/openldap/openldap-2.4.43.ebuild b/net-nds/openldap/openldap-2.4.43.ebuild
index 10dcd00..42f229c 100644
--- a/net-nds/openldap/openldap-2.4.43.ebuild
+++ b/net-nds/openldap/openldap-2.4.43.ebuild
@@ -476,6 +476,11 @@ multilib_src_configure() {
 		$(use_enable tcpd wrappers)
 	)
 
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
 	local ssl_lib="no"
 	if use ssl || ( ! use minimal && use samba ) ; then
 		ssl_lib="openssl"

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index e232b36..54d6df7 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -479,6 +479,11 @@ multilib_src_configure() {
 		$(use_enable tcpd wrappers)
 	)
 
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
 	local ssl_lib="no"
 	if use ssl || ( ! use minimal && use samba ) ; then
 		ssl_lib="openssl"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2016-11-10  5:00 Mike Frysinger
  0 siblings, 0 replies; 187+ messages in thread
From: Mike Frysinger @ 2016-11-10  5:00 UTC (permalink / raw
  To: gentoo-commits

commit:     f0962e9d29a9aec5a11777d6753bd0ec1bd485b2
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 10 04:53:24 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 10 04:57:14 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f0962e9d

net-nds/openldap: skip acct creation for USE=minimal

The accounts are only used by the ldap server, not its libraries,
so skip account creation in those cases.

 net-nds/openldap/openldap-2.3.43-r3.ebuild | 8 ++++++--
 net-nds/openldap/openldap-2.3.43-r4.ebuild | 8 ++++++--
 net-nds/openldap/openldap-2.4.38-r2.ebuild | 8 ++++++--
 net-nds/openldap/openldap-2.4.39.ebuild    | 8 ++++++--
 net-nds/openldap/openldap-2.4.40-r2.ebuild | 8 ++++++--
 net-nds/openldap/openldap-2.4.40-r4.ebuild | 8 ++++++--
 net-nds/openldap/openldap-2.4.40.ebuild    | 8 ++++++--
 net-nds/openldap/openldap-2.4.42-r1.ebuild | 8 ++++++--
 net-nds/openldap/openldap-2.4.42.ebuild    | 8 ++++++--
 net-nds/openldap/openldap-2.4.43-r1.ebuild | 8 ++++++--
 net-nds/openldap/openldap-2.4.43.ebuild    | 8 ++++++--
 net-nds/openldap/openldap-2.4.44.ebuild    | 8 ++++++--
 12 files changed, 72 insertions(+), 24 deletions(-)

diff --git a/net-nds/openldap/openldap-2.3.43-r3.ebuild b/net-nds/openldap/openldap-2.3.43-r3.ebuild
index 43fc797..7d5c8c0 100644
--- a/net-nds/openldap/openldap-2.3.43-r3.ebuild
+++ b/net-nds/openldap/openldap-2.3.43-r3.ebuild
@@ -188,8 +188,12 @@ pkg_setup() {
 		openldap_find_versiontags
 	fi
 
-	enewgroup ldap 439
-	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
 }
 
 src_prepare() {

diff --git a/net-nds/openldap/openldap-2.3.43-r4.ebuild b/net-nds/openldap/openldap-2.3.43-r4.ebuild
index bdb8c8d..e8c1aa5 100644
--- a/net-nds/openldap/openldap-2.3.43-r4.ebuild
+++ b/net-nds/openldap/openldap-2.3.43-r4.ebuild
@@ -188,8 +188,12 @@ pkg_setup() {
 		openldap_find_versiontags
 	fi
 
-	enewgroup ldap 439
-	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
 }
 
 src_prepare() {

diff --git a/net-nds/openldap/openldap-2.4.38-r2.ebuild b/net-nds/openldap/openldap-2.4.38-r2.ebuild
index 54cb2f6..a24614b 100644
--- a/net-nds/openldap/openldap-2.4.38-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.38-r2.ebuild
@@ -270,8 +270,12 @@ pkg_setup() {
 		openldap_find_versiontags
 	fi
 
-	enewgroup ldap 439
-	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
 }
 
 src_prepare() {

diff --git a/net-nds/openldap/openldap-2.4.39.ebuild b/net-nds/openldap/openldap-2.4.39.ebuild
index 354d070..09e8f85 100644
--- a/net-nds/openldap/openldap-2.4.39.ebuild
+++ b/net-nds/openldap/openldap-2.4.39.ebuild
@@ -269,8 +269,12 @@ pkg_setup() {
 		openldap_find_versiontags
 	fi
 
-	enewgroup ldap 439
-	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
 }
 
 src_prepare() {

diff --git a/net-nds/openldap/openldap-2.4.40-r2.ebuild b/net-nds/openldap/openldap-2.4.40-r2.ebuild
index 3aab68c..3330f90 100644
--- a/net-nds/openldap/openldap-2.4.40-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.40-r2.ebuild
@@ -288,8 +288,12 @@ pkg_setup() {
 		openldap_find_versiontags
 	fi
 
-	enewgroup ldap 439
-	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
 }
 
 src_prepare() {

diff --git a/net-nds/openldap/openldap-2.4.40-r4.ebuild b/net-nds/openldap/openldap-2.4.40-r4.ebuild
index d7a9f34..b12340e 100644
--- a/net-nds/openldap/openldap-2.4.40-r4.ebuild
+++ b/net-nds/openldap/openldap-2.4.40-r4.ebuild
@@ -288,8 +288,12 @@ pkg_setup() {
 		openldap_find_versiontags
 	fi
 
-	enewgroup ldap 439
-	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
 }
 
 src_prepare() {

diff --git a/net-nds/openldap/openldap-2.4.40.ebuild b/net-nds/openldap/openldap-2.4.40.ebuild
index d43fc01..8268a01 100644
--- a/net-nds/openldap/openldap-2.4.40.ebuild
+++ b/net-nds/openldap/openldap-2.4.40.ebuild
@@ -274,8 +274,12 @@ pkg_setup() {
 		openldap_find_versiontags
 	fi
 
-	enewgroup ldap 439
-	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
 }
 
 src_prepare() {

diff --git a/net-nds/openldap/openldap-2.4.42-r1.ebuild b/net-nds/openldap/openldap-2.4.42-r1.ebuild
index d86a0f9..2803acd 100644
--- a/net-nds/openldap/openldap-2.4.42-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.42-r1.ebuild
@@ -298,8 +298,12 @@ pkg_setup() {
 		openldap_find_versiontags
 	fi
 
-	enewgroup ldap 439
-	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
 }
 
 src_prepare() {

diff --git a/net-nds/openldap/openldap-2.4.42.ebuild b/net-nds/openldap/openldap-2.4.42.ebuild
index 2cabc23..9207343 100644
--- a/net-nds/openldap/openldap-2.4.42.ebuild
+++ b/net-nds/openldap/openldap-2.4.42.ebuild
@@ -288,8 +288,12 @@ pkg_setup() {
 		openldap_find_versiontags
 	fi
 
-	enewgroup ldap 439
-	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
 }
 
 src_prepare() {

diff --git a/net-nds/openldap/openldap-2.4.43-r1.ebuild b/net-nds/openldap/openldap-2.4.43-r1.ebuild
index 01b0bc4..dd87fea 100644
--- a/net-nds/openldap/openldap-2.4.43-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.43-r1.ebuild
@@ -301,8 +301,12 @@ pkg_setup() {
 		openldap_find_versiontags
 	fi
 
-	enewgroup ldap 439
-	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
 }
 
 src_prepare() {

diff --git a/net-nds/openldap/openldap-2.4.43.ebuild b/net-nds/openldap/openldap-2.4.43.ebuild
index 978f7d1..10dcd00 100644
--- a/net-nds/openldap/openldap-2.4.43.ebuild
+++ b/net-nds/openldap/openldap-2.4.43.ebuild
@@ -298,8 +298,12 @@ pkg_setup() {
 		openldap_find_versiontags
 	fi
 
-	enewgroup ldap 439
-	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
 }
 
 src_prepare() {

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index 1412f49..e232b36 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -301,8 +301,12 @@ pkg_setup() {
 		openldap_find_versiontags
 	fi
 
-	enewgroup ldap 439
-	enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
 }
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2016-11-19 13:53 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2016-11-19 13:53 UTC (permalink / raw
  To: gentoo-commits

commit:     8050529169842c9c85b91562752889c86b24b16e
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 19 13:52:35 2016 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Sat Nov 19 13:52:35 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80505291

net-nds/openldap: amd64 stable wrt bug #560424

Package-Manager: portage-2.3.0
RepoMan-Options: --include-arches="amd64"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.43.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.43.ebuild b/net-nds/openldap/openldap-2.4.43.ebuild
index 42f229c..b261da2 100644
--- a/net-nds/openldap/openldap-2.4.43.ebuild
+++ b/net-nds/openldap/openldap-2.4.43.ebuild
@@ -19,7 +19,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2016-11-19 13:55 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2016-11-19 13:55 UTC (permalink / raw
  To: gentoo-commits

commit:     b73cc74262d776a85828ef2df12bf6c9a602f964
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 19 13:54:58 2016 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Sat Nov 19 13:54:58 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b73cc742

net-nds/openldap: x86 stable wrt bug #560424

Package-Manager: portage-2.3.0
RepoMan-Options: --include-arches="x86"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.43.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.43.ebuild b/net-nds/openldap/openldap-2.4.43.ebuild
index b261da2..76b17cf 100644
--- a/net-nds/openldap/openldap-2.4.43.ebuild
+++ b/net-nds/openldap/openldap-2.4.43.ebuild
@@ -19,7 +19,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2016-11-23  9:20 Tobias Klausmann
  0 siblings, 0 replies; 187+ messages in thread
From: Tobias Klausmann @ 2016-11-23  9:20 UTC (permalink / raw
  To: gentoo-commits

commit:     af4d162e43ac358fd692d88794aa849a3ea6e088
Author:     Tobias Klausmann <klausman <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 23 09:19:59 2016 +0000
Commit:     Tobias Klausmann <klausman <AT> gentoo <DOT> org>
CommitDate: Wed Nov 23 09:20:19 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af4d162e

net-nds/openldap-2.4.44-r0: stable on alpha

Gentoo-Bug: 560424

 net-nds/openldap/openldap-2.4.44.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index 54d6df7..ac5a0c8 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -19,7 +19,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2016-11-28  5:15 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2016-11-28  5:15 UTC (permalink / raw
  To: gentoo-commits

commit:     e8e07dcbb4eafbbbef6b7a780410c86947505d4c
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 28 05:15:10 2016 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Nov 28 05:15:30 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e8e07dcb

net-nds/openldap: bug #588792, ensure dev-db/lmdb matches or exceeds bundled lmdb.

Package-Manager: portage-2.3.2

 net-nds/openldap/openldap-2.4.42-r1.ebuild | 2 +-
 net-nds/openldap/openldap-2.4.42.ebuild    | 2 +-
 net-nds/openldap/openldap-2.4.43-r1.ebuild | 2 +-
 net-nds/openldap/openldap-2.4.43.ebuild    | 2 +-
 net-nds/openldap/openldap-2.4.44.ebuild    | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.42-r1.ebuild b/net-nds/openldap/openldap-2.4.42-r1.ebuild
index 0a41823..e7033de 100644
--- a/net-nds/openldap/openldap-2.4.42-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.42-r1.ebuild
@@ -52,7 +52,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 	!minimal? (
 		sys-devel/libtool
 		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.14
+		>=dev-db/lmdb-0.9.17
 		tcpd? ( sys-apps/tcp-wrappers )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )

diff --git a/net-nds/openldap/openldap-2.4.42.ebuild b/net-nds/openldap/openldap-2.4.42.ebuild
index 586750b..4aa1760 100644
--- a/net-nds/openldap/openldap-2.4.42.ebuild
+++ b/net-nds/openldap/openldap-2.4.42.ebuild
@@ -46,7 +46,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 	!minimal? (
 		sys-devel/libtool
 		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.14
+		>=dev-db/lmdb-0.9.17
 		tcpd? ( sys-apps/tcp-wrappers )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )

diff --git a/net-nds/openldap/openldap-2.4.43-r1.ebuild b/net-nds/openldap/openldap-2.4.43-r1.ebuild
index bb12c53..ee27b3c 100644
--- a/net-nds/openldap/openldap-2.4.43-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.43-r1.ebuild
@@ -52,7 +52,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 	!minimal? (
 		sys-devel/libtool
 		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.14
+		>=dev-db/lmdb-0.9.17
 		tcpd? ( sys-apps/tcp-wrappers )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )

diff --git a/net-nds/openldap/openldap-2.4.43.ebuild b/net-nds/openldap/openldap-2.4.43.ebuild
index 76b17cf..dd6af16 100644
--- a/net-nds/openldap/openldap-2.4.43.ebuild
+++ b/net-nds/openldap/openldap-2.4.43.ebuild
@@ -52,7 +52,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 	!minimal? (
 		sys-devel/libtool
 		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.14
+		>=dev-db/lmdb-0.9.17
 		tcpd? ( sys-apps/tcp-wrappers )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index ac5a0c8..41ea450 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -52,7 +52,7 @@ CDEPEND="icu? ( dev-libs/icu:= )
 	!minimal? (
 		sys-devel/libtool
 		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.14:=
+		>=dev-db/lmdb-0.9.18:=
 		tcpd? ( sys-apps/tcp-wrappers )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-01-13 16:51 Markus Meier
  0 siblings, 0 replies; 187+ messages in thread
From: Markus Meier @ 2017-01-13 16:51 UTC (permalink / raw
  To: gentoo-commits

commit:     b01d2041fd961c950a904e117e8d9a22fa3fe794
Author:     Markus Meier <maekke <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 13 16:50:56 2017 +0000
Commit:     Markus Meier <maekke <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 16:50:56 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b01d2041

net-nds/openldap: arm stable, bug #560424

Package-Manager: Portage-2.3.3, Repoman-2.3.1
RepoMan-Options: --include-arches="arm"

 net-nds/openldap/openldap-2.4.44.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index 6f13895..fe51e1f 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -19,7 +19,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha ~amd64 arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-01-15 19:27 Jeroen Roovers
  0 siblings, 0 replies; 187+ messages in thread
From: Jeroen Roovers @ 2017-01-15 19:27 UTC (permalink / raw
  To: gentoo-commits

commit:     5a73621d27aec26a5a24792e90360bdd385fb1b5
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 15 19:26:26 2017 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Sun Jan 15 19:26:26 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a73621d

net-nds/openldap: Stable for HPPA (bug #560424).

Package-Manager: Portage-2.3.3, Repoman-2.3.1
RepoMan-Options: --ignore-arches

 net-nds/openldap/openldap-2.4.44.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index d8205dc..77c9fb1 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -19,7 +19,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha ~amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ~ppc64 ~s390 ~sh sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha ~amd64 arm ~arm64 hppa ~ia64 ~mips ppc ~ppc64 ~s390 ~sh sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-01-18 10:02 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2017-01-18 10:02 UTC (permalink / raw
  To: gentoo-commits

commit:     48d3c68592869e8553e9b60eb6df2493675b3c98
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 18 10:01:45 2017 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Wed Jan 18 10:02:39 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48d3c685

net-nds/openldap: ppc64 stable wrt bug #560424

Package-Manager: portage-2.3.0
RepoMan-Options: --include-arches="ppc64"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.44.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index 8ff4f6e..4b43621 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -19,7 +19,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha ~amd64 arm ~arm64 hppa ia64 ~mips ppc ~ppc64 ~s390 ~sh sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha ~amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-01-24  8:23 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2017-01-24  8:23 UTC (permalink / raw
  To: gentoo-commits

commit:     aa33a8f9b888c52f7460a54357c21f60aeab86d6
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 24 08:23:44 2017 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Tue Jan 24 08:23:44 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa33a8f9

net-nds/openldap: amd64 stable wrt bug #560424

Package-Manager: portage-2.3.0
RepoMan-Options: --include-arches="amd64"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.44.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index 4b43621..0e67cb3 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -19,7 +19,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha ~amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-01-24  8:24 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2017-01-24  8:24 UTC (permalink / raw
  To: gentoo-commits

commit:     ff88f75ed50256ecf14d59d794ffd609a93520f8
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 24 08:24:09 2017 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Tue Jan 24 08:24:09 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff88f75e

net-nds/openldap: x86 stable wrt bug #560424

Package-Manager: portage-2.3.0
RepoMan-Options: --include-arches="x86"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.44.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index 0e67cb3..7b96577 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -19,7 +19,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-02-07 20:07 Patrick McLean
  0 siblings, 0 replies; 187+ messages in thread
From: Patrick McLean @ 2017-02-07 20:07 UTC (permalink / raw
  To: gentoo-commits

commit:     0f6336d03b42615c04381febe8d98f0928350439
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  7 20:06:36 2017 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Feb  7 20:07:41 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f6336d0

net-nds/openldap: Revision bump, add USE=pbkdf2 for pbkdf2 password support

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 net-nds/openldap/metadata.xml              |   1 +
 net-nds/openldap/openldap-2.4.44-r1.ebuild | 853 +++++++++++++++++++++++++++++
 2 files changed, 854 insertions(+)

diff --git a/net-nds/openldap/metadata.xml b/net-nds/openldap/metadata.xml
index b53a10a..cda62a6 100644
--- a/net-nds/openldap/metadata.xml
+++ b/net-nds/openldap/metadata.xml
@@ -12,6 +12,7 @@
 		<flag name="smbkrb5passwd">Enable overlay for syncing ldap, unix and
 			lanman passwords</flag>
 		<flag name="minimal">Build libraries &amp; userspace tools only. Does not install any server code.</flag>
+		<flag name="pbkdf2">Enable support for pbkdf2 passwords</flag>
 	</use>
 	<upstream>
 		<remote-id type="cpe">cpe:/a:openldap:openldap</remote-id>

diff --git a/net-nds/openldap/openldap-2.4.44-r1.ebuild b/net-nds/openldap/openldap-2.4.44-r1.ebuild
new file mode 100644
index 00000000..7e7c7a0
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.44-r1.ebuild
@@ -0,0 +1,853 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit db-use eutils flag-o-matic multilib multilib-minimal ssl-cert versionator toolchain-funcs autotools user systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="http://www.OpenLDAP.org/"
+
+# mirrors are mostly not working, using canonical URI
+SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
+		 mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+REQUIRED_USE="cxx? ( sasl )
+	?? ( gnutls libressl )
+	pbkdf2? ( ssl )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+BDB_SLOTS='5.3 5.1 4.8 4.7 4.6 4.5 4.4'
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+CDEPEND="icu? ( dev-libs/icu:= )
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
+		)
+		gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
+		libressl? ( dev-libs/libressl[${MULTILIB_USEDEP}] )
+		>=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] ) )
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		slp? ( net-libs/openslp )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20140508-r3
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+	)"
+DEPEND="${CDEPEND}
+	sys-apps/groff"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	openldap_datadirs=""
+	if [ -f "${EROOT}"/etc/openldap/slapd.conf ]; then
+		openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${EROOT}/etc/openldap/slapd.conf)"
+	fi
+	openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs}; do
+		CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
+		CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
+		if [ -d ${CURRENT_TAGDIR} ] &&	[ ${openldap_found_tag} == 0 ] ; then
+			einfo "- Checking ${each}..."
+			if [ -r ${CURRENT_TAG} ] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source ${CURRENT_TAG}
+				if [ "${OLDPF}" == "" ] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
+
+				[ $(openldap_filecount ${CURRENT_TAGDIR}) -gt 0 ] && have_files=1
+
+				# are we on the same branch?
+				if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[ $(openldap_filecount ${each}) -gt 0 ] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[ "${have_files}" == "1" ] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH=${EROOT}/usr/$(get_libdir)/openldap/slapd
+	if [ "${have_files}" == "1" -a -f "${SLAPD_PATH}" ]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in $BDB_SLOTS ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "$NEWVER" ]] && break
+			done
+		fi
+		local fail=0
+		if [ -z "${OLDVER}" -a -z "${NEWVER}" ]; then
+			:
+			# Nothing wrong here.
+		elif [ -z "${OLDVER}" -a -n "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [ -n "${OLDVER}" -a -z "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [ "${OLDVER}" != "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[ "${fail}" == "1" ] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [ "${FORCE_UPGRADE}" != "1" ]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version "net-nds/openldap" && built_with_use net-nds/openldap minimal ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		"${S}"/include/ldap_defaults.h
+
+	epatch "${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	epatch \
+		"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \
+		"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	epatch "${FILESDIR}"/${PN}-2.4.17-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	epatch "${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	epatch "${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	epatch "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	epatch "${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	epatch "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+	rm -rf "${S}"/libraries/liblmdb
+
+	cd "${S}"/build || die
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed -i \
+		-e 's|/bin/sh|/bin/bash|g' \
+		"${S}"/tests/scripts/* || die "sed failed"
+
+	cd "${S}" || die
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	cd "${S}/contrib/slapd-modules/$1" || die
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(echo "SLAPD_OVER_${1}" | LC_ALL=C tr '[:lower:]' '[:upper:]')"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU usage is not configurable
+	export ac_cv_header_unicode_utypes_h="$(multilib_is_native_abi && use icu && echo yes || echo no)"
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir $BDB_SLOTS)
+			einfo "Using $DBINCLUDE for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			$(use_enable slp)
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	ECONF_SOURCE=${S} \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	cd "${BUILD_DIR}/contrib/ldapc++" || die
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake \
+				CC="${CC}" CXX="${CXX}"
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			cd "${S}/contrib/slapd-modules/passwd" || die
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+		fi
+
+		if use pbkdf2; then
+			cd "${S}/contrib/slapd-modules/passwd/pbkdf2" || die
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		cd "${S}/contrib/slapd-modules/passwd" || die
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		build_contrib_module "nops" "nops.c" "nops-overlay"
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		# build slapi-plugins
+		cd "${S}/contrib/slapi-plugins/addrdnvalues" || die
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests || die "make tests failed"
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+	use static-libs || prune_libtool_files --all
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		newinitd "${FILESDIR}"/slapd-initd-2.4.40-r2 slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+		einfo "Install systemd service"
+		systemd_dounit "${FILESDIR}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		if [[ $(get_libdir) != lib ]]; then
+			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i \
+				"${ED}"/etc/init.d/slapd \
+				"${ED}"/usr/lib/systemd/system/slapd.service || die
+		fi
+		# If built without SLP, we don't need to be before avahi
+		use slp \
+			|| sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"etc/init.d/slapd
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
+		chmod 0755 "${EROOT}"var/run/openldap
+		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
+		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://www.gentoo.org/doc/en/ldap-howto.xml)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-02-08 23:38 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2017-02-08 23:38 UTC (permalink / raw
  To: gentoo-commits

commit:     224ac572445499be78cf3ad2dbbc791568d1458f
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 23:37:55 2017 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 23:38:20 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=224ac572

net-nds/openldap: allow override of BDB slot during build.

Package-Manager: portage-2.3.2

 net-nds/openldap/openldap-2.4.40-r2.ebuild | 3 ++-
 net-nds/openldap/openldap-2.4.40-r4.ebuild | 3 ++-
 net-nds/openldap/openldap-2.4.42-r1.ebuild | 3 ++-
 net-nds/openldap/openldap-2.4.42.ebuild    | 3 ++-
 net-nds/openldap/openldap-2.4.43-r1.ebuild | 3 ++-
 net-nds/openldap/openldap-2.4.43.ebuild    | 3 ++-
 net-nds/openldap/openldap-2.4.44-r1.ebuild | 3 ++-
 net-nds/openldap/openldap-2.4.44.ebuild    | 3 ++-
 8 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.40-r2.ebuild b/net-nds/openldap/openldap-2.4.40-r2.ebuild
index ee565280fe..2b1bd80466 100644
--- a/net-nds/openldap/openldap-2.4.40-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.40-r2.ebuild
@@ -34,7 +34,8 @@ REQUIRED_USE="cxx? ( sasl )"
 # always list newer first
 # Do not add any AGPL-3 BDB here!
 # See bug 525110, comment 15.
-BDB_SLOTS='5.3 5.1 4.8 4.7 4.6 4.5 4.4'
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
 BDB_PKGS=''
 for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 

diff --git a/net-nds/openldap/openldap-2.4.40-r4.ebuild b/net-nds/openldap/openldap-2.4.40-r4.ebuild
index 7db8c17d09..f0cf71b4cb 100644
--- a/net-nds/openldap/openldap-2.4.40-r4.ebuild
+++ b/net-nds/openldap/openldap-2.4.40-r4.ebuild
@@ -34,7 +34,8 @@ REQUIRED_USE="cxx? ( sasl )"
 # always list newer first
 # Do not add any AGPL-3 BDB here!
 # See bug 525110, comment 15.
-BDB_SLOTS='5.3 5.1 4.8 4.7 4.6 4.5 4.4'
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
 BDB_PKGS=''
 for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 

diff --git a/net-nds/openldap/openldap-2.4.42-r1.ebuild b/net-nds/openldap/openldap-2.4.42-r1.ebuild
index 22b73afd2e..2b8a56f637 100644
--- a/net-nds/openldap/openldap-2.4.42-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.42-r1.ebuild
@@ -35,7 +35,8 @@ REQUIRED_USE="cxx? ( sasl )
 # always list newer first
 # Do not add any AGPL-3 BDB here!
 # See bug 525110, comment 15.
-BDB_SLOTS='5.3 5.1 4.8 4.7 4.6 4.5 4.4'
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
 BDB_PKGS=''
 for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 

diff --git a/net-nds/openldap/openldap-2.4.42.ebuild b/net-nds/openldap/openldap-2.4.42.ebuild
index 19ad134306..e3e20faa16 100644
--- a/net-nds/openldap/openldap-2.4.42.ebuild
+++ b/net-nds/openldap/openldap-2.4.42.ebuild
@@ -34,7 +34,8 @@ REQUIRED_USE="cxx? ( sasl )"
 # always list newer first
 # Do not add any AGPL-3 BDB here!
 # See bug 525110, comment 15.
-BDB_SLOTS='5.3 5.1 4.8 4.7 4.6 4.5 4.4'
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
 BDB_PKGS=''
 for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 

diff --git a/net-nds/openldap/openldap-2.4.43-r1.ebuild b/net-nds/openldap/openldap-2.4.43-r1.ebuild
index 165b543fcf..c10ab6232b 100644
--- a/net-nds/openldap/openldap-2.4.43-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.43-r1.ebuild
@@ -35,7 +35,8 @@ REQUIRED_USE="cxx? ( sasl )
 # always list newer first
 # Do not add any AGPL-3 BDB here!
 # See bug 525110, comment 15.
-BDB_SLOTS='5.3 5.1 4.8 4.7 4.6 4.5 4.4'
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
 BDB_PKGS=''
 for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 

diff --git a/net-nds/openldap/openldap-2.4.43.ebuild b/net-nds/openldap/openldap-2.4.43.ebuild
index baeab80882..d16b8b3c75 100644
--- a/net-nds/openldap/openldap-2.4.43.ebuild
+++ b/net-nds/openldap/openldap-2.4.43.ebuild
@@ -35,7 +35,8 @@ REQUIRED_USE="cxx? ( sasl )
 # always list newer first
 # Do not add any AGPL-3 BDB here!
 # See bug 525110, comment 15.
-BDB_SLOTS='5.3 5.1 4.8 4.7 4.6 4.5 4.4'
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
 BDB_PKGS=''
 for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 

diff --git a/net-nds/openldap/openldap-2.4.44-r1.ebuild b/net-nds/openldap/openldap-2.4.44-r1.ebuild
index 7e7c7a09df..b4cce18283 100644
--- a/net-nds/openldap/openldap-2.4.44-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.44-r1.ebuild
@@ -36,7 +36,8 @@ REQUIRED_USE="cxx? ( sasl )
 # always list newer first
 # Do not add any AGPL-3 BDB here!
 # See bug 525110, comment 15.
-BDB_SLOTS='5.3 5.1 4.8 4.7 4.6 4.5 4.4'
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
 BDB_PKGS=''
 for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index 0b553596b3..560b602b6a 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -35,7 +35,8 @@ REQUIRED_USE="cxx? ( sasl )
 # always list newer first
 # Do not add any AGPL-3 BDB here!
 # See bug 525110, comment 15.
-BDB_SLOTS='5.3 5.1 4.8 4.7 4.6 4.5 4.4'
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
 BDB_PKGS=''
 for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-02-20  0:36 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2017-02-20  0:36 UTC (permalink / raw
  To: gentoo-commits

commit:     2baad4921bfcff1cc24af346d9257196c705d700
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 19 23:07:32 2017 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Feb 20 00:36:32 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2baad492

net-nds/openldap: drop unused ICU linkage

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=510858
Package-Manager: portage-2.3.2

 net-nds/openldap/openldap-2.4.44-r1.ebuild | 8 ++++----
 net-nds/openldap/openldap-2.4.44.ebuild    | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.44-r1.ebuild b/net-nds/openldap/openldap-2.4.44-r1.ebuild
index b4cce18283..aede7c1056 100644
--- a/net-nds/openldap/openldap-2.4.44-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.44-r1.ebuild
@@ -21,7 +21,7 @@ LICENSE="OPENLDAP GPL-2"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
-IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
+IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"
 IUSE_OVERLAY="overlays perl"
 IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
@@ -42,7 +42,7 @@ BDB_PKGS=''
 for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 
 # openssl is needed to generate lanman-passwords required by samba
-CDEPEND="icu? ( dev-libs/icu:= )
+CDEPEND="
 	ssl? (
 		!gnutls? (
 			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
@@ -401,8 +401,8 @@ multilib_src_configure() {
 
 	use debug && myconf+=( $(use_enable debug) )
 
-	# ICU usage is not configurable
-	export ac_cv_header_unicode_utypes_h="$(multilib_is_native_abi && use icu && echo yes || echo no)"
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
 
 	if ! use minimal && multilib_is_native_abi; then
 		local CPPFLAGS=${CPPFLAGS}

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index 560b602b6a..47400ab6b2 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -21,7 +21,7 @@ LICENSE="OPENLDAP GPL-2"
 SLOT="0"
 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
-IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
+IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"
 IUSE_OVERLAY="overlays perl"
 IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
@@ -41,7 +41,7 @@ BDB_PKGS=''
 for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 
 # openssl is needed to generate lanman-passwords required by samba
-CDEPEND="icu? ( dev-libs/icu:= )
+CDEPEND="
 	ssl? (
 		!gnutls? (
 			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
@@ -400,8 +400,8 @@ multilib_src_configure() {
 
 	use debug && myconf+=( $(use_enable debug) )
 
-	# ICU usage is not configurable
-	export ac_cv_header_unicode_utypes_h="$(multilib_is_native_abi && use icu && echo yes || echo no)"
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
 
 	if ! use minimal && multilib_is_native_abi; then
 		local CPPFLAGS=${CPPFLAGS}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-02-23 19:09 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2017-02-23 19:09 UTC (permalink / raw
  To: gentoo-commits

commit:     39a60ca58ef439b835ca2a03479d83f0eb333375
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 23 19:08:24 2017 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Feb 23 19:09:05 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39a60ca5

net-nds/openldap: built_with_use -> has_version

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=610448
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 net-nds/openldap/openldap-2.3.43-r3.ebuild | 2 +-
 net-nds/openldap/openldap-2.3.43-r4.ebuild | 2 +-
 net-nds/openldap/openldap-2.4.44-r1.ebuild | 2 +-
 net-nds/openldap/openldap-2.4.44.ebuild    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net-nds/openldap/openldap-2.3.43-r3.ebuild b/net-nds/openldap/openldap-2.3.43-r3.ebuild
index 7d5c8c0234..dda92d5efd 100644
--- a/net-nds/openldap/openldap-2.3.43-r3.ebuild
+++ b/net-nds/openldap/openldap-2.3.43-r3.ebuild
@@ -180,7 +180,7 @@ pkg_setup() {
 		die "Please set ssl useflag"
 	fi
 
-	if use minimal && has_version "net-nds/openldap" && built_with_use net-nds/openldap minimal ; then
+	if use minimal && has_version 'net-nds/openldap[minimal]' ; then
 		einfo
 		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
 		einfo

diff --git a/net-nds/openldap/openldap-2.3.43-r4.ebuild b/net-nds/openldap/openldap-2.3.43-r4.ebuild
index e8c1aa5dbf..c4c6745bdf 100644
--- a/net-nds/openldap/openldap-2.3.43-r4.ebuild
+++ b/net-nds/openldap/openldap-2.3.43-r4.ebuild
@@ -180,7 +180,7 @@ pkg_setup() {
 		die "Please set ssl useflag"
 	fi
 
-	if use minimal && has_version "net-nds/openldap" && built_with_use net-nds/openldap minimal ; then
+	if use minimal && has_version 'net-nds/openldap[minimal]' ; then
 		einfo
 		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
 		einfo

diff --git a/net-nds/openldap/openldap-2.4.44-r1.ebuild b/net-nds/openldap/openldap-2.4.44-r1.ebuild
index aede7c1056..2445bd5958 100644
--- a/net-nds/openldap/openldap-2.4.44-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.44-r1.ebuild
@@ -297,7 +297,7 @@ pkg_setup() {
 	# Bug #322787
 	if use minimal && ! has_version "net-nds/openldap" ; then
 		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version "net-nds/openldap" && built_with_use net-nds/openldap minimal ; then
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
 		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
 	else
 		openldap_find_versiontags

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index 47400ab6b2..ad16fcf5ec 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -296,7 +296,7 @@ pkg_setup() {
 	# Bug #322787
 	if use minimal && ! has_version "net-nds/openldap" ; then
 		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version "net-nds/openldap" && built_with_use net-nds/openldap minimal ; then
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
 		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
 	else
 		openldap_find_versiontags


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-05-26 10:27 David Seifert
  0 siblings, 0 replies; 187+ messages in thread
From: David Seifert @ 2017-05-26 10:27 UTC (permalink / raw
  To: gentoo-commits

commit:     13e8626f2c48395dc2be27e18e0a4a3afe4ad092
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Fri May 26 10:13:06 2017 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Fri May 26 10:26:51 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13e8626f

net-nds/openldap: [QA] Remove redundant WANT_AUTO*="latest"

Package-Manager: Portage-2.3.6, Repoman-2.3.2

 net-nds/openldap/openldap-2.3.43-r3.ebuild | 4 +---
 net-nds/openldap/openldap-2.3.43-r4.ebuild | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/net-nds/openldap/openldap-2.3.43-r3.ebuild b/net-nds/openldap/openldap-2.3.43-r3.ebuild
index 3e5e74112f7..321b6b720fc 100644
--- a/net-nds/openldap/openldap-2.3.43-r3.ebuild
+++ b/net-nds/openldap/openldap-2.3.43-r3.ebuild
@@ -1,10 +1,8 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="2"
 
-WANT_AUTOCONF="latest"
-WANT_AUTOMAKE="latest"
 AT_M4DIR="./build"
 inherit autotools db-use eutils flag-o-matic multilib ssl-cert toolchain-funcs versionator user
 

diff --git a/net-nds/openldap/openldap-2.3.43-r4.ebuild b/net-nds/openldap/openldap-2.3.43-r4.ebuild
index 28ece21d93d..663b6aa5e36 100644
--- a/net-nds/openldap/openldap-2.3.43-r4.ebuild
+++ b/net-nds/openldap/openldap-2.3.43-r4.ebuild
@@ -1,10 +1,8 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="2"
 
-WANT_AUTOCONF="latest"
-WANT_AUTOMAKE="latest"
 AT_M4DIR="./build"
 inherit autotools db-use eutils flag-o-matic multilib ssl-cert toolchain-funcs versionator user
 


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-06-21 19:23 Matt Thode
  0 siblings, 0 replies; 187+ messages in thread
From: Matt Thode @ 2017-06-21 19:23 UTC (permalink / raw
  To: gentoo-commits

commit:     00cb30711ddaf929bcf288073fb29f305bcaeb5e
Author:     Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 21 19:23:04 2017 +0000
Commit:     Matt Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Wed Jun 21 19:23:41 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00cb3071

net-nds/openldap: bup

Package-Manager: Portage-2.3.6, Repoman-2.3.2

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.4.45.ebuild | 853 ++++++++++++++++++++++++++++++++
 2 files changed, 854 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 0f5b7b5f578..fa72c337aa0 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,3 +1,4 @@
 DIST openldap-2.3.43.tgz 3803011 SHA256 d7d2dea05362c8ac7e11bb7bf1da4cdeb07225ba8dc16974bff9f51a9f3d37e1 SHA512 2b0ebb35adbeed34673e1a55cc7a89b348ddee7ad6ce7f915ca3745198cee992aba7281bf0d56197dcfd59665935d5d3764db0ba487975e4dbc2a2507d6ea7a6 WHIRLPOOL 7457112bbad83d75f7ad01230da97511a8d983a98f7e31357dbffd79a7ed7e53057af781002cae8c610d3ad7834dfeefbd7f223798d45aea8cd00b70f5ee0e39
 DIST openldap-2.4.44.tgz 5658830 SHA256 d7de6bf3c67009c95525dde3a0212cc110d0a70b92af2af8e3ee800e81b88400 SHA512 132eb81798f59a364c9246d08697e1c7ebb6c2c3b983f786b14ec0233df09696cbad33a1f35f3076348b5efb77665a076ab854a24122c31e8b58310b7c7fd136 WHIRLPOOL 37399793d681a6489c369d663772970c62a4e1e370d4dc306bcb6fa3b9cb680139c9d940d9218aaac4618f50a63bc391b10f2aec0a134f84094ce4f7378c88ff
+DIST openldap-2.4.45.tgz 5672845 SHA256 cdd6cffdebcd95161a73305ec13fc7a78e9707b46ca9f84fb897cd5626df3824 SHA512 1c9fc84efed8998f107ce6e1c6be3f5466388241afdca0cb3847720c9def0bc263a2dbc15bf0f9112d1b4c391fd01e8531a4fb08c5532c30fb86924c08daedab WHIRLPOOL b5855bfe2b2c3856a98fb8b07ab94e51ef995ff80d4f39f0e7edae64f9774f0af9987db3673e25f98df8a5856a3f8839f28f1aa9184c92862a4df22540b3ab49
 DIST rfc2307bis.schema-20140524 12262 SHA256 6cd8154ad86be1d6bb88a79c303dc10a49bce4ce7d21bb417a951d6496df30b1 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e WHIRLPOOL 40cef24529fb4bfc1661d03088eccdb17d9056d696b2bf0e698fa248d03f508ba776784bf8abbaffb5f4c2c59b59b29525b4be2babc978fed681e5e3c88073de

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
new file mode 100644
index 00000000000..23c66c3db53
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -0,0 +1,853 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit db-use eutils flag-o-matic multilib multilib-minimal ssl-cert versionator toolchain-funcs autotools user systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="http://www.OpenLDAP.org/"
+
+# mirrors are mostly not working, using canonical URI
+SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
+		 mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+REQUIRED_USE="cxx? ( sasl )
+	?? ( gnutls libressl )
+	pbkdf2? ( ssl )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+CDEPEND="
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
+		)
+		gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
+		libressl? ( dev-libs/libressl[${MULTILIB_USEDEP}] )
+		>=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] ) )
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		slp? ( net-libs/openslp )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0 )
+			libressl? ( dev-libs/libressl )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20140508-r3
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+	)"
+DEPEND="${CDEPEND}
+	sys-apps/groff"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	openldap_datadirs=""
+	if [ -f "${EROOT}"/etc/openldap/slapd.conf ]; then
+		openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${EROOT}/etc/openldap/slapd.conf)"
+	fi
+	openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs}; do
+		CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
+		CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
+		if [ -d ${CURRENT_TAGDIR} ] &&	[ ${openldap_found_tag} == 0 ] ; then
+			einfo "- Checking ${each}..."
+			if [ -r ${CURRENT_TAG} ] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source ${CURRENT_TAG}
+				if [ "${OLDPF}" == "" ] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
+
+				[ $(openldap_filecount ${CURRENT_TAGDIR}) -gt 0 ] && have_files=1
+
+				# are we on the same branch?
+				if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[ $(openldap_filecount ${each}) -gt 0 ] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[ "${have_files}" == "1" ] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH=${EROOT}/usr/$(get_libdir)/openldap/slapd
+	if [ "${have_files}" == "1" -a -f "${SLAPD_PATH}" ]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in $BDB_SLOTS ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "$NEWVER" ]] && break
+			done
+		fi
+		local fail=0
+		if [ -z "${OLDVER}" -a -z "${NEWVER}" ]; then
+			:
+			# Nothing wrong here.
+		elif [ -z "${OLDVER}" -a -n "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [ -n "${OLDVER}" -a -z "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [ "${OLDVER}" != "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[ "${fail}" == "1" ] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [ "${FORCE_UPGRADE}" != "1" ]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		"${S}"/include/ldap_defaults.h
+
+	epatch "${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	epatch \
+		"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \
+		"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	epatch "${FILESDIR}"/${PN}-2.4.17-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	epatch "${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	epatch "${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	epatch "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	epatch "${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	epatch "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+	rm -rf "${S}"/libraries/liblmdb
+
+	cd "${S}"/build || die
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed -i \
+		-e 's|/bin/sh|/bin/bash|g' \
+		"${S}"/tests/scripts/* || die "sed failed"
+
+	cd "${S}" || die
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	cd "${S}/contrib/slapd-modules/$1" || die
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(echo "SLAPD_OVER_${1}" | LC_ALL=C tr '[:lower:]' '[:upper:]')"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir $BDB_SLOTS)
+			einfo "Using $DBINCLUDE for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			$(use_enable slp)
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	ECONF_SOURCE=${S} \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	cd "${BUILD_DIR}/contrib/ldapc++" || die
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake \
+				CC="${CC}" CXX="${CXX}"
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			cd "${S}/contrib/slapd-modules/passwd" || die
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+		fi
+
+		if use pbkdf2; then
+			cd "${S}/contrib/slapd-modules/passwd/pbkdf2" || die
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		cd "${S}/contrib/slapd-modules/passwd" || die
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		build_contrib_module "nops" "nops.c" "nops-overlay"
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		# build slapi-plugins
+		cd "${S}/contrib/slapi-plugins/addrdnvalues" || die
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests || die "make tests failed"
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+	use static-libs || prune_libtool_files --all
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		newinitd "${FILESDIR}"/slapd-initd-2.4.40-r2 slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+		einfo "Install systemd service"
+		systemd_dounit "${FILESDIR}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		if [[ $(get_libdir) != lib ]]; then
+			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i \
+				"${ED}"/etc/init.d/slapd \
+				"${ED}"/usr/lib/systemd/system/slapd.service || die
+		fi
+		# If built without SLP, we don't need to be before avahi
+		use slp \
+			|| sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"etc/init.d/slapd
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
+		chmod 0755 "${EROOT}"var/run/openldap
+		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
+		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://www.gentoo.org/doc/en/ldap-howto.xml)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-06-23 16:34 Matt Thode
  0 siblings, 0 replies; 187+ messages in thread
From: Matt Thode @ 2017-06-23 16:34 UTC (permalink / raw
  To: gentoo-commits

commit:     eaa4df2ad0d1a6328b82fd01eee327061a7115b2
Author:     Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 23 16:33:38 2017 +0000
Commit:     Matt Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Fri Jun 23 16:34:27 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eaa4df2a

net-nds/openldap: added sha2 contrib support pre bug 621670 and pr \#4973

Package-Manager: Portage-2.3.6, Repoman-2.3.2

 net-nds/openldap/metadata.xml           |  3 ++-
 net-nds/openldap/openldap-2.4.45.ebuild | 29 ++++++++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/net-nds/openldap/metadata.xml b/net-nds/openldap/metadata.xml
index cda62a66159..4e5e2c49039 100644
--- a/net-nds/openldap/metadata.xml
+++ b/net-nds/openldap/metadata.xml
@@ -4,7 +4,7 @@
     <maintainer type="project">
         <email>ldap-bugs@gentoo.org</email>
     </maintainer>
-	<use> 
+	<use>
 		<flag name="experimental">Enable experimental backend options</flag>
 		<flag name="kinit">Enable support for kerberos init</flag>
 		<flag name="odbc">Enable ODBC and SQL backend options</flag>
@@ -13,6 +13,7 @@
 			lanman passwords</flag>
 		<flag name="minimal">Build libraries &amp; userspace tools only. Does not install any server code.</flag>
 		<flag name="pbkdf2">Enable support for pbkdf2 passwords</flag>
+		<flag name="sha2">Enable support for pw-sha2 password hashes.</flag>
 	</use>
 	<upstream>
 		<remote-id type="cpe">cpe:/a:openldap:openldap</remote-id>

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index b2493271ba4..e81d3543054 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -24,7 +24,7 @@ IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"
 IUSE_OVERLAY="overlays perl"
 IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
 IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
 IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
 
@@ -618,6 +618,33 @@ multilib_src_compile() {
 				pbkdf2.lo || die "linking pw-pbkdf2 failed"
 		fi
 
+		if use sha2 ; then
+			cd "${S}/contrib/slapd-modules/passwd/sha2" || die
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+		fi
+
 		# We could build pw-radius if GNURadius would install radlib.h
 		cd "${S}/contrib/slapd-modules/passwd" || die
 		einfo "Compiling contrib-module: pw-netscape"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-07-17  0:02 Aaron Bauman
  0 siblings, 0 replies; 187+ messages in thread
From: Aaron Bauman @ 2017-07-17  0:02 UTC (permalink / raw
  To: gentoo-commits

commit:     19c0a4ec55e0c9802b1b4fdf2bf7c1613ebfcd33
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 17 00:00:30 2017 +0000
Commit:     Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Mon Jul 17 00:00:30 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19c0a4ec

net-nds/openldap: drop vulnerable wrt sec bug #560424

 net-nds/openldap/Manifest                  |   1 -
 net-nds/openldap/openldap-2.3.43-r3.ebuild | 541 ----------------------------
 net-nds/openldap/openldap-2.3.43-r4.ebuild | 547 -----------------------------
 3 files changed, 1089 deletions(-)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index fa72c337aa0..09991fe1096 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,4 +1,3 @@
-DIST openldap-2.3.43.tgz 3803011 SHA256 d7d2dea05362c8ac7e11bb7bf1da4cdeb07225ba8dc16974bff9f51a9f3d37e1 SHA512 2b0ebb35adbeed34673e1a55cc7a89b348ddee7ad6ce7f915ca3745198cee992aba7281bf0d56197dcfd59665935d5d3764db0ba487975e4dbc2a2507d6ea7a6 WHIRLPOOL 7457112bbad83d75f7ad01230da97511a8d983a98f7e31357dbffd79a7ed7e53057af781002cae8c610d3ad7834dfeefbd7f223798d45aea8cd00b70f5ee0e39
 DIST openldap-2.4.44.tgz 5658830 SHA256 d7de6bf3c67009c95525dde3a0212cc110d0a70b92af2af8e3ee800e81b88400 SHA512 132eb81798f59a364c9246d08697e1c7ebb6c2c3b983f786b14ec0233df09696cbad33a1f35f3076348b5efb77665a076ab854a24122c31e8b58310b7c7fd136 WHIRLPOOL 37399793d681a6489c369d663772970c62a4e1e370d4dc306bcb6fa3b9cb680139c9d940d9218aaac4618f50a63bc391b10f2aec0a134f84094ce4f7378c88ff
 DIST openldap-2.4.45.tgz 5672845 SHA256 cdd6cffdebcd95161a73305ec13fc7a78e9707b46ca9f84fb897cd5626df3824 SHA512 1c9fc84efed8998f107ce6e1c6be3f5466388241afdca0cb3847720c9def0bc263a2dbc15bf0f9112d1b4c391fd01e8531a4fb08c5532c30fb86924c08daedab WHIRLPOOL b5855bfe2b2c3856a98fb8b07ab94e51ef995ff80d4f39f0e7edae64f9774f0af9987db3673e25f98df8a5856a3f8839f28f1aa9184c92862a4df22540b3ab49
 DIST rfc2307bis.schema-20140524 12262 SHA256 6cd8154ad86be1d6bb88a79c303dc10a49bce4ce7d21bb417a951d6496df30b1 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e WHIRLPOOL 40cef24529fb4bfc1661d03088eccdb17d9056d696b2bf0e698fa248d03f508ba776784bf8abbaffb5f4c2c59b59b29525b4be2babc978fed681e5e3c88073de

diff --git a/net-nds/openldap/openldap-2.3.43-r3.ebuild b/net-nds/openldap/openldap-2.3.43-r3.ebuild
deleted file mode 100644
index 321b6b720fc..00000000000
--- a/net-nds/openldap/openldap-2.3.43-r3.ebuild
+++ /dev/null
@@ -1,541 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="2"
-
-AT_M4DIR="./build"
-inherit autotools db-use eutils flag-o-matic multilib ssl-cert toolchain-funcs versionator user
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="http://www.OpenLDAP.org/"
-SRC_URI="mirror://openldap/openldap-release/${P}.tgz"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
-IUSE="berkdb crypt debug gdbm ipv6 kerberos minimal odbc overlays perl samba sasl slp smbkrb5passwd ssl tcpd selinux"
-
-# note that the 'samba' USE flag pulling in OpenSSL is NOT an error.  OpenLDAP
-# uses OpenSSL for LanMan/NTLM hashing (which is used in some enviroments, like
-# mine at work)!
-# Robin H. Johnson <robbat2@gentoo.org> March 8, 2004
-
-RDEPEND="sys-libs/ncurses
-	tcpd? ( sys-apps/tcp-wrappers )
-	ssl? ( dev-libs/openssl )
-	sasl? ( dev-libs/cyrus-sasl )
-	!minimal? (
-		odbc? ( dev-db/unixODBC )
-		slp? ( net-libs/openslp )
-		perl? ( || ( >=dev-lang/perl-5.16 <dev-lang/perl-5.16[-build] ) )
-		samba? ( dev-libs/openssl )
-		kerberos? ( virtual/krb5 )
-		berkdb? (
-			|| ( 	sys-libs/db:4.5
-				sys-libs/db:4.4
-				sys-libs/db:4.3
-				>=sys-libs/db-4.2.52_p2-r1:4.2
-			)
-		)
-		!berkdb? (
-			gdbm? ( sys-libs/gdbm )
-			!gdbm? (
-				|| (	sys-libs/db:4.5
-					sys-libs/db:4.4
-					sys-libs/db:4.3
-					>=sys-libs/db-4.2.52_p2-r1:4.2
-				)
-			)
-		)
-		smbkrb5passwd? (
-			dev-libs/openssl
-			app-crypt/heimdal
-		)
-	)
-	selinux? ( sec-policy/selinux-ldap )"
-DEPEND="${RDEPEND}"
-
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-openldap_upgrade_howto() {
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [ "${FORCE_UPGRADE}" != "1" ]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	openldap_datadirs=""
-	if [ -f "${ROOT}"/etc/openldap/slapd.conf ]; then
-		openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${ROOT}/etc/openldap/slapd.conf)"
-	fi
-	openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	for each in ${openldap_datadirs}; do
-		CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
-		CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
-		if [ -d ${CURRENT_TAGDIR} ] &&	[ ${openldap_found_tag} == 0 ] ; then
-			einfo "- Checking ${each}..."
-			if [ -r ${CURRENT_TAG} ] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source ${CURRENT_TAG}
-				if [ "${OLDPF}" == "" ] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
-
-				# are we on the same branch?
-				if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ `ls -a ${CURRENT_TAGDIR} | wc -l` -gt 5 ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				if [[ `ls -a ${each} | wc -l` > 5 ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-
-}
-
-pkg_setup() {
-	if has_version "<=dev-lang/perl-5.8.8_rc1" && built_with_use dev-lang/perl minimal ; then
-		die "You must have a complete (USE='-minimal') Perl install to use the perl backend!"
-	fi
-
-	if use samba && ! use ssl ; then
-		eerror "LAN manager passwords need ssl flag set"
-		die "Please set ssl useflag"
-	fi
-
-	if use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-		einfo
-	else
-		openldap_find_versiontags
-	fi
-
-	# The user/group are only used for running daemons which are
-	# disabled in minimal builds, so elide the accounts too.
-	if ! use minimal ; then
-		enewgroup ldap 439
-		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
-	fi
-}
-
-src_prepare() {
-	# According to MDK, the link order needs to be changed so that
-	# on systems w/ MD5 passwords the system crypt library is used
-	# (the net result is that "passwd" can be used to change ldap passwords w/
-	#  proper pam support)
-	sed -i -e 's/$(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)/$(LUTIL_LIBS) $(SECURITY_LIBS) $(LDIF_LIBS)/' \
-		"${S}"/servers/slapd/Makefile.in
-
-	# supersedes old fix for bug #31202
-	EPATCH_OPTS="-p1 -d ${S}" epatch "${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
-
-	# ensure correct SLAPI path by default
-	sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "/var/run/openldap/slapd.sock",' \
-		"${S}"/include/ldap_defaults.h
-
-	EPATCH_OPTS="-p0 -d ${S}"
-
-	# ximian connector 1.4.7 ntlm patch
-	epatch "${FILESDIR}"/${PN}-2.2.6-ntlm.patch
-
-	# bug #132263
-	epatch "${FILESDIR}"/${PN}-2.3.21-ppolicy.patch
-
-	# bug #189817
-	epatch "${FILESDIR}"/${PN}-2.3.37-libldap_r.patch
-
-	# fix up stuff for newer autoconf that simulates autoconf-2.13, but doesn't
-	# do it perfectly.
-	cd "${S}"/build
-	ln -s shtool install
-	ln -s shtool install.sh
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-
-	# bug #116045
-	# patch contrib modules
-	if ! use minimal ; then
-		cd "${S}"/contrib
-		epatch "${FILESDIR}"/${PN}-2.3.24-contrib-smbk5pwd.patch
-	fi
-	# Fix gcc-4.4 compat, bug 264761
-	epatch "${FILESDIR}/openldap-2.3.XY-gcc44.patch"
-}
-
-src_configure() {
-	local myconf
-
-	#Fix for glibc-2.8 and ucred. Bug 228457.
-	append-flags -D_GNU_SOURCE
-
-	# HDB is only available with BerkDB
-	myconf_berkdb='--enable-bdb --enable-ldbm-api=berkeley --enable-hdb=mod'
-	myconf_gdbm='--disable-bdb --enable-ldbm-api=gdbm --disable-hdb'
-
-	use debug && myconf="${myconf} --enable-debug" # there is no disable-debug
-
-	# enable slapd/slurpd servers if not doing a minimal build
-	if ! use minimal ; then
-		myconf="${myconf} --enable-slapd --enable-slurpd"
-		# base backend stuff
-		myconf="${myconf} --enable-ldbm"
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf="${myconf} ${myconf_berkdb}"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I$(db_includedir 4.5 4.4 4.3 4.2 )
-		elif use gdbm ; then
-			einfo "Using GDBM for local backend"
-			myconf="${myconf} ${myconf_gdbm}"
-		else
-			ewarn "Neither gdbm or berkdb USE flags present, falling back to"
-			ewarn "Berkeley DB for local backend"
-			myconf="${myconf} ${myconf_berkdb}"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I$(db_includedir 4.5 4.4 4.3 4.2 )
-		fi
-		# extra backend stuff
-		myconf="${myconf} --enable-passwd=mod --enable-phonetic=mod"
-		myconf="${myconf} --enable-dnssrv=mod --enable-ldap"
-		myconf="${myconf} --enable-meta=mod --enable-monitor=mod"
-		myconf="${myconf} --enable-null=mod --enable-shell=mod"
-		myconf="${myconf} --enable-relay=mod"
-		myconf="${myconf} $(use_enable perl perl mod)"
-		myconf="${myconf} $(use_enable odbc sql mod)"
-		# slapd options
-		myconf="${myconf} $(use_enable crypt) $(use_enable slp)"
-		myconf="${myconf} --enable-rewrite --enable-rlookups"
-		myconf="${myconf} --enable-aci --enable-modules"
-		myconf="${myconf} --enable-cleartext --enable-slapi"
-		myconf="${myconf} $(use_enable samba lmpasswd)"
-		# slapd overlay options
-		myconf="${myconf} --enable-dyngroup --enable-proxycache"
-		use overlays && myconf="${myconf} --enable-overlays=mod"
-		myconf="${myconf} --enable-syncprov"
-	else
-		myconf="${myconf} --disable-slapd --disable-slurpd"
-		myconf="${myconf} --disable-bdb --disable-ldbm"
-		myconf="${myconf} --disable-hdb --disable-monitor"
-		myconf="${myconf} --disable-slurpd --disable-overlays"
-		myconf="${myconf} --disable-relay"
-	fi
-
-	# basic functionality stuff
-	myconf="${myconf} --enable-syslog --enable-dynamic"
-	myconf="${myconf} --enable-local --enable-proctitle"
-
-	myconf="${myconf} $(use_enable ipv6)"
-	myconf="${myconf} $(use_with sasl cyrus-sasl) $(use_enable sasl spasswd)"
-	myconf="${myconf} $(use_enable tcpd wrappers) $(use_with ssl tls)"
-
-	if [ $(get_libdir) != "lib" ] ; then
-		append-ldflags -L/usr/$(get_libdir)
-	fi
-
-	STRIP=/bin/true \
-	econf \
-		--enable-static \
-		--enable-shared \
-		--libexecdir=/usr/$(get_libdir)/openldap \
-		${myconf} || die "configure failed"
-}
-
-src_compile() {
-	emake depend || die "make depend failed"
-	emake || die "make failed"
-
-	# openldap/contrib
-	tc-export CC
-	if ! use minimal ; then
-		# dsaschema
-			einfo "Building contributed dsaschema"
-			cd "${S}"/contrib/slapd-modules/dsaschema
-			${CC} -shared -I../../../include ${CFLAGS} -fPIC \
-			-Wall -o libdsaschema-plugin.so dsaschema.c || \
-			die "failed to compile dsaschema module"
-		# kerberos passwd
-		if use kerberos ; then
-			einfo "Building contributed pw-kerberos"
-			cd "${S}"/contrib/slapd-modules/passwd/ && \
-			${CC} -shared -I../../../include ${CFLAGS} -fPIC \
-			$(krb5-config --cflags) \
-			-DHAVE_KRB5 -o pw-kerberos.so kerberos.c || \
-			die "failed to compile kerberos password module"
-		fi
-		# netscape mta-md5 password
-			einfo "Building contributed pw-netscape"
-			cd "${S}"/contrib/slapd-modules/passwd/ && \
-			${CC} -shared -I../../../include ${CFLAGS} -fPIC \
-			-o pw-netscape.so netscape.c || \
-			die "failed to compile netscape password module"
-		# smbk5pwd overlay
-		# Note: this modules builds, but may not work with
-		#	Gentoo's MIT-Kerberos.	It was designed for Heimdal
-		#	Kerberos.
-		if use smbkrb5passwd ; then
-			einfo "Building contributed smbk5pwd"
-			local mydef
-			local mykrb5inc
-			mydef="-DDO_SAMBA -DDO_KRB5"
-			mykrb5inc="$(krb5-config --cflags)"
-			cd "${S}"/contrib/slapd-modules/smbk5pwd && \
-			libexecdir="/usr/$(get_libdir)/openldap" \
-			DEFS="${mydef}" KRB5_INC="${mykrb5inc}" emake || \
-			die "failed to compile smbk5pwd module"
-		fi
-		# addrdnvalues
-			einfo "Building contributed addrdnvalues"
-			cd "${S}"/contrib/slapi-plugins/addrdnvalues/ && \
-			${CC} -shared -I../../../include ${CFLAGS} -fPIC \
-			-o libaddrdnvalues-plugin.so addrdnvalues.c || \
-			die "failed to compile addrdnvalues plugin"
-	fi
-}
-
-src_test() {
-	einfo "Doing tests"
-	cd tests ; make tests || die "make tests failed"
-}
-
-src_install() {
-	emake DESTDIR="${D}" install || die "make install failed"
-
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README "${FILESDIR}"/DB_CONFIG.fast.example
-	docinto rfc ; dodoc doc/rfc/*.txt
-
-	# openldap modules go here
-	# TODO: write some code to populate slapd.conf with moduleload statements
-	keepdir /usr/$(get_libdir)/openldap/openldap/
-
-	# make state directories
-	local dirlist="data"
-	if ! use minimal; then
-		dirlist="${dirlist} slurp ldbm"
-	fi
-	for x in ${dirlist}; do
-		keepdir /var/lib/openldap-${x}
-		fowners ldap:ldap /var/lib/openldap-${x}
-		fperms 0700 /var/lib/openldap-${x}
-	done
-
-	echo "OLDPF='${PF}'" > "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-	echo "# do NOT delete this. it is used"	>> "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-	echo "# to track versions for upgrading." >> "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-	# manually remove /var/tmp references in .la
-	# because it is packaged with an ancient libtool
-	#for x in "${D}"/usr/$(get_libdir)/lib*.la; do
-	#	sed -i -e "s:-L${S}[/]*libraries::" ${x}
-	#done
-
-	# change slapd.pid location in configuration file
-	keepdir /var/run/openldap
-	fowners ldap:ldap /var/run/openldap
-	fperms 0755 /var/run/openldap
-
-	if ! use minimal; then
-		# use our config
-		rm "${D}"etc/openldap/slapd.con*
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.3.34-slapd-conf slapd.conf
-		configfile="${D}"etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${D}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			elog "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default
-		eend
-
-		# install our own init scripts
-		newinitd "${FILESDIR}"/slapd-initd slapd
-		newinitd "${FILESDIR}"/slurpd-initd slurpd
-		newconfd "${FILESDIR}"/slapd-confd slapd
-
-		if [ $(get_libdir) != lib ]; then
-			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${D}"etc/init.d/{slapd,slurpd}
-		fi
-
-		# install contributed modules
-		docinto /
-		if [ -e "${S}"/contrib/slapd-modules/dsaschema/libdsaschema-plugin.so ];
-		then
-			cd "${S}"/contrib/slapd-modules/dsaschema/
-			newdoc README README.contrib.dsaschema
-			exeinto /usr/$(get_libdir)/openldap/openldap
-			doexe libdsaschema-plugin.so || \
-			die "failed to install dsaschema module"
-		fi
-		if [ -e "${S}"/contrib/slapd-modules/passwd/pw-kerberos.so ]; then
-			cd "${S}"/contrib/slapd-modules/passwd/
-			newdoc README README.contrib.passwd
-			exeinto /usr/$(get_libdir)/openldap/openldap
-			doexe pw-kerberos.so || \
-			die "failed to install kerberos passwd module"
-		fi
-		if [ -e "${S}"/contrib/slapd-modules/passwd/pw-netscape.so ]; then
-			cd "${S}"/contrib/slapd-modules/passwd/
-			newdoc README README.contrib.passwd
-			exeinto /usr/$(get_libdir)/openldap/openldap
-			doexe "${S}"/contrib/slapd-modules/passwd/pw-netscape.so || \
-			die "failed to install Netscape MTA-MD5 passwd module"
-		fi
-		if [ -e "${S}"/contrib/slapd-modules/smbk5pwd/.libs/smbk5pwd.so ]; then
-			cd "${S}"/contrib/slapd-modules/smbk5pwd
-			newdoc README README.contrib.smbk5pwd
-			libexecdir="/usr/$(get_libdir)/openldap" \
-			emake DESTDIR="${D}" install-mod || \
-			die "failed to install smbk5pwd overlay module"
-		fi
-		if [ -e "${S}"/contrib/slapd-tools/statslog ]; then
-			cd "${S}"/contrib/slapd-tools
-			exeinto /usr/bin
-			newexe statslog ldapstatslog || \
-			die "failed to install ldapstatslog script"
-		fi
-		if [ -e "${S}"/contrib/slapi-plugins/addrdnvalues/libaddrdnvalues-plugin.so ];
-		then
-			cd "${S}"/contrib/slapi-plugins/addrdnvalues
-			newdoc README README.contrib.addrdnvalues
-			exeinto /usr/$(get_libdir)/openldap/openldap
-			doexe libaddrdnvalues-plugin.so || \
-			die "failed to install addrdnvalues plugin"
-		fi
-	fi
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	LIBSUFFIXES=".so.2.0.130 -2.2.so.7"
-	for LIBSUFFIX in ${LIBSUFFIXES} ; do
-		for each in libldap libldap_r liblber ; do
-			preserve_old_lib "usr/$(get_libdir)/${each}${LIBSUFFIX}"
-		done
-	done
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		# Additionally, it overwrites
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			chown ldap:ldap "${ROOT}"etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT never' if you want to use them."
-		fi
-		# These lines force the permissions of various content to be correct
-		chown ldap:ldap "${ROOT}"var/run/openldap
-		chmod 0755 "${ROOT}"var/run/openldap
-		chown root:ldap "${ROOT}"etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${ROOT}"etc/openldap/slapd.conf{,.default}
-		chown ldap:ldap "${ROOT}"var/lib/openldap-{data,ldbm,slurp}
-	fi
-
-	# Reference inclusion bug #77330
-	echo
-	elog
-	elog "Getting started using OpenLDAP? There is some documentation available:"
-	elog "Gentoo Guide to OpenLDAP Authentication"
-	elog "(https://www.gentoo.org/doc/en/ldap-howto.xml)"
-	elog
-
-	# note to bug #110412
-	echo
-	elog
-	elog "An example file for tuning BDB backends with openldap is"
-	elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	elog
-
-	LIBSUFFIXES=".so.2.0.130 -2.2.so.7"
-	for LIBSUFFIX in ${LIBSUFFIXES} ; do
-		for each in liblber libldap libldap_r ; do
-			preserve_old_lib_notify "usr/$(get_libdir)/${each}${LIBSUFFIX}"
-		done
-	done
-}

diff --git a/net-nds/openldap/openldap-2.3.43-r4.ebuild b/net-nds/openldap/openldap-2.3.43-r4.ebuild
deleted file mode 100644
index 663b6aa5e36..00000000000
--- a/net-nds/openldap/openldap-2.3.43-r4.ebuild
+++ /dev/null
@@ -1,547 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="2"
-
-AT_M4DIR="./build"
-inherit autotools db-use eutils flag-o-matic multilib ssl-cert toolchain-funcs versionator user
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="http://www.OpenLDAP.org/"
-SRC_URI="mirror://openldap/openldap-release/${P}.tgz"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd"
-IUSE="berkdb crypt debug gdbm ipv6 kerberos minimal odbc overlays perl samba sasl slp smbkrb5passwd ssl tcpd selinux"
-
-# note that the 'samba' USE flag pulling in OpenSSL is NOT an error.  OpenLDAP
-# uses OpenSSL for LanMan/NTLM hashing (which is used in some enviroments, like
-# mine at work)!
-# Robin H. Johnson <robbat2@gentoo.org> March 8, 2004
-
-RDEPEND="sys-libs/ncurses
-	tcpd? ( sys-apps/tcp-wrappers )
-	ssl? ( dev-libs/openssl )
-	sasl? ( dev-libs/cyrus-sasl )
-	!minimal? (
-		odbc? ( dev-db/unixODBC )
-		slp? ( net-libs/openslp )
-		perl? ( || ( >=dev-lang/perl-5.16 <dev-lang/perl-5.16[-build] ) )
-		samba? ( dev-libs/openssl )
-		kerberos? ( virtual/krb5 )
-		berkdb? (
-			|| ( 	sys-libs/db:4.5
-				sys-libs/db:4.4
-				sys-libs/db:4.3
-				>=sys-libs/db-4.2.52_p2-r1:4.2
-			)
-		)
-		!berkdb? (
-			gdbm? ( sys-libs/gdbm )
-			!gdbm? (
-				|| (	sys-libs/db:4.5
-					sys-libs/db:4.4
-					sys-libs/db:4.3
-					>=sys-libs/db-4.2.52_p2-r1:4.2
-				)
-			)
-		)
-		smbkrb5passwd? (
-			dev-libs/openssl
-			app-crypt/heimdal
-		)
-	)
-	selinux? ( sec-policy/selinux-ldap )"
-DEPEND="${RDEPEND}"
-
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-openldap_upgrade_howto() {
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [ "${FORCE_UPGRADE}" != "1" ]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	openldap_datadirs=""
-	if [ -f "${ROOT}"/etc/openldap/slapd.conf ]; then
-		openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${ROOT}/etc/openldap/slapd.conf)"
-	fi
-	openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	for each in ${openldap_datadirs}; do
-		CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
-		CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
-		if [ -d ${CURRENT_TAGDIR} ] &&	[ ${openldap_found_tag} == 0 ] ; then
-			einfo "- Checking ${each}..."
-			if [ -r ${CURRENT_TAG} ] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source ${CURRENT_TAG}
-				if [ "${OLDPF}" == "" ] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
-
-				# are we on the same branch?
-				if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ `ls -a ${CURRENT_TAGDIR} | wc -l` -gt 5 ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				if [[ `ls -a ${each} | wc -l` > 5 ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-
-}
-
-pkg_setup() {
-	if has_version "<=dev-lang/perl-5.8.8_rc1" && built_with_use dev-lang/perl minimal ; then
-		die "You must have a complete (USE='-minimal') Perl install to use the perl backend!"
-	fi
-
-	if use samba && ! use ssl ; then
-		eerror "LAN manager passwords need ssl flag set"
-		die "Please set ssl useflag"
-	fi
-
-	if use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-		einfo
-	else
-		openldap_find_versiontags
-	fi
-
-	# The user/group are only used for running daemons which are
-	# disabled in minimal builds, so elide the accounts too.
-	if ! use minimal ; then
-		enewgroup ldap 439
-		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
-	fi
-}
-
-src_prepare() {
-	# According to MDK, the link order needs to be changed so that
-	# on systems w/ MD5 passwords the system crypt library is used
-	# (the net result is that "passwd" can be used to change ldap passwords w/
-	#  proper pam support)
-	sed -i -e 's/$(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)/$(LUTIL_LIBS) $(SECURITY_LIBS) $(LDIF_LIBS)/' \
-		"${S}"/servers/slapd/Makefile.in
-
-	# supersedes old fix for bug #31202
-	EPATCH_OPTS="-p1 -d ${S}" epatch "${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
-
-	# ensure correct SLAPI path by default
-	sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "/var/run/openldap/slapd.sock",' \
-		"${S}"/include/ldap_defaults.h
-
-	EPATCH_OPTS="-p0 -d ${S}"
-
-	# ximian connector 1.4.7 ntlm patch
-	epatch "${FILESDIR}"/${PN}-2.2.6-ntlm.patch
-
-	# bug #132263
-	epatch "${FILESDIR}"/${PN}-2.3.21-ppolicy.patch
-
-	# bug #189817
-	epatch "${FILESDIR}"/${PN}-2.3.37-libldap_r.patch
-
-	# fix up stuff for newer autoconf that simulates autoconf-2.13, but doesn't
-	# do it perfectly.
-	cd "${S}"/build
-	ln -s shtool install
-	ln -s shtool install.sh
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-
-	# bug #116045
-	# patch contrib modules
-	if ! use minimal ; then
-		cd "${S}"/contrib
-		epatch "${FILESDIR}"/${PN}-2.3.24-contrib-smbk5pwd.patch
-	fi
-	# Fix gcc-4.4 compat, bug 264761
-	epatch "${FILESDIR}/openldap-2.3.XY-gcc44.patch"
-
-	# Backport random-hang fix from 2.4
-	# http://www.openldap.org/lists/openldap-technical/201208/msg00120.html
-	EPATCH_OPTS=""
-	cd "${S}"
-	epatch "${FILESDIR}/openldap-2.3.43-fix-hang.patch"
-}
-
-src_configure() {
-	local myconf
-
-	#Fix for glibc-2.8 and ucred. Bug 228457.
-	append-flags -D_GNU_SOURCE
-
-	# HDB is only available with BerkDB
-	myconf_berkdb='--enable-bdb --enable-ldbm-api=berkeley --enable-hdb=mod'
-	myconf_gdbm='--disable-bdb --enable-ldbm-api=gdbm --disable-hdb'
-
-	use debug && myconf="${myconf} --enable-debug" # there is no disable-debug
-
-	# enable slapd/slurpd servers if not doing a minimal build
-	if ! use minimal ; then
-		myconf="${myconf} --enable-slapd --enable-slurpd"
-		# base backend stuff
-		myconf="${myconf} --enable-ldbm"
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf="${myconf} ${myconf_berkdb}"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I$(db_includedir 4.5 4.4 4.3 4.2 )
-		elif use gdbm ; then
-			einfo "Using GDBM for local backend"
-			myconf="${myconf} ${myconf_gdbm}"
-		else
-			ewarn "Neither gdbm or berkdb USE flags present, falling back to"
-			ewarn "Berkeley DB for local backend"
-			myconf="${myconf} ${myconf_berkdb}"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I$(db_includedir 4.5 4.4 4.3 4.2 )
-		fi
-		# extra backend stuff
-		myconf="${myconf} --enable-passwd=mod --enable-phonetic=mod"
-		myconf="${myconf} --enable-dnssrv=mod --enable-ldap"
-		myconf="${myconf} --enable-meta=mod --enable-monitor=mod"
-		myconf="${myconf} --enable-null=mod --enable-shell=mod"
-		myconf="${myconf} --enable-relay=mod"
-		myconf="${myconf} $(use_enable perl perl mod)"
-		myconf="${myconf} $(use_enable odbc sql mod)"
-		# slapd options
-		myconf="${myconf} $(use_enable crypt) $(use_enable slp)"
-		myconf="${myconf} --enable-rewrite --enable-rlookups"
-		myconf="${myconf} --enable-aci --enable-modules"
-		myconf="${myconf} --enable-cleartext --enable-slapi"
-		myconf="${myconf} $(use_enable samba lmpasswd)"
-		# slapd overlay options
-		myconf="${myconf} --enable-dyngroup --enable-proxycache"
-		use overlays && myconf="${myconf} --enable-overlays=mod"
-		myconf="${myconf} --enable-syncprov"
-	else
-		myconf="${myconf} --disable-slapd --disable-slurpd"
-		myconf="${myconf} --disable-bdb --disable-ldbm"
-		myconf="${myconf} --disable-hdb --disable-monitor"
-		myconf="${myconf} --disable-slurpd --disable-overlays"
-		myconf="${myconf} --disable-relay"
-	fi
-
-	# basic functionality stuff
-	myconf="${myconf} --enable-syslog --enable-dynamic"
-	myconf="${myconf} --enable-local --enable-proctitle"
-
-	myconf="${myconf} $(use_enable ipv6)"
-	myconf="${myconf} $(use_with sasl cyrus-sasl) $(use_enable sasl spasswd)"
-	myconf="${myconf} $(use_enable tcpd wrappers) $(use_with ssl tls)"
-
-	if [ $(get_libdir) != "lib" ] ; then
-		append-ldflags -L/usr/$(get_libdir)
-	fi
-
-	STRIP=/bin/true \
-	econf \
-		--enable-static \
-		--enable-shared \
-		--libexecdir=/usr/$(get_libdir)/openldap \
-		${myconf} || die "configure failed"
-}
-
-src_compile() {
-	emake depend || die "make depend failed"
-	emake || die "make failed"
-
-	# openldap/contrib
-	tc-export CC
-	if ! use minimal ; then
-		# dsaschema
-			einfo "Building contributed dsaschema"
-			cd "${S}"/contrib/slapd-modules/dsaschema
-			${CC} -shared -I../../../include ${CFLAGS} -fPIC \
-			-Wall -o libdsaschema-plugin.so dsaschema.c || \
-			die "failed to compile dsaschema module"
-		# kerberos passwd
-		if use kerberos ; then
-			einfo "Building contributed pw-kerberos"
-			cd "${S}"/contrib/slapd-modules/passwd/ && \
-			${CC} -shared -I../../../include ${CFLAGS} -fPIC \
-			$(krb5-config --cflags) \
-			-DHAVE_KRB5 -o pw-kerberos.so kerberos.c || \
-			die "failed to compile kerberos password module"
-		fi
-		# netscape mta-md5 password
-			einfo "Building contributed pw-netscape"
-			cd "${S}"/contrib/slapd-modules/passwd/ && \
-			${CC} -shared -I../../../include ${CFLAGS} -fPIC \
-			-o pw-netscape.so netscape.c || \
-			die "failed to compile netscape password module"
-		# smbk5pwd overlay
-		# Note: this modules builds, but may not work with
-		#	Gentoo's MIT-Kerberos.	It was designed for Heimdal
-		#	Kerberos.
-		if use smbkrb5passwd ; then
-			einfo "Building contributed smbk5pwd"
-			local mydef
-			local mykrb5inc
-			mydef="-DDO_SAMBA -DDO_KRB5"
-			mykrb5inc="$(krb5-config --cflags)"
-			cd "${S}"/contrib/slapd-modules/smbk5pwd && \
-			libexecdir="/usr/$(get_libdir)/openldap" \
-			DEFS="${mydef}" KRB5_INC="${mykrb5inc}" emake || \
-			die "failed to compile smbk5pwd module"
-		fi
-		# addrdnvalues
-			einfo "Building contributed addrdnvalues"
-			cd "${S}"/contrib/slapi-plugins/addrdnvalues/ && \
-			${CC} -shared -I../../../include ${CFLAGS} -fPIC \
-			-o libaddrdnvalues-plugin.so addrdnvalues.c || \
-			die "failed to compile addrdnvalues plugin"
-	fi
-}
-
-src_test() {
-	einfo "Doing tests"
-	cd tests ; make tests || die "make tests failed"
-}
-
-src_install() {
-	emake DESTDIR="${D}" install || die "make install failed"
-
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README "${FILESDIR}"/DB_CONFIG.fast.example
-	docinto rfc ; dodoc doc/rfc/*.txt
-
-	# openldap modules go here
-	# TODO: write some code to populate slapd.conf with moduleload statements
-	keepdir /usr/$(get_libdir)/openldap/openldap/
-
-	# make state directories
-	local dirlist="data"
-	if ! use minimal; then
-		dirlist="${dirlist} slurp ldbm"
-	fi
-	for x in ${dirlist}; do
-		keepdir /var/lib/openldap-${x}
-		fowners ldap:ldap /var/lib/openldap-${x}
-		fperms 0700 /var/lib/openldap-${x}
-	done
-
-	echo "OLDPF='${PF}'" > "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-	echo "# do NOT delete this. it is used"	>> "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-	echo "# to track versions for upgrading." >> "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-	# manually remove /var/tmp references in .la
-	# because it is packaged with an ancient libtool
-	#for x in "${D}"/usr/$(get_libdir)/lib*.la; do
-	#	sed -i -e "s:-L${S}[/]*libraries::" ${x}
-	#done
-
-	# change slapd.pid location in configuration file
-	keepdir /var/run/openldap
-	fowners ldap:ldap /var/run/openldap
-	fperms 0755 /var/run/openldap
-
-	if ! use minimal; then
-		# use our config
-		rm "${D}"etc/openldap/slapd.con*
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.3.34-slapd-conf slapd.conf
-		configfile="${D}"etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${D}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			elog "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default
-		eend
-
-		# install our own init scripts
-		newinitd "${FILESDIR}"/slapd-initd slapd
-		newinitd "${FILESDIR}"/slurpd-initd slurpd
-		newconfd "${FILESDIR}"/slapd-confd slapd
-
-		if [ $(get_libdir) != lib ]; then
-			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${D}"etc/init.d/{slapd,slurpd}
-		fi
-
-		# install contributed modules
-		docinto /
-		if [ -e "${S}"/contrib/slapd-modules/dsaschema/libdsaschema-plugin.so ];
-		then
-			cd "${S}"/contrib/slapd-modules/dsaschema/
-			newdoc README README.contrib.dsaschema
-			exeinto /usr/$(get_libdir)/openldap/openldap
-			doexe libdsaschema-plugin.so || \
-			die "failed to install dsaschema module"
-		fi
-		if [ -e "${S}"/contrib/slapd-modules/passwd/pw-kerberos.so ]; then
-			cd "${S}"/contrib/slapd-modules/passwd/
-			newdoc README README.contrib.passwd
-			exeinto /usr/$(get_libdir)/openldap/openldap
-			doexe pw-kerberos.so || \
-			die "failed to install kerberos passwd module"
-		fi
-		if [ -e "${S}"/contrib/slapd-modules/passwd/pw-netscape.so ]; then
-			cd "${S}"/contrib/slapd-modules/passwd/
-			newdoc README README.contrib.passwd
-			exeinto /usr/$(get_libdir)/openldap/openldap
-			doexe "${S}"/contrib/slapd-modules/passwd/pw-netscape.so || \
-			die "failed to install Netscape MTA-MD5 passwd module"
-		fi
-		if [ -e "${S}"/contrib/slapd-modules/smbk5pwd/.libs/smbk5pwd.so ]; then
-			cd "${S}"/contrib/slapd-modules/smbk5pwd
-			newdoc README README.contrib.smbk5pwd
-			libexecdir="/usr/$(get_libdir)/openldap" \
-			emake DESTDIR="${D}" install-mod || \
-			die "failed to install smbk5pwd overlay module"
-		fi
-		if [ -e "${S}"/contrib/slapd-tools/statslog ]; then
-			cd "${S}"/contrib/slapd-tools
-			exeinto /usr/bin
-			newexe statslog ldapstatslog || \
-			die "failed to install ldapstatslog script"
-		fi
-		if [ -e "${S}"/contrib/slapi-plugins/addrdnvalues/libaddrdnvalues-plugin.so ];
-		then
-			cd "${S}"/contrib/slapi-plugins/addrdnvalues
-			newdoc README README.contrib.addrdnvalues
-			exeinto /usr/$(get_libdir)/openldap/openldap
-			doexe libaddrdnvalues-plugin.so || \
-			die "failed to install addrdnvalues plugin"
-		fi
-	fi
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	LIBSUFFIXES=".so.2.0.130 -2.2.so.7"
-	for LIBSUFFIX in ${LIBSUFFIXES} ; do
-		for each in libldap libldap_r liblber ; do
-			preserve_old_lib "usr/$(get_libdir)/${each}${LIBSUFFIX}"
-		done
-	done
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		# Additionally, it overwrites
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			chown ldap:ldap "${ROOT}"etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT never' if you want to use them."
-		fi
-		# These lines force the permissions of various content to be correct
-		chown ldap:ldap "${ROOT}"var/run/openldap
-		chmod 0755 "${ROOT}"var/run/openldap
-		chown root:ldap "${ROOT}"etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${ROOT}"etc/openldap/slapd.conf{,.default}
-		chown ldap:ldap "${ROOT}"var/lib/openldap-{data,ldbm,slurp}
-	fi
-
-	# Reference inclusion bug #77330
-	echo
-	elog
-	elog "Getting started using OpenLDAP? There is some documentation available:"
-	elog "Gentoo Guide to OpenLDAP Authentication"
-	elog "(https://www.gentoo.org/doc/en/ldap-howto.xml)"
-	elog
-
-	# note to bug #110412
-	echo
-	elog
-	elog "An example file for tuning BDB backends with openldap is"
-	elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	elog
-
-	LIBSUFFIXES=".so.2.0.130 -2.2.so.7"
-	for LIBSUFFIX in ${LIBSUFFIXES} ; do
-		for each in liblber libldap libldap_r ; do
-			preserve_old_lib_notify "usr/$(get_libdir)/${each}${LIBSUFFIX}"
-		done
-	done
-}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-07-22 19:37 Mike Gilbert
  0 siblings, 0 replies; 187+ messages in thread
From: Mike Gilbert @ 2017-07-22 19:37 UTC (permalink / raw
  To: gentoo-commits

commit:     3d4a1abe1ccbc6d32dd6d860d0701c88bea83399
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 22 19:30:47 2017 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Jul 22 19:35:39 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d4a1abe

net-nds/openldap: sed init script and systemd unit before install

Bug: https://bugs.gentoo.org/625960
Package-Manager: Portage-2.3.6_p23, Repoman-2.3.3_p1

 net-nds/openldap/openldap-2.4.44-r1.ebuild | 12 +++++-------
 net-nds/openldap/openldap-2.4.44.ebuild    | 12 +++++-------
 net-nds/openldap/openldap-2.4.45.ebuild    | 12 +++++-------
 3 files changed, 15 insertions(+), 21 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.44-r1.ebuild b/net-nds/openldap/openldap-2.4.44-r1.ebuild
index 23c66c3db53..9b5a6d372a1 100644
--- a/net-nds/openldap/openldap-2.4.44-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.44-r1.ebuild
@@ -716,18 +716,16 @@ multilib_src_install() {
 
 		# install our own init scripts and systemd unit files
 		einfo "Install init scripts"
-		newinitd "${FILESDIR}"/slapd-initd-2.4.40-r2 slapd
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
 		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
 		einfo "Install systemd service"
-		systemd_dounit "${FILESDIR}"/slapd.service
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
 		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
 		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
 
-		if [[ $(get_libdir) != lib ]]; then
-			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i \
-				"${ED}"/etc/init.d/slapd \
-				"${ED}"/usr/lib/systemd/system/slapd.service || die
-		fi
 		# If built without SLP, we don't need to be before avahi
 		use slp \
 			|| sed -i \

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index ea8e84e9cf0..099049a509a 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -694,18 +694,16 @@ multilib_src_install() {
 
 		# install our own init scripts and systemd unit files
 		einfo "Install init scripts"
-		newinitd "${FILESDIR}"/slapd-initd-2.4.40-r2 slapd
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
 		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
 		einfo "Install systemd service"
-		systemd_dounit "${FILESDIR}"/slapd.service
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
 		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
 		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
 
-		if [[ $(get_libdir) != lib ]]; then
-			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i \
-				"${ED}"/etc/init.d/slapd \
-				"${ED}"/usr/lib/systemd/system/slapd.service || die
-		fi
 		# If built without SLP, we don't need to be before avahi
 		use slp \
 			|| sed -i \

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index 0ead191e540..6d2ffdfb34d 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -748,18 +748,16 @@ multilib_src_install() {
 
 		# install our own init scripts and systemd unit files
 		einfo "Install init scripts"
-		newinitd "${FILESDIR}"/slapd-initd-2.4.40-r2 slapd
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
 		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
 		einfo "Install systemd service"
-		systemd_dounit "${FILESDIR}"/slapd.service
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
 		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
 		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
 
-		if [[ $(get_libdir) != lib ]]; then
-			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i \
-				"${ED}"/etc/init.d/slapd \
-				"${ED}"/usr/lib/systemd/system/slapd.service || die
-		fi
 		# If built without SLP, we don't need to be before avahi
 		use slp \
 			|| sed -i \


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-09-02 14:15 Michael Palimaka
  0 siblings, 0 replies; 187+ messages in thread
From: Michael Palimaka @ 2017-09-02 14:15 UTC (permalink / raw
  To: gentoo-commits

commit:     f587c13b22b6487aeb3c9b94e8fb4de329cb2993
Author:     Francesco Turco <fturco <AT> fastmail <DOT> fm>
AuthorDate: Fri Sep  1 20:02:55 2017 +0000
Commit:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Sat Sep  2 14:14:59 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f587c13b

net-nds/openldap: update link to wiki

 net-nds/openldap/openldap-2.4.44-r1.ebuild | 2 +-
 net-nds/openldap/openldap-2.4.44.ebuild    | 2 +-
 net-nds/openldap/openldap-2.4.45.ebuild    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.44-r1.ebuild b/net-nds/openldap/openldap-2.4.44-r1.ebuild
index 9b5a6d372a1..b25baead93f 100644
--- a/net-nds/openldap/openldap-2.4.44-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.44-r1.ebuild
@@ -841,7 +841,7 @@ pkg_postinst() {
 	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
 		elog "Getting started using OpenLDAP? There is some documentation available:"
 		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://www.gentoo.org/doc/en/ldap-howto.xml)"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
 		elog "---"
 		elog "An example file for tuning BDB backends with openldap is"
 		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index 099049a509a..be14b0370f6 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -818,7 +818,7 @@ pkg_postinst() {
 	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
 		elog "Getting started using OpenLDAP? There is some documentation available:"
 		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://www.gentoo.org/doc/en/ldap-howto.xml)"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
 		elog "---"
 		elog "An example file for tuning BDB backends with openldap is"
 		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index 6d2ffdfb34d..de36c98cf1a 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -873,7 +873,7 @@ pkg_postinst() {
 	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
 		elog "Getting started using OpenLDAP? There is some documentation available:"
 		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://www.gentoo.org/doc/en/ldap-howto.xml)"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
 		elog "---"
 		elog "An example file for tuning BDB backends with openldap is"
 		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-11-05 20:46 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2017-11-05 20:46 UTC (permalink / raw
  To: gentoo-commits

commit:     d5eaafc35a30d6371c1edfc53d44cf0678a849c8
Author:     Zhao Yongming <ming.zym <AT> gmail <DOT> com>
AuthorDate: Mon Oct 16 08:50:09 2017 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Nov  5 20:45:27 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5eaafc3

net-nds/openldap: fix modules libtool files prune

the prune_libtool_files is run before the modules intall, that will
leave many la files in openldap module directory broken due to main
la file is gone, which will make revdep-rebuild or cave fix-linkage
keep rebuilding net-nds/openldap.

keep module la files removed by default will prevent user from using
.la file in modules config, which is working but should not been
encouraged, such as BUG:600484

Fixes: https://bugs.gentoo.org/537418
(cherry picked from commit 2c2376d9efd3d77424e3c8a626a165daf881e145)
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.44-r1.ebuild | 3 ++-
 net-nds/openldap/openldap-2.4.44.ebuild    | 3 ++-
 net-nds/openldap/openldap-2.4.45.ebuild    | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.44-r1.ebuild b/net-nds/openldap/openldap-2.4.44-r1.ebuild
index b25baead93f..b4e5a2c3c69 100644
--- a/net-nds/openldap/openldap-2.4.44-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.44-r1.ebuild
@@ -680,7 +680,6 @@ multilib_src_test() {
 multilib_src_install() {
 	local lt="${BUILD_DIR}/libtool"
 	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
-	use static-libs || prune_libtool_files --all
 
 	if ! use minimal && multilib_is_native_abi; then
 		# openldap modules go here
@@ -793,6 +792,8 @@ multilib_src_install() {
 		dosbin "${S}"/contrib/slapd-tools/statslog
 		newdoc "${S}"/contrib/slapd-tools/README README.statslog
 	fi
+
+	use static-libs || prune_libtool_files --all
 }
 
 multilib_src_install_all() {

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index be14b0370f6..a782cf0ca6c 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -658,7 +658,6 @@ multilib_src_test() {
 multilib_src_install() {
 	local lt="${BUILD_DIR}/libtool"
 	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
-	use static-libs || prune_libtool_files --all
 
 	if ! use minimal && multilib_is_native_abi; then
 		# openldap modules go here
@@ -770,6 +769,8 @@ multilib_src_install() {
 		dosbin "${S}"/contrib/slapd-tools/statslog
 		newdoc "${S}"/contrib/slapd-tools/README README.statslog
 	fi
+
+	use static-libs || prune_libtool_files --all
 }
 
 multilib_src_install_all() {

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index de36c98cf1a..6b11f7e0475 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -712,7 +712,6 @@ multilib_src_test() {
 multilib_src_install() {
 	local lt="${BUILD_DIR}/libtool"
 	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
-	use static-libs || prune_libtool_files --all
 
 	if ! use minimal && multilib_is_native_abi; then
 		# openldap modules go here
@@ -825,6 +824,8 @@ multilib_src_install() {
 		dosbin "${S}"/contrib/slapd-tools/statslog
 		newdoc "${S}"/contrib/slapd-tools/README README.statslog
 	fi
+
+	use static-libs || prune_libtool_files --all
 }
 
 multilib_src_install_all() {


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-11-26 23:23 David Seifert
  0 siblings, 0 replies; 187+ messages in thread
From: David Seifert @ 2017-11-26 23:23 UTC (permalink / raw
  To: gentoo-commits

commit:     96b52492fb94aa716ef6a6e554e62990350f08eb
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 26 12:49:21 2017 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Nov 26 23:22:25 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96b52492

net-nds/openldap: [QA] Consistent whitespace in metadata.xml

 net-nds/openldap/metadata.xml | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/net-nds/openldap/metadata.xml b/net-nds/openldap/metadata.xml
index 4e5e2c49039..6cea2f2e325 100644
--- a/net-nds/openldap/metadata.xml
+++ b/net-nds/openldap/metadata.xml
@@ -1,19 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-    <maintainer type="project">
-        <email>ldap-bugs@gentoo.org</email>
-    </maintainer>
+	<maintainer type="project">
+		<email>ldap-bugs@gentoo.org</email>
+	</maintainer>
 	<use>
 		<flag name="experimental">Enable experimental backend options</flag>
 		<flag name="kinit">Enable support for kerberos init</flag>
 		<flag name="odbc">Enable ODBC and SQL backend options</flag>
 		<flag name="overlays">Enable contributed OpenLDAP overlays</flag>
-		<flag name="smbkrb5passwd">Enable overlay for syncing ldap, unix and
-			lanman passwords</flag>
-		<flag name="minimal">Build libraries &amp; userspace tools only. Does not install any server code.</flag>
+		<flag name="smbkrb5passwd">Enable overlay for syncing ldap, unix and lanman passwords</flag>
+		<flag name="minimal">Build libraries &amp; userspace tools only. Does not install any server code</flag>
 		<flag name="pbkdf2">Enable support for pbkdf2 passwords</flag>
-		<flag name="sha2">Enable support for pw-sha2 password hashes.</flag>
+		<flag name="sha2">Enable support for pw-sha2 password hashes</flag>
 	</use>
 	<upstream>
 		<remote-id type="cpe">cpe:/a:openldap:openldap</remote-id>


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2017-12-14 22:08 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2017-12-14 22:08 UTC (permalink / raw
  To: gentoo-commits

commit:     1fedd1f876557cdda4827505e69e5ef4c6955bc4
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 14 22:06:58 2017 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Dec 14 22:06:58 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fedd1f8

net-nds/openldap: slurpd no longer exists.

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.44-r1.ebuild | 2 +-
 net-nds/openldap/openldap-2.4.44.ebuild    | 2 +-
 net-nds/openldap/openldap-2.4.45.ebuild    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.44-r1.ebuild b/net-nds/openldap/openldap-2.4.44-r1.ebuild
index b4e5a2c3c69..d8a585339a5 100644
--- a/net-nds/openldap/openldap-2.4.44-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.44-r1.ebuild
@@ -269,7 +269,7 @@ openldap_upgrade_howto() {
 	d="$(date -u +%s)"
 	l="/root/ldapdump.${d}"
 	i="${l}.raw"
-	eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
+	eerror " 1. /etc/init.d/slapd stop"
 	eerror " 2. slapcat -l ${i}"
 	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
 	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index a782cf0ca6c..a9d3fd556cb 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -268,7 +268,7 @@ openldap_upgrade_howto() {
 	d="$(date -u +%s)"
 	l="/root/ldapdump.${d}"
 	i="${l}.raw"
-	eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
+	eerror " 1. /etc/init.d/slapd stop"
 	eerror " 2. slapcat -l ${i}"
 	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
 	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index 6b11f7e0475..83ca893c0e1 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -269,7 +269,7 @@ openldap_upgrade_howto() {
 	d="$(date -u +%s)"
 	l="/root/ldapdump.${d}"
 	i="${l}.raw"
-	eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
+	eerror " 1. /etc/init.d/slapd stop"
 	eerror " 2. slapcat -l ${i}"
 	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
 	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2018-03-16 22:50 Lars Wendler
  0 siblings, 0 replies; 187+ messages in thread
From: Lars Wendler @ 2018-03-16 22:50 UTC (permalink / raw
  To: gentoo-commits

commit:     913d28e3cb47673a8fc7e68e8d6a9409665a4825
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 16 22:48:12 2018 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Fri Mar 16 22:48:12 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=913d28e3

net-nds/openldap: Added sub-slot dep operator for dev-libs/openssl.

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 net-nds/openldap/openldap-2.4.44-r1.ebuild | 6 +++---
 net-nds/openldap/openldap-2.4.44.ebuild    | 6 +++---
 net-nds/openldap/openldap-2.4.45.ebuild    | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.44-r1.ebuild b/net-nds/openldap/openldap-2.4.44-r1.ebuild
index 7c85e867ef5..2c0a46f3c1b 100644
--- a/net-nds/openldap/openldap-2.4.44-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.44-r1.ebuild
@@ -44,7 +44,7 @@ for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 CDEPEND="
 	ssl? (
 		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
 		)
 		gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
 		libressl? ( dev-libs/libressl[${MULTILIB_USEDEP}] )
@@ -60,7 +60,7 @@ CDEPEND="
 		slp? ( net-libs/openslp )
 		perl? ( dev-lang/perl:=[-build(-)] )
 		samba? (
-			!libressl? ( dev-libs/openssl:0 )
+			!libressl? ( dev-libs/openssl:0= )
 			libressl? ( dev-libs/libressl )
 		)
 		berkdb? (
@@ -68,7 +68,7 @@ CDEPEND="
 			|| ( ${BDB_PKGS} )
 			)
 		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0 )
+			!libressl? ( dev-libs/openssl:0= )
 			libressl? ( dev-libs/libressl )
 			kerberos? ( app-crypt/heimdal )
 			)

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index 68058c56614..224368aab68 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -43,7 +43,7 @@ for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 CDEPEND="
 	ssl? (
 		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
 		)
 		gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
 		libressl? ( dev-libs/libressl[${MULTILIB_USEDEP}] )
@@ -59,7 +59,7 @@ CDEPEND="
 		slp? ( net-libs/openslp )
 		perl? ( dev-lang/perl:=[-build(-)] )
 		samba? (
-			!libressl? ( dev-libs/openssl:0 )
+			!libressl? ( dev-libs/openssl:0= )
 			libressl? ( dev-libs/libressl )
 		)
 		berkdb? (
@@ -67,7 +67,7 @@ CDEPEND="
 			|| ( ${BDB_PKGS} )
 			)
 		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0 )
+			!libressl? ( dev-libs/openssl:0= )
 			libressl? ( dev-libs/libressl )
 			kerberos? ( app-crypt/heimdal )
 			)

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index 4024eb34308..7b031230377 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -44,7 +44,7 @@ for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 CDEPEND="
 	ssl? (
 		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
 		)
 		gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
 		libressl? ( dev-libs/libressl[${MULTILIB_USEDEP}] )
@@ -60,7 +60,7 @@ CDEPEND="
 		slp? ( net-libs/openslp )
 		perl? ( dev-lang/perl:=[-build(-)] )
 		samba? (
-			!libressl? ( dev-libs/openssl:0 )
+			!libressl? ( dev-libs/openssl:0= )
 			libressl? ( dev-libs/libressl )
 		)
 		berkdb? (
@@ -68,7 +68,7 @@ CDEPEND="
 			|| ( ${BDB_PKGS} )
 			)
 		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0 )
+			!libressl? ( dev-libs/openssl:0= )
 			libressl? ( dev-libs/libressl )
 			kerberos? ( app-crypt/heimdal )
 			)


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2018-06-03 10:01 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2018-06-03 10:01 UTC (permalink / raw
  To: gentoo-commits

commit:     ba8cb721f6b099edd509b4c0ada12fbbe864c221
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  3 09:56:16 2018 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Sun Jun  3 09:56:16 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba8cb721

net-nds/openldap: s390 stable wrt bug #657058

Package-Manager: Portage-2.3.40, Repoman-2.3.9

 net-nds/openldap/openldap-2.4.44.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index 9ff3e77920a..cf061b07f61 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2018-07-15 11:45 Mart Raudsepp
  0 siblings, 0 replies; 187+ messages in thread
From: Mart Raudsepp @ 2018-07-15 11:45 UTC (permalink / raw
  To: gentoo-commits

commit:     88747b92b700608e21758cf98a0d349f8492e944
Author:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 15 11:11:15 2018 +0000
Commit:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Sun Jul 15 11:27:01 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88747b92

net-nds/openldap-2.4.44: arm64 stable

Package-Manager: Portage-2.3.40, Repoman-2.3.9

 net-nds/openldap/openldap-2.4.44.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
index cf061b07f61..6e0599b9c96 100644
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ b/net-nds/openldap/openldap-2.4.44.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2018-11-27 15:11 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2018-11-27 15:11 UTC (permalink / raw
  To: gentoo-commits

commit:     41f9ee4874c4acb422aa421e6b1939c787970733
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 27 15:11:06 2018 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Tue Nov 27 15:11:06 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41f9ee48

net-nds/openldap: amd64 stable wrt bug #620204

Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

 net-nds/openldap/openldap-2.4.45.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index 5e128b5c465..694d45d9196 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="5"
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2018-11-27 16:01 Tobias Klausmann
  0 siblings, 0 replies; 187+ messages in thread
From: Tobias Klausmann @ 2018-11-27 16:01 UTC (permalink / raw
  To: gentoo-commits

commit:     f6c39556943d00d8462d523def8038deb75a6c0a
Author:     Tobias Klausmann <klausman <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 27 16:00:55 2018 +0000
Commit:     Tobias Klausmann <klausman <AT> gentoo <DOT> org>
CommitDate: Tue Nov 27 16:00:55 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6c39556

net-nds/openldap-2.4.45-r0: alpha stable

Bug: http://bugs.gentoo.org/620204
Signed-off-by: Tobias Klausmann <klausman <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.45.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index 694d45d9196..0dcf4fbd890 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2018-11-27 21:55 Thomas Deutschmann
  0 siblings, 0 replies; 187+ messages in thread
From: Thomas Deutschmann @ 2018-11-27 21:55 UTC (permalink / raw
  To: gentoo-commits

commit:     ed127fc28bb1f38f5f15827327d18eff450d4f83
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 27 21:49:14 2018 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Tue Nov 27 21:55:31 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed127fc2

net-nds/openldap: x86 stable (bug #620204)

Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.45.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index 0dcf4fbd890..bf36e059d1f 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2018-11-28 12:35 Mart Raudsepp
  0 siblings, 0 replies; 187+ messages in thread
From: Mart Raudsepp @ 2018-11-28 12:35 UTC (permalink / raw
  To: gentoo-commits

commit:     c01067cb540b1c36b9053f25b13d5e93c91fcd10
Author:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 28 12:34:48 2018 +0000
Commit:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Wed Nov 28 12:34:48 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c01067cb

net-nds/openldap-2.4.45: arm64 stable (bug #620204)

Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>
Package-Manager: Portage-2.3.52, Repoman-2.3.11

 net-nds/openldap/openldap-2.4.45.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index bf36e059d1f..31792bbbe5b 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 ~arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2018-11-28 22:28 Sergei Trofimovich
  0 siblings, 0 replies; 187+ messages in thread
From: Sergei Trofimovich @ 2018-11-28 22:28 UTC (permalink / raw
  To: gentoo-commits

commit:     fab5d8ecb1cc93b151eaf0a74877c4585540157b
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 28 22:26:59 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Wed Nov 28 22:26:59 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fab5d8ec

net-nds/openldap: stable 2.4.45 for ia64, bug #620204

Package-Manager: Portage-2.3.52, Repoman-2.3.12
RepoMan-Options: --include-arches="ia64"
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.45.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index 31792bbbe5b..b89631117db 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 ~arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 ~arm arm64 ~hppa ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2018-11-28 22:33 Sergei Trofimovich
  0 siblings, 0 replies; 187+ messages in thread
From: Sergei Trofimovich @ 2018-11-28 22:33 UTC (permalink / raw
  To: gentoo-commits

commit:     f9598dd5e617f1c2d4a903aa56a42bd6995e08cb
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 28 22:30:22 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Wed Nov 28 22:32:52 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9598dd5

net-nds/openldap: stable 2.4.45 for ppc, bug #620204

Package-Manager: Portage-2.3.52, Repoman-2.3.12
RepoMan-Options: --include-arches="ppc"
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.45.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index b89631117db..c1b8a0572dd 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 ~arm arm64 ~hppa ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 ~arm arm64 ~hppa ia64 ~mips ppc ~ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2018-11-28 22:35 Sergei Trofimovich
  0 siblings, 0 replies; 187+ messages in thread
From: Sergei Trofimovich @ 2018-11-28 22:35 UTC (permalink / raw
  To: gentoo-commits

commit:     ce5ab93b3fb66d877b9c3836d1e0a7a9b633481d
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 28 22:34:21 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Wed Nov 28 22:34:21 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce5ab93b

net-nds/openldap: stable 2.4.45 for ppc64, bug #620204

Package-Manager: Portage-2.3.52, Repoman-2.3.12
RepoMan-Options: --include-arches="ppc64"
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.45.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index c1b8a0572dd..cc028f32619 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 ~arm arm64 ~hppa ia64 ~mips ppc ~ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 ~arm arm64 ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2018-11-29 20:06 Sergei Trofimovich
  0 siblings, 0 replies; 187+ messages in thread
From: Sergei Trofimovich @ 2018-11-29 20:06 UTC (permalink / raw
  To: gentoo-commits

commit:     c2d08f585f0f9176af080d3da661d8b6cce12d6a
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 29 20:03:53 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Nov 29 20:05:08 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2d08f58

net-nds/openldap: stable 2.4.45 for hppa, bug #620204

Package-Manager: Portage-2.3.52, Repoman-2.3.12
RepoMan-Options: --include-arches="hppa"
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.45.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index cc028f32619..d65817bcc81 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 ~arm arm64 ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 ~arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2018-11-30 20:18 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2018-11-30 20:18 UTC (permalink / raw
  To: gentoo-commits

commit:     617619246a1b3c197201db4468624a0928d1ac26
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 30 20:17:03 2018 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri Nov 30 20:17:03 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61761924

net-nds/openldap: s390/sparc stable wrt bug #620204

Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

 net-nds/openldap/openldap-2.4.45.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index 45833f07561..7f5cd3fc1bd 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2018-11-30 20:18 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2018-11-30 20:18 UTC (permalink / raw
  To: gentoo-commits

commit:     6727f7cec806c5d938b67f3ef8bc2de07ab2fcb9
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 30 20:15:37 2018 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri Nov 30 20:15:37 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6727f7ce

net-nds/openldap: arm stable wrt bug #620204

Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

 net-nds/openldap/openldap-2.4.45.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index d65817bcc81..45833f07561 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 ~arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2018-11-30 20:18 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2018-11-30 20:18 UTC (permalink / raw
  To: gentoo-commits

commit:     9955fcfd7c5d530007ad8b5c2cf0dcfe9e54b3f4
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 30 20:18:04 2018 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri Nov 30 20:18:04 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9955fcfd

net-nds/openldap: Security cleanup

Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

 net-nds/openldap/Manifest                  |   1 -
 net-nds/openldap/openldap-2.4.44-r1.ebuild | 848 -----------------------------
 net-nds/openldap/openldap-2.4.44.ebuild    | 825 ----------------------------
 3 files changed, 1674 deletions(-)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 158a00fe7a6..d0a81c6ed50 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,3 +1,2 @@
-DIST openldap-2.4.44.tgz 5658830 BLAKE2B 0d9101bbc159f78f23ffc5db78943dd602610650cda166a2920c4acba502c04d4a96968b9e7f146fe1dd87b677d5da6513500b57ec42b92f9991d577b3a4ed46 SHA512 132eb81798f59a364c9246d08697e1c7ebb6c2c3b983f786b14ec0233df09696cbad33a1f35f3076348b5efb77665a076ab854a24122c31e8b58310b7c7fd136
 DIST openldap-2.4.45.tgz 5672845 BLAKE2B e1f97553482a2e8630b62bc0f439af2484f1a2349a1a077382a124354424fe510ab55f32c073565b142d0c9318870fe31a2652268ebabd97d3afd8c833bc7aab SHA512 1c9fc84efed8998f107ce6e1c6be3f5466388241afdca0cb3847720c9def0bc263a2dbc15bf0f9112d1b4c391fd01e8531a4fb08c5532c30fb86924c08daedab
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.44-r1.ebuild b/net-nds/openldap/openldap-2.4.44-r1.ebuild
deleted file mode 100644
index 9a2496805c4..00000000000
--- a/net-nds/openldap/openldap-2.4.44-r1.ebuild
+++ /dev/null
@@ -1,848 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-inherit db-use eutils flag-o-matic multilib multilib-minimal ssl-cert versionator toolchain-funcs autotools user systemd
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="http://www.OpenLDAP.org/"
-
-# mirrors are mostly not working, using canonical URI
-SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
-		 mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-REQUIRED_USE="cxx? ( sasl )
-	?? ( gnutls libressl )
-	pbkdf2? ( ssl )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-CDEPEND="
-	ssl? (
-		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
-		)
-		gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
-		libressl? ( dev-libs/libressl[${MULTILIB_USEDEP}] )
-		>=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] ) )
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		sys-devel/libtool
-		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.18:=
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl )
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl )
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)"
-DEPEND="${CDEPEND}
-	sys-apps/groff"
-RDEPEND="${CDEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	openldap_datadirs=""
-	if [ -f "${EROOT}"/etc/openldap/slapd.conf ]; then
-		openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${EROOT}/etc/openldap/slapd.conf)"
-	fi
-	openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs}; do
-		CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
-		CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
-		if [ -d ${CURRENT_TAGDIR} ] &&	[ ${openldap_found_tag} == 0 ] ; then
-			einfo "- Checking ${each}..."
-			if [ -r ${CURRENT_TAG} ] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source ${CURRENT_TAG}
-				if [ "${OLDPF}" == "" ] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
-
-				[ $(openldap_filecount ${CURRENT_TAGDIR}) -gt 0 ] && have_files=1
-
-				# are we on the same branch?
-				if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[ $(openldap_filecount ${each}) -gt 0 ] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[ "${have_files}" == "1" ] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH=${EROOT}/usr/$(get_libdir)/openldap/slapd
-	if [ "${have_files}" == "1" -a -f "${SLAPD_PATH}" ]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in $BDB_SLOTS ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "$NEWVER" ]] && break
-			done
-		fi
-		local fail=0
-		if [ -z "${OLDVER}" -a -z "${NEWVER}" ]; then
-			:
-			# Nothing wrong here.
-		elif [ -z "${OLDVER}" -a -n "${NEWVER}" ]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [ -n "${OLDVER}" -a -z "${NEWVER}" ]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [ "${OLDVER}" != "${NEWVER}" ]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[ "${fail}" == "1" ] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [ "${FORCE_UPGRADE}" != "1" ]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-
-	# The user/group are only used for running daemons which are
-	# disabled in minimal builds, so elide the accounts too.
-	if ! use minimal ; then
-		enewgroup ldap 439
-		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		"${S}"/include/ldap_defaults.h
-
-	epatch "${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	epatch \
-		"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \
-		"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	epatch "${FILESDIR}"/${PN}-2.4.17-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	epatch "${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	epatch "${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	epatch "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	epatch "${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# unbundle lmdb
-	epatch "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-	rm -rf "${S}"/libraries/liblmdb
-
-	cd "${S}"/build || die
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed -i \
-		-e 's|/bin/sh|/bin/bash|g' \
-		"${S}"/tests/scripts/* || die "sed failed"
-
-	cd "${S}" || die
-
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	cd "${S}/contrib/slapd-modules/$1" || die
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(echo "SLAPD_OVER_${1}" | LC_ALL=C tr '[:lower:]' '[:upper:]')"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-}
-
-src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir $BDB_SLOTS)
-			einfo "Using $DBINCLUDE for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			$(use_enable slp)
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	ECONF_SOURCE=${S} \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	cd "${BUILD_DIR}/contrib/ldapc++" || die
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake \
-				CC="${CC}" CXX="${CXX}"
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			cd "${S}/contrib/slapd-modules/passwd" || die
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-		fi
-
-		if use pbkdf2; then
-			cd "${S}/contrib/slapd-modules/passwd/pbkdf2" || die
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		cd "${S}/contrib/slapd-modules/passwd" || die
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		build_contrib_module "nops" "nops.c" "nops-overlay"
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		# build slapi-plugins
-		cd "${S}/contrib/slapi-plugins/addrdnvalues" || die
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests || die "make tests failed"
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${ED}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default
-		eend
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-		use slp \
-			|| sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"etc/init.d/slapd
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED}"usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README  allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins  */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	use static-libs || prune_libtool_files --all
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
-		chmod 0755 "${EROOT}"var/run/openldap
-		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
-		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}

diff --git a/net-nds/openldap/openldap-2.4.44.ebuild b/net-nds/openldap/openldap-2.4.44.ebuild
deleted file mode 100644
index 6e0599b9c96..00000000000
--- a/net-nds/openldap/openldap-2.4.44.ebuild
+++ /dev/null
@@ -1,825 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-inherit db-use eutils flag-o-matic multilib multilib-minimal ssl-cert versionator toolchain-funcs autotools user systemd
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="http://www.OpenLDAP.org/"
-
-# mirrors are mostly not working, using canonical URI
-SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
-		 mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-REQUIRED_USE="cxx? ( sasl )
-	?? ( gnutls libressl )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-CDEPEND="
-	ssl? (
-		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
-		)
-		gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
-		libressl? ( dev-libs/libressl[${MULTILIB_USEDEP}] )
-		>=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] ) )
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		sys-devel/libtool
-		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.18:=
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl )
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl )
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)"
-DEPEND="${CDEPEND}
-	sys-apps/groff"
-RDEPEND="${CDEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	openldap_datadirs=""
-	if [ -f "${EROOT}"/etc/openldap/slapd.conf ]; then
-		openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${EROOT}/etc/openldap/slapd.conf)"
-	fi
-	openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs}; do
-		CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
-		CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
-		if [ -d ${CURRENT_TAGDIR} ] &&	[ ${openldap_found_tag} == 0 ] ; then
-			einfo "- Checking ${each}..."
-			if [ -r ${CURRENT_TAG} ] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source ${CURRENT_TAG}
-				if [ "${OLDPF}" == "" ] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
-
-				[ $(openldap_filecount ${CURRENT_TAGDIR}) -gt 0 ] && have_files=1
-
-				# are we on the same branch?
-				if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[ $(openldap_filecount ${each}) -gt 0 ] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[ "${have_files}" == "1" ] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH=${EROOT}/usr/$(get_libdir)/openldap/slapd
-	if [ "${have_files}" == "1" -a -f "${SLAPD_PATH}" ]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in $BDB_SLOTS ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "$NEWVER" ]] && break
-			done
-		fi
-		local fail=0
-		if [ -z "${OLDVER}" -a -z "${NEWVER}" ]; then
-			:
-			# Nothing wrong here.
-		elif [ -z "${OLDVER}" -a -n "${NEWVER}" ]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [ -n "${OLDVER}" -a -z "${NEWVER}" ]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [ "${OLDVER}" != "${NEWVER}" ]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[ "${fail}" == "1" ] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [ "${FORCE_UPGRADE}" != "1" ]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-
-	# The user/group are only used for running daemons which are
-	# disabled in minimal builds, so elide the accounts too.
-	if ! use minimal ; then
-		enewgroup ldap 439
-		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		"${S}"/include/ldap_defaults.h
-
-	epatch "${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	epatch \
-		"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \
-		"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	epatch "${FILESDIR}"/${PN}-2.4.17-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	epatch "${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	epatch "${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	epatch "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	epatch "${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# unbundle lmdb
-	epatch "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-	rm -rf "${S}"/libraries/liblmdb
-
-	cd "${S}"/build || die
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed -i \
-		-e 's|/bin/sh|/bin/bash|g' \
-		"${S}"/tests/scripts/* || die "sed failed"
-
-	cd "${S}" || die
-
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	cd "${S}/contrib/slapd-modules/$1" || die
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(echo "SLAPD_OVER_${1}" | LC_ALL=C tr '[:lower:]' '[:upper:]')"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-}
-
-src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir $BDB_SLOTS)
-			einfo "Using $DBINCLUDE for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			$(use_enable slp)
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	ECONF_SOURCE=${S} \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	cd "${BUILD_DIR}/contrib/ldapc++" || die
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake \
-				CC="${CC}" CXX="${CXX}"
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			cd "${S}/contrib/slapd-modules/passwd" || die
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-		fi
-		# We could build pw-radius if GNURadius would install radlib.h
-		cd "${S}/contrib/slapd-modules/passwd" || die
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		build_contrib_module "nops" "nops.c" "nops-overlay"
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		# build slapi-plugins
-		cd "${S}/contrib/slapi-plugins/addrdnvalues" || die
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests || die "make tests failed"
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${ED}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default
-		eend
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-		use slp \
-			|| sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"etc/init.d/slapd
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la; do
-			"${lt}" --mode=install cp ${l} \
-				"${ED}"usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README  allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins  */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	use static-libs || prune_libtool_files --all
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
-		chmod 0755 "${EROOT}"var/run/openldap
-		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
-		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-02-16 18:58 Aaron Bauman
  0 siblings, 0 replies; 187+ messages in thread
From: Aaron Bauman @ 2019-02-16 18:58 UTC (permalink / raw
  To: gentoo-commits

commit:     dd4a2dc7b7fd4832775fb65241d78371643014b6
Author:     Stefan Strogin <stefan.strogin <AT> gmail <DOT> com>
AuthorDate: Sat Feb 16 07:47:09 2019 +0000
Commit:     Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Sat Feb 16 18:58:21 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd4a2dc7

net-nds/openldap: add missing slot operator for libressl dependency

Package-Manager: Portage-2.3.60, Repoman-2.3.12
Signed-off-by: Stefan Strogin <stefan.strogin <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/11070
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.45-r1.ebuild | 880 +++++++++++++++++++++++++++++
 1 file changed, 880 insertions(+)

diff --git a/net-nds/openldap/openldap-2.4.45-r1.ebuild b/net-nds/openldap/openldap-2.4.45-r1.ebuild
new file mode 100644
index 00000000000..7d16acea025
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.45-r1.ebuild
@@ -0,0 +1,880 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit db-use eutils flag-o-matic multilib multilib-minimal ssl-cert versionator toolchain-funcs autotools user systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="http://www.OpenLDAP.org/"
+
+# mirrors are mostly not working, using canonical URI
+SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
+		 mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+REQUIRED_USE="cxx? ( sasl )
+	?? ( gnutls libressl )
+	pbkdf2? ( ssl )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+CDEPEND="
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
+		)
+		gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
+		libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+		>=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] ) )
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		slp? ( net-libs/openslp )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)"
+DEPEND="${CDEPEND}
+	sys-apps/groff"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	openldap_datadirs=""
+	if [ -f "${EROOT}"/etc/openldap/slapd.conf ]; then
+		openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${EROOT}/etc/openldap/slapd.conf)"
+	fi
+	openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs}; do
+		CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
+		CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
+		if [ -d ${CURRENT_TAGDIR} ] &&	[ ${openldap_found_tag} == 0 ] ; then
+			einfo "- Checking ${each}..."
+			if [ -r ${CURRENT_TAG} ] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source ${CURRENT_TAG}
+				if [ "${OLDPF}" == "" ] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
+
+				[ $(openldap_filecount ${CURRENT_TAGDIR}) -gt 0 ] && have_files=1
+
+				# are we on the same branch?
+				if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[ $(openldap_filecount ${each}) -gt 0 ] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[ "${have_files}" == "1" ] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH=${EROOT}/usr/$(get_libdir)/openldap/slapd
+	if [ "${have_files}" == "1" -a -f "${SLAPD_PATH}" ]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in $BDB_SLOTS ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "$NEWVER" ]] && break
+			done
+		fi
+		local fail=0
+		if [ -z "${OLDVER}" -a -z "${NEWVER}" ]; then
+			:
+			# Nothing wrong here.
+		elif [ -z "${OLDVER}" -a -n "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [ -n "${OLDVER}" -a -z "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [ "${OLDVER}" != "${NEWVER}" ]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[ "${fail}" == "1" ] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [ "${FORCE_UPGRADE}" != "1" ]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		"${S}"/include/ldap_defaults.h
+
+	epatch "${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	epatch \
+		"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \
+		"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	epatch "${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	epatch "${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	epatch "${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	epatch "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	epatch "${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# bug #622464
+	epatch "${FILESDIR}"/${PN}-2.4.45-libressl.patch
+
+	# unbundle lmdb
+	epatch "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+	rm -rf "${S}"/libraries/liblmdb
+
+	epatch_user
+
+	cd "${S}"/build || die
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed -i \
+		-e 's|/bin/sh|/bin/bash|g' \
+		"${S}"/tests/scripts/* || die "sed failed"
+
+	cd "${S}" || die
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	cd "${S}/contrib/slapd-modules/$1" || die
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(echo "SLAPD_OVER_${1}" | LC_ALL=C tr '[:lower:]' '[:upper:]')"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir $BDB_SLOTS)
+			einfo "Using $DBINCLUDE for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			$(use_enable slp)
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	ECONF_SOURCE=${S} \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	cd "${BUILD_DIR}/contrib/ldapc++" || die
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake \
+				CC="${CC}" CXX="${CXX}"
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			cd "${S}/contrib/slapd-modules/passwd" || die
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+		fi
+
+		if use pbkdf2; then
+			cd "${S}/contrib/slapd-modules/passwd/pbkdf2" || die
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+		fi
+
+		if use sha2 ; then
+			cd "${S}/contrib/slapd-modules/passwd/sha2" || die
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		cd "${S}/contrib/slapd-modules/passwd" || die
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		build_contrib_module "nops" "nops.c" "nops-overlay"
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		# build slapi-plugins
+		cd "${S}/contrib/slapi-plugins/addrdnvalues" || die
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests || die "make tests failed"
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# If built without SLP, we don't need to be before avahi
+		use slp \
+			|| sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"etc/init.d/slapd
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	use static-libs || prune_libtool_files --all
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
+		chmod 0755 "${EROOT}"var/run/openldap
+		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
+		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-02-20 15:06 Lars Wendler
  0 siblings, 0 replies; 187+ messages in thread
From: Lars Wendler @ 2019-02-20 15:06 UTC (permalink / raw
  To: gentoo-commits

commit:     00db46a3bafb7100b0917bcc20bfbc73f1b293d4
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 20 15:05:45 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Feb 20 15:06:06 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00db46a3

net-nds/openldap: Bump to version 2.4.47

Closes: https://bugs.gentoo.org/661174
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.4.47.ebuild | 896 ++++++++++++++++++++++++++++++++
 2 files changed, 897 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index d0a81c6ed50..138e3852a81 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,2 +1,3 @@
 DIST openldap-2.4.45.tgz 5672845 BLAKE2B e1f97553482a2e8630b62bc0f439af2484f1a2349a1a077382a124354424fe510ab55f32c073565b142d0c9318870fe31a2652268ebabd97d3afd8c833bc7aab SHA512 1c9fc84efed8998f107ce6e1c6be3f5466388241afdca0cb3847720c9def0bc263a2dbc15bf0f9112d1b4c391fd01e8531a4fb08c5532c30fb86924c08daedab
+DIST openldap-2.4.47.tgz 5699678 BLAKE2B e172b3f0bb3c1dfdaa734fd76581758a5d51bb9abb9c038f9ae5dfa6de45ae0eaaecab443aa113b08f8c26b44b1b1ed684a85882732bffa42548029f80f4c1be SHA512 d424079e34207e3d24383a2bea70a07ded40714982a6767174d2b2cb208cd94feab5ef12157accae915b8e404e5773a7547aaef65f06b44dc3cc09c6a64d5a11
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.47.ebuild b/net-nds/openldap/openldap-2.4.47.ebuild
new file mode 100644
index 00000000000..1f5e9a429ea
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.47.ebuild
@@ -0,0 +1,896 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit db-use flag-o-matic multilib multilib-minimal ssl-cert eapi7-ver toolchain-funcs autotools user systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="http://www.OpenLDAP.org/"
+
+# mirrors are mostly not working, using canonical URI
+SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
+		 mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+REQUIRED_USE="cxx? ( sasl )
+	?? ( gnutls libressl )
+	pbkdf2? ( ssl )
+	test? ( berkdb )
+	?? ( test minimal )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+CDEPEND="
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
+			libressl? ( dev-libs/libressl:=[${MULTILIB_USEDEP}] )
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		slp? ( net-libs/openslp )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:= )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+"
+DEPEND="${CDEPEND}
+	sys-apps/groff"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
+	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in ${BDB_SLOTS} ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "${NEWVER}" ]] && break
+			done
+		fi
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]]&& [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		-i include/ldap_defaults.h || die
+
+	default
+	rm -r libraries/liblmdb || die
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+	popd &>/dev/null || die
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed \
+		-e 's|/bin/sh|/bin/bash|g' \
+		-i tests/scripts/* || die "sed failed"
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+	popd &>/dev/null || die
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
+			einfo "Using ${DBINCLUDE} for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			$(use_enable slp)
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	ECONF_SOURCE="${S}" \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+	popd &>/dev/null || die
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake CC="${CC}" CXX="${CXX}"
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+			popd &>/dev/null || die
+		fi
+
+		if use pbkdf2; then
+			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+			popd &>/dev/null || die
+		fi
+
+		if use sha2 ; then
+			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+			popd &>/dev/null || die
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		build_contrib_module "nops" "nops.c" "nops-overlay"
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		popd &>/dev/null || die
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests || die "make tests failed"
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED%/}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED%/}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED%/}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# If built without SLP, we don't need to be before avahi
+		if ! use slp ; then
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED%/}"/etc/init.d/slapd \
+				|| die
+		fi
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED%/}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
+		chmod 0755 "${EROOT}"var/run/openldap
+		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
+		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-02-22  1:42 Patrick McLean
  0 siblings, 0 replies; 187+ messages in thread
From: Patrick McLean @ 2019-02-22  1:42 UTC (permalink / raw
  To: gentoo-commits

commit:     21ea86933fb5c774a77edbe267fe34e1e1867a72
Author:     Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Fri Feb 22 01:42:12 2019 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Fri Feb 22 01:42:12 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21ea8693

net-nds/openldap: Revbump, fix libressl slot deps in 2.4.47

Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 .../openldap/{openldap-2.4.47.ebuild => openldap-2.4.47-r1.ebuild}  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.47.ebuild b/net-nds/openldap/openldap-2.4.47-r1.ebuild
similarity index 99%
rename from net-nds/openldap/openldap-2.4.47.ebuild
rename to net-nds/openldap/openldap-2.4.47-r1.ebuild
index b05c43ed9ff..e63077460b1 100644
--- a/net-nds/openldap/openldap-2.4.47.ebuild
+++ b/net-nds/openldap/openldap-2.4.47-r1.ebuild
@@ -47,7 +47,7 @@ CDEPEND="
 	ssl? (
 		!gnutls? (
 			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
-			libressl? ( dev-libs/libressl:=[${MULTILIB_USEDEP}] )
+			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
 		)
 		gnutls? (
 			>=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
@@ -66,7 +66,7 @@ CDEPEND="
 		perl? ( dev-lang/perl:=[-build(-)] )
 		samba? (
 			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl )
+			libressl? ( dev-libs/libressl:0= )
 		)
 		berkdb? (
 			<sys-libs/db-6.0:=
@@ -74,7 +74,7 @@ CDEPEND="
 			)
 		smbkrb5passwd? (
 			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:= )
+			libressl? ( dev-libs/libressl:0= )
 			kerberos? ( app-crypt/heimdal )
 			)
 		kerberos? (


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-04-27 20:28 David Seifert
  0 siblings, 0 replies; 187+ messages in thread
From: David Seifert @ 2019-04-27 20:28 UTC (permalink / raw
  To: gentoo-commits

commit:     ac9711d1ba3c62defd5560ca827c8959f68386f1
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 27 16:35:04 2019 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sat Apr 27 20:27:54 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac9711d1

net-nds/openldap: [QA] Fix USE=libressl semantics

Closes: https://bugs.gentoo.org/684004
Package-Manager: Portage-2.3.64, Repoman-2.3.12
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.45-r1.ebuild | 10 ++++++----
 net-nds/openldap/openldap-2.4.45.ebuild    | 12 +++++++-----
 net-nds/openldap/openldap-2.4.47-r1.ebuild |  5 ++---
 3 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.45-r1.ebuild b/net-nds/openldap/openldap-2.4.45-r1.ebuild
index 7d16acea025..027f4e6a258 100644
--- a/net-nds/openldap/openldap-2.4.45-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.45-r1.ebuild
@@ -29,7 +29,6 @@ IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
 IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
 
 REQUIRED_USE="cxx? ( sasl )
-	?? ( gnutls libressl )
 	pbkdf2? ( ssl )"
 
 # always list newer first
@@ -45,10 +44,13 @@ CDEPEND="
 	ssl? (
 		!gnutls? (
 			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
+			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
 		)
-		gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
-		libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
-		>=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] ) )
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
 	sasl? ( dev-libs/cyrus-sasl:= )
 	!minimal? (
 		sys-devel/libtool

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index 7f5cd3fc1bd..afafb6f7063 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="5"
@@ -29,7 +29,6 @@ IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
 IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
 
 REQUIRED_USE="cxx? ( sasl )
-	?? ( gnutls libressl )
 	pbkdf2? ( ssl )"
 
 # always list newer first
@@ -45,10 +44,13 @@ CDEPEND="
 	ssl? (
 		!gnutls? (
 			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
+			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
 		)
-		gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
-		libressl? ( dev-libs/libressl[${MULTILIB_USEDEP}] )
-		>=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] ) )
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
 	sasl? ( dev-libs/cyrus-sasl:= )
 	!minimal? (
 		sys-devel/libtool

diff --git a/net-nds/openldap/openldap-2.4.47-r1.ebuild b/net-nds/openldap/openldap-2.4.47-r1.ebuild
index e63077460b1..5b6b5239e46 100644
--- a/net-nds/openldap/openldap-2.4.47-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.47-r1.ebuild
@@ -29,7 +29,6 @@ IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
 IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
 
 REQUIRED_USE="cxx? ( sasl )
-	?? ( gnutls libressl )
 	pbkdf2? ( ssl )
 	test? ( berkdb )
 	?? ( test minimal )"
@@ -50,8 +49,8 @@ CDEPEND="
 			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
 		)
 		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}]
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
 		)
 	)
 	sasl? ( dev-libs/cyrus-sasl:= )


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-04-28 10:48 Lars Wendler
  0 siblings, 0 replies; 187+ messages in thread
From: Lars Wendler @ 2019-04-28 10:48 UTC (permalink / raw
  To: gentoo-commits

commit:     fc7b17c0e890b7cf02754aba8c99602134a84b6d
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 28 10:48:31 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sun Apr 28 10:48:44 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc7b17c0

net-nds/openldap: Minor style fix.

Package-Manager: Portage-2.3.65, Repoman-2.3.12
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.47-r1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.47-r1.ebuild b/net-nds/openldap/openldap-2.4.47-r1.ebuild
index 5b6b5239e46..942ddca8b1f 100644
--- a/net-nds/openldap/openldap-2.4.47-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.47-r1.ebuild
@@ -272,7 +272,7 @@ openldap_find_versiontags() {
 			eerror "	against	${NEWVER} and your database may be inaccessible."
 			echo
 			fail=1
-		elif [[ -n "${OLDVER}" ]]&& [[ -z "${NEWVER}" ]]; then
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
 			eerror "	Your existing version of OpenLDAP was built against"
 			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
 			eerror "	built against any version and your database may be"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-05-05 18:41 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2019-05-05 18:41 UTC (permalink / raw
  To: gentoo-commits

commit:     aeb90647a4f34c743cd8b8364b51ba9d925cad39
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Sun May  5 18:31:56 2019 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Sun May  5 18:41:18 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aeb90647

net-nds/openldap: Add ~riscv keyword

Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
Package-Manager: Portage-2.3.62, Repoman-2.3.11

 net-nds/openldap/openldap-2.4.47-r1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.47-r1.ebuild b/net-nds/openldap/openldap-2.4.47-r1.ebuild
index 942ddca8b1f..2193b6d1a1e 100644
--- a/net-nds/openldap/openldap-2.4.47-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.47-r1.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-07-25  6:46 Lars Wendler
  0 siblings, 0 replies; 187+ messages in thread
From: Lars Wendler @ 2019-07-25  6:46 UTC (permalink / raw
  To: gentoo-commits

commit:     6bab9f27f4326e7981fe787f197f514ff86a3357
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 25 06:30:27 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Jul 25 06:46:04 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6bab9f27

net-nds/openldap: Bump to version 2.4.48

Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.4.48.ebuild | 903 ++++++++++++++++++++++++++++++++
 2 files changed, 904 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 138e3852a81..068956c4799 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,3 +1,4 @@
 DIST openldap-2.4.45.tgz 5672845 BLAKE2B e1f97553482a2e8630b62bc0f439af2484f1a2349a1a077382a124354424fe510ab55f32c073565b142d0c9318870fe31a2652268ebabd97d3afd8c833bc7aab SHA512 1c9fc84efed8998f107ce6e1c6be3f5466388241afdca0cb3847720c9def0bc263a2dbc15bf0f9112d1b4c391fd01e8531a4fb08c5532c30fb86924c08daedab
 DIST openldap-2.4.47.tgz 5699678 BLAKE2B e172b3f0bb3c1dfdaa734fd76581758a5d51bb9abb9c038f9ae5dfa6de45ae0eaaecab443aa113b08f8c26b44b1b1ed684a85882732bffa42548029f80f4c1be SHA512 d424079e34207e3d24383a2bea70a07ded40714982a6767174d2b2cb208cd94feab5ef12157accae915b8e404e5773a7547aaef65f06b44dc3cc09c6a64d5a11
+DIST openldap-2.4.48.tgz 5704883 BLAKE2B ef856ff0b22c9187e68e9c09583a176fe4c2ee1f5bfe6b169f03bc0058294170ec4d1aa1b164e28eecd2ef6bafab539c1b942b0bd74e93852205beeaff39aeef SHA512 cf694a415be0bd55cc7f606099da2ed461748efd276561944cd29d7f5a8252a9be799d8778fac2d4fa9f382731eb4ca48c6b85630cb58a3b8249843561ae8feb
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.48.ebuild b/net-nds/openldap/openldap-2.4.48.ebuild
new file mode 100644
index 00000000000..34edb0aee64
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.48.ebuild
@@ -0,0 +1,903 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools db-use eapi7-ver flag-o-matic multilib multilib-minimal ssl-cert toolchain-funcs user systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="http://www.OpenLDAP.org/"
+
+# mirrors are mostly not working, using canonical URI
+SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
+		 mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( berkdb )
+	?? ( test minimal )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+CDEPEND="
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
+			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		slp? ( net-libs/openslp )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+"
+DEPEND="${CDEPEND}
+	sys-apps/groff
+"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
+	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+
+	# bug #622464
+	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
+
+	# fix some compiler warnings
+	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in ${BDB_SLOTS} ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "${NEWVER}" ]] && break
+			done
+		fi
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		-i include/ldap_defaults.h || die
+
+	default
+	rm -r libraries/liblmdb || die
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+	popd &>/dev/null || die
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed \
+		-e 's|/bin/sh|/bin/bash|g' \
+		-i tests/scripts/* || die "sed failed"
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+	popd &>/dev/null || die
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
+			einfo "Using ${DBINCLUDE} for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			$(use_enable slp)
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	CONFIG_SHELL="/bin/bash" \
+	ECONF_SOURCE="${S}" \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+	popd &>/dev/null || die
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake CC="${CC}" CXX="${CXX}"
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+			popd &>/dev/null || die
+		fi
+
+		if use pbkdf2; then
+			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+			popd &>/dev/null || die
+		fi
+
+		if use sha2 ; then
+			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+			popd &>/dev/null || die
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		build_contrib_module "nops" "nops.c" "nops-overlay"
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		popd &>/dev/null || die
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests || die "make tests failed"
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED%/}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED%/}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED%/}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# If built without SLP, we don't need to be before avahi
+		if ! use slp ; then
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED%/}"/etc/init.d/slapd \
+				|| die
+		fi
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED%/}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
+		chmod 0755 "${EROOT}"var/run/openldap
+		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
+		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-09-29 19:26 Sergei Trofimovich
  0 siblings, 0 replies; 187+ messages in thread
From: Sergei Trofimovich @ 2019-09-29 19:26 UTC (permalink / raw
  To: gentoo-commits

commit:     fa93db3eaa9883cb8e4177b1936d1a85f408350c
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 29 19:24:35 2019 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Sep 29 19:24:35 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa93db3e

net-nds/openldap: stable 2.4.48 for ia64, bug #695504

Package-Manager: Portage-2.3.76, Repoman-2.3.17
RepoMan-Options: --include-arches="ia64"
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.48.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.48.ebuild b/net-nds/openldap/openldap-2.4.48.ebuild
index 34edb0aee64..9945a534128 100644
--- a/net-nds/openldap/openldap-2.4.48.ebuild
+++ b/net-nds/openldap/openldap-2.4.48.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-10-03  8:09 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2019-10-03  8:09 UTC (permalink / raw
  To: gentoo-commits

commit:     de46ba92a859458ca2057af41cd851918ba48e02
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  3 08:09:11 2019 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Thu Oct  3 08:09:11 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de46ba92

net-nds/openldap: s390 stable wrt bug #695504

Package-Manager: Portage-2.3.69, Repoman-2.3.16
RepoMan-Options: --include-arches="s390"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.48.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.48.ebuild b/net-nds/openldap/openldap-2.4.48.ebuild
index 2f672d92c74..c41f600be2f 100644
--- a/net-nds/openldap/openldap-2.4.48.ebuild
+++ b/net-nds/openldap/openldap-2.4.48.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ~ppc ~ppc64 ~riscv s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-10-03  8:12 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2019-10-03  8:12 UTC (permalink / raw
  To: gentoo-commits

commit:     c53ff473ad0fb49b72de5ea38848d9de35dcb47e
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  3 08:11:30 2019 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Thu Oct  3 08:11:30 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c53ff473

net-nds/openldap: ppc stable wrt bug #695504

Package-Manager: Portage-2.3.69, Repoman-2.3.16
RepoMan-Options: --include-arches="ppc"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.48.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.48.ebuild b/net-nds/openldap/openldap-2.4.48.ebuild
index c41f600be2f..32e088ea904 100644
--- a/net-nds/openldap/openldap-2.4.48.ebuild
+++ b/net-nds/openldap/openldap-2.4.48.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ~ppc ~ppc64 ~riscv s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ppc ~ppc64 ~riscv s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-10-03  8:14 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2019-10-03  8:14 UTC (permalink / raw
  To: gentoo-commits

commit:     e94563248d0f041942c263a334043d09b42128c9
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  3 08:13:56 2019 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Thu Oct  3 08:13:56 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9456324

net-nds/openldap: ppc64 stable wrt bug #695504

Package-Manager: Portage-2.3.69, Repoman-2.3.16
RepoMan-Options: --include-arches="ppc64"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.48.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.48.ebuild b/net-nds/openldap/openldap-2.4.48.ebuild
index 32e088ea904..fb3402fac18 100644
--- a/net-nds/openldap/openldap-2.4.48.ebuild
+++ b/net-nds/openldap/openldap-2.4.48.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ppc ~ppc64 ~riscv s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ppc ppc64 ~riscv s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-10-03  8:16 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2019-10-03  8:16 UTC (permalink / raw
  To: gentoo-commits

commit:     271736e0be1edf4e6a5f8b7c64908b797aff8062
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  3 08:16:04 2019 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Thu Oct  3 08:16:04 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=271736e0

net-nds/openldap: sparc stable wrt bug #695504

Package-Manager: Portage-2.3.69, Repoman-2.3.16
RepoMan-Options: --include-arches="sparc"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.48.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.48.ebuild b/net-nds/openldap/openldap-2.4.48.ebuild
index fb3402fac18..0addcca6e33 100644
--- a/net-nds/openldap/openldap-2.4.48.ebuild
+++ b/net-nds/openldap/openldap-2.4.48.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ppc ppc64 ~riscv s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ppc ppc64 ~riscv s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-10-11 15:37 Michał Górny
  0 siblings, 0 replies; 187+ messages in thread
From: Michał Górny @ 2019-10-11 15:37 UTC (permalink / raw
  To: gentoo-commits

commit:     7fd1a07e19135962bb1a1bf9e68212dd44c85faf
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 11 15:36:54 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Oct 11 15:36:54 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7fd1a07e

net-nds: Remove *-fbsd KEYWORDS

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.45-r1.ebuild | 2 +-
 net-nds/openldap/openldap-2.4.45.ebuild    | 2 +-
 net-nds/openldap/openldap-2.4.47-r1.ebuild | 2 +-
 net-nds/openldap/openldap-2.4.48.ebuild    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.45-r1.ebuild b/net-nds/openldap/openldap-2.4.45-r1.ebuild
index 027f4e6a258..8cb3e58f1d4 100644
--- a/net-nds/openldap/openldap-2.4.45-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.45-r1.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index afafb6f7063..344d168105b 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"

diff --git a/net-nds/openldap/openldap-2.4.47-r1.ebuild b/net-nds/openldap/openldap-2.4.47-r1.ebuild
index 2193b6d1a1e..8023c2ebaf9 100644
--- a/net-nds/openldap/openldap-2.4.47-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.47-r1.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"

diff --git a/net-nds/openldap/openldap-2.4.48.ebuild b/net-nds/openldap/openldap-2.4.48.ebuild
index 0addcca6e33..acf2b252ea0 100644
--- a/net-nds/openldap/openldap-2.4.48.ebuild
+++ b/net-nds/openldap/openldap-2.4.48.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ppc ppc64 ~riscv s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ia64 ~mips ppc ppc64 ~riscv s390 ~sh sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-11-01  8:44 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2019-11-01  8:44 UTC (permalink / raw
  To: gentoo-commits

commit:     10961eb90668f1925e3be5552c86aee72560043a
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri Nov  1 08:41:00 2019 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri Nov  1 08:44:39 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10961eb9

net-nds/openldap: Drop old

Package-Manager: Portage-2.3.76, Repoman-2.3.16
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest                  |   1 -
 net-nds/openldap/openldap-2.4.45-r1.ebuild | 882 ----------------------------
 net-nds/openldap/openldap-2.4.47-r1.ebuild | 901 -----------------------------
 3 files changed, 1784 deletions(-)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 068956c4799..0aba7c48052 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,4 +1,3 @@
 DIST openldap-2.4.45.tgz 5672845 BLAKE2B e1f97553482a2e8630b62bc0f439af2484f1a2349a1a077382a124354424fe510ab55f32c073565b142d0c9318870fe31a2652268ebabd97d3afd8c833bc7aab SHA512 1c9fc84efed8998f107ce6e1c6be3f5466388241afdca0cb3847720c9def0bc263a2dbc15bf0f9112d1b4c391fd01e8531a4fb08c5532c30fb86924c08daedab
-DIST openldap-2.4.47.tgz 5699678 BLAKE2B e172b3f0bb3c1dfdaa734fd76581758a5d51bb9abb9c038f9ae5dfa6de45ae0eaaecab443aa113b08f8c26b44b1b1ed684a85882732bffa42548029f80f4c1be SHA512 d424079e34207e3d24383a2bea70a07ded40714982a6767174d2b2cb208cd94feab5ef12157accae915b8e404e5773a7547aaef65f06b44dc3cc09c6a64d5a11
 DIST openldap-2.4.48.tgz 5704883 BLAKE2B ef856ff0b22c9187e68e9c09583a176fe4c2ee1f5bfe6b169f03bc0058294170ec4d1aa1b164e28eecd2ef6bafab539c1b942b0bd74e93852205beeaff39aeef SHA512 cf694a415be0bd55cc7f606099da2ed461748efd276561944cd29d7f5a8252a9be799d8778fac2d4fa9f382731eb4ca48c6b85630cb58a3b8249843561ae8feb
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.45-r1.ebuild b/net-nds/openldap/openldap-2.4.45-r1.ebuild
deleted file mode 100644
index 8cb3e58f1d4..00000000000
--- a/net-nds/openldap/openldap-2.4.45-r1.ebuild
+++ /dev/null
@@ -1,882 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-inherit db-use eutils flag-o-matic multilib multilib-minimal ssl-cert versionator toolchain-funcs autotools user systemd
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="http://www.OpenLDAP.org/"
-
-# mirrors are mostly not working, using canonical URI
-SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
-		 mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-CDEPEND="
-	ssl? (
-		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
-			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		sys-devel/libtool
-		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.18:=
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)"
-DEPEND="${CDEPEND}
-	sys-apps/groff"
-RDEPEND="${CDEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	openldap_datadirs=""
-	if [ -f "${EROOT}"/etc/openldap/slapd.conf ]; then
-		openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${EROOT}/etc/openldap/slapd.conf)"
-	fi
-	openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs}; do
-		CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
-		CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
-		if [ -d ${CURRENT_TAGDIR} ] &&	[ ${openldap_found_tag} == 0 ] ; then
-			einfo "- Checking ${each}..."
-			if [ -r ${CURRENT_TAG} ] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source ${CURRENT_TAG}
-				if [ "${OLDPF}" == "" ] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
-
-				[ $(openldap_filecount ${CURRENT_TAGDIR}) -gt 0 ] && have_files=1
-
-				# are we on the same branch?
-				if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[ $(openldap_filecount ${each}) -gt 0 ] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[ "${have_files}" == "1" ] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH=${EROOT}/usr/$(get_libdir)/openldap/slapd
-	if [ "${have_files}" == "1" -a -f "${SLAPD_PATH}" ]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in $BDB_SLOTS ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "$NEWVER" ]] && break
-			done
-		fi
-		local fail=0
-		if [ -z "${OLDVER}" -a -z "${NEWVER}" ]; then
-			:
-			# Nothing wrong here.
-		elif [ -z "${OLDVER}" -a -n "${NEWVER}" ]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [ -n "${OLDVER}" -a -z "${NEWVER}" ]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [ "${OLDVER}" != "${NEWVER}" ]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[ "${fail}" == "1" ] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [ "${FORCE_UPGRADE}" != "1" ]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-
-	# The user/group are only used for running daemons which are
-	# disabled in minimal builds, so elide the accounts too.
-	if ! use minimal ; then
-		enewgroup ldap 439
-		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		"${S}"/include/ldap_defaults.h
-
-	epatch "${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	epatch \
-		"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \
-		"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	epatch "${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	epatch "${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	epatch "${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	epatch "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	epatch "${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# bug #622464
-	epatch "${FILESDIR}"/${PN}-2.4.45-libressl.patch
-
-	# unbundle lmdb
-	epatch "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-	rm -rf "${S}"/libraries/liblmdb
-
-	epatch_user
-
-	cd "${S}"/build || die
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed -i \
-		-e 's|/bin/sh|/bin/bash|g' \
-		"${S}"/tests/scripts/* || die "sed failed"
-
-	cd "${S}" || die
-
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	cd "${S}/contrib/slapd-modules/$1" || die
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(echo "SLAPD_OVER_${1}" | LC_ALL=C tr '[:lower:]' '[:upper:]')"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-}
-
-src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir $BDB_SLOTS)
-			einfo "Using $DBINCLUDE for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			$(use_enable slp)
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	ECONF_SOURCE=${S} \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	cd "${BUILD_DIR}/contrib/ldapc++" || die
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake \
-				CC="${CC}" CXX="${CXX}"
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			cd "${S}/contrib/slapd-modules/passwd" || die
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-		fi
-
-		if use pbkdf2; then
-			cd "${S}/contrib/slapd-modules/passwd/pbkdf2" || die
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-		fi
-
-		if use sha2 ; then
-			cd "${S}/contrib/slapd-modules/passwd/sha2" || die
-			einfo "Compiling contrib-module: pw-sha2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o sha2.lo \
-				-c sha2.c || die "compiling pw-sha2 failed"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o slapd-sha2.lo \
-				-c slapd-sha2.c || die "compiling pw-sha2 failed"
-			einfo "Linking contrib-module: pw-sha2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-sha2.la \
-				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		cd "${S}/contrib/slapd-modules/passwd" || die
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		build_contrib_module "nops" "nops.c" "nops-overlay"
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		# build slapi-plugins
-		cd "${S}/contrib/slapi-plugins/addrdnvalues" || die
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests || die "make tests failed"
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${ED}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default
-		eend
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-		use slp \
-			|| sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"etc/init.d/slapd
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED}"usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README  allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins  */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	use static-libs || prune_libtool_files --all
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
-		chmod 0755 "${EROOT}"var/run/openldap
-		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
-		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}

diff --git a/net-nds/openldap/openldap-2.4.47-r1.ebuild b/net-nds/openldap/openldap-2.4.47-r1.ebuild
deleted file mode 100644
index 8023c2ebaf9..00000000000
--- a/net-nds/openldap/openldap-2.4.47-r1.ebuild
+++ /dev/null
@@ -1,901 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit db-use flag-o-matic multilib multilib-minimal ssl-cert eapi7-ver toolchain-funcs autotools user systemd
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="http://www.OpenLDAP.org/"
-
-# mirrors are mostly not working, using canonical URI
-SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
-		 mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( berkdb )
-	?? ( test minimal )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-CDEPEND="
-	ssl? (
-		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
-			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		sys-devel/libtool
-		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.18:=
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)
-"
-DEPEND="${CDEPEND}
-	sys-apps/groff"
-RDEPEND="${CDEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
-	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# unbundle lmdb
-	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-
-	# bug #622464
-	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
-
-	# fix some compiler warnings
-	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in ${BDB_SLOTS} ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "${NEWVER}" ]] && break
-			done
-		fi
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-
-	# The user/group are only used for running daemons which are
-	# disabled in minimal builds, so elide the accounts too.
-	if ! use minimal ; then
-		enewgroup ldap 439
-		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		-i include/ldap_defaults.h || die
-
-	default
-	rm -r libraries/liblmdb || die
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-	popd &>/dev/null || die
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed \
-		-e 's|/bin/sh|/bin/bash|g' \
-		-i tests/scripts/* || die "sed failed"
-
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-	popd &>/dev/null || die
-}
-
-src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
-			einfo "Using ${DBINCLUDE} for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			$(use_enable slp)
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	ECONF_SOURCE="${S}" \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-	popd &>/dev/null || die
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake CC="${CC}" CXX="${CXX}"
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-			popd &>/dev/null || die
-		fi
-
-		if use pbkdf2; then
-			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-			popd &>/dev/null || die
-		fi
-
-		if use sha2 ; then
-			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
-			einfo "Compiling contrib-module: pw-sha2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o sha2.lo \
-				-c sha2.c || die "compiling pw-sha2 failed"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o slapd-sha2.lo \
-				-c slapd-sha2.c || die "compiling pw-sha2 failed"
-			einfo "Linking contrib-module: pw-sha2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-sha2.la \
-				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
-			popd &>/dev/null || die
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		build_contrib_module "nops" "nops.c" "nops-overlay"
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		popd &>/dev/null || die
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests || die "make tests failed"
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED%/}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED%/}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${ED%/}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-		eend
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-		if ! use slp ; then
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED%/}"/etc/init.d/slapd \
-				|| die
-		fi
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED%/}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README  allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins  */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
-		chmod 0755 "${EROOT}"var/run/openldap
-		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
-		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-11-01 11:09 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2019-11-01 11:09 UTC (permalink / raw
  To: gentoo-commits

commit:     9ab64bff83a8780b6aff820d506df79dd27031a7
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri Nov  1 11:09:34 2019 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri Nov  1 11:09:34 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ab64bff

net-nds/openldap: arm stable wrt bug #695504

Package-Manager: Portage-2.3.76, Repoman-2.3.16
RepoMan-Options: --include-arches="arm"
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.48.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.48.ebuild b/net-nds/openldap/openldap-2.4.48.ebuild
index c8fa5b950ca..a21942c9d28 100644
--- a/net-nds/openldap/openldap-2.4.48.ebuild
+++ b/net-nds/openldap/openldap-2.4.48.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 hppa ia64 ~mips ppc ppc64 ~riscv s390 ~sh sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~riscv s390 ~sh sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-11-08 15:08 Aaron Bauman
  0 siblings, 0 replies; 187+ messages in thread
From: Aaron Bauman @ 2019-11-08 15:08 UTC (permalink / raw
  To: gentoo-commits

commit:     7f4cd03dc18ff72110ad95453cd1485172fb9bdf
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Fri Nov  8 15:08:23 2019 +0000
Commit:     Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Fri Nov  8 15:08:46 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f4cd03d

net-nds/openldap: arm64 stable (bug #695504)

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Package-Manager: Portage-2.3.78, Repoman-2.3.17

 net-nds/openldap/openldap-2.4.48.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.48.ebuild b/net-nds/openldap/openldap-2.4.48.ebuild
index a21942c9d28..7f6afec3f9a 100644
--- a/net-nds/openldap/openldap-2.4.48.ebuild
+++ b/net-nds/openldap/openldap-2.4.48.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~riscv s390 ~sh sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~riscv s390 ~sh sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-11-09 22:55 Matt Turner
  0 siblings, 0 replies; 187+ messages in thread
From: Matt Turner @ 2019-11-09 22:55 UTC (permalink / raw
  To: gentoo-commits

commit:     6ed9a6120a7b2c0762de0845a0cfca681bbcef57
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Sat Nov  9 22:55:13 2019 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sat Nov  9 22:55:13 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ed9a612

net-nds/openldap-2.4.48: alpha stable, bug 695504

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.48.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.48.ebuild b/net-nds/openldap/openldap-2.4.48.ebuild
index 7f6afec3f9a..ba833c3f7a0 100644
--- a/net-nds/openldap/openldap-2.4.48.ebuild
+++ b/net-nds/openldap/openldap-2.4.48.ebuild
@@ -18,7 +18,7 @@ SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~riscv s390 ~sh sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~riscv s390 ~sh sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2019-12-11 14:18 Michał Górny
  0 siblings, 0 replies; 187+ messages in thread
From: Michał Górny @ 2019-12-11 14:18 UTC (permalink / raw
  To: gentoo-commits

commit:     c2e5b56197a5aebc6f37f0dc1d8af846d1976c90
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 11 14:16:21 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Dec 11 14:18:25 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2e5b561

net-nds/openldap: [QA] Fix MissingTestRestrict

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.48.ebuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net-nds/openldap/openldap-2.4.48.ebuild b/net-nds/openldap/openldap-2.4.48.ebuild
index 36678c333b5..4a06584e799 100644
--- a/net-nds/openldap/openldap-2.4.48.ebuild
+++ b/net-nds/openldap/openldap-2.4.48.ebuild
@@ -28,6 +28,7 @@ IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
 IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
 IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
 
+RESTRICT="!test? ( test )"
 REQUIRED_USE="cxx? ( sasl )
 	pbkdf2? ( ssl )
 	test? ( berkdb )


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-02-12 15:22 David Seifert
  0 siblings, 0 replies; 187+ messages in thread
From: David Seifert @ 2020-02-12 15:22 UTC (permalink / raw
  To: gentoo-commits

commit:     c56d91ea91ca8634761df46b5fa43b4b338c3f67
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 12 15:22:29 2020 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Wed Feb 12 15:22:29 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c56d91ea

net-nds/openldap: [QA] inherit preserve-libs.eclass directly

Package-Manager: Portage-2.3.88, Repoman-2.3.20
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.45.ebuild | 2 +-
 net-nds/openldap/openldap-2.4.48.ebuild | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
index f382794bfe1..4d11c27b76e 100644
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ b/net-nds/openldap/openldap-2.4.45.ebuild
@@ -3,7 +3,7 @@
 
 EAPI="5"
 
-inherit db-use eutils flag-o-matic multilib multilib-minimal ssl-cert versionator toolchain-funcs autotools user systemd
+inherit db-use eutils flag-o-matic multilib multilib-minimal preserve-libs ssl-cert versionator toolchain-funcs autotools user systemd
 
 BIS_PN=rfc2307bis.schema
 BIS_PV=20140524

diff --git a/net-nds/openldap/openldap-2.4.48.ebuild b/net-nds/openldap/openldap-2.4.48.ebuild
index 8b0fd4b02e9..2c74c836815 100644
--- a/net-nds/openldap/openldap-2.4.48.ebuild
+++ b/net-nds/openldap/openldap-2.4.48.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=6
 
-inherit autotools db-use eapi7-ver flag-o-matic multilib multilib-minimal ssl-cert toolchain-funcs user systemd
+inherit autotools db-use eapi7-ver flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs user systemd
 
 BIS_PN=rfc2307bis.schema
 BIS_PV=20140524


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-02-12 16:38 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-02-12 16:38 UTC (permalink / raw
  To: gentoo-commits

commit:     79afa36ff4994a224a4750bac21e31c718282e0d
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 12 16:24:56 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Wed Feb 12 16:38:23 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79afa36f

net-nds/openldap: Version bump (v2.4.49)

Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.4.49.ebuild | 901 ++++++++++++++++++++++++++++++++
 2 files changed, 902 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 0aba7c48052..ed0cf9a5574 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,3 +1,4 @@
 DIST openldap-2.4.45.tgz 5672845 BLAKE2B e1f97553482a2e8630b62bc0f439af2484f1a2349a1a077382a124354424fe510ab55f32c073565b142d0c9318870fe31a2652268ebabd97d3afd8c833bc7aab SHA512 1c9fc84efed8998f107ce6e1c6be3f5466388241afdca0cb3847720c9def0bc263a2dbc15bf0f9112d1b4c391fd01e8531a4fb08c5532c30fb86924c08daedab
 DIST openldap-2.4.48.tgz 5704883 BLAKE2B ef856ff0b22c9187e68e9c09583a176fe4c2ee1f5bfe6b169f03bc0058294170ec4d1aa1b164e28eecd2ef6bafab539c1b942b0bd74e93852205beeaff39aeef SHA512 cf694a415be0bd55cc7f606099da2ed461748efd276561944cd29d7f5a8252a9be799d8778fac2d4fa9f382731eb4ca48c6b85630cb58a3b8249843561ae8feb
+DIST openldap-2.4.49.tgz 5704723 BLAKE2B ee777588d758f6704b0d38b90feb85b27e2307510a05d1d147324e9958a6f6fc5bc7dd521a1462971c3f707429ad38fab734f508d71fd88b447770e112e844a2 SHA512 99d1943d126b06e62865e31e5825fcff2cb15415f7f85ae4962fa0e7425bc3b58db5b9639150d7b09e3642c80257724c745e47c25ab4fcb1bba0ba771011dd49
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.49.ebuild b/net-nds/openldap/openldap-2.4.49.ebuild
new file mode 100644
index 00000000000..d7df0d817e0
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.49.ebuild
@@ -0,0 +1,901 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools db-use flag-o-matic multilib-minimal ssl-cert toolchain-funcs user systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="http://www.OpenLDAP.org/"
+
+# mirrors are mostly not working, using canonical URI
+SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
+		 mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt samba tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( berkdb )
+	?? ( test minimal )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
+			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
+	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+
+	# bug #622464
+	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
+
+	# fix some compiler warnings
+	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in ${BDB_SLOTS} ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "${NEWVER}" ]] && break
+			done
+		fi
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		-i include/ldap_defaults.h || die
+
+	default
+	rm -r libraries/liblmdb || die
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+	popd &>/dev/null || die
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed \
+		-e 's|/bin/sh|/bin/bash|g' \
+		-i tests/scripts/* || die "sed failed"
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+	popd &>/dev/null || die
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
+			einfo "Using ${DBINCLUDE} for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			--disable-slp
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	CONFIG_SHELL="/bin/bash" \
+	ECONF_SOURCE="${S}" \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+	popd &>/dev/null || die
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake CC="${CC}" CXX="${CXX}"
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+			popd &>/dev/null || die
+		fi
+
+		if use pbkdf2; then
+			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+			popd &>/dev/null || die
+		fi
+
+		if use sha2 ; then
+			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+			popd &>/dev/null || die
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		build_contrib_module "nops" "nops.c" "nops-overlay"
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		popd &>/dev/null || die
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED%/}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED%/}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED%/}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# If built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED%/}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED%/}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
+		chmod 0755 "${EROOT}"var/run/openldap
+		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
+		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-02-12 16:46 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-02-12 16:46 UTC (permalink / raw
  To: gentoo-commits

commit:     d68d4b6c21cf023d7c6a2544bb36fc9a41ab7440
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 12 16:46:25 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Wed Feb 12 16:46:25 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d68d4b6c

net-nds/openldap: Drop old

Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 -
 net-nds/openldap/openldap-2.4.45.ebuild | 882 --------------------------------
 2 files changed, 883 deletions(-)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index ed0cf9a5574..097a02925b8 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,4 +1,3 @@
-DIST openldap-2.4.45.tgz 5672845 BLAKE2B e1f97553482a2e8630b62bc0f439af2484f1a2349a1a077382a124354424fe510ab55f32c073565b142d0c9318870fe31a2652268ebabd97d3afd8c833bc7aab SHA512 1c9fc84efed8998f107ce6e1c6be3f5466388241afdca0cb3847720c9def0bc263a2dbc15bf0f9112d1b4c391fd01e8531a4fb08c5532c30fb86924c08daedab
 DIST openldap-2.4.48.tgz 5704883 BLAKE2B ef856ff0b22c9187e68e9c09583a176fe4c2ee1f5bfe6b169f03bc0058294170ec4d1aa1b164e28eecd2ef6bafab539c1b942b0bd74e93852205beeaff39aeef SHA512 cf694a415be0bd55cc7f606099da2ed461748efd276561944cd29d7f5a8252a9be799d8778fac2d4fa9f382731eb4ca48c6b85630cb58a3b8249843561ae8feb
 DIST openldap-2.4.49.tgz 5704723 BLAKE2B ee777588d758f6704b0d38b90feb85b27e2307510a05d1d147324e9958a6f6fc5bc7dd521a1462971c3f707429ad38fab734f508d71fd88b447770e112e844a2 SHA512 99d1943d126b06e62865e31e5825fcff2cb15415f7f85ae4962fa0e7425bc3b58db5b9639150d7b09e3642c80257724c745e47c25ab4fcb1bba0ba771011dd49
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.45.ebuild b/net-nds/openldap/openldap-2.4.45.ebuild
deleted file mode 100644
index 4d11c27b76e..00000000000
--- a/net-nds/openldap/openldap-2.4.45.ebuild
+++ /dev/null
@@ -1,882 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-inherit db-use eutils flag-o-matic multilib multilib-minimal preserve-libs ssl-cert versionator toolchain-funcs autotools user systemd
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="http://www.OpenLDAP.org/"
-
-# mirrors are mostly not working, using canonical URI
-SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
-		 mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-CDEPEND="
-	ssl? (
-		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
-			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		sys-devel/libtool
-		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.18:=
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl )
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl )
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)"
-DEPEND="${CDEPEND}
-	sys-apps/groff"
-RDEPEND="${CDEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	openldap_datadirs=""
-	if [ -f "${EROOT}"/etc/openldap/slapd.conf ]; then
-		openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${EROOT}/etc/openldap/slapd.conf)"
-	fi
-	openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs}; do
-		CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
-		CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
-		if [ -d ${CURRENT_TAGDIR} ] &&	[ ${openldap_found_tag} == 0 ] ; then
-			einfo "- Checking ${each}..."
-			if [ -r ${CURRENT_TAG} ] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source ${CURRENT_TAG}
-				if [ "${OLDPF}" == "" ] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
-
-				[ $(openldap_filecount ${CURRENT_TAGDIR}) -gt 0 ] && have_files=1
-
-				# are we on the same branch?
-				if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[ $(openldap_filecount ${each}) -gt 0 ] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[ "${have_files}" == "1" ] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH=${EROOT}/usr/$(get_libdir)/openldap/slapd
-	if [ "${have_files}" == "1" -a -f "${SLAPD_PATH}" ]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in $BDB_SLOTS ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "$NEWVER" ]] && break
-			done
-		fi
-		local fail=0
-		if [ -z "${OLDVER}" -a -z "${NEWVER}" ]; then
-			:
-			# Nothing wrong here.
-		elif [ -z "${OLDVER}" -a -n "${NEWVER}" ]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [ -n "${OLDVER}" -a -z "${NEWVER}" ]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [ "${OLDVER}" != "${NEWVER}" ]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[ "${fail}" == "1" ] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [ "${FORCE_UPGRADE}" != "1" ]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-
-	# The user/group are only used for running daemons which are
-	# disabled in minimal builds, so elide the accounts too.
-	if ! use minimal ; then
-		enewgroup ldap 439
-		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		"${S}"/include/ldap_defaults.h
-
-	epatch "${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	epatch \
-		"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \
-		"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	epatch "${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	epatch "${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	epatch "${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	epatch "${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	epatch "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	epatch "${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# bug #622464
-	epatch "${FILESDIR}"/${PN}-2.4.45-libressl.patch
-
-	# unbundle lmdb
-	epatch "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-	rm -rf "${S}"/libraries/liblmdb
-
-	epatch_user
-
-	cd "${S}"/build || die
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed -i \
-		-e 's|/bin/sh|/bin/bash|g' \
-		"${S}"/tests/scripts/* || die "sed failed"
-
-	cd "${S}" || die
-
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	cd "${S}/contrib/slapd-modules/$1" || die
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(echo "SLAPD_OVER_${1}" | LC_ALL=C tr '[:lower:]' '[:upper:]')"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-}
-
-src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir $BDB_SLOTS)
-			einfo "Using $DBINCLUDE for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			$(use_enable slp)
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	ECONF_SOURCE=${S} \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	cd "${BUILD_DIR}/contrib/ldapc++" || die
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake \
-				CC="${CC}" CXX="${CXX}"
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			cd "${S}/contrib/slapd-modules/passwd" || die
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-		fi
-
-		if use pbkdf2; then
-			cd "${S}/contrib/slapd-modules/passwd/pbkdf2" || die
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-		fi
-
-		if use sha2 ; then
-			cd "${S}/contrib/slapd-modules/passwd/sha2" || die
-			einfo "Compiling contrib-module: pw-sha2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o sha2.lo \
-				-c sha2.c || die "compiling pw-sha2 failed"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o slapd-sha2.lo \
-				-c slapd-sha2.c || die "compiling pw-sha2 failed"
-			einfo "Linking contrib-module: pw-sha2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-sha2.la \
-				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		cd "${S}/contrib/slapd-modules/passwd" || die
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		build_contrib_module "nops" "nops.c" "nops-overlay"
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		# build slapi-plugins
-		cd "${S}/contrib/slapi-plugins/addrdnvalues" || die
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${ED}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default
-		eend
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-		use slp \
-			|| sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"etc/init.d/slapd
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED}"usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README  allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins  */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	use static-libs || prune_libtool_files --all
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
-		chmod 0755 "${EROOT}"var/run/openldap
-		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
-		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-02-12 19:07 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-02-12 19:07 UTC (permalink / raw
  To: gentoo-commits

commit:     08af5d112cc3044e4068dddef1b40d8ba26c7ae8
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 12 19:06:29 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Wed Feb 12 19:06:59 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=08af5d11

net-nds/openldap: fix MissingSlash

Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.49.ebuild | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.49.ebuild b/net-nds/openldap/openldap-2.4.49.ebuild
index d7df0d817e0..6b4c5ba2ad9 100644
--- a/net-nds/openldap/openldap-2.4.49.ebuild
+++ b/net-nds/openldap/openldap-2.4.49.ebuild
@@ -866,7 +866,7 @@ pkg_postinst() {
 		# and a misconfiguration if multiple machines use the same key and cert.
 		if use ssl; then
 			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
 			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
 			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
 			ewarn "add 'TLS_REQCERT allow' if you want to use them."
@@ -881,11 +881,11 @@ pkg_postinst() {
 		fi
 
 		# These lines force the permissions of various content to be correct
-		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
+		use prefix || chown ldap:ldap "${EROOT}"/var/run/openldap
 		chmod 0755 "${EROOT}"var/run/openldap
-		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
 		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
-		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
 	fi
 
 	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-02-12 19:10 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-02-12 19:10 UTC (permalink / raw
  To: gentoo-commits

commit:     0e011a3d8d82660823bc1b0be32a937ea38a970c
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 12 19:10:45 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Wed Feb 12 19:10:53 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e011a3d

net-nds/openldap: fix UnnecessarySlashStrip

Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.49.ebuild | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.49.ebuild b/net-nds/openldap/openldap-2.4.49.ebuild
index 6b4c5ba2ad9..065d0375a0b 100644
--- a/net-nds/openldap/openldap-2.4.49.ebuild
+++ b/net-nds/openldap/openldap-2.4.49.ebuild
@@ -738,19 +738,19 @@ multilib_src_install() {
 		use prefix || fowners ldap:ldap /var/lib/openldap-data
 		fperms 0700 /var/lib/openldap-data
 
-		echo "OLDPF='${PF}'" > "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
 
 		# use our config
-		rm "${ED%/}"/etc/openldap/slapd.conf
+		rm "${ED}"/etc/openldap/slapd.conf
 		insinto /etc/openldap
 		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED%/}"/etc/openldap/slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
 
 		# populate with built backends
 		ebegin "populate config with built backends"
-		for x in "${ED%/}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
 			einfo "Adding $(basename ${x})"
 			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
 		done
@@ -775,7 +775,7 @@ multilib_src_install() {
 		# If built without SLP, we don't need to be before avahi
 			sed -i \
 				-e '/before/{s/avahi-daemon//g}' \
-				"${ED%/}"/etc/init.d/slapd \
+				"${ED}"/etc/init.d/slapd \
 				|| die
 
 		if use cxx ; then
@@ -809,7 +809,7 @@ multilib_src_install() {
 		for l in */*.la */*/*.la; do
 			[[ -e ${l} ]] || continue
 			"${lt}" --mode=install cp ${l} \
-				"${ED%/}"/usr/$(get_libdir)/openldap/openldap || \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
 				die "installing ${l} failed"
 		done
 


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-02-13  1:43 Thomas Deutschmann
  0 siblings, 0 replies; 187+ messages in thread
From: Thomas Deutschmann @ 2020-02-13  1:43 UTC (permalink / raw
  To: gentoo-commits

commit:     ce78373e5c527f494448c72ee04fc716f7f5b533
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 13 01:42:19 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Feb 13 01:43:03 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce78373e

net-nds/openldap: fix missing trailing slash

Package-Manager: Portage-2.3.88, Repoman-2.3.20
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 .../openldap/{openldap-2.4.49.ebuild => openldap-2.4.49-r1.ebuild}    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.49.ebuild b/net-nds/openldap/openldap-2.4.49-r1.ebuild
similarity index 99%
rename from net-nds/openldap/openldap-2.4.49.ebuild
rename to net-nds/openldap/openldap-2.4.49-r1.ebuild
index 065d0375a0b..8859904cbf5 100644
--- a/net-nds/openldap/openldap-2.4.49.ebuild
+++ b/net-nds/openldap/openldap-2.4.49-r1.ebuild
@@ -882,9 +882,9 @@ pkg_postinst() {
 
 		# These lines force the permissions of various content to be correct
 		use prefix || chown ldap:ldap "${EROOT}"/var/run/openldap
-		chmod 0755 "${EROOT}"var/run/openldap
+		chmod 0755 "${EROOT}"/var/run/openldap || die
 		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
 		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
 	fi
 


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-03-18  1:34 Patrick McLean
  0 siblings, 0 replies; 187+ messages in thread
From: Patrick McLean @ 2020-03-18  1:34 UTC (permalink / raw
  To: gentoo-commits

commit:     276da7075cf8a92fa965fda056817d68eeac7b40
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 18 01:25:56 2020 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Wed Mar 18 01:33:48 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=276da707

net-nds/openldap-2.4.49-r2: revbump, fix pkg_postinst, sec bug #641576

pkg_postinst currently die()-s if /var/run/openldap doesn't exist, this
breaks many cases (chroot build, first install etc).

Also disable build of nops module for security bug #641576

Bug: https://bugs.gentoo.org/641576
Package-Manager: Portage-2.3.94, Repoman-2.3.21
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.49-r2.ebuild | 903 +++++++++++++++++++++++++++++
 1 file changed, 903 insertions(+)

diff --git a/net-nds/openldap/openldap-2.4.49-r2.ebuild b/net-nds/openldap/openldap-2.4.49-r2.ebuild
new file mode 100644
index 00000000000..7dfac101a8b
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.49-r2.ebuild
@@ -0,0 +1,903 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools db-use flag-o-matic multilib-minimal ssl-cert toolchain-funcs user systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="http://www.OpenLDAP.org/"
+
+# mirrors are mostly not working, using canonical URI
+SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
+		 mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt samba tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( berkdb )
+	?? ( test minimal )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
+			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
+	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+
+	# bug #622464
+	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
+
+	# fix some compiler warnings
+	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in ${BDB_SLOTS} ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "${NEWVER}" ]] && break
+			done
+		fi
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		-i include/ldap_defaults.h || die
+
+	default
+	rm -r libraries/liblmdb || die
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+	popd &>/dev/null || die
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed \
+		-e 's|/bin/sh|/bin/bash|g' \
+		-i tests/scripts/* || die "sed failed"
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+	popd &>/dev/null || die
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
+			einfo "Using ${DBINCLUDE} for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			--disable-slp
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	CONFIG_SHELL="/bin/bash" \
+	ECONF_SOURCE="${S}" \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+	popd &>/dev/null || die
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake CC="${CC}" CXX="${CXX}"
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+			popd &>/dev/null || die
+		fi
+
+		if use pbkdf2; then
+			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+			popd &>/dev/null || die
+		fi
+
+		if use sha2 ; then
+			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+			popd &>/dev/null || die
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		popd &>/dev/null || die
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# If built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-05-02 23:15 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2020-05-02 23:15 UTC (permalink / raw
  To: gentoo-commits

commit:     4bf2f1709bbb8b087c56a2e01ce735d0dac58c2b
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sat May  2 23:12:26 2020 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat May  2 23:12:26 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4bf2f170

net-nds/openldap: bump for security CVE-2020-12243

Also update mirrors to use HTTPS/HTTPS, because upstream's official
download URL is a FTP site which seems to be broken.

Bug: https://bugs.gentoo.org/641576
Bug: https://bugs.gentoo.org/719960
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.4.50.ebuild | 907 ++++++++++++++++++++++++++++++++
 2 files changed, 908 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 097a02925b8..535c953b507 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,3 +1,4 @@
 DIST openldap-2.4.48.tgz 5704883 BLAKE2B ef856ff0b22c9187e68e9c09583a176fe4c2ee1f5bfe6b169f03bc0058294170ec4d1aa1b164e28eecd2ef6bafab539c1b942b0bd74e93852205beeaff39aeef SHA512 cf694a415be0bd55cc7f606099da2ed461748efd276561944cd29d7f5a8252a9be799d8778fac2d4fa9f382731eb4ca48c6b85630cb58a3b8249843561ae8feb
 DIST openldap-2.4.49.tgz 5704723 BLAKE2B ee777588d758f6704b0d38b90feb85b27e2307510a05d1d147324e9958a6f6fc5bc7dd521a1462971c3f707429ad38fab734f508d71fd88b447770e112e844a2 SHA512 99d1943d126b06e62865e31e5825fcff2cb15415f7f85ae4962fa0e7425bc3b58db5b9639150d7b09e3642c80257724c745e47c25ab4fcb1bba0ba771011dd49
+DIST openldap-2.4.50.tgz 5712635 BLAKE2B 6a7d864a44c411b82cf703585c4a81954a02497e8510c84e29070dd120da0181e8425fd2b8bb7616e42e6e26d0f06db5ffdf50fb1cd97943d23f9914eb4f1260 SHA512 f528043ff9de36f7b65d8816c9a9c24f0ac400041b2969965178ee6eae62c92a11af33a0a883e4954e5fff98a0738a9f9aa2faf5b385d21974754e045aab31ae
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
new file mode 100644
index 00000000000..0a53058f874
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.50.ebuild
@@ -0,0 +1,907 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools db-use flag-o-matic multilib-minimal ssl-cert toolchain-funcs user systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="http://www.OpenLDAP.org/"
+
+# upstream mirrors are mostly not working, using canonical URI
+SRC_URI="
+	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
+	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
+	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
+	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
+	mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt samba tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( berkdb )
+	?? ( test minimal )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
+			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
+	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+
+	# bug #622464
+	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
+
+	# fix some compiler warnings
+	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in ${BDB_SLOTS} ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "${NEWVER}" ]] && break
+			done
+		fi
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		-i include/ldap_defaults.h || die
+
+	default
+	rm -r libraries/liblmdb || die
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+	popd &>/dev/null || die
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed \
+		-e 's|/bin/sh|/bin/bash|g' \
+		-i tests/scripts/* || die "sed failed"
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+	popd &>/dev/null || die
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
+			einfo "Using ${DBINCLUDE} for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			--disable-slp
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	CONFIG_SHELL="/bin/bash" \
+	ECONF_SOURCE="${S}" \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+	popd &>/dev/null || die
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake CC="${CC}" CXX="${CXX}"
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+			popd &>/dev/null || die
+		fi
+
+		if use pbkdf2; then
+			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+			popd &>/dev/null || die
+		fi
+
+		if use sha2 ; then
+			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+			popd &>/dev/null || die
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		popd &>/dev/null || die
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# If built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-05-03 15:05 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2020-05-03 15:05 UTC (permalink / raw
  To: gentoo-commits

commit:     b97a5cd61046d68f54895d36769f2f31271fa098
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Sun May  3 15:05:47 2020 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Sun May  3 15:05:53 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b97a5cd6

net-nds/openldap: arm stable wrt bug #719960

Package-Manager: Portage-2.3.89, Repoman-2.3.20
RepoMan-Options: --include-arches="arm"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.50.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
index 0a53058f874..33f9c657f35 100644
--- a/net-nds/openldap/openldap-2.4.50.ebuild
+++ b/net-nds/openldap/openldap-2.4.50.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha ~amd64 arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-05-03 19:10 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2020-05-03 19:10 UTC (permalink / raw
  To: gentoo-commits

commit:     89ceef2faa161512e86a40cb96378ee4f669c5b5
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Sun May  3 19:10:46 2020 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Sun May  3 19:10:46 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89ceef2f

net-nds/openldap: amd64 stable wrt bug #719960

Package-Manager: Portage-2.3.89, Repoman-2.3.20
RepoMan-Options: --include-arches="amd64"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.50.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
index 33f9c657f35..4ce6f2aa05a 100644
--- a/net-nds/openldap/openldap-2.4.50.ebuild
+++ b/net-nds/openldap/openldap-2.4.50.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-05-03 19:12 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2020-05-03 19:12 UTC (permalink / raw
  To: gentoo-commits

commit:     9a5c6738578bb6f723f5e3fad9385cda6ec1cd61
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Sun May  3 19:12:21 2020 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Sun May  3 19:12:27 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a5c6738

net-nds/openldap: sparc stable wrt bug #719960

Package-Manager: Portage-2.3.89, Repoman-2.3.20
RepoMan-Options: --include-arches="sparc"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.50.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
index 4ce6f2aa05a..b9c4673dfde 100644
--- a/net-nds/openldap/openldap-2.4.50.ebuild
+++ b/net-nds/openldap/openldap-2.4.50.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-05-04  6:16 Mart Raudsepp
  0 siblings, 0 replies; 187+ messages in thread
From: Mart Raudsepp @ 2020-05-04  6:16 UTC (permalink / raw
  To: gentoo-commits

commit:     92cf3304d098af60ff05ee93d76d048eb4e54a3d
Author:     Sam James (sam_c) <sam <AT> cmpct <DOT> info>
AuthorDate: Sun May  3 12:15:08 2020 +0000
Commit:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Mon May  4 06:15:45 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92cf3304

net-nds/openldap: arm64 stable (bug #719960)

Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Sam James (sam_c) <sam <AT> cmpct.info>
Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.50.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
index b9c4673dfde..7f9d43f5a4b 100644
--- a/net-nds/openldap/openldap-2.4.50.ebuild
+++ b/net-nds/openldap/openldap-2.4.50.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-05-07 17:11 Sergei Trofimovich
  0 siblings, 0 replies; 187+ messages in thread
From: Sergei Trofimovich @ 2020-05-07 17:11 UTC (permalink / raw
  To: gentoo-commits

commit:     f6f8646ef0073971945697a84dabe02825141c80
Author:     Rolf Eike Beer <eike <AT> sf-mail <DOT> de>
AuthorDate: Thu May  7 15:56:22 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu May  7 17:10:55 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6f8646e

net-nds/openldap: stable 2.4.50 for hppa, bug #719960

Package-Manager: Portage-2.3.89, Repoman-2.3.20
RepoMan-Options: --include-arches="hppa"
Signed-off-by: Rolf Eike Beer <eike <AT> sf-mail.de>
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.50.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
index 7f9d43f5a4b..28801e5ffe3 100644
--- a/net-nds/openldap/openldap-2.4.50.ebuild
+++ b/net-nds/openldap/openldap-2.4.50.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-05-08 10:21 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-05-08 10:21 UTC (permalink / raw
  To: gentoo-commits

commit:     74532cd219f5f9f1adc8e9186f7159779a323354
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri May  8 10:18:33 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri May  8 10:21:31 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74532cd2

net-nds/openldap: x86 stable wrt bug #719960

Package-Manager: Portage-2.3.99, Repoman-2.3.22
RepoMan-Options: --include-arches="x86"
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.50.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
index f29d6544900..b112d931d8a 100644
--- a/net-nds/openldap/openldap-2.4.50.ebuild
+++ b/net-nds/openldap/openldap-2.4.50.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv s390 sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-05-08 10:21 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-05-08 10:21 UTC (permalink / raw
  To: gentoo-commits

commit:     71e5705e2331cbc48474363fc87a2487e74011eb
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri May  8 10:19:06 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri May  8 10:21:31 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71e5705e

net-nds/openldap: ppc stable wrt bug #719960

Package-Manager: Portage-2.3.99, Repoman-2.3.22
RepoMan-Options: --include-arches="ppc"
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.50.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
index b112d931d8a..253cc140284 100644
--- a/net-nds/openldap/openldap-2.4.50.ebuild
+++ b/net-nds/openldap/openldap-2.4.50.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ~ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-05-08 10:21 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-05-08 10:21 UTC (permalink / raw
  To: gentoo-commits

commit:     5d8aeaebf77372c370121167c694d9d8da7214da
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri May  8 10:17:20 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri May  8 10:21:31 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d8aeaeb

net-nds/openldap: s390 stable wrt bug #719960

Package-Manager: Portage-2.3.99, Repoman-2.3.22
RepoMan-Options: --include-arches="s390"
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.50.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
index 28801e5ffe3..f29d6544900 100644
--- a/net-nds/openldap/openldap-2.4.50.ebuild
+++ b/net-nds/openldap/openldap-2.4.50.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv s390 sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-05-08 10:21 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-05-08 10:21 UTC (permalink / raw
  To: gentoo-commits

commit:     dba9e43f67808bec3df18c99eeb76edd4d17cde3
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri May  8 10:21:05 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri May  8 10:21:32 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dba9e43f

net-nds/openldap: Security cleanup

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest                  |   2 -
 net-nds/openldap/openldap-2.4.48.ebuild    | 904 -----------------------------
 net-nds/openldap/openldap-2.4.49-r1.ebuild | 901 ----------------------------
 net-nds/openldap/openldap-2.4.49-r2.ebuild | 903 ----------------------------
 4 files changed, 2710 deletions(-)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 535c953b507..12dd61f09da 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,4 +1,2 @@
-DIST openldap-2.4.48.tgz 5704883 BLAKE2B ef856ff0b22c9187e68e9c09583a176fe4c2ee1f5bfe6b169f03bc0058294170ec4d1aa1b164e28eecd2ef6bafab539c1b942b0bd74e93852205beeaff39aeef SHA512 cf694a415be0bd55cc7f606099da2ed461748efd276561944cd29d7f5a8252a9be799d8778fac2d4fa9f382731eb4ca48c6b85630cb58a3b8249843561ae8feb
-DIST openldap-2.4.49.tgz 5704723 BLAKE2B ee777588d758f6704b0d38b90feb85b27e2307510a05d1d147324e9958a6f6fc5bc7dd521a1462971c3f707429ad38fab734f508d71fd88b447770e112e844a2 SHA512 99d1943d126b06e62865e31e5825fcff2cb15415f7f85ae4962fa0e7425bc3b58db5b9639150d7b09e3642c80257724c745e47c25ab4fcb1bba0ba771011dd49
 DIST openldap-2.4.50.tgz 5712635 BLAKE2B 6a7d864a44c411b82cf703585c4a81954a02497e8510c84e29070dd120da0181e8425fd2b8bb7616e42e6e26d0f06db5ffdf50fb1cd97943d23f9914eb4f1260 SHA512 f528043ff9de36f7b65d8816c9a9c24f0ac400041b2969965178ee6eae62c92a11af33a0a883e4954e5fff98a0738a9f9aa2faf5b385d21974754e045aab31ae
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.48.ebuild b/net-nds/openldap/openldap-2.4.48.ebuild
deleted file mode 100644
index d25e104dc3e..00000000000
--- a/net-nds/openldap/openldap-2.4.48.ebuild
+++ /dev/null
@@ -1,904 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit autotools db-use eapi7-ver flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs user systemd
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="http://www.OpenLDAP.org/"
-
-# mirrors are mostly not working, using canonical URI
-SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
-		 mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba slp tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( berkdb )
-	?? ( test minimal )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-CDEPEND="
-	ssl? (
-		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
-			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		sys-devel/libtool
-		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.18:=
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		slp? ( net-libs/openslp )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)
-"
-DEPEND="${CDEPEND}
-	sys-apps/groff
-"
-RDEPEND="${CDEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
-	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# unbundle lmdb
-	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-
-	# bug #622464
-	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
-
-	# fix some compiler warnings
-	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in ${BDB_SLOTS} ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "${NEWVER}" ]] && break
-			done
-		fi
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-
-	# The user/group are only used for running daemons which are
-	# disabled in minimal builds, so elide the accounts too.
-	if ! use minimal ; then
-		enewgroup ldap 439
-		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		-i include/ldap_defaults.h || die
-
-	default
-	rm -r libraries/liblmdb || die
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-	popd &>/dev/null || die
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed \
-		-e 's|/bin/sh|/bin/bash|g' \
-		-i tests/scripts/* || die "sed failed"
-
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-	popd &>/dev/null || die
-}
-
-src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
-			einfo "Using ${DBINCLUDE} for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			$(use_enable slp)
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	CONFIG_SHELL="/bin/bash" \
-	ECONF_SOURCE="${S}" \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-	popd &>/dev/null || die
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake CC="${CC}" CXX="${CXX}"
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-			popd &>/dev/null || die
-		fi
-
-		if use pbkdf2; then
-			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-			popd &>/dev/null || die
-		fi
-
-		if use sha2 ; then
-			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
-			einfo "Compiling contrib-module: pw-sha2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o sha2.lo \
-				-c sha2.c || die "compiling pw-sha2 failed"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o slapd-sha2.lo \
-				-c slapd-sha2.c || die "compiling pw-sha2 failed"
-			einfo "Linking contrib-module: pw-sha2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-sha2.la \
-				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
-			popd &>/dev/null || die
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		build_contrib_module "nops" "nops.c" "nops-overlay"
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		popd &>/dev/null || die
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED%/}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED%/}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED%/}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${ED%/}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-		eend
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-		if ! use slp ; then
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED%/}"/etc/init.d/slapd \
-				|| die
-		fi
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED%/}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README  allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins  */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		use prefix || chown ldap:ldap "${EROOT}"var/run/openldap
-		chmod 0755 "${EROOT}"var/run/openldap
-		use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default}
-		use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}

diff --git a/net-nds/openldap/openldap-2.4.49-r1.ebuild b/net-nds/openldap/openldap-2.4.49-r1.ebuild
deleted file mode 100644
index c82a49b7878..00000000000
--- a/net-nds/openldap/openldap-2.4.49-r1.ebuild
+++ /dev/null
@@ -1,901 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools db-use flag-o-matic multilib-minimal ssl-cert toolchain-funcs user systemd
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="http://www.OpenLDAP.org/"
-
-# mirrors are mostly not working, using canonical URI
-SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
-		 mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( berkdb )
-	?? ( test minimal )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-COMMON_DEPEND="
-	ssl? (
-		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
-			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		sys-devel/libtool
-		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.18:=
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)
-"
-DEPEND="${COMMON_DEPEND}
-	sys-apps/groff
-"
-RDEPEND="${COMMON_DEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
-	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# unbundle lmdb
-	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-
-	# bug #622464
-	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
-
-	# fix some compiler warnings
-	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in ${BDB_SLOTS} ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "${NEWVER}" ]] && break
-			done
-		fi
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-
-	# The user/group are only used for running daemons which are
-	# disabled in minimal builds, so elide the accounts too.
-	if ! use minimal ; then
-		enewgroup ldap 439
-		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		-i include/ldap_defaults.h || die
-
-	default
-	rm -r libraries/liblmdb || die
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-	popd &>/dev/null || die
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed \
-		-e 's|/bin/sh|/bin/bash|g' \
-		-i tests/scripts/* || die "sed failed"
-
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-	popd &>/dev/null || die
-}
-
-src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
-			einfo "Using ${DBINCLUDE} for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			--disable-slp
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	CONFIG_SHELL="/bin/bash" \
-	ECONF_SOURCE="${S}" \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-	popd &>/dev/null || die
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake CC="${CC}" CXX="${CXX}"
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-			popd &>/dev/null || die
-		fi
-
-		if use pbkdf2; then
-			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-			popd &>/dev/null || die
-		fi
-
-		if use sha2 ; then
-			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
-			einfo "Compiling contrib-module: pw-sha2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o sha2.lo \
-				-c sha2.c || die "compiling pw-sha2 failed"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o slapd-sha2.lo \
-				-c slapd-sha2.c || die "compiling pw-sha2 failed"
-			einfo "Linking contrib-module: pw-sha2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-sha2.la \
-				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
-			popd &>/dev/null || die
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		build_contrib_module "nops" "nops.c" "nops-overlay"
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		popd &>/dev/null || die
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-		eend
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"/etc/init.d/slapd \
-				|| die
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README  allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins  */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		use prefix || chown ldap:ldap "${EROOT}"/var/run/openldap
-		chmod 0755 "${EROOT}"/var/run/openldap || die
-		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
-		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}

diff --git a/net-nds/openldap/openldap-2.4.49-r2.ebuild b/net-nds/openldap/openldap-2.4.49-r2.ebuild
deleted file mode 100644
index 21df99a4271..00000000000
--- a/net-nds/openldap/openldap-2.4.49-r2.ebuild
+++ /dev/null
@@ -1,903 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools db-use flag-o-matic multilib-minimal ssl-cert toolchain-funcs user systemd
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="http://www.OpenLDAP.org/"
-
-# mirrors are mostly not working, using canonical URI
-SRC_URI="ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${P}.tgz
-		 mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( berkdb )
-	?? ( test minimal )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-COMMON_DEPEND="
-	ssl? (
-		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
-			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		sys-devel/libtool
-		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.18:=
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)
-"
-DEPEND="${COMMON_DEPEND}
-	sys-apps/groff
-"
-RDEPEND="${COMMON_DEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
-	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# unbundle lmdb
-	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-
-	# bug #622464
-	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
-
-	# fix some compiler warnings
-	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in ${BDB_SLOTS} ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "${NEWVER}" ]] && break
-			done
-		fi
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-
-	# The user/group are only used for running daemons which are
-	# disabled in minimal builds, so elide the accounts too.
-	if ! use minimal ; then
-		enewgroup ldap 439
-		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		-i include/ldap_defaults.h || die
-
-	default
-	rm -r libraries/liblmdb || die
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-	popd &>/dev/null || die
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed \
-		-e 's|/bin/sh|/bin/bash|g' \
-		-i tests/scripts/* || die "sed failed"
-
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-	popd &>/dev/null || die
-}
-
-src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
-			einfo "Using ${DBINCLUDE} for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			--disable-slp
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	CONFIG_SHELL="/bin/bash" \
-	ECONF_SOURCE="${S}" \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-	popd &>/dev/null || die
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake CC="${CC}" CXX="${CXX}"
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-			popd &>/dev/null || die
-		fi
-
-		if use pbkdf2; then
-			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-			popd &>/dev/null || die
-		fi
-
-		if use sha2 ; then
-			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
-			einfo "Compiling contrib-module: pw-sha2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o sha2.lo \
-				-c sha2.c || die "compiling pw-sha2 failed"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o slapd-sha2.lo \
-				-c slapd-sha2.c || die "compiling pw-sha2 failed"
-			einfo "Linking contrib-module: pw-sha2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-sha2.la \
-				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
-			popd &>/dev/null || die
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		popd &>/dev/null || die
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-		eend
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"/etc/init.d/slapd \
-				|| die
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README  allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins  */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		if [[ -d "${EROOT}"/var/run/openldap ]]; then
-			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
-			chmod 0755 "${EROOT}"/var/run/openldap || die
-		fi
-		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
-		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-05-08 10:21 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-05-08 10:21 UTC (permalink / raw
  To: gentoo-commits

commit:     16ab2d6f67ff0a46baebf9723dc42dfe063455b9
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri May  8 10:19:32 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri May  8 10:21:32 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=16ab2d6f

net-nds/openldap: ppc64 stable wrt bug #719960

Package-Manager: Portage-2.3.99, Repoman-2.3.22
RepoMan-Options: --include-arches="ppc64"
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.50.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
index 253cc140284..378ca1d8094 100644
--- a/net-nds/openldap/openldap-2.4.50.ebuild
+++ b/net-nds/openldap/openldap-2.4.50.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ~ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-05-17 16:55 Aaron Bauman
  0 siblings, 0 replies; 187+ messages in thread
From: Aaron Bauman @ 2020-05-17 16:55 UTC (permalink / raw
  To: gentoo-commits

commit:     fa05b766a44c18baf2ed50d12801bd85af3db8dc
Author:     Alexey Sokolov <sokolov <AT> google <DOT> com>
AuthorDate: Fri May  8 14:56:09 2020 +0000
Commit:     Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Sun May 17 16:55:23 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa05b766

net-nds/openldap: update homepage

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Alexey Sokolov <sokolov <AT> google.com>
Closes: https://github.com/gentoo/gentoo/pull/15714
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.50.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
index 378ca1d8094..4fdf8de27ce 100644
--- a/net-nds/openldap/openldap-2.4.50.ebuild
+++ b/net-nds/openldap/openldap-2.4.50.ebuild
@@ -10,7 +10,7 @@ BIS_PV=20140524
 BIS_P="${BIS_PN}-${BIS_PV}"
 
 DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="http://www.OpenLDAP.org/"
+HOMEPAGE="https://www.OpenLDAP.org/"
 
 # upstream mirrors are mostly not working, using canonical URI
 SRC_URI="


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-08-26  7:38 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-08-26  7:38 UTC (permalink / raw
  To: gentoo-commits

commit:     cbb8a3ae3e023f2ef715cd597d5ac2d7661b209a
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 26 07:38:41 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Wed Aug 26 07:38:41 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cbb8a3ae

net-nds/openldap: Version bump (v2.4.51)

Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.4.51.ebuild | 907 ++++++++++++++++++++++++++++++++
 2 files changed, 908 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 12dd61f09da..b2582fe8395 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,2 +1,3 @@
 DIST openldap-2.4.50.tgz 5712635 BLAKE2B 6a7d864a44c411b82cf703585c4a81954a02497e8510c84e29070dd120da0181e8425fd2b8bb7616e42e6e26d0f06db5ffdf50fb1cd97943d23f9914eb4f1260 SHA512 f528043ff9de36f7b65d8816c9a9c24f0ac400041b2969965178ee6eae62c92a11af33a0a883e4954e5fff98a0738a9f9aa2faf5b385d21974754e045aab31ae
+DIST openldap-2.4.51.tgz 5876819 BLAKE2B 4d2459e79ad5f297d8f8be0d633f5e3f7ae93395f2f83ee0da055315b59d053892303b717b56a9e90cd32b7391b4178db13d0c93aec8cdc68543553d3cd8f930 SHA512 169483ec4f2b2728ab4b75e608f72dfa9cadfa524c477f9258c9580eb22d6c34e4c4422b58f222b6bf66a93fc713cb7b0682d12ecd4e6f95a3a7887e93347f1f
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.51.ebuild b/net-nds/openldap/openldap-2.4.51.ebuild
new file mode 100644
index 00000000000..d50405b7074
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.51.ebuild
@@ -0,0 +1,907 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools db-use flag-o-matic multilib-minimal ssl-cert toolchain-funcs user systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.OpenLDAP.org/"
+
+# upstream mirrors are mostly not working, using canonical URI
+SRC_URI="
+	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
+	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
+	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
+	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
+	mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt samba tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( berkdb )
+	?? ( test minimal )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
+			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
+	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+
+	# bug #622464
+	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
+
+	# fix some compiler warnings
+	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in ${BDB_SLOTS} ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "${NEWVER}" ]] && break
+			done
+		fi
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		-i include/ldap_defaults.h || die
+
+	default
+	rm -r libraries/liblmdb || die
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+	popd &>/dev/null || die
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed \
+		-e 's|/bin/sh|/bin/bash|g' \
+		-i tests/scripts/* || die "sed failed"
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+	popd &>/dev/null || die
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
+			einfo "Using ${DBINCLUDE} for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			--disable-slp
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	CONFIG_SHELL="/bin/bash" \
+	ECONF_SOURCE="${S}" \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+	popd &>/dev/null || die
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake CC="${CC}" CXX="${CXX}"
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+			popd &>/dev/null || die
+		fi
+
+		if use pbkdf2; then
+			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+			popd &>/dev/null || die
+		fi
+
+		if use sha2 ; then
+			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+			popd &>/dev/null || die
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		popd &>/dev/null || die
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# If built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-08-26 18:42 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-08-26 18:42 UTC (permalink / raw
  To: gentoo-commits

commit:     03efb9dea7e53280aa6399f545607122c2baa16a
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 26 18:42:03 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Wed Aug 26 18:42:36 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03efb9de

net-nds/openldap: inherit preserve-libs.eclass

Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.50.ebuild | 2 +-
 net-nds/openldap/openldap-2.4.51.ebuild | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
index 4fdf8de27ce..71320172f0b 100644
--- a/net-nds/openldap/openldap-2.4.50.ebuild
+++ b/net-nds/openldap/openldap-2.4.50.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit autotools db-use flag-o-matic multilib-minimal ssl-cert toolchain-funcs user systemd
+inherit autotools db-use flag-o-matic multilib-minimal ssl-cert preserve-libs toolchain-funcs user systemd
 
 BIS_PN=rfc2307bis.schema
 BIS_PV=20140524

diff --git a/net-nds/openldap/openldap-2.4.51.ebuild b/net-nds/openldap/openldap-2.4.51.ebuild
index d50405b7074..89a4da0e820 100644
--- a/net-nds/openldap/openldap-2.4.51.ebuild
+++ b/net-nds/openldap/openldap-2.4.51.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit autotools db-use flag-o-matic multilib-minimal ssl-cert toolchain-funcs user systemd
+inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs user systemd
 
 BIS_PN=rfc2307bis.schema
 BIS_PV=20140524


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-09-11  8:52 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-09-11  8:52 UTC (permalink / raw
  To: gentoo-commits

commit:     b8cb6a41a3f47bc036d41746cb25b58ff5b34e62
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 11 08:51:40 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri Sep 11 08:52:04 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b8cb6a41

net-nds/openldap: Drop old

Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 -
 net-nds/openldap/openldap-2.4.51.ebuild | 907 --------------------------------
 2 files changed, 908 deletions(-)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index bf08d5e73c6..94aff9a9fbf 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,4 +1,3 @@
 DIST openldap-2.4.50.tgz 5712635 BLAKE2B 6a7d864a44c411b82cf703585c4a81954a02497e8510c84e29070dd120da0181e8425fd2b8bb7616e42e6e26d0f06db5ffdf50fb1cd97943d23f9914eb4f1260 SHA512 f528043ff9de36f7b65d8816c9a9c24f0ac400041b2969965178ee6eae62c92a11af33a0a883e4954e5fff98a0738a9f9aa2faf5b385d21974754e045aab31ae
-DIST openldap-2.4.51.tgz 5876819 BLAKE2B 4d2459e79ad5f297d8f8be0d633f5e3f7ae93395f2f83ee0da055315b59d053892303b717b56a9e90cd32b7391b4178db13d0c93aec8cdc68543553d3cd8f930 SHA512 169483ec4f2b2728ab4b75e608f72dfa9cadfa524c477f9258c9580eb22d6c34e4c4422b58f222b6bf66a93fc713cb7b0682d12ecd4e6f95a3a7887e93347f1f
 DIST openldap-2.4.53.tgz 5883013 BLAKE2B 09d17d2a5438b09a4aa7f4a815e858d8b17ae7873580e5b3bc81d9569e97174703600472b9ecf79a28b7df561ba8214dfb6d08b467c823feeeae7d0cbdd37c6b SHA512 32dcbf18ffa53b3c2c5399f726c7a8970154d40fb88de85896d18ea2abd79c55ebe28fcf5fbfd52771f95561d70ab364db5f667fe2ec0e67b21e281f5112ec99
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.51.ebuild b/net-nds/openldap/openldap-2.4.51.ebuild
deleted file mode 100644
index 89a4da0e820..00000000000
--- a/net-nds/openldap/openldap-2.4.51.ebuild
+++ /dev/null
@@ -1,907 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs user systemd
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="https://www.OpenLDAP.org/"
-
-# upstream mirrors are mostly not working, using canonical URI
-SRC_URI="
-	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
-	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
-	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
-	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
-	mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( berkdb )
-	?? ( test minimal )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-COMMON_DEPEND="
-	ssl? (
-		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
-			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		sys-devel/libtool
-		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.18:=
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)
-"
-DEPEND="${COMMON_DEPEND}
-	sys-apps/groff
-"
-RDEPEND="${COMMON_DEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
-	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# unbundle lmdb
-	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-
-	# bug #622464
-	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
-
-	# fix some compiler warnings
-	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in ${BDB_SLOTS} ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "${NEWVER}" ]] && break
-			done
-		fi
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-
-	# The user/group are only used for running daemons which are
-	# disabled in minimal builds, so elide the accounts too.
-	if ! use minimal ; then
-		enewgroup ldap 439
-		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		-i include/ldap_defaults.h || die
-
-	default
-	rm -r libraries/liblmdb || die
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-	popd &>/dev/null || die
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed \
-		-e 's|/bin/sh|/bin/bash|g' \
-		-i tests/scripts/* || die "sed failed"
-
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-	popd &>/dev/null || die
-}
-
-src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
-			einfo "Using ${DBINCLUDE} for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			--disable-slp
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	CONFIG_SHELL="/bin/bash" \
-	ECONF_SOURCE="${S}" \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-	popd &>/dev/null || die
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake CC="${CC}" CXX="${CXX}"
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-			popd &>/dev/null || die
-		fi
-
-		if use pbkdf2; then
-			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-			popd &>/dev/null || die
-		fi
-
-		if use sha2 ; then
-			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
-			einfo "Compiling contrib-module: pw-sha2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o sha2.lo \
-				-c sha2.c || die "compiling pw-sha2 failed"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o slapd-sha2.lo \
-				-c slapd-sha2.c || die "compiling pw-sha2 failed"
-			einfo "Linking contrib-module: pw-sha2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-sha2.la \
-				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
-			popd &>/dev/null || die
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		popd &>/dev/null || die
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-		eend
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"/etc/init.d/slapd \
-				|| die
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README  allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins  */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		if [[ -d "${EROOT}"/var/run/openldap ]]; then
-			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
-			chmod 0755 "${EROOT}"/var/run/openldap || die
-		fi
-		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
-		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-09-11  8:52 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-09-11  8:52 UTC (permalink / raw
  To: gentoo-commits

commit:     208b69438db95d3f23b86c052a45dac02c184570
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 11 08:50:48 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri Sep 11 08:52:04 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=208b6943

net-nds/openldap: Version bump (v2.5.53)

Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.4.53.ebuild | 907 ++++++++++++++++++++++++++++++++
 2 files changed, 908 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index b2582fe8395..bf08d5e73c6 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,3 +1,4 @@
 DIST openldap-2.4.50.tgz 5712635 BLAKE2B 6a7d864a44c411b82cf703585c4a81954a02497e8510c84e29070dd120da0181e8425fd2b8bb7616e42e6e26d0f06db5ffdf50fb1cd97943d23f9914eb4f1260 SHA512 f528043ff9de36f7b65d8816c9a9c24f0ac400041b2969965178ee6eae62c92a11af33a0a883e4954e5fff98a0738a9f9aa2faf5b385d21974754e045aab31ae
 DIST openldap-2.4.51.tgz 5876819 BLAKE2B 4d2459e79ad5f297d8f8be0d633f5e3f7ae93395f2f83ee0da055315b59d053892303b717b56a9e90cd32b7391b4178db13d0c93aec8cdc68543553d3cd8f930 SHA512 169483ec4f2b2728ab4b75e608f72dfa9cadfa524c477f9258c9580eb22d6c34e4c4422b58f222b6bf66a93fc713cb7b0682d12ecd4e6f95a3a7887e93347f1f
+DIST openldap-2.4.53.tgz 5883013 BLAKE2B 09d17d2a5438b09a4aa7f4a815e858d8b17ae7873580e5b3bc81d9569e97174703600472b9ecf79a28b7df561ba8214dfb6d08b467c823feeeae7d0cbdd37c6b SHA512 32dcbf18ffa53b3c2c5399f726c7a8970154d40fb88de85896d18ea2abd79c55ebe28fcf5fbfd52771f95561d70ab364db5f667fe2ec0e67b21e281f5112ec99
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.53.ebuild b/net-nds/openldap/openldap-2.4.53.ebuild
new file mode 100644
index 00000000000..89a4da0e820
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.53.ebuild
@@ -0,0 +1,907 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs user systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.OpenLDAP.org/"
+
+# upstream mirrors are mostly not working, using canonical URI
+SRC_URI="
+	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
+	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
+	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
+	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
+	mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt samba tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( berkdb )
+	?? ( test minimal )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
+			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
+	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+
+	# bug #622464
+	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
+
+	# fix some compiler warnings
+	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in ${BDB_SLOTS} ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "${NEWVER}" ]] && break
+			done
+		fi
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+
+	# The user/group are only used for running daemons which are
+	# disabled in minimal builds, so elide the accounts too.
+	if ! use minimal ; then
+		enewgroup ldap 439
+		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		-i include/ldap_defaults.h || die
+
+	default
+	rm -r libraries/liblmdb || die
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+	popd &>/dev/null || die
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed \
+		-e 's|/bin/sh|/bin/bash|g' \
+		-i tests/scripts/* || die "sed failed"
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+	popd &>/dev/null || die
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
+			einfo "Using ${DBINCLUDE} for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			--disable-slp
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	CONFIG_SHELL="/bin/bash" \
+	ECONF_SOURCE="${S}" \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+	popd &>/dev/null || die
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake CC="${CC}" CXX="${CXX}"
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+			popd &>/dev/null || die
+		fi
+
+		if use pbkdf2; then
+			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+			popd &>/dev/null || die
+		fi
+
+		if use sha2 ; then
+			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+			popd &>/dev/null || die
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		popd &>/dev/null || die
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# If built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-09-25 19:22 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-09-25 19:22 UTC (permalink / raw
  To: gentoo-commits

commit:     e815726ad0189d4f3e974a6d717eea4e803de110
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 25 19:21:25 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri Sep 25 19:22:11 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e815726a

net-nds/openldap: add myself as maintainer

Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/metadata.xml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net-nds/openldap/metadata.xml b/net-nds/openldap/metadata.xml
index 6cea2f2e325..38186cd8f1b 100644
--- a/net-nds/openldap/metadata.xml
+++ b/net-nds/openldap/metadata.xml
@@ -1,6 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
+	<maintainer type="person">
+		<email>zlogene@gentoo.org</email>
+		<name>Mikle Kolyada</name>
+	</maintainer>
 	<maintainer type="project">
 		<email>ldap-bugs@gentoo.org</email>
 	</maintainer>


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-10-09 15:57 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-10-09 15:57 UTC (permalink / raw
  To: gentoo-commits

commit:     873d3aabf93c8b03ac7a2fdd17ea73b39f838676
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  9 15:56:15 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri Oct  9 15:57:05 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=873d3aab

net-nds/openldap: Do not hardcode bash

Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.50.ebuild | 6 +++---
 net-nds/openldap/openldap-2.4.53.ebuild | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
index 71320172f0b..2c5a8f5c18c 100644
--- a/net-nds/openldap/openldap-2.4.50.ebuild
+++ b/net-nds/openldap/openldap-2.4.50.ebuild
@@ -514,7 +514,7 @@ multilib_src_configure() {
 	done
 
 	tc-export AR CC CXX
-	CONFIG_SHELL="/bin/bash" \
+	CONFIG_SHELL="/bin/sh" \
 	ECONF_SOURCE="${S}" \
 	STRIP=/bin/true \
 	econf \
@@ -548,7 +548,7 @@ src_configure_cxx() {
 
 multilib_src_compile() {
 	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
 	local lt="${BUILD_DIR}/libtool"
 	export echo="echo"
 
@@ -730,7 +730,7 @@ multilib_src_test() {
 
 multilib_src_install() {
 	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
 
 	if ! use minimal && multilib_is_native_abi; then
 		# openldap modules go here

diff --git a/net-nds/openldap/openldap-2.4.53.ebuild b/net-nds/openldap/openldap-2.4.53.ebuild
index 89a4da0e820..759f1545776 100644
--- a/net-nds/openldap/openldap-2.4.53.ebuild
+++ b/net-nds/openldap/openldap-2.4.53.ebuild
@@ -514,7 +514,7 @@ multilib_src_configure() {
 	done
 
 	tc-export AR CC CXX
-	CONFIG_SHELL="/bin/bash" \
+	CONFIG_SHELL="/bin/sh" \
 	ECONF_SOURCE="${S}" \
 	STRIP=/bin/true \
 	econf \
@@ -548,7 +548,7 @@ src_configure_cxx() {
 
 multilib_src_compile() {
 	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
 	local lt="${BUILD_DIR}/libtool"
 	export echo="echo"
 
@@ -730,7 +730,7 @@ multilib_src_test() {
 
 multilib_src_install() {
 	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
 
 	if ! use minimal && multilib_is_native_abi; then
 		# openldap modules go here


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-10-18 15:12 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-10-18 15:12 UTC (permalink / raw
  To: gentoo-commits

commit:     d5bbf1b9473d59ab07f4d3cb57a18d0732cbc82e
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 18 15:11:17 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Sun Oct 18 15:12:16 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5bbf1b9

net-nds/openldap: migrate 2.4.53 to glep 81

Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 ...enldap-2.4.53.ebuild => openldap-2.4.53-r1.ebuild} | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.53.ebuild b/net-nds/openldap/openldap-2.4.53-r1.ebuild
similarity index 99%
rename from net-nds/openldap/openldap-2.4.53.ebuild
rename to net-nds/openldap/openldap-2.4.53-r1.ebuild
index 759f1545776..f8eedca45d4 100644
--- a/net-nds/openldap/openldap-2.4.53.ebuild
+++ b/net-nds/openldap/openldap-2.4.53-r1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs user systemd
+inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd
 
 BIS_PN=rfc2307bis.schema
 BIS_PV=20140524
@@ -93,7 +93,17 @@ DEPEND="${COMMON_DEPEND}
 RDEPEND="${COMMON_DEPEND}
 	selinux? ( sec-policy/selinux-ldap )
 "
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
 # for tracking versions
+
+BDEPEND="!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+)
+"
+
 OPENLDAP_VERSIONTAG=".version-tag"
 OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
 
@@ -347,13 +357,6 @@ pkg_setup() {
 	else
 		openldap_find_versiontags
 	fi
-
-	# The user/group are only used for running daemons which are
-	# disabled in minimal builds, so elide the accounts too.
-	if ! use minimal ; then
-		enewgroup ldap 439
-		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
-	fi
 }
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-10-18 15:12 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-10-18 15:12 UTC (permalink / raw
  To: gentoo-commits

commit:     fba1d2addfa09787a7122cc1f8d815934cc1ae14
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 18 15:09:31 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Sun Oct 18 15:12:16 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fba1d2ad

net-nds/openldap: Version bump (v2.4.54)

Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.4.54.ebuild | 910 ++++++++++++++++++++++++++++++++
 2 files changed, 911 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 94aff9a9fbf..4f0734c20c4 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,3 +1,4 @@
 DIST openldap-2.4.50.tgz 5712635 BLAKE2B 6a7d864a44c411b82cf703585c4a81954a02497e8510c84e29070dd120da0181e8425fd2b8bb7616e42e6e26d0f06db5ffdf50fb1cd97943d23f9914eb4f1260 SHA512 f528043ff9de36f7b65d8816c9a9c24f0ac400041b2969965178ee6eae62c92a11af33a0a883e4954e5fff98a0738a9f9aa2faf5b385d21974754e045aab31ae
 DIST openldap-2.4.53.tgz 5883013 BLAKE2B 09d17d2a5438b09a4aa7f4a815e858d8b17ae7873580e5b3bc81d9569e97174703600472b9ecf79a28b7df561ba8214dfb6d08b467c823feeeae7d0cbdd37c6b SHA512 32dcbf18ffa53b3c2c5399f726c7a8970154d40fb88de85896d18ea2abd79c55ebe28fcf5fbfd52771f95561d70ab364db5f667fe2ec0e67b21e281f5112ec99
+DIST openldap-2.4.54.tgz 5885717 BLAKE2B 804fec18146d673c78c414914fe37903976de6e1b0b1456f20c545665c9a78d15640e34cebfc4576d7781e67df377c33fed6de1deb984c2be2c9aeeaf4fcfacb SHA512 30cbe23f310f1901a0300ac0d123fc2e6fcc5bde8b15692f2fd8291d1f1e5b7e97426823eb1be9977a15d728fd175c8938c6790a57582a72d10be0b497c3ef5f
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.54.ebuild b/net-nds/openldap/openldap-2.4.54.ebuild
new file mode 100644
index 00000000000..f8eedca45d4
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.54.ebuild
@@ -0,0 +1,910 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.OpenLDAP.org/"
+
+# upstream mirrors are mostly not working, using canonical URI
+SRC_URI="
+	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
+	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
+	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
+	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
+	mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt samba tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( berkdb )
+	?? ( test minimal )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
+			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+# for tracking versions
+
+BDEPEND="!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+)
+"
+
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
+	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+
+	# bug #622464
+	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
+
+	# fix some compiler warnings
+	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in ${BDB_SLOTS} ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "${NEWVER}" ]] && break
+			done
+		fi
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		-i include/ldap_defaults.h || die
+
+	default
+	rm -r libraries/liblmdb || die
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+	popd &>/dev/null || die
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed \
+		-e 's|/bin/sh|/bin/bash|g' \
+		-i tests/scripts/* || die "sed failed"
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+	popd &>/dev/null || die
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
+			einfo "Using ${DBINCLUDE} for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			--disable-slp
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	CONFIG_SHELL="/bin/sh" \
+	ECONF_SOURCE="${S}" \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+	popd &>/dev/null || die
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake CC="${CC}" CXX="${CXX}"
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+			popd &>/dev/null || die
+		fi
+
+		if use pbkdf2; then
+			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+			popd &>/dev/null || die
+		fi
+
+		if use sha2 ; then
+			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+			popd &>/dev/null || die
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		popd &>/dev/null || die
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# If built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-10-28 10:05 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-10-28 10:05 UTC (permalink / raw
  To: gentoo-commits

commit:     66fc5aded9590a36972dd43f1e1ad22c26d84d8f
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 28 10:03:52 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Wed Oct 28 10:05:26 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66fc5ade

net-nds/openldap: mark stable

Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.53-r1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.53-r1.ebuild b/net-nds/openldap/openldap-2.4.53-r1.ebuild
index f8eedca45d4..ad2d09e1404 100644
--- a/net-nds/openldap/openldap-2.4.53-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.53-r1.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-10-28 10:05 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-10-28 10:05 UTC (permalink / raw
  To: gentoo-commits

commit:     9aa47c8ea320b4b10200165638a39c2b65fad3ce
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 28 10:04:53 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Wed Oct 28 10:05:27 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9aa47c8e

net-nds/openldap: Drop old

Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 -
 net-nds/openldap/openldap-2.4.50.ebuild | 907 --------------------------------
 2 files changed, 908 deletions(-)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 4f0734c20c4..a86662bb380 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,4 +1,3 @@
-DIST openldap-2.4.50.tgz 5712635 BLAKE2B 6a7d864a44c411b82cf703585c4a81954a02497e8510c84e29070dd120da0181e8425fd2b8bb7616e42e6e26d0f06db5ffdf50fb1cd97943d23f9914eb4f1260 SHA512 f528043ff9de36f7b65d8816c9a9c24f0ac400041b2969965178ee6eae62c92a11af33a0a883e4954e5fff98a0738a9f9aa2faf5b385d21974754e045aab31ae
 DIST openldap-2.4.53.tgz 5883013 BLAKE2B 09d17d2a5438b09a4aa7f4a815e858d8b17ae7873580e5b3bc81d9569e97174703600472b9ecf79a28b7df561ba8214dfb6d08b467c823feeeae7d0cbdd37c6b SHA512 32dcbf18ffa53b3c2c5399f726c7a8970154d40fb88de85896d18ea2abd79c55ebe28fcf5fbfd52771f95561d70ab364db5f667fe2ec0e67b21e281f5112ec99
 DIST openldap-2.4.54.tgz 5885717 BLAKE2B 804fec18146d673c78c414914fe37903976de6e1b0b1456f20c545665c9a78d15640e34cebfc4576d7781e67df377c33fed6de1deb984c2be2c9aeeaf4fcfacb SHA512 30cbe23f310f1901a0300ac0d123fc2e6fcc5bde8b15692f2fd8291d1f1e5b7e97426823eb1be9977a15d728fd175c8938c6790a57582a72d10be0b497c3ef5f
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
deleted file mode 100644
index 2c5a8f5c18c..00000000000
--- a/net-nds/openldap/openldap-2.4.50.ebuild
+++ /dev/null
@@ -1,907 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools db-use flag-o-matic multilib-minimal ssl-cert preserve-libs toolchain-funcs user systemd
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="https://www.OpenLDAP.org/"
-
-# upstream mirrors are mostly not working, using canonical URI
-SRC_URI="
-	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
-	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
-	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
-	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
-	mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( berkdb )
-	?? ( test minimal )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-COMMON_DEPEND="
-	ssl? (
-		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
-			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		sys-devel/libtool
-		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.18:=
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)
-"
-DEPEND="${COMMON_DEPEND}
-	sys-apps/groff
-"
-RDEPEND="${COMMON_DEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
-	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# unbundle lmdb
-	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-
-	# bug #622464
-	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
-
-	# fix some compiler warnings
-	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in ${BDB_SLOTS} ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "${NEWVER}" ]] && break
-			done
-		fi
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-
-	# The user/group are only used for running daemons which are
-	# disabled in minimal builds, so elide the accounts too.
-	if ! use minimal ; then
-		enewgroup ldap 439
-		enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		-i include/ldap_defaults.h || die
-
-	default
-	rm -r libraries/liblmdb || die
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-	popd &>/dev/null || die
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed \
-		-e 's|/bin/sh|/bin/bash|g' \
-		-i tests/scripts/* || die "sed failed"
-
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-	popd &>/dev/null || die
-}
-
-src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
-			einfo "Using ${DBINCLUDE} for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			--disable-slp
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	CONFIG_SHELL="/bin/sh" \
-	ECONF_SOURCE="${S}" \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-	popd &>/dev/null || die
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake CC="${CC}" CXX="${CXX}"
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-			popd &>/dev/null || die
-		fi
-
-		if use pbkdf2; then
-			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-			popd &>/dev/null || die
-		fi
-
-		if use sha2 ; then
-			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
-			einfo "Compiling contrib-module: pw-sha2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o sha2.lo \
-				-c sha2.c || die "compiling pw-sha2 failed"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o slapd-sha2.lo \
-				-c slapd-sha2.c || die "compiling pw-sha2 failed"
-			einfo "Linking contrib-module: pw-sha2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-sha2.la \
-				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
-			popd &>/dev/null || die
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		popd &>/dev/null || die
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-		eend
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"/etc/init.d/slapd \
-				|| die
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README  allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins  */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		if [[ -d "${EROOT}"/var/run/openldap ]]; then
-			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
-			chmod 0755 "${EROOT}"/var/run/openldap || die
-		fi
-		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
-		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-11-21 14:12 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-11-21 14:12 UTC (permalink / raw
  To: gentoo-commits

commit:     b738fc78d3c5145db818480ae47f5cdafc7026b2
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 21 14:12:06 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Sat Nov 21 14:12:45 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b738fc78

net-nds/openldap: Version bump (v2.4.56)

Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.4.56.ebuild | 910 ++++++++++++++++++++++++++++++++
 2 files changed, 911 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index a86662bb380..952cd961b19 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,3 +1,4 @@
 DIST openldap-2.4.53.tgz 5883013 BLAKE2B 09d17d2a5438b09a4aa7f4a815e858d8b17ae7873580e5b3bc81d9569e97174703600472b9ecf79a28b7df561ba8214dfb6d08b467c823feeeae7d0cbdd37c6b SHA512 32dcbf18ffa53b3c2c5399f726c7a8970154d40fb88de85896d18ea2abd79c55ebe28fcf5fbfd52771f95561d70ab364db5f667fe2ec0e67b21e281f5112ec99
 DIST openldap-2.4.54.tgz 5885717 BLAKE2B 804fec18146d673c78c414914fe37903976de6e1b0b1456f20c545665c9a78d15640e34cebfc4576d7781e67df377c33fed6de1deb984c2be2c9aeeaf4fcfacb SHA512 30cbe23f310f1901a0300ac0d123fc2e6fcc5bde8b15692f2fd8291d1f1e5b7e97426823eb1be9977a15d728fd175c8938c6790a57582a72d10be0b497c3ef5f
+DIST openldap-2.4.56.tgz 5885444 BLAKE2B cebb189346f9114ed6e2dbb11a836c0b802e28f42d49351d6e807cba9c0f49e85ab3dbb34260b7c5eb3849c181eb51046ef48f555083647e3ce83209d6224bbb SHA512 cf371db5595d5b6643db3e6788ce56e34fe271c244dd39d781cadd2a7f85cec421a51c11a4857a7e286ba94a27c1f0dab0ff27e8de20208587471f4a589588e6
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.56.ebuild b/net-nds/openldap/openldap-2.4.56.ebuild
new file mode 100644
index 00000000000..f8eedca45d4
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.56.ebuild
@@ -0,0 +1,910 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.OpenLDAP.org/"
+
+# upstream mirrors are mostly not working, using canonical URI
+SRC_URI="
+	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
+	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
+	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
+	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
+	mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt samba tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( berkdb )
+	?? ( test minimal )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
+			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		sys-devel/libtool
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+# for tracking versions
+
+BDEPEND="!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+)
+"
+
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
+	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+
+	# bug #622464
+	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
+
+	# fix some compiler warnings
+	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in ${BDB_SLOTS} ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "${NEWVER}" ]] && break
+			done
+		fi
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		-i include/ldap_defaults.h || die
+
+	default
+	rm -r libraries/liblmdb || die
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+	popd &>/dev/null || die
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed \
+		-e 's|/bin/sh|/bin/bash|g' \
+		-i tests/scripts/* || die "sed failed"
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+	popd &>/dev/null || die
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
+			einfo "Using ${DBINCLUDE} for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			--disable-slp
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	CONFIG_SHELL="/bin/sh" \
+	ECONF_SOURCE="${S}" \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+	popd &>/dev/null || die
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake CC="${CC}" CXX="${CXX}"
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+			popd &>/dev/null || die
+		fi
+
+		if use pbkdf2; then
+			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+			popd &>/dev/null || die
+		fi
+
+		if use sha2 ; then
+			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+			popd &>/dev/null || die
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		popd &>/dev/null || die
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# If built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-12-18 14:13 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-12-18 14:13 UTC (permalink / raw
  To: gentoo-commits

commit:     2cddfdc6450ebef79a9079d76aea9ce1a52b29fa
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 18 14:12:54 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri Dec 18 14:13:30 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2cddfdc6

net-nds/openldap: Drop old

Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest                  |   2 -
 net-nds/openldap/openldap-2.4.53-r1.ebuild | 910 -----------------------------
 net-nds/openldap/openldap-2.4.54.ebuild    | 910 -----------------------------
 3 files changed, 1822 deletions(-)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 952cd961b19..cefb5bac9fa 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,4 +1,2 @@
-DIST openldap-2.4.53.tgz 5883013 BLAKE2B 09d17d2a5438b09a4aa7f4a815e858d8b17ae7873580e5b3bc81d9569e97174703600472b9ecf79a28b7df561ba8214dfb6d08b467c823feeeae7d0cbdd37c6b SHA512 32dcbf18ffa53b3c2c5399f726c7a8970154d40fb88de85896d18ea2abd79c55ebe28fcf5fbfd52771f95561d70ab364db5f667fe2ec0e67b21e281f5112ec99
-DIST openldap-2.4.54.tgz 5885717 BLAKE2B 804fec18146d673c78c414914fe37903976de6e1b0b1456f20c545665c9a78d15640e34cebfc4576d7781e67df377c33fed6de1deb984c2be2c9aeeaf4fcfacb SHA512 30cbe23f310f1901a0300ac0d123fc2e6fcc5bde8b15692f2fd8291d1f1e5b7e97426823eb1be9977a15d728fd175c8938c6790a57582a72d10be0b497c3ef5f
 DIST openldap-2.4.56.tgz 5885444 BLAKE2B cebb189346f9114ed6e2dbb11a836c0b802e28f42d49351d6e807cba9c0f49e85ab3dbb34260b7c5eb3849c181eb51046ef48f555083647e3ce83209d6224bbb SHA512 cf371db5595d5b6643db3e6788ce56e34fe271c244dd39d781cadd2a7f85cec421a51c11a4857a7e286ba94a27c1f0dab0ff27e8de20208587471f4a589588e6
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.53-r1.ebuild b/net-nds/openldap/openldap-2.4.53-r1.ebuild
deleted file mode 100644
index ad2d09e1404..00000000000
--- a/net-nds/openldap/openldap-2.4.53-r1.ebuild
+++ /dev/null
@@ -1,910 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="https://www.OpenLDAP.org/"
-
-# upstream mirrors are mostly not working, using canonical URI
-SRC_URI="
-	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
-	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
-	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
-	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
-	mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( berkdb )
-	?? ( test minimal )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-COMMON_DEPEND="
-	ssl? (
-		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
-			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		sys-devel/libtool
-		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.18:=
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)
-"
-DEPEND="${COMMON_DEPEND}
-	sys-apps/groff
-"
-RDEPEND="${COMMON_DEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-
-# The user/group are only used for running daemons which are
-# disabled in minimal builds, so elide the accounts too.
-# for tracking versions
-
-BDEPEND="!minimal? (
-		acct-group/ldap
-		acct-user/ldap
-)
-"
-
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
-	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# unbundle lmdb
-	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-
-	# bug #622464
-	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
-
-	# fix some compiler warnings
-	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in ${BDB_SLOTS} ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "${NEWVER}" ]] && break
-			done
-		fi
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		-i include/ldap_defaults.h || die
-
-	default
-	rm -r libraries/liblmdb || die
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-	popd &>/dev/null || die
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed \
-		-e 's|/bin/sh|/bin/bash|g' \
-		-i tests/scripts/* || die "sed failed"
-
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-	popd &>/dev/null || die
-}
-
-src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
-			einfo "Using ${DBINCLUDE} for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			--disable-slp
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	CONFIG_SHELL="/bin/sh" \
-	ECONF_SOURCE="${S}" \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-	popd &>/dev/null || die
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake CC="${CC}" CXX="${CXX}"
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-			popd &>/dev/null || die
-		fi
-
-		if use pbkdf2; then
-			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-			popd &>/dev/null || die
-		fi
-
-		if use sha2 ; then
-			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
-			einfo "Compiling contrib-module: pw-sha2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o sha2.lo \
-				-c sha2.c || die "compiling pw-sha2 failed"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o slapd-sha2.lo \
-				-c slapd-sha2.c || die "compiling pw-sha2 failed"
-			einfo "Linking contrib-module: pw-sha2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-sha2.la \
-				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
-			popd &>/dev/null || die
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		popd &>/dev/null || die
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-		eend
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"/etc/init.d/slapd \
-				|| die
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README  allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins  */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		if [[ -d "${EROOT}"/var/run/openldap ]]; then
-			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
-			chmod 0755 "${EROOT}"/var/run/openldap || die
-		fi
-		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
-		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}

diff --git a/net-nds/openldap/openldap-2.4.54.ebuild b/net-nds/openldap/openldap-2.4.54.ebuild
deleted file mode 100644
index f8eedca45d4..00000000000
--- a/net-nds/openldap/openldap-2.4.54.ebuild
+++ /dev/null
@@ -1,910 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="https://www.OpenLDAP.org/"
-
-# upstream mirrors are mostly not working, using canonical URI
-SRC_URI="
-	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
-	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
-	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
-	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
-	mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( berkdb )
-	?? ( test minimal )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-COMMON_DEPEND="
-	ssl? (
-		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
-			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		sys-devel/libtool
-		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.18:=
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)
-"
-DEPEND="${COMMON_DEPEND}
-	sys-apps/groff
-"
-RDEPEND="${COMMON_DEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-
-# The user/group are only used for running daemons which are
-# disabled in minimal builds, so elide the accounts too.
-# for tracking versions
-
-BDEPEND="!minimal? (
-		acct-group/ldap
-		acct-user/ldap
-)
-"
-
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
-	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# unbundle lmdb
-	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-
-	# bug #622464
-	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
-
-	# fix some compiler warnings
-	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in ${BDB_SLOTS} ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "${NEWVER}" ]] && break
-			done
-		fi
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		-i include/ldap_defaults.h || die
-
-	default
-	rm -r libraries/liblmdb || die
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-	popd &>/dev/null || die
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed \
-		-e 's|/bin/sh|/bin/bash|g' \
-		-i tests/scripts/* || die "sed failed"
-
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-	popd &>/dev/null || die
-}
-
-src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
-			einfo "Using ${DBINCLUDE} for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			--disable-slp
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	CONFIG_SHELL="/bin/sh" \
-	ECONF_SOURCE="${S}" \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-	popd &>/dev/null || die
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake CC="${CC}" CXX="${CXX}"
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-			popd &>/dev/null || die
-		fi
-
-		if use pbkdf2; then
-			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-			popd &>/dev/null || die
-		fi
-
-		if use sha2 ; then
-			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
-			einfo "Compiling contrib-module: pw-sha2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o sha2.lo \
-				-c sha2.c || die "compiling pw-sha2 failed"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o slapd-sha2.lo \
-				-c slapd-sha2.c || die "compiling pw-sha2 failed"
-			einfo "Linking contrib-module: pw-sha2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-sha2.la \
-				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
-			popd &>/dev/null || die
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		popd &>/dev/null || die
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-		eend
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"/etc/init.d/slapd \
-				|| die
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README  allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins  */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		if [[ -d "${EROOT}"/var/run/openldap ]]; then
-			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
-			chmod 0755 "${EROOT}"/var/run/openldap || die
-		fi
-		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
-		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-12-18 14:13 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2020-12-18 14:13 UTC (permalink / raw
  To: gentoo-commits

commit:     ac5f843d252f41ee8b92ebf34ff88ea3142d5aa7
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 18 14:11:52 2020 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri Dec 18 14:13:30 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac5f843d

net-nds/openldap: mark stable

Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.56.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.56.ebuild b/net-nds/openldap/openldap-2.4.56.ebuild
index f8eedca45d4..019498b6bf9 100644
--- a/net-nds/openldap/openldap-2.4.56.ebuild
+++ b/net-nds/openldap/openldap-2.4.56.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2020-12-27 17:57 Fabian Groffen
  0 siblings, 0 replies; 187+ messages in thread
From: Fabian Groffen @ 2020-12-27 17:57 UTC (permalink / raw
  To: gentoo-commits

commit:     9e1307acd32f77d75c30b90d471505ae54425d6d
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 27 17:57:07 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Dec 27 17:57:07 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e1307ac

net-nds/openldap: drop ppc-aix m68k-mint

Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.56.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.56.ebuild b/net-nds/openldap/openldap-2.4.56.ebuild
index 019498b6bf9..229f43df9b2 100644
--- a/net-nds/openldap/openldap-2.4.56.ebuild
+++ b/net-nds/openldap/openldap-2.4.56.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-01-12 10:01 Lars Wendler
  0 siblings, 0 replies; 187+ messages in thread
From: Lars Wendler @ 2021-01-12 10:01 UTC (permalink / raw
  To: gentoo-commits

commit:     219efe93ddac271ee78c2aa5a87d7d93b6e055fc
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 12 10:01:02 2021 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Tue Jan 12 10:01:35 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=219efe93

net-nds/openldap: Fixed build with sys-devel/autoconf:2.70

Thanks-to: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Closes: https://bugs.gentoo.org/765043
Package-Manager: Portage-3.0.13, Repoman-3.0.2
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.56.ebuild | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.56.ebuild b/net-nds/openldap/openldap-2.4.56.ebuild
index 229f43df9b2..9aad8b8fec3 100644
--- a/net-nds/openldap/openldap-2.4.56.ebuild
+++ b/net-nds/openldap/openldap-2.4.56.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -379,6 +379,8 @@ src_prepare() {
 		-e 's|/bin/sh|/bin/bash|g' \
 		-i tests/scripts/* || die "sed failed"
 
+	# Required for autoconf-2.70 #765043
+	sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.in || die
 	AT_NOEAUTOMAKE=yes eautoreconf
 }
 


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-01-24 14:17 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2021-01-24 14:17 UTC (permalink / raw
  To: gentoo-commits

commit:     999f187566a3d5e3c0e603e15ebf296ad52f19ef
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 24 14:17:10 2021 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Sun Jan 24 14:17:53 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=999f1875

net-nds/openldap: Version bump (v2.4.57)

Package-Manager: Portage-3.0.13, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.4.57.ebuild | 912 ++++++++++++++++++++++++++++++++
 2 files changed, 913 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index cefb5bac9fa..5882823d5f4 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,2 +1,3 @@
 DIST openldap-2.4.56.tgz 5885444 BLAKE2B cebb189346f9114ed6e2dbb11a836c0b802e28f42d49351d6e807cba9c0f49e85ab3dbb34260b7c5eb3849c181eb51046ef48f555083647e3ce83209d6224bbb SHA512 cf371db5595d5b6643db3e6788ce56e34fe271c244dd39d781cadd2a7f85cec421a51c11a4857a7e286ba94a27c1f0dab0ff27e8de20208587471f4a589588e6
+DIST openldap-2.4.57.tgz 5883912 BLAKE2B 439605e1bebcf34968f0a552aaade1b72b7671ae2a94a0b700a84f9f715acd162e7b8dadfdd3ffd5b0a785f9306b5f5033ab956cf0ffd26b66119a7110d0aa57 SHA512 b929bced0f5ba9a90e015a24b8037c8958fbb7282db272bd0cacf43b5f7540ab42159a3c4441148074340228bb5f07f93651c0dbb2affde961be156058f99ce5
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.57.ebuild b/net-nds/openldap/openldap-2.4.57.ebuild
new file mode 100644
index 00000000000..eb74b9878f2
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.57.ebuild
@@ -0,0 +1,912 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.OpenLDAP.org/"
+
+# upstream mirrors are mostly not working, using canonical URI
+SRC_URI="
+	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
+	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
+	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
+	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
+	mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt samba tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( berkdb )
+	?? ( test minimal )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
+			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		dev-libs/libltdl
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+# for tracking versions
+
+BDEPEND="!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+)
+"
+
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
+	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+
+	# bug #622464
+	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
+
+	# fix some compiler warnings
+	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in ${BDB_SLOTS} ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "${NEWVER}" ]] && break
+			done
+		fi
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		-i include/ldap_defaults.h || die
+
+	default
+	rm -r libraries/liblmdb || die
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+	popd &>/dev/null || die
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed \
+		-e 's|/bin/sh|/bin/bash|g' \
+		-i tests/scripts/* || die "sed failed"
+
+	# Required for autoconf-2.70 #765043
+	sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.in || die
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+	popd &>/dev/null || die
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
+			einfo "Using ${DBINCLUDE} for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			--disable-slp
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	CONFIG_SHELL="/bin/sh" \
+	ECONF_SOURCE="${S}" \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+	popd &>/dev/null || die
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake CC="${CC}" CXX="${CXX}"
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+			popd &>/dev/null || die
+		fi
+
+		if use pbkdf2; then
+			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+			popd &>/dev/null || die
+		fi
+
+		if use sha2 ; then
+			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+			popd &>/dev/null || die
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		popd &>/dev/null || die
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# If built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-01-26  9:53 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2021-01-26  9:53 UTC (permalink / raw
  To: gentoo-commits

commit:     188c68adb2c5a5a0f1572f01492ca2e88840ed24
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 26 09:51:57 2021 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Tue Jan 26 09:53:33 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=188c68ad

net-nds/openldap: mark stable

Package-Manager: Portage-3.0.13, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.57.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.57.ebuild b/net-nds/openldap/openldap-2.4.57.ebuild
index eb74b9878f2..0e8d47d384d 100644
--- a/net-nds/openldap/openldap-2.4.57.ebuild
+++ b/net-nds/openldap/openldap-2.4.57.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-01-26  9:53 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2021-01-26  9:53 UTC (permalink / raw
  To: gentoo-commits

commit:     daedc40462a87f7633ec49e7135384be856f59f5
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 26 09:53:07 2021 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Tue Jan 26 09:53:33 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=daedc404

net-nds/openldap: Drop old

Package-Manager: Portage-3.0.13, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 -
 net-nds/openldap/openldap-2.4.56.ebuild | 912 --------------------------------
 2 files changed, 913 deletions(-)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 5882823d5f4..49fc44f187d 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,3 +1,2 @@
-DIST openldap-2.4.56.tgz 5885444 BLAKE2B cebb189346f9114ed6e2dbb11a836c0b802e28f42d49351d6e807cba9c0f49e85ab3dbb34260b7c5eb3849c181eb51046ef48f555083647e3ce83209d6224bbb SHA512 cf371db5595d5b6643db3e6788ce56e34fe271c244dd39d781cadd2a7f85cec421a51c11a4857a7e286ba94a27c1f0dab0ff27e8de20208587471f4a589588e6
 DIST openldap-2.4.57.tgz 5883912 BLAKE2B 439605e1bebcf34968f0a552aaade1b72b7671ae2a94a0b700a84f9f715acd162e7b8dadfdd3ffd5b0a785f9306b5f5033ab956cf0ffd26b66119a7110d0aa57 SHA512 b929bced0f5ba9a90e015a24b8037c8958fbb7282db272bd0cacf43b5f7540ab42159a3c4441148074340228bb5f07f93651c0dbb2affde961be156058f99ce5
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.56.ebuild b/net-nds/openldap/openldap-2.4.56.ebuild
deleted file mode 100644
index 9aad8b8fec3..00000000000
--- a/net-nds/openldap/openldap-2.4.56.ebuild
+++ /dev/null
@@ -1,912 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="https://www.OpenLDAP.org/"
-
-# upstream mirrors are mostly not working, using canonical URI
-SRC_URI="
-	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
-	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
-	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
-	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
-	mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( berkdb )
-	?? ( test minimal )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-COMMON_DEPEND="
-	ssl? (
-		!gnutls? (
-			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
-			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		sys-devel/libtool
-		sys-libs/e2fsprogs-libs
-		>=dev-db/lmdb-0.9.18:=
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			!libressl? ( dev-libs/openssl:0= )
-			libressl? ( dev-libs/libressl:0= )
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)
-"
-DEPEND="${COMMON_DEPEND}
-	sys-apps/groff
-"
-RDEPEND="${COMMON_DEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-
-# The user/group are only used for running daemons which are
-# disabled in minimal builds, so elide the accounts too.
-# for tracking versions
-
-BDEPEND="!minimal? (
-		acct-group/ldap
-		acct-user/ldap
-)
-"
-
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
-	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# unbundle lmdb
-	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-
-	# bug #622464
-	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
-
-	# fix some compiler warnings
-	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in ${BDB_SLOTS} ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "${NEWVER}" ]] && break
-			done
-		fi
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		-i include/ldap_defaults.h || die
-
-	default
-	rm -r libraries/liblmdb || die
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-	popd &>/dev/null || die
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed \
-		-e 's|/bin/sh|/bin/bash|g' \
-		-i tests/scripts/* || die "sed failed"
-
-	# Required for autoconf-2.70 #765043
-	sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.in || die
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-	popd &>/dev/null || die
-}
-
-src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
-			einfo "Using ${DBINCLUDE} for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			--disable-slp
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	CONFIG_SHELL="/bin/sh" \
-	ECONF_SOURCE="${S}" \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-	popd &>/dev/null || die
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake CC="${CC}" CXX="${CXX}"
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-			popd &>/dev/null || die
-		fi
-
-		if use pbkdf2; then
-			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-			popd &>/dev/null || die
-		fi
-
-		if use sha2 ; then
-			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
-			einfo "Compiling contrib-module: pw-sha2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o sha2.lo \
-				-c sha2.c || die "compiling pw-sha2 failed"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o slapd-sha2.lo \
-				-c slapd-sha2.c || die "compiling pw-sha2 failed"
-			einfo "Linking contrib-module: pw-sha2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-sha2.la \
-				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
-			popd &>/dev/null || die
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		popd &>/dev/null || die
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		ebegin "populate config with built backends"
-		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-		eend
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"/etc/init.d/slapd \
-				|| die
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README  allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins  */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		if [[ -d "${EROOT}"/var/run/openldap ]]; then
-			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
-			chmod 0755 "${EROOT}"/var/run/openldap || die
-		fi
-		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
-		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-03-07 11:58 David Seifert
  0 siblings, 0 replies; 187+ messages in thread
From: David Seifert @ 2021-03-07 11:58 UTC (permalink / raw
  To: gentoo-commits

commit:     324591f44435c074dfba3e41dc5742c4fa3314a9
Author:     Theo Anderson <telans <AT> posteo <DOT> de>
AuthorDate: Sun Mar  7 11:57:31 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Mar  7 11:57:31 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=324591f4

net-nds/openldap: migrate to tmpfiles.eclass

Package-Manager: Portage-3.0.16, Repoman-3.0.2
Signed-off-by: Theo Anderson <telans <AT> posteo.de>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.57.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.57.ebuild b/net-nds/openldap/openldap-2.4.57.ebuild
index 0e8d47d384d..2db1c490121 100644
--- a/net-nds/openldap/openldap-2.4.57.ebuild
+++ b/net-nds/openldap/openldap-2.4.57.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd
+inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
 
 BIS_PN=rfc2307bis.schema
 BIS_PV=20140524
@@ -779,7 +779,7 @@ multilib_src_install() {
 		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
 		systemd_dounit "${T}"/slapd.service
 		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
 
 		# If built without SLP, we don't need to be before avahi
 			sed -i \


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-03-19  9:56 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2021-03-19  9:56 UTC (permalink / raw
  To: gentoo-commits

commit:     bd9d85d919cf499a88ce40d45107497794130f5e
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 19 09:55:54 2021 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri Mar 19 09:56:28 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd9d85d9

net-nds/openldap: Version bump (v2.4.58)

Package-Manager: Portage-3.0.13, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.4.58.ebuild | 912 ++++++++++++++++++++++++++++++++
 2 files changed, 913 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 49fc44f187d..aec133cdfbe 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,2 +1,3 @@
 DIST openldap-2.4.57.tgz 5883912 BLAKE2B 439605e1bebcf34968f0a552aaade1b72b7671ae2a94a0b700a84f9f715acd162e7b8dadfdd3ffd5b0a785f9306b5f5033ab956cf0ffd26b66119a7110d0aa57 SHA512 b929bced0f5ba9a90e015a24b8037c8958fbb7282db272bd0cacf43b5f7540ab42159a3c4441148074340228bb5f07f93651c0dbb2affde961be156058f99ce5
+DIST openldap-2.4.58.tgz 5885225 BLAKE2B effb618dba03497796a497cd7f53ec52e389133769321dd242433bed5ec4b1f66cf7353f08a49d5f3465880f6bcfc9afc9c7d2a28e075b66f5fd926b02213541 SHA512 2fa2aa36117692eca44e55559f162c8c796f78469e6c2aee91b06d46f2b755d416979c913a3d89bbf9db14cc84881ecffee69af75b48e1d16b7aa9d2e3873baa
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.58.ebuild b/net-nds/openldap/openldap-2.4.58.ebuild
new file mode 100644
index 00000000000..f2095a16dd2
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.58.ebuild
@@ -0,0 +1,912 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.OpenLDAP.org/"
+
+# upstream mirrors are mostly not working, using canonical URI
+SRC_URI="
+	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
+	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
+	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
+	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
+	mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt samba tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( berkdb )
+	?? ( test minimal )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	ssl? (
+		!gnutls? (
+			!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
+			libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		dev-libs/libltdl
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:0= )
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+# for tracking versions
+
+BDEPEND="!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+)
+"
+
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
+	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+
+	# bug #622464
+	"${FILESDIR}"/${PN}-2.4.47-libressl.patch
+
+	# fix some compiler warnings
+	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in ${BDB_SLOTS} ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "${NEWVER}" ]] && break
+			done
+		fi
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		-i include/ldap_defaults.h || die
+
+	default
+	rm -r libraries/liblmdb || die
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+	popd &>/dev/null || die
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed \
+		-e 's|/bin/sh|/bin/bash|g' \
+		-i tests/scripts/* || die "sed failed"
+
+	# Required for autoconf-2.70 #765043
+	sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.in || die
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+	popd &>/dev/null || die
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
+			einfo "Using ${DBINCLUDE} for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			--disable-slp
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	CONFIG_SHELL="/bin/sh" \
+	ECONF_SOURCE="${S}" \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+	popd &>/dev/null || die
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake CC="${CC}" CXX="${CXX}"
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+			popd &>/dev/null || die
+		fi
+
+		if use pbkdf2; then
+			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+			popd &>/dev/null || die
+		fi
+
+		if use sha2 ; then
+			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+			popd &>/dev/null || die
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		popd &>/dev/null || die
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# If built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-05-07  7:47 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2021-05-07  7:47 UTC (permalink / raw
  To: gentoo-commits

commit:     b2ec02bd61b68ee1182dc4ef3c9fa2e480bc1e91
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Fri May  7 07:46:29 2021 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Fri May  7 07:47:27 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2ec02bd

net-nds/openldap: Version bump (v2.5.4)

Package-Manager: Portage-3.0.18, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest              |   1 +
 net-nds/openldap/openldap-2.5.4.ebuild | 838 +++++++++++++++++++++++++++++++++
 2 files changed, 839 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index aec133cdfbe..0588a7819c6 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,3 +1,4 @@
 DIST openldap-2.4.57.tgz 5883912 BLAKE2B 439605e1bebcf34968f0a552aaade1b72b7671ae2a94a0b700a84f9f715acd162e7b8dadfdd3ffd5b0a785f9306b5f5033ab956cf0ffd26b66119a7110d0aa57 SHA512 b929bced0f5ba9a90e015a24b8037c8958fbb7282db272bd0cacf43b5f7540ab42159a3c4441148074340228bb5f07f93651c0dbb2affde961be156058f99ce5
 DIST openldap-2.4.58.tgz 5885225 BLAKE2B effb618dba03497796a497cd7f53ec52e389133769321dd242433bed5ec4b1f66cf7353f08a49d5f3465880f6bcfc9afc9c7d2a28e075b66f5fd926b02213541 SHA512 2fa2aa36117692eca44e55559f162c8c796f78469e6c2aee91b06d46f2b755d416979c913a3d89bbf9db14cc84881ecffee69af75b48e1d16b7aa9d2e3873baa
+DIST openldap-2.5.4.tgz 6415235 BLAKE2B 16e466d01dc7642786bb88a101854513f1239f1e817fd05145e89deb54bc1b911a5dc5f42b132747f14bdd2a3355e7c398b8b14937e7093361f4a96bfb7e9197 SHA512 00b57c9179acf3b1bde738e91604f3b09b5f5309106362bb947154d131868f233713eaa75c9af9771bfad731902d67406e8fb429851bad227fc48054cace16a8
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.5.4.ebuild b/net-nds/openldap/openldap-2.5.4.ebuild
new file mode 100644
index 00000000000..dccb2e94a85
--- /dev/null
+++ b/net-nds/openldap/openldap-2.5.4.ebuild
@@ -0,0 +1,838 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.OpenLDAP.org/"
+
+# upstream mirrors are mostly not working, using canonical URI
+SRC_URI="
+	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
+	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
+	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
+	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
+	mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS=""
+
+IUSE_DAEMON="crypt samba tcpd experimental minimal"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
+IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	?? ( test minimal )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	ssl? (
+		!gnutls? (
+			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		dev-libs/libltdl
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			dev-libs/openssl:0=
+		)
+		smbkrb5passwd? (
+			dev-libs/openssl:0=
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+# for tracking versions
+
+BDEPEND="!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+)
+"
+
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		-i include/ldap_defaults.h || die
+
+	default
+	rm -r libraries/liblmdb || die
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+	popd &>/dev/null || die
+
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+	popd &>/dev/null || die
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			--disable-slp
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	CONFIG_SHELL="/bin/sh" \
+	ECONF_SOURCE="${S}" \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+	popd &>/dev/null || die
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake CC="${CC}" CXX="${CXX}"
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+			popd &>/dev/null || die
+		fi
+
+		if use pbkdf2; then
+			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+			popd &>/dev/null || die
+		fi
+
+		if use sha2 ; then
+			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+			popd &>/dev/null || die
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		popd &>/dev/null || die
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# If built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-06-03 19:15 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2021-06-03 19:15 UTC (permalink / raw
  To: gentoo-commits

commit:     e300beafe0bd18c72b852405ba3a24ee9ac67c8b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  2 23:57:26 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun  3 19:15:02 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e300beaf

net-nds/openldap: fix BadDefaultUseFlags

-foo in IUSE is discouraged. It is equivalent (in every meaningful case) to 'foo' but confuses parsing
tools like e.g. packages.gentoo.org.

Dropping '-' from these flags has no impact on the actual default behaviour.

See: https://devmanual.gentoo.org/general-concepts/use-flags/index.html#iuse-defaults
Package-Manager: Portage-3.0.19, Repoman-3.0.3
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.57.ebuild | 2 +-
 net-nds/openldap/openldap-2.4.58.ebuild | 2 +-
 net-nds/openldap/openldap-2.5.4.ebuild  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.57.ebuild b/net-nds/openldap/openldap-2.4.57.ebuild
index 275d24ff2e0..2a461032a16 100644
--- a/net-nds/openldap/openldap-2.4.57.ebuild
+++ b/net-nds/openldap/openldap-2.4.57.ebuild
@@ -29,7 +29,7 @@ IUSE_BACKEND="+berkdb"
 IUSE_OVERLAY="overlays perl"
 IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test"
 IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
 IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
 
 RESTRICT="!test? ( test )"

diff --git a/net-nds/openldap/openldap-2.4.58.ebuild b/net-nds/openldap/openldap-2.4.58.ebuild
index 02f6d9096b6..67b024653c5 100644
--- a/net-nds/openldap/openldap-2.4.58.ebuild
+++ b/net-nds/openldap/openldap-2.4.58.ebuild
@@ -29,7 +29,7 @@ IUSE_BACKEND="+berkdb"
 IUSE_OVERLAY="overlays perl"
 IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test"
 IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
 IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
 
 RESTRICT="!test? ( test )"

diff --git a/net-nds/openldap/openldap-2.5.4.ebuild b/net-nds/openldap/openldap-2.5.4.ebuild
index dccb2e94a85..b43e411f275 100644
--- a/net-nds/openldap/openldap-2.5.4.ebuild
+++ b/net-nds/openldap/openldap-2.5.4.ebuild
@@ -28,7 +28,7 @@ IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_OVERLAY="overlays perl"
 IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test"
 IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
+IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
 IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
 
 RESTRICT="!test? ( test )"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-06-22  6:26 Mikle Kolyada
  0 siblings, 0 replies; 187+ messages in thread
From: Mikle Kolyada @ 2021-06-22  6:26 UTC (permalink / raw
  To: gentoo-commits

commit:     8a8451f8c7e79b809390182e8335c2ca435bf3e9
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 22 06:26:21 2021 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Tue Jun 22 06:26:21 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a8451f8

net-nds/openldap: Version bump (v2.4.59)

Package-Manager: Portage-3.0.18, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.4.59.ebuild | 906 ++++++++++++++++++++++++++++++++
 2 files changed, 907 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 0588a7819c6..94ca3b8be20 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,4 +1,5 @@
 DIST openldap-2.4.57.tgz 5883912 BLAKE2B 439605e1bebcf34968f0a552aaade1b72b7671ae2a94a0b700a84f9f715acd162e7b8dadfdd3ffd5b0a785f9306b5f5033ab956cf0ffd26b66119a7110d0aa57 SHA512 b929bced0f5ba9a90e015a24b8037c8958fbb7282db272bd0cacf43b5f7540ab42159a3c4441148074340228bb5f07f93651c0dbb2affde961be156058f99ce5
 DIST openldap-2.4.58.tgz 5885225 BLAKE2B effb618dba03497796a497cd7f53ec52e389133769321dd242433bed5ec4b1f66cf7353f08a49d5f3465880f6bcfc9afc9c7d2a28e075b66f5fd926b02213541 SHA512 2fa2aa36117692eca44e55559f162c8c796f78469e6c2aee91b06d46f2b755d416979c913a3d89bbf9db14cc84881ecffee69af75b48e1d16b7aa9d2e3873baa
+DIST openldap-2.4.59.tgz 5886272 BLAKE2B a2a8bed1d2af97fd41d651668152fd4740871bc5a8abf4b50390839228af82ac103346b3500ae0f8dd31b708acabb30435b90cd48dfafe510e648df5150d96b8 SHA512 233459ab446da6e107a7fc4ecd5668d6b08c11a11359ee76449550393e8f586a29b59d7ae09a050a1fca4fcf388ea61438ef60831b3ae802d92c048365ae3968
 DIST openldap-2.5.4.tgz 6415235 BLAKE2B 16e466d01dc7642786bb88a101854513f1239f1e817fd05145e89deb54bc1b911a5dc5f42b132747f14bdd2a3355e7c398b8b14937e7093361f4a96bfb7e9197 SHA512 00b57c9179acf3b1bde738e91604f3b09b5f5309106362bb947154d131868f233713eaa75c9af9771bfad731902d67406e8fb429851bad227fc48054cace16a8
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.4.59.ebuild b/net-nds/openldap/openldap-2.4.59.ebuild
new file mode 100644
index 00000000000..67b024653c5
--- /dev/null
+++ b/net-nds/openldap/openldap-2.4.59.ebuild
@@ -0,0 +1,906 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.OpenLDAP.org/"
+
+# upstream mirrors are mostly not working, using canonical URI
+SRC_URI="
+	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
+	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
+	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
+	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
+	mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="crypt samba tcpd experimental minimal"
+IUSE_BACKEND="+berkdb"
+IUSE_OVERLAY="overlays perl"
+IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test"
+IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
+IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
+IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( berkdb )
+	?? ( test minimal )"
+
+# always list newer first
+# Do not add any AGPL-3 BDB here!
+# See bug 525110, comment 15.
+# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_PKGS=''
+for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
+
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	ssl? (
+		!gnutls? (
+			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		dev-libs/libltdl
+		sys-libs/e2fsprogs-libs
+		>=dev-db/lmdb-0.9.18:=
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			dev-libs/openssl:0=
+		)
+		berkdb? (
+			<sys-libs/db-6.0:=
+			|| ( ${BDB_PKGS} )
+			)
+		smbkrb5passwd? (
+			dev-libs/openssl:0=
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+			)
+		cxx? ( dev-libs/cyrus-sasl:= )
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+# for tracking versions
+
+BDEPEND="!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+)
+"
+
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
+
+	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
+	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
+
+	# bug #116045 - still present in 2.4.28
+	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
+	# bug #408077 - samba4
+	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
+
+	# bug #189817
+	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
+
+	# bug #233633
+	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
+
+	# bug #281495
+	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
+
+	# bug #294350
+	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
+
+	# unbreak /bin/sh -> dash
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+
+	# bug #420959
+	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
+
+	# unbundle lmdb
+	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
+
+	# fix some compiler warnings
+	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		if use berkdb; then
+			# find which one would be used
+			for bdb_slot in ${BDB_SLOTS} ; do
+				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
+				[[ -n "${NEWVER}" ]] && break
+			done
+		fi
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	# ensure correct SLAPI path by default
+	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
+		-i include/ldap_defaults.h || die
+
+	default
+	rm -r libraries/liblmdb || die
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to block stripping"
+	popd &>/dev/null || die
+
+	# wrong assumption that /bin/sh is /bin/bash
+	sed \
+		-e 's|/bin/sh|/bin/bash|g' \
+		-i tests/scripts/* || die "sed failed"
+
+	# Required for autoconf-2.70 #765043
+	sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.in || die
+	AT_NOEAUTOMAKE=yes eautoreconf
+}
+
+build_contrib_module() {
+	# <dir> <sources> <outputname>
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $3"
+	# Make sure it's uppercase
+	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
+	"${lt}" --mode=compile --tag=CC \
+		"${CC}" \
+		-D${define_name}=SLAPD_MOD_DYNAMIC \
+		-I"${BUILD_DIR}"/include \
+		-I../../../include -I../../../servers/slapd ${CFLAGS} \
+		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
+	einfo "Linking contrib-module: $3"
+	"${lt}" --mode=link --tag=CC \
+		"${CC}" -module \
+		${CFLAGS} \
+		${LDFLAGS} \
+		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+		-o $3.la ${2%.c}.lo || die "linking $3 failed"
+	popd &>/dev/null || die
+}
+
+src_configure() {
+	# Bug 408001
+	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
+
+	# connectionless ldap per bug #342439
+	append-cppflags -DLDAP_CONNECTIONLESS
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	local myconf=()
+
+	use debug && myconf+=( $(use_enable debug) )
+
+	# ICU exists only in the configure, nowhere in the codebase, bug #510858
+	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
+
+	if ! use minimal && multilib_is_native_abi; then
+		local CPPFLAGS=${CPPFLAGS}
+
+		# re-enable serverside overlay chains per bug #296567
+		# see ldap docs chaper 12.3.1 for details
+		myconf+=( --enable-ldap )
+
+		# backends
+		myconf+=( --enable-slapd )
+		if use berkdb ; then
+			einfo "Using Berkeley DB for local backend"
+			myconf+=( --enable-bdb --enable-hdb )
+			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
+			einfo "Using ${DBINCLUDE} for sys-libs/db version"
+			# We need to include the slotted db.h dir for FreeBSD
+			append-cppflags -I${DBINCLUDE}
+		else
+			myconf+=( --disable-bdb --disable-hdb )
+		fi
+		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		myconf+=( $(use_enable perl perl mod) )
+
+		myconf+=( $(use_enable odbc sql mod) )
+		if use odbc ; then
+			local odbc_lib="unixodbc"
+			if use iodbc ; then
+				odbc_lib="iodbc"
+				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
+			fi
+			myconf+=( --with-odbc=${odbc_lib} )
+		fi
+
+		# slapd options
+		myconf+=(
+			$(use_enable crypt)
+			--disable-slp
+			$(use_enable samba lmpasswd)
+			$(use_enable syslog)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				--enable-aci=mod
+			)
+		fi
+		for option in aci cleartext modules rewrite rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# slapd overlay options
+		# Compile-in the syncprov, the others as module
+		myconf+=( --enable-syncprov=yes )
+		use overlays && myconf+=( --enable-overlays=mod )
+
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-bdb
+			--disable-hdb
+			--disable-mdb
+			--disable-overlays
+			--disable-syslog
+		)
+	fi
+
+	# basic functionality stuff
+	myconf+=(
+		$(use_enable ipv6)
+		$(multilib_native_use_with sasl cyrus-sasl)
+		$(multilib_native_use_enable sasl spasswd)
+		$(use_enable tcpd wrappers)
+	)
+
+	# Some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		ssl_lib="openssl"
+		use gnutls && ssl_lib="gnutls"
+	fi
+
+	myconf+=( --with-tls=${ssl_lib} )
+
+	for basicflag in dynamic local proctitle shared; do
+		myconf+=( --enable-${basicflag} )
+	done
+
+	tc-export AR CC CXX
+	CONFIG_SHELL="/bin/sh" \
+	ECONF_SOURCE="${S}" \
+	STRIP=/bin/true \
+	econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		$(use_enable static-libs static) \
+		"${myconf[@]}"
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# So we have to run it AFTER the main build, not just after the main
+	# configure.
+	local myconf_ldapcpp=(
+		--with-ldap-includes="${S}"/include
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}" \
+		CC="${CC}" \
+		CXX="${CXX}"
+	popd &>/dev/null || die
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
+	local lt="${BUILD_DIR}/libtool"
+	export echo="echo"
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake CC="${CC}" CXX="${CXX}"
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+			einfo "Compiling contrib-module: pw-kerberos"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../include \
+				${CFLAGS} \
+				$(krb5-config --cflags) \
+				-DHAVE_KRB5 \
+				-o kerberos.lo \
+				-c kerberos.c || die "compiling pw-kerberos failed"
+			einfo "Linking contrib-module: pw-kerberos"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-kerberos.la \
+				kerberos.lo || die "linking pw-kerberos failed"
+			popd &>/dev/null || die
+		fi
+
+		if use pbkdf2; then
+			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
+			einfo "Compiling contrib-module: pw-pbkdf2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o pbkdf2.lo \
+				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
+			einfo "Linking contrib-module: pw-pbkdf2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-pbkdf2.la \
+				pbkdf2.lo || die "linking pw-pbkdf2 failed"
+			popd &>/dev/null || die
+		fi
+
+		if use sha2 ; then
+			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
+			einfo "Compiling contrib-module: pw-sha2"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o sha2.lo \
+				-c sha2.c || die "compiling pw-sha2 failed"
+			"${lt}" --mode=compile --tag=CC \
+				"${CC}" \
+				-I"${BUILD_DIR}"/include \
+				-I../../../../include \
+				${CFLAGS} \
+				-o slapd-sha2.lo \
+				-c slapd-sha2.c || die "compiling pw-sha2 failed"
+			einfo "Linking contrib-module: pw-sha2"
+			"${lt}" --mode=link --tag=CC \
+				"${CC}" -module \
+				${CFLAGS} \
+				${LDFLAGS} \
+				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+				-o pw-sha2.la \
+				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
+			popd &>/dev/null || die
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
+		einfo "Compiling contrib-module: pw-netscape"
+		"${lt}" --mode=compile --tag=CC \
+			"${CC}" \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-o netscape.lo \
+			-c netscape.c || die "compiling pw-netscape failed"
+		einfo "Linking contrib-module: pw-netscape"
+		"${lt}" --mode=link --tag=CC \
+			"${CC}" -module \
+			${CFLAGS} \
+			${LDFLAGS} \
+			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
+			-o pw-netscape.la \
+			netscape.lo || die "linking pw-netscape failed"
+
+		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
+		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
+		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
+		build_contrib_module "allop" "allop.c" "overlay-allop"
+		build_contrib_module "allowed" "allowed.c" "allowed"
+		build_contrib_module "autogroup" "autogroup.c" "autogroup"
+		build_contrib_module "cloak" "cloak.c" "cloak"
+		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
+		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
+		build_contrib_module "dupent" "dupent.c" "dupent"
+		build_contrib_module "lastbind" "lastbind.c" "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod" "lastmod.c" "lastmod"
+		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
+		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
+		build_contrib_module "trace" "trace.c" "trace"
+		popd &>/dev/null || die
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		"${CC}" -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		emake tests
+	fi
+}
+
+multilib_src_install() {
+	local lt="${BUILD_DIR}/libtool"
+	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		ebegin "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+		eend
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# If built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			"${lt}" --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README  allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins  */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+		elog "---"
+		elog "An example file for tuning BDB backends with openldap is"
+		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-06-22 19:59 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2021-06-22 19:59 UTC (permalink / raw
  To: gentoo-commits

commit:     e5ffcf19986eb9ddf44f50e23517018d42b69dce
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Feb 12 00:00:00 2020 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun 22 19:49:57 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5ffcf19

net-nds/openldap: Add dependency on virtual/libcrypt.

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../{openldap-2.4.59.ebuild => openldap-2.4.59-r1.ebuild}         | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.59.ebuild b/net-nds/openldap/openldap-2.4.59-r1.ebuild
similarity index 99%
rename from net-nds/openldap/openldap-2.4.59.ebuild
rename to net-nds/openldap/openldap-2.4.59-r1.ebuild
index 67b024653c5..633bd5c86de 100644
--- a/net-nds/openldap/openldap-2.4.59.ebuild
+++ b/net-nds/openldap/openldap-2.4.59-r1.ebuild
@@ -62,6 +62,7 @@ COMMON_DEPEND="
 		dev-libs/libltdl
 		sys-libs/e2fsprogs-libs
 		>=dev-db/lmdb-0.9.18:=
+		crypt? ( virtual/libcrypt:= )
 		tcpd? ( sys-apps/tcp-wrappers )
 		odbc? ( !iodbc? ( dev-db/unixODBC )
 			iodbc? ( dev-db/libiodbc ) )
@@ -93,14 +94,13 @@ RDEPEND="${COMMON_DEPEND}
 
 # The user/group are only used for running daemons which are
 # disabled in minimal builds, so elide the accounts too.
-# for tracking versions
-
 BDEPEND="!minimal? (
 		acct-group/ldap
 		acct-user/ldap
 )
 "
 
+# for tracking versions
 OPENLDAP_VERSIONTAG=".version-tag"
 OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
 
@@ -822,13 +822,13 @@ multilib_src_install() {
 		#newdoc acl/README*
 		newdoc addpartial/README addpartial-README
 		newdoc allop/README allop-README
-		newdoc allowed/README  allowed-README
+		newdoc allowed/README allowed-README
 		newdoc autogroup/README autogroup-README
 		newdoc dsaschema/README dsaschema-README
 		newdoc passwd/README passwd-README
 		cd "${S}/contrib/slapi-plugins" || die
 		insinto /usr/$(get_libdir)/openldap/openldap
-		doins  */*.so
+		doins */*.so
 		docinto contrib
 		newdoc addrdnvalues/README addrdnvalues-README
 


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-07-30 23:31 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2021-07-30 23:31 UTC (permalink / raw
  To: gentoo-commits

commit:     70d19ec56b8a00963fdb09b76d51ce608563095f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 30 22:58:10 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 30 23:30:12 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=70d19ec5

net-nds/openldap: [QA] call tmpfiles_process in pkg_postinst

This is needed to actually apply the tmpfiles configuration
we've installed in the ebuild. See tmpfiles.eclass documentation.

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.57-r1.ebuild | 2 ++
 net-nds/openldap/openldap-2.4.58-r1.ebuild | 2 ++
 net-nds/openldap/openldap-2.4.59-r1.ebuild | 2 ++
 net-nds/openldap/openldap-2.5.4.ebuild     | 2 ++
 4 files changed, 8 insertions(+)

diff --git a/net-nds/openldap/openldap-2.4.57-r1.ebuild b/net-nds/openldap/openldap-2.4.57-r1.ebuild
index 7486eb82e4b..47420777739 100644
--- a/net-nds/openldap/openldap-2.4.57-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.57-r1.ebuild
@@ -864,6 +864,8 @@ pkg_preinst() {
 
 pkg_postinst() {
 	if ! use minimal ; then
+		tmpfiles_process slapd.conf
+
 		# You cannot build SSL certificates during src_install that will make
 		# binary packages containing your SSL key, which is both a security risk
 		# and a misconfiguration if multiple machines use the same key and cert.

diff --git a/net-nds/openldap/openldap-2.4.58-r1.ebuild b/net-nds/openldap/openldap-2.4.58-r1.ebuild
index 633bd5c86de..679dc8b2ae5 100644
--- a/net-nds/openldap/openldap-2.4.58-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.58-r1.ebuild
@@ -864,6 +864,8 @@ pkg_preinst() {
 
 pkg_postinst() {
 	if ! use minimal ; then
+		tmpfiles_process slapd.conf
+
 		# You cannot build SSL certificates during src_install that will make
 		# binary packages containing your SSL key, which is both a security risk
 		# and a misconfiguration if multiple machines use the same key and cert.

diff --git a/net-nds/openldap/openldap-2.4.59-r1.ebuild b/net-nds/openldap/openldap-2.4.59-r1.ebuild
index 633bd5c86de..679dc8b2ae5 100644
--- a/net-nds/openldap/openldap-2.4.59-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.59-r1.ebuild
@@ -864,6 +864,8 @@ pkg_preinst() {
 
 pkg_postinst() {
 	if ! use minimal ; then
+		tmpfiles_process slapd.conf
+
 		# You cannot build SSL certificates during src_install that will make
 		# binary packages containing your SSL key, which is both a security risk
 		# and a misconfiguration if multiple machines use the same key and cert.

diff --git a/net-nds/openldap/openldap-2.5.4.ebuild b/net-nds/openldap/openldap-2.5.4.ebuild
index c0fabfd506f..8c6dab1cf30 100644
--- a/net-nds/openldap/openldap-2.5.4.ebuild
+++ b/net-nds/openldap/openldap-2.5.4.ebuild
@@ -796,6 +796,8 @@ pkg_preinst() {
 
 pkg_postinst() {
 	if ! use minimal ; then
+		tmpfiles_process slapd.conf
+
 		# You cannot build SSL certificates during src_install that will make
 		# binary packages containing your SSL key, which is both a security risk
 		# and a misconfiguration if multiple machines use the same key and cert.


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-09-13 20:30 David Seifert
  0 siblings, 0 replies; 187+ messages in thread
From: David Seifert @ 2021-09-13 20:30 UTC (permalink / raw
  To: gentoo-commits

commit:     85cbde157dbb2d45bc830e7d2699c40f4e1508f4
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 13 20:30:20 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Mon Sep 13 20:30:20 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85cbde15

net-nds/openldap: e2fsprogs-libs → e2fsprogs

Bug: https://bugs.gentoo.org/806875
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../openldap/{openldap-2.4.57-r1.ebuild => openldap-2.4.57-r2.ebuild}   | 2 +-
 .../openldap/{openldap-2.4.58-r1.ebuild => openldap-2.4.58-r2.ebuild}   | 2 +-
 .../openldap/{openldap-2.4.59-r1.ebuild => openldap-2.4.59-r2.ebuild}   | 2 +-
 net-nds/openldap/{openldap-2.5.4.ebuild => openldap-2.5.4-r1.ebuild}    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.57-r1.ebuild b/net-nds/openldap/openldap-2.4.57-r2.ebuild
similarity index 99%
rename from net-nds/openldap/openldap-2.4.57-r1.ebuild
rename to net-nds/openldap/openldap-2.4.57-r2.ebuild
index 47420777739..0687cd44fef 100644
--- a/net-nds/openldap/openldap-2.4.57-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.57-r2.ebuild
@@ -60,7 +60,7 @@ COMMON_DEPEND="
 	sasl? ( dev-libs/cyrus-sasl:= )
 	!minimal? (
 		dev-libs/libltdl
-		sys-libs/e2fsprogs-libs
+		sys-fs/e2fsprogs
 		>=dev-db/lmdb-0.9.18:=
 		crypt? ( virtual/libcrypt:= )
 		tcpd? ( sys-apps/tcp-wrappers )

diff --git a/net-nds/openldap/openldap-2.4.58-r1.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild
similarity index 99%
rename from net-nds/openldap/openldap-2.4.58-r1.ebuild
rename to net-nds/openldap/openldap-2.4.58-r2.ebuild
index 679dc8b2ae5..440319751d1 100644
--- a/net-nds/openldap/openldap-2.4.58-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.58-r2.ebuild
@@ -60,7 +60,7 @@ COMMON_DEPEND="
 	sasl? ( dev-libs/cyrus-sasl:= )
 	!minimal? (
 		dev-libs/libltdl
-		sys-libs/e2fsprogs-libs
+		sys-fs/e2fsprogs
 		>=dev-db/lmdb-0.9.18:=
 		crypt? ( virtual/libcrypt:= )
 		tcpd? ( sys-apps/tcp-wrappers )

diff --git a/net-nds/openldap/openldap-2.4.59-r1.ebuild b/net-nds/openldap/openldap-2.4.59-r2.ebuild
similarity index 99%
rename from net-nds/openldap/openldap-2.4.59-r1.ebuild
rename to net-nds/openldap/openldap-2.4.59-r2.ebuild
index 679dc8b2ae5..440319751d1 100644
--- a/net-nds/openldap/openldap-2.4.59-r1.ebuild
+++ b/net-nds/openldap/openldap-2.4.59-r2.ebuild
@@ -60,7 +60,7 @@ COMMON_DEPEND="
 	sasl? ( dev-libs/cyrus-sasl:= )
 	!minimal? (
 		dev-libs/libltdl
-		sys-libs/e2fsprogs-libs
+		sys-fs/e2fsprogs
 		>=dev-db/lmdb-0.9.18:=
 		crypt? ( virtual/libcrypt:= )
 		tcpd? ( sys-apps/tcp-wrappers )

diff --git a/net-nds/openldap/openldap-2.5.4.ebuild b/net-nds/openldap/openldap-2.5.4-r1.ebuild
similarity index 99%
rename from net-nds/openldap/openldap-2.5.4.ebuild
rename to net-nds/openldap/openldap-2.5.4-r1.ebuild
index 8c6dab1cf30..72168dd71c9 100644
--- a/net-nds/openldap/openldap-2.5.4.ebuild
+++ b/net-nds/openldap/openldap-2.5.4-r1.ebuild
@@ -58,7 +58,7 @@ COMMON_DEPEND="
 	sasl? ( dev-libs/cyrus-sasl:= )
 	!minimal? (
 		dev-libs/libltdl
-		sys-libs/e2fsprogs-libs
+		sys-fs/e2fsprogs
 		>=dev-db/lmdb-0.9.18:=
 		crypt? ( virtual/libcrypt:= )
 		tcpd? ( sys-apps/tcp-wrappers )


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-10-18 15:18 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2021-10-18 15:18 UTC (permalink / raw
  To: gentoo-commits

commit:     285629af65ad50bee75650d6eac222035f92f966
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 18 15:18:36 2021 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Mon Oct 18 15:18:36 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=285629af

net-nds/openldap: amd64 stable wrt bug #818739

Package-Manager: Portage-3.0.20, Repoman-3.0.3
RepoMan-Options: --include-arches="amd64"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.58-r2.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.58-r2.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild
index 440319751d1..2e0e0e5b43a 100644
--- a/net-nds/openldap/openldap-2.4.58-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.58-r2.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-10-18 15:22 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2021-10-18 15:22 UTC (permalink / raw
  To: gentoo-commits

commit:     b417628674d590a014e9c5076e57bc709602f4a4
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 18 15:22:29 2021 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Mon Oct 18 15:22:29 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4176286

net-nds/openldap: x86 stable wrt bug #818739

Package-Manager: Portage-3.0.20, Repoman-3.0.3
RepoMan-Options: --include-arches="x86"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.58-r2.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.58-r2.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild
index 2e0e0e5b43a..2408cae4900 100644
--- a/net-nds/openldap/openldap-2.4.58-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.58-r2.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-10-18 23:49 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2021-10-18 23:49 UTC (permalink / raw
  To: gentoo-commits

commit:     fdf07b1eacab4f9af35d3ec39887f520812fc106
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 18 23:48:16 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 18 23:48:16 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fdf07b1e

net-nds/openldap: Stabilize 2.4.58-r2 arm, #818739

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.58-r2.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.58-r2.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild
index 2408cae4900..f6159cec2ea 100644
--- a/net-nds/openldap/openldap-2.4.58-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.58-r2.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-10-21 23:26 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2021-10-21 23:26 UTC (permalink / raw
  To: gentoo-commits

commit:     d191f36122c9f5915beb8d9fc60ee9239413b8a6
Author:     Rolf Eike Beer <eike <AT> sf-mail <DOT> de>
AuthorDate: Thu Oct 21 08:35:36 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Oct 21 23:25:57 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d191f361

net-nds/openldap: stable 2.4.58-r2 for hppa, bug #818739

Package-Manager: Portage-3.0.20, Repoman-3.0.3
RepoMan-Options: --include-arches="hppa"
Signed-off-by: Rolf Eike Beer <eike <AT> sf-mail.de>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.58-r2.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.58-r2.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild
index f6159cec2ea..d70ec55bd8c 100644
--- a/net-nds/openldap/openldap-2.4.58-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.58-r2.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-10-29  5:54 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2021-10-29  5:54 UTC (permalink / raw
  To: gentoo-commits

commit:     d099e7ad31cf34fbfdad9272e4ee04cd8753fdf9
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 29 05:53:59 2021 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Fri Oct 29 05:54:03 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d099e7ad

net-nds/openldap: ppc stable wrt bug #818739

Package-Manager: Portage-3.0.20, Repoman-3.0.3
RepoMan-Options: --include-arches="ppc"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.58-r2.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.58-r2.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild
index d70ec55bd8c..e1a23d8125a 100644
--- a/net-nds/openldap/openldap-2.4.58-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.58-r2.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-10-29  5:55 Agostino Sarubbo
  0 siblings, 0 replies; 187+ messages in thread
From: Agostino Sarubbo @ 2021-10-29  5:55 UTC (permalink / raw
  To: gentoo-commits

commit:     d985d1fc58bd9092f6142310b1ded7d1b8487977
Author:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 29 05:54:57 2021 +0000
Commit:     Agostino Sarubbo <ago <AT> gentoo <DOT> org>
CommitDate: Fri Oct 29 05:55:54 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d985d1fc

net-nds/openldap: ppc64 stable wrt bug #818739

Package-Manager: Portage-3.0.20, Repoman-3.0.3
RepoMan-Options: --include-arches="ppc64"
Signed-off-by: Agostino Sarubbo <ago <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.58-r2.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.58-r2.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild
index e1a23d8125a..048e6dbeb4b 100644
--- a/net-nds/openldap/openldap-2.4.58-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.58-r2.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2021-11-17  7:49 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2021-11-17  7:49 UTC (permalink / raw
  To: gentoo-commits

commit:     1a21528c92a99643b0a557a522c8912be135cbc5
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 17 07:47:29 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Nov 17 07:48:32 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a21528c

net-nds/openldap: Stabilize 2.4.58-r2 arm64, #818739

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.58-r2.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.4.58-r2.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild
index 048e6dbeb4bc..3a6aa07bb4a3 100644
--- a/net-nds/openldap/openldap-2.4.58-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.58-r2.ebuild
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-01-02 17:49 David Seifert
  0 siblings, 0 replies; 187+ messages in thread
From: David Seifert @ 2022-01-02 17:49 UTC (permalink / raw
  To: gentoo-commits

commit:     c6ff937d4eb05575205b8a895b316d99f4cda6d4
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  2 17:48:55 2022 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Jan  2 17:48:55 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c6ff937d

net-nds/openldap: remove freebsd-libc

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.57-r2.ebuild | 9 +++------
 net-nds/openldap/openldap-2.4.58-r2.ebuild | 9 +++------
 net-nds/openldap/openldap-2.4.59-r2.ebuild | 9 +++------
 net-nds/openldap/openldap-2.5.4-r1.ebuild  | 9 +++------
 4 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.57-r2.ebuild b/net-nds/openldap/openldap-2.4.57-r2.ebuild
index 0687cd44fefb..f594d17cece9 100644
--- a/net-nds/openldap/openldap-2.4.57-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.57-r2.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
-inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
+inherit autotools db-use flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
 
 BIS_PN=rfc2307bis.schema
 BIS_PV=20140524
@@ -42,7 +42,7 @@ REQUIRED_USE="cxx? ( sasl )
 # Do not add any AGPL-3 BDB here!
 # See bug 525110, comment 15.
 # Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 4.8}"
 BDB_PKGS=''
 for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 
@@ -401,9 +401,6 @@ build_contrib_module() {
 }
 
 src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
 	# connectionless ldap per bug #342439
 	append-cppflags -DLDAP_CONNECTIONLESS
 

diff --git a/net-nds/openldap/openldap-2.4.58-r2.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild
index 3a6aa07bb4a3..afe2534c109e 100644
--- a/net-nds/openldap/openldap-2.4.58-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.58-r2.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
-inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
+inherit autotools db-use flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
 
 BIS_PN=rfc2307bis.schema
 BIS_PV=20140524
@@ -42,7 +42,7 @@ REQUIRED_USE="cxx? ( sasl )
 # Do not add any AGPL-3 BDB here!
 # See bug 525110, comment 15.
 # Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 4.8}"
 BDB_PKGS=''
 for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 
@@ -401,9 +401,6 @@ build_contrib_module() {
 }
 
 src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
 	# connectionless ldap per bug #342439
 	append-cppflags -DLDAP_CONNECTIONLESS
 

diff --git a/net-nds/openldap/openldap-2.4.59-r2.ebuild b/net-nds/openldap/openldap-2.4.59-r2.ebuild
index 440319751d1e..25141776f10a 100644
--- a/net-nds/openldap/openldap-2.4.59-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.59-r2.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
-inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
+inherit autotools db-use flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
 
 BIS_PN=rfc2307bis.schema
 BIS_PV=20140524
@@ -42,7 +42,7 @@ REQUIRED_USE="cxx? ( sasl )
 # Do not add any AGPL-3 BDB here!
 # See bug 525110, comment 15.
 # Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 4.8}"
 BDB_PKGS=''
 for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 
@@ -401,9 +401,6 @@ build_contrib_module() {
 }
 
 src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
 	# connectionless ldap per bug #342439
 	append-cppflags -DLDAP_CONNECTIONLESS
 

diff --git a/net-nds/openldap/openldap-2.5.4-r1.ebuild b/net-nds/openldap/openldap-2.5.4-r1.ebuild
index 72168dd71c9c..53daba349ce5 100644
--- a/net-nds/openldap/openldap-2.5.4-r1.ebuild
+++ b/net-nds/openldap/openldap-2.5.4-r1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 
-inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
+inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
 
 BIS_PN=rfc2307bis.schema
 BIS_PV=20140524
@@ -40,7 +40,7 @@ REQUIRED_USE="cxx? ( sasl )
 # Do not add any AGPL-3 BDB here!
 # See bug 525110, comment 15.
 # Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
+BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 4.8}"
 BDB_PKGS=''
 for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
 
@@ -345,9 +345,6 @@ build_contrib_module() {
 }
 
 src_configure() {
-	# Bug 408001
-	use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
-
 	# connectionless ldap per bug #342439
 	append-cppflags -DLDAP_CONNECTIONLESS
 


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-03-19 22:39 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-03-19 22:39 UTC (permalink / raw
  To: gentoo-commits

commit:     1f66f26dd9b459c07198663772614c11d9b9fb96
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 19 22:37:06 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 19 22:39:06 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f66f26d

net-nds/openldap: drop rmdir /run

Fails due to non-existent /run.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.1.ebuild | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net-nds/openldap/openldap-2.6.1.ebuild b/net-nds/openldap/openldap-2.6.1.ebuild
index 04bd86b1b15b..971bbbe40b39 100644
--- a/net-nds/openldap/openldap-2.6.1.ebuild
+++ b/net-nds/openldap/openldap-2.6.1.ebuild
@@ -732,8 +732,6 @@ multilib_src_install() {
 	if ! use static-libs ; then
 		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
 	fi
-
-	rmdir "${ED}/run" || die
 }
 
 multilib_src_install_all() {


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-03-19 22:39 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-03-19 22:39 UTC (permalink / raw
  To: gentoo-commits

commit:     96fe1038c5e07c43aecac821a9f078abdc612dde
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 19 22:36:37 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 19 22:39:04 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96fe1038

net-nds/openldap: fix tc-getCC quoting

Breaks build otherwise for e.g. ABI_X86_32:
```
>>> Compiling source in /var/tmp/portage/net-nds/openldap-2.6.1/work/openldap-OPENLDAP_REL_ENG_2_6_1 ...
 * abi_x86_32.x86: running multilib-minimal_abi_src_compile
make -j32 -l32 CC=x86_64-pc-linux-gnu-gcc -m32 SHELL=/bin/sh
make: invalid option -- '3'
make: invalid option -- '2'
Usage: make [options] [target] ...
Options:
```

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.1.ebuild | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/net-nds/openldap/openldap-2.6.1.ebuild b/net-nds/openldap/openldap-2.6.1.ebuild
index 0e0449e3885e..04bd86b1b15b 100644
--- a/net-nds/openldap/openldap-2.6.1.ebuild
+++ b/net-nds/openldap/openldap-2.6.1.ebuild
@@ -144,7 +144,6 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
 	"${FILESDIR}"/${PN}-2.6.1-flags.patch
 	"${FILESDIR}"/${PN}-2.6.1-fix-missing-mapping.patch
-	"${FILESDIR}"/${PN}-2.6.1-make-flags.patch
 )
 
 openldap_filecount() {
@@ -515,7 +514,7 @@ src_configure_cxx() {
 
 multilib_src_compile() {
 	tc-export AR CC CXX
-	emake CC=$(tc-getCC) SHELL="${EPREFIX}"/bin/sh
+	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
 
 	if ! use minimal && multilib_is_native_abi ; then
 		if use cxx ; then
@@ -554,7 +553,7 @@ multilib_src_compile() {
 
 			emake \
 				LDAP_BUILD="${BUILD_DIR}" \
-				CC=$(tc-getCC) libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap
+				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
 			popd &>/dev/null || die
 		fi
 
@@ -616,7 +615,7 @@ multilib_src_test() {
 }
 
 multilib_src_install() {
-	emake CC=$(tc-getCC) \
+	emake CC="$(tc-getCC)" \
 		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
 
 	if ! use minimal && multilib_is_native_abi; then


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-03-20  0:53 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-03-20  0:53 UTC (permalink / raw
  To: gentoo-commits

commit:     f2692d73ae7207cec295970fd4713f38bb45e0ca
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 20 00:52:03 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar 20 00:52:03 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2692d73

net-nds/openldap: restore MAKEOPTS patch

Accidentally dropped.

Fixes: b7da48a7fce92735b1cb9353ea9a85afe8acc139
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.1.ebuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net-nds/openldap/openldap-2.6.1.ebuild b/net-nds/openldap/openldap-2.6.1.ebuild
index 971bbbe40b39..30b563e02efb 100644
--- a/net-nds/openldap/openldap-2.6.1.ebuild
+++ b/net-nds/openldap/openldap-2.6.1.ebuild
@@ -144,6 +144,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
 	"${FILESDIR}"/${PN}-2.6.1-flags.patch
 	"${FILESDIR}"/${PN}-2.6.1-fix-missing-mapping.patch
+	"${FILESDIR}"/${PN}-2.6.1-make-flags.patch
 )
 
 openldap_filecount() {


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-03-20 23:08 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2022-03-20 23:08 UTC (permalink / raw
  To: gentoo-commits

commit:     4c4745b05a90742b564fef0714e66aec98e415f2
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 20 23:07:56 2022 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Mar 20 23:08:52 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4c4745b0

net-nds/openldap: make src_test run parallel tests

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.1.ebuild | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.1.ebuild b/net-nds/openldap/openldap-2.6.1.ebuild
index 62f91410a233..7af43ba480d1 100644
--- a/net-nds/openldap/openldap-2.6.1.ebuild
+++ b/net-nds/openldap/openldap-2.6.1.ebuild
@@ -608,7 +608,15 @@ multilib_src_compile() {
 
 multilib_src_test() {
 	if multilib_is_native_abi; then
-		emake test
+		cd "tests"
+		pwd
+		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
+		# emake partests => runs ALL of the tests in parallel
+		# wt/WiredTiger is not supported in Gentoo
+		TESTS=( plloadd pmdb )
+		#TESTS+=( pldif ) # not done by default, so also exclude here
+		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
+		emake "${TESTS[@]}"
 	fi
 }
 


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-03-20 23:08 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2022-03-20 23:08 UTC (permalink / raw
  To: gentoo-commits

commit:     86964447d6b2e6798be6874ae677cebfae1ab069
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 20 22:51:44 2022 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Mar 20 23:08:52 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86964447

net-nds: avoid automagic autoca

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.1.ebuild | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.1.ebuild b/net-nds/openldap/openldap-2.6.1.ebuild
index 0edc6a14276a..62f91410a233 100644
--- a/net-nds/openldap/openldap-2.6.1.ebuild
+++ b/net-nds/openldap/openldap-2.6.1.ebuild
@@ -23,7 +23,7 @@ SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
-IUSE_OVERLAY="overlays perl"
+IUSE_OVERLAY="overlays perl autoca"
 IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog test"
 IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
 IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
@@ -34,6 +34,7 @@ RESTRICT="!test? ( test )"
 REQUIRED_USE="cxx? ( sasl )
 	pbkdf2? ( ssl )
 	test? ( cleartext sasl )
+	autoca? ( !gnutls )
 	?? ( test minimal )"
 
 S=${WORKDIR}/${PN}-OPENLDAP_REL_ENG_${MY_PV}
@@ -416,6 +417,7 @@ multilib_src_configure() {
 		fi
 
 		use overlays && myconf+=( --enable-overlays=mod )
+		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
 		# compile-in the syncprov
 		myconf+=( --enable-syncprov=yes )
 
@@ -435,6 +437,7 @@ multilib_src_configure() {
 			--disable-slapd
 			--disable-mdb
 			--disable-overlays
+			--disable-autoca
 			--disable-syslog
 			--without-systemd
 		)


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-03-22 23:32 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-03-22 23:32 UTC (permalink / raw
  To: gentoo-commits

commit:     02c5c5076c42da8eb3452a633aeb96d95156e63c
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 22 23:12:09 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 22 23:26:52 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02c5c507

net-nds/openldap: add sys-apps/util-linux dependency for libutil

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.1-r1.ebuild | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.1-r1.ebuild b/net-nds/openldap/openldap-2.6.1-r1.ebuild
index 2b25520bfaa5..7091232465cf 100644
--- a/net-nds/openldap/openldap-2.6.1-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.1-r1.ebuild
@@ -42,6 +42,7 @@ S=${WORKDIR}/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 
 # openssl is needed to generate lanman-passwords required by samba
 COMMON_DEPEND="
+	kernel_linux? ( sys-apps/util-linux )
 	ssl? (
 		!gnutls? (
 			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
@@ -72,7 +73,7 @@ COMMON_DEPEND="
 		kerberos? (
 			virtual/krb5
 			kinit? ( !app-crypt/heimdal )
-			)
+		)
 	)
 "
 DEPEND="${COMMON_DEPEND}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-03-22 23:32 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-03-22 23:32 UTC (permalink / raw
  To: gentoo-commits

commit:     d10a5bfa66f462ac45ee4ba0e59c62ece6fafe79
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 22 22:49:01 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 22 23:26:50 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d10a5bfa

net-nds/openldap: add subslot

Closes: https://bugs.gentoo.org/835654
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/{openldap-2.6.1.ebuild => openldap-2.6.1-r1.ebuild} | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.1.ebuild b/net-nds/openldap/openldap-2.6.1-r1.ebuild
similarity index 99%
rename from net-nds/openldap/openldap-2.6.1.ebuild
rename to net-nds/openldap/openldap-2.6.1-r1.ebuild
index 7af43ba480d1..2b25520bfaa5 100644
--- a/net-nds/openldap/openldap-2.6.1.ebuild
+++ b/net-nds/openldap/openldap-2.6.1-r1.ebuild
@@ -19,7 +19,8 @@ SRC_URI="
 	mirror://gentoo/${BIS_P}"
 
 LICENSE="OPENLDAP GPL-2"
-SLOT="0"
+# Subslot added for bug #835654
+SLOT="0/$(ver_cut 1-2)"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-04-15 19:35 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2022-04-15 19:35 UTC (permalink / raw
  To: gentoo-commits

commit:     eac600cf87417f9312fae99b7f73536b5ff399d1
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 15 19:34:21 2022 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Fri Apr 15 19:35:04 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eac600cf

net-nds/openldap: fix multilib inherit

Fixes:
IndirectInherits: version 2.6.1-r1: multilib: indirect inherit usage: 'get_libname 0', line 752

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.1-r1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.1-r1.ebuild b/net-nds/openldap/openldap-2.6.1-r1.ebuild
index 7091232465cf..f90979e12030 100644
--- a/net-nds/openldap/openldap-2.6.1-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.1-r1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit autotools flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
+inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
 
 MY_PV="$(ver_rs 1-2 _)"
 


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-04-15 19:35 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2022-04-15 19:35 UTC (permalink / raw
  To: gentoo-commits

commit:     093cd54d45df6d840c33b0d2c367d7a5c70acdc7
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 15 19:33:19 2022 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Fri Apr 15 19:35:04 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=093cd54d

net-nds/openldap: document USE=autoca

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 net-nds/openldap/metadata.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net-nds/openldap/metadata.xml b/net-nds/openldap/metadata.xml
index 62176631c249..d19853eda044 100644
--- a/net-nds/openldap/metadata.xml
+++ b/net-nds/openldap/metadata.xml
@@ -10,6 +10,7 @@
 	</maintainer>
 	<use>
 		<flag name="argon2">Enable password hashing algorithm from <pkg>app-crypt/argon2</pkg></flag>
+		<flag name="autoca">Automatic Certificate Authority overlay</flag>
 		<flag name="cleartext">Enable use of cleartext passwords</flag>
 		<flag name="experimental">Enable experimental backend options</flag>
 		<flag name="kinit">Enable support for kerberos init</flag>


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-05-13 12:19 WANG Xuerui
  0 siblings, 0 replies; 187+ messages in thread
From: WANG Xuerui @ 2022-05-13 12:19 UTC (permalink / raw
  To: gentoo-commits

commit:     f0a3cbb5d944b47486908d8b9f933551643dfef5
Author:     WANG Xuerui <xen0n <AT> gentoo <DOT> org>
AuthorDate: Fri May 13 06:47:15 2022 +0000
Commit:     WANG Xuerui <xen0n <AT> gentoo <DOT> org>
CommitDate: Fri May 13 12:18:53 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f0a3cbb5

net-nds/openldap: keyword 2.6.1-r1 for ~loong

Tests passed on real hardware.

Signed-off-by: WANG Xuerui <xen0n <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.1-r1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.1-r1.ebuild b/net-nds/openldap/openldap-2.6.1-r1.ebuild
index 6c594f6880be..2bb87baa4aa0 100644
--- a/net-nds/openldap/openldap-2.6.1-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.1-r1.ebuild
@@ -21,7 +21,7 @@ SRC_URI="
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-05-13 20:04 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-05-13 20:04 UTC (permalink / raw
  To: gentoo-commits

commit:     54d6b965bc03481d743a874991ce4072a3a7d37b
Author:     Thomas Bracht Laumann Jespersen <t <AT> laumann <DOT> xyz>
AuthorDate: Wed Apr 20 20:13:02 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 13 20:03:35 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54d6b965

net-nds/openldap: [QA] eend without argument

Remove the lone eend, and change the ebegin to einfo.

Signed-off-by: Thomas Bracht Laumann Jespersen <t <AT> laumann.xyz>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.57-r2.ebuild | 3 +--
 net-nds/openldap/openldap-2.4.58-r2.ebuild | 3 +--
 net-nds/openldap/openldap-2.4.59-r2.ebuild | 3 +--
 net-nds/openldap/openldap-2.5.4-r1.ebuild  | 3 +--
 net-nds/openldap/openldap-2.6.1-r1.ebuild  | 3 +--
 5 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.57-r2.ebuild b/net-nds/openldap/openldap-2.4.57-r2.ebuild
index 6071ea4e4bfc..5ec8d89d34fe 100644
--- a/net-nds/openldap/openldap-2.4.57-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.57-r2.ebuild
@@ -749,7 +749,7 @@ multilib_src_install() {
 		configfile="${ED}"/etc/openldap/slapd.conf
 
 		# populate with built backends
-		ebegin "populate config with built backends"
+		einfo "populate config with built backends"
 		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
 			einfo "Adding $(basename ${x})"
 			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
@@ -758,7 +758,6 @@ multilib_src_install() {
 		use prefix || fowners root:ldap /etc/openldap/slapd.conf
 		fperms 0640 /etc/openldap/slapd.conf
 		cp "${configfile}" "${configfile}".default || die
-		eend
 
 		# install our own init scripts and systemd unit files
 		einfo "Install init scripts"

diff --git a/net-nds/openldap/openldap-2.4.58-r2.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild
index 8ecc781450b2..dda39f5339c0 100644
--- a/net-nds/openldap/openldap-2.4.58-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.58-r2.ebuild
@@ -749,7 +749,7 @@ multilib_src_install() {
 		configfile="${ED}"/etc/openldap/slapd.conf
 
 		# populate with built backends
-		ebegin "populate config with built backends"
+		einfo "populate config with built backends"
 		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
 			einfo "Adding $(basename ${x})"
 			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
@@ -758,7 +758,6 @@ multilib_src_install() {
 		use prefix || fowners root:ldap /etc/openldap/slapd.conf
 		fperms 0640 /etc/openldap/slapd.conf
 		cp "${configfile}" "${configfile}".default || die
-		eend
 
 		# install our own init scripts and systemd unit files
 		einfo "Install init scripts"

diff --git a/net-nds/openldap/openldap-2.4.59-r2.ebuild b/net-nds/openldap/openldap-2.4.59-r2.ebuild
index 25141776f10a..0aca184d6849 100644
--- a/net-nds/openldap/openldap-2.4.59-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.59-r2.ebuild
@@ -749,7 +749,7 @@ multilib_src_install() {
 		configfile="${ED}"/etc/openldap/slapd.conf
 
 		# populate with built backends
-		ebegin "populate config with built backends"
+		einfo "populate config with built backends"
 		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
 			einfo "Adding $(basename ${x})"
 			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
@@ -758,7 +758,6 @@ multilib_src_install() {
 		use prefix || fowners root:ldap /etc/openldap/slapd.conf
 		fperms 0640 /etc/openldap/slapd.conf
 		cp "${configfile}" "${configfile}".default || die
-		eend
 
 		# install our own init scripts and systemd unit files
 		einfo "Install init scripts"

diff --git a/net-nds/openldap/openldap-2.5.4-r1.ebuild b/net-nds/openldap/openldap-2.5.4-r1.ebuild
index 53daba349ce5..8304dd4e70f1 100644
--- a/net-nds/openldap/openldap-2.5.4-r1.ebuild
+++ b/net-nds/openldap/openldap-2.5.4-r1.ebuild
@@ -681,7 +681,7 @@ multilib_src_install() {
 		configfile="${ED}"/etc/openldap/slapd.conf
 
 		# populate with built backends
-		ebegin "populate config with built backends"
+		einfo "populate config with built backends"
 		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
 			einfo "Adding $(basename ${x})"
 			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
@@ -690,7 +690,6 @@ multilib_src_install() {
 		use prefix || fowners root:ldap /etc/openldap/slapd.conf
 		fperms 0640 /etc/openldap/slapd.conf
 		cp "${configfile}" "${configfile}".default || die
-		eend
 
 		# install our own init scripts and systemd unit files
 		einfo "Install init scripts"

diff --git a/net-nds/openldap/openldap-2.6.1-r1.ebuild b/net-nds/openldap/openldap-2.6.1-r1.ebuild
index 2bb87baa4aa0..1223fd163d99 100644
--- a/net-nds/openldap/openldap-2.6.1-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.1-r1.ebuild
@@ -648,7 +648,7 @@ multilib_src_install() {
 		configfile="${ED}"/etc/openldap/slapd.conf
 
 		# populate with built backends
-		ebegin "populate config with built backends"
+		einfo "populate config with built backends"
 		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
 			einfo "Adding $(basename ${x})"
 			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
@@ -657,7 +657,6 @@ multilib_src_install() {
 		use prefix || fowners root:ldap /etc/openldap/slapd.conf
 		fperms 0640 /etc/openldap/slapd.conf
 		cp "${configfile}" "${configfile}".default || die
-		eend $?
 
 		# install our own init scripts and systemd unit files
 		einfo "Install init scripts"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-05-15  1:00 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-05-15  1:00 UTC (permalink / raw
  To: gentoo-commits

commit:     6d3ea27fcd353cb0d6a13b36f169612555513bde
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat May  7 06:55:24 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun May 15 01:00:16 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d3ea27f

net-nds/openldap: egrep -> grep -E

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.57-r2.ebuild | 2 +-
 net-nds/openldap/openldap-2.4.58-r2.ebuild | 2 +-
 net-nds/openldap/openldap-2.4.59-r2.ebuild | 2 +-
 net-nds/openldap/openldap-2.5.4-r1.ebuild  | 2 +-
 net-nds/openldap/openldap-2.6.1-r1.ebuild  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.57-r2.ebuild b/net-nds/openldap/openldap-2.4.57-r2.ebuild
index 5ec8d89d34fe..92d0abe3c671 100644
--- a/net-nds/openldap/openldap-2.4.57-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.57-r2.ebuild
@@ -321,7 +321,7 @@ openldap_upgrade_howto() {
 	i="${l}.raw"
 	eerror " 1. /etc/init.d/slapd stop"
 	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
 	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
 	eerror " 5. emerge --update \=net-nds/${PF}"
 	eerror " 6. etc-update, and ensure that you apply the changes"

diff --git a/net-nds/openldap/openldap-2.4.58-r2.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild
index dda39f5339c0..41c31f8ea973 100644
--- a/net-nds/openldap/openldap-2.4.58-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.58-r2.ebuild
@@ -321,7 +321,7 @@ openldap_upgrade_howto() {
 	i="${l}.raw"
 	eerror " 1. /etc/init.d/slapd stop"
 	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
 	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
 	eerror " 5. emerge --update \=net-nds/${PF}"
 	eerror " 6. etc-update, and ensure that you apply the changes"

diff --git a/net-nds/openldap/openldap-2.4.59-r2.ebuild b/net-nds/openldap/openldap-2.4.59-r2.ebuild
index 0aca184d6849..f04abefec1a4 100644
--- a/net-nds/openldap/openldap-2.4.59-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.59-r2.ebuild
@@ -321,7 +321,7 @@ openldap_upgrade_howto() {
 	i="${l}.raw"
 	eerror " 1. /etc/init.d/slapd stop"
 	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
 	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
 	eerror " 5. emerge --update \=net-nds/${PF}"
 	eerror " 6. etc-update, and ensure that you apply the changes"

diff --git a/net-nds/openldap/openldap-2.5.4-r1.ebuild b/net-nds/openldap/openldap-2.5.4-r1.ebuild
index 8304dd4e70f1..4582bc9b5067 100644
--- a/net-nds/openldap/openldap-2.5.4-r1.ebuild
+++ b/net-nds/openldap/openldap-2.5.4-r1.ebuild
@@ -272,7 +272,7 @@ openldap_upgrade_howto() {
 	i="${l}.raw"
 	eerror " 1. /etc/init.d/slapd stop"
 	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
 	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
 	eerror " 5. emerge --update \=net-nds/${PF}"
 	eerror " 6. etc-update, and ensure that you apply the changes"

diff --git a/net-nds/openldap/openldap-2.6.1-r1.ebuild b/net-nds/openldap/openldap-2.6.1-r1.ebuild
index 1223fd163d99..698e662ce9cc 100644
--- a/net-nds/openldap/openldap-2.6.1-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.1-r1.ebuild
@@ -281,7 +281,7 @@ openldap_upgrade_howto() {
 	i="${l}.raw"
 	eerror " 1. /etc/init.d/slapd stop"
 	eerror " 2. slapcat -l ${i}"
-	eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
 	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
 	eerror " 5. emerge --update \=net-nds/${PF}"
 	eerror " 6. etc-update, and ensure that you apply the changes"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-06-01  5:20 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-06-01  5:20 UTC (permalink / raw
  To: gentoo-commits

commit:     e90e15bb20c01e2a2baf7c955671066959439ead
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  1 05:07:30 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun  1 05:07:30 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e90e15bb

net-nds/openldap: add 2.6.2

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/Manifest              |   1 +
 net-nds/openldap/openldap-2.6.2.ebuild | 798 +++++++++++++++++++++++++++++++++
 2 files changed, 799 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index c0b19b7c9812..dd98473ce9c1 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -3,4 +3,5 @@ DIST openldap-2.4.58.tgz 5885225 BLAKE2B effb618dba03497796a497cd7f53ec52e389133
 DIST openldap-2.4.59.tgz 5886272 BLAKE2B a2a8bed1d2af97fd41d651668152fd4740871bc5a8abf4b50390839228af82ac103346b3500ae0f8dd31b708acabb30435b90cd48dfafe510e648df5150d96b8 SHA512 233459ab446da6e107a7fc4ecd5668d6b08c11a11359ee76449550393e8f586a29b59d7ae09a050a1fca4fcf388ea61438ef60831b3ae802d92c048365ae3968
 DIST openldap-2.5.4.tgz 6415235 BLAKE2B 16e466d01dc7642786bb88a101854513f1239f1e817fd05145e89deb54bc1b911a5dc5f42b132747f14bdd2a3355e7c398b8b14937e7093361f4a96bfb7e9197 SHA512 00b57c9179acf3b1bde738e91604f3b09b5f5309106362bb947154d131868f233713eaa75c9af9771bfad731902d67406e8fb429851bad227fc48054cace16a8
 DIST openldap-OPENLDAP_REL_ENG_2_6_1.tar.gz 6211863 BLAKE2B 81f4591db483a214351c2e02631fef2875e17e0890fc621182d2ed61d927c3c029a4f290ee6c0788952495d6f7a76ed15e62557b8d8f2e241d867e19fdf223b7 SHA512 ca61c1dccf3194d8d149ca0c45a4834d6fadf67a3676cf348f5f62ab92c94bc7501216d7da681c3a6f87f646a18d0f3d116c3d3a24d2e5cbebc6c695c986e517
+DIST openldap-OPENLDAP_REL_ENG_2_6_2.tar.gz 6216063 BLAKE2B 51c8d5ee712971c1aeeaedfc7bb89e65b2ccc2dc171bd0fb99e2b568d70ea5c66903194ab92a66de88fd9bc78511ffee0ab595b13a725933c7084943ac8c624a SHA512 0668165e194a7b1a483f88bf6b0f6eab2707c404f6c3164948cb11896c5e5411972a0677a927c0e509e98bfebb75b79e514bb6346b23d35687d9234f973d7520
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.6.2.ebuild b/net-nds/openldap/openldap-2.6.2.ebuild
new file mode 100644
index 000000000000..ada8b4ae1615
--- /dev/null
+++ b/net-nds/openldap/openldap-2.6.2.ebuild
@@ -0,0 +1,798 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
+
+MY_PV="$(ver_rs 1-2 _)"
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.OpenLDAP.org/"
+
+SRC_URI="
+	https://gitlab.com/openldap/${PN}/-/archive/OPENLDAP_REL_ENG_${MY_PV}/${PN}-OPENLDAP_REL_ENG_${MY_PV}.tar.gz
+	mirror://gentoo/${BIS_P}"
+
+LICENSE="OPENLDAP GPL-2"
+# Subslot added for bug #835654
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
+IUSE_OVERLAY="overlays perl autoca"
+IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog test"
+IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
+IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
+IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+RESTRICT="!test? ( test )"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( cleartext sasl )
+	autoca? ( !gnutls )
+	?? ( test minimal )"
+
+S=${WORKDIR}/${PN}-OPENLDAP_REL_ENG_${MY_PV}
+
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	kernel_linux? ( sys-apps/util-linux )
+	ssl? (
+		!gnutls? (
+			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		dev-libs/libltdl
+		sys-fs/e2fsprogs
+		>=dev-db/lmdb-0.9.18:=
+		argon2? ( app-crypt/argon2:= )
+		crypt? ( virtual/libcrypt:= )
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			dev-libs/openssl:0=
+		)
+		smbkrb5passwd? (
+			dev-libs/openssl:0=
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+		)
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+BDEPEND="!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+)
+"
+
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+	"${FILESDIR}"/${PN}-2.6.1-system-mdb.patch
+	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
+	"${FILESDIR}"/${PN}-2.6.1-flags.patch
+	"${FILESDIR}"/${PN}-2.6.1-fix-missing-mapping.patch
+	"${FILESDIR}"/${PN}-2.6.1-fix-bashism-configure.patch
+	"${FILESDIR}"/${PN}-2.6.1-parallel-build.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	# TODO: remove this as we dropped bdb support (gone upstream) in 2.6.1?
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
+
+	for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do
+		iconv -f iso-8859-1 -t utf-8 "$filename" > "$filename.utf8"
+		mv "$filename.utf8" "$filename"
+	done
+
+	default
+
+	sed -i \
+		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
+		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to remove to early stripping"
+	popd &>/dev/null || die
+
+	eautoreconf
+	multilib_copy_sources
+}
+
+build_contrib_module() {
+	# <dir> [<target>]
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $1"
+	local target="${2:-all}"
+	emake \
+		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
+		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
+		"$target"
+	popd &>/dev/null || die
+}
+
+multilib_src_configure() {
+	# Optional Features
+	myconf+=(
+		--enable-option-checking
+		$(use_enable debug)
+		--enable-dynamic
+		$(use_enable syslog)
+		$(use_enable ipv6)
+		--enable-local
+	)
+
+	# Optional Packages
+	myconf+=(
+		--without-fetch
+	)
+
+	if ! use minimal && multilib_is_native_abi; then
+		# SLAPD (Standalone LDAP Daemon) Options
+		# overlay chaining requires '--enable-ldap' #296567
+		# see https://www.openldap.org/doc/admin26/overlays.html#Chaining
+		myconf+=(
+			--enable-ldap=yes
+			--enable-slapd
+			$(use_enable cleartext)
+			$(use_enable crypt)
+			$(multilib_native_use_enable sasl spasswd)
+			--disable-slp
+			$(use_enable tcpd wrappers)
+		)
+		if use experimental ; then
+			# connectionless ldap per bug #342439
+			# connectionless is a unsupported feature according to Howard Chu
+			# see https://bugs.openldap.org/show_bug.cgi?id=9739
+			append-cppflags -DLDAP_CONNECTIONLESS
+
+			myconf+=(
+				--enable-dynacl
+				# ACI build as dynamic module not supported (yet)
+				--enable-aci=yes
+			)
+		fi
+
+		for option in modules rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# static SLAPD backends
+		for backend in mdb; do
+			myconf+=( --enable-${backend}=yes )
+		done
+
+		# module SLAPD backends
+		for backend in asyncmeta dnssrv meta null passwd relay sock; do
+			# missing modules: wiredtiger (not available in portage)
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		use perl && myconf+=( --enable-perl=mod )
+
+		if use odbc ; then
+			myconf+=( --enable-sql=mod )
+			if use iodbc ; then
+				myconf+=( --with-odbc="iodbc" )
+				append-cflags -I"${EPREFIX}"/usr/include/iodbc
+			else
+				myconf+=( --with-odbc="unixodbc" )
+			fi
+		fi
+
+		use overlays && myconf+=( --enable-overlays=mod )
+		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
+		# compile-in the syncprov
+		myconf+=( --enable-syncprov=yes )
+
+		# SLAPD Password Module Options
+		myconf+=(
+			$(use_enable argon2)
+		)
+
+		# Optional Packages
+		myconf+=(
+			$(use_with systemd)
+			$(multilib_native_use_with sasl cyrus-sasl)
+		)
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-mdb
+			--disable-overlays
+			--disable-autoca
+			--disable-syslog
+			--without-systemd
+		)
+	fi
+
+	# Library Generation & Linking Options
+	myconf+=(
+		$(use_enable static-libs static)
+		--enable-shared
+		--enable-versioning
+		--with-pic
+	)
+
+	# some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		if use gnutls ; then
+			myconf+=( --with-tls="gnutls" )
+		else
+			# disable MD2 hash function
+			append-cflags -DOPENSSL_NO_MD2
+			myconf+=( --with-tls="openssl" )
+		fi
+	else
+		myconf+=( --with-tls="no" )
+	fi
+
+	tc-export AR CC CXX
+
+	ECONF_SOURCE="${S}" econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		--localstatedir="${EPREFIX}"/var \
+		--runstatedir="${EPREFIX}"/run \
+		--sharedstatedir="${EPREFIX}"/var/lib \
+		"${myconf[@]}"
+
+	# argument '--runstatedir' seems to have no effect therefore this workaround
+	sed -i \
+		-e 's:^runstatedir=.*:runstatedir=${EPREFIX}/run:' \
+		configure contrib/ldapc++/configure contrib/ldaptcl/configure || die 'could not set runstatedir'
+
+	sed -i \
+		-e "s:/var/run/sasl2/mux:${EPREFIX}/run/sasl2/mux:" \
+		doc/guide/admin/security.sdf || die 'could not fix run path in doc'
+
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# we have to run it AFTER the main build, not just after the main configure
+	local myconf_ldapcpp=(
+		--with-libldap="${E}/lib"
+		--with-ldap-includes="${S}/include"
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die "could not create ${BUILD_DIR}/contrib/ldapc++ directory"
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+	local LDFLAGS=${LDFLAGS}
+	local CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}"
+	popd &>/dev/null || die "popd contrib/ldapc++"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			build_contrib_module "passwd" "pw-kerberos.la"
+		fi
+
+		if use pbkdf2; then
+			build_contrib_module "passwd/pbkdf2"
+		fi
+
+		if use sha2 ; then
+			build_contrib_module "passwd/sha2"
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		build_contrib_module "passwd" "pw-netscape.la"
+
+		#build_contrib_module "acl" "posixgroup.la" # example code only
+		#build_contrib_module "acl" "gssacl.la" # example code only, also needs kerberos
+		build_contrib_module "addpartial"
+		build_contrib_module "allop"
+		build_contrib_module "allowed"
+		build_contrib_module "autogroup"
+		build_contrib_module "cloak"
+		# build_contrib_module "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop"
+		build_contrib_module "dsaschema"
+		build_contrib_module "dupent"
+		build_contrib_module "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod"
+		build_contrib_module "noopsrch"
+		#build_contrib_module "nops" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" RESO:LATER
+		build_contrib_module "trace"
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		$(tc-getCC) -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd "tests"
+		pwd
+		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
+		# emake partests => runs ALL of the tests in parallel
+		# wt/WiredTiger is not supported in Gentoo
+		TESTS=( plloadd pmdb )
+		#TESTS+=( pldif ) # not done by default, so also exclude here
+		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
+		emake "${TESTS[@]}"
+	fi
+}
+
+multilib_src_install() {
+	emake CC="$(tc-getCC)" \
+		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		einfo "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# if built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			libtool --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		tmpfiles_process slapd.conf
+
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-07-15  3:31 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-07-15  3:31 UTC (permalink / raw
  To: gentoo-commits

commit:     eb1a9293d25d824eca054422287588fd98c0c1bd
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 15 03:30:57 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 15 03:30:57 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb1a9293

net-nds/openldap: add 2.6.3

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/Manifest              |   1 +
 net-nds/openldap/openldap-2.6.3.ebuild | 796 +++++++++++++++++++++++++++++++++
 2 files changed, 797 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index f2e1b6fd5424..afda18553753 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -2,4 +2,5 @@ DIST openldap-2.4.57.tgz 5883912 BLAKE2B 439605e1bebcf34968f0a552aaade1b72b7671a
 DIST openldap-2.4.58.tgz 5885225 BLAKE2B effb618dba03497796a497cd7f53ec52e389133769321dd242433bed5ec4b1f66cf7353f08a49d5f3465880f6bcfc9afc9c7d2a28e075b66f5fd926b02213541 SHA512 2fa2aa36117692eca44e55559f162c8c796f78469e6c2aee91b06d46f2b755d416979c913a3d89bbf9db14cc84881ecffee69af75b48e1d16b7aa9d2e3873baa
 DIST openldap-2.4.59.tgz 5886272 BLAKE2B a2a8bed1d2af97fd41d651668152fd4740871bc5a8abf4b50390839228af82ac103346b3500ae0f8dd31b708acabb30435b90cd48dfafe510e648df5150d96b8 SHA512 233459ab446da6e107a7fc4ecd5668d6b08c11a11359ee76449550393e8f586a29b59d7ae09a050a1fca4fcf388ea61438ef60831b3ae802d92c048365ae3968
 DIST openldap-OPENLDAP_REL_ENG_2_6_2.tar.gz 6216063 BLAKE2B 51c8d5ee712971c1aeeaedfc7bb89e65b2ccc2dc171bd0fb99e2b568d70ea5c66903194ab92a66de88fd9bc78511ffee0ab595b13a725933c7084943ac8c624a SHA512 0668165e194a7b1a483f88bf6b0f6eab2707c404f6c3164948cb11896c5e5411972a0677a927c0e509e98bfebb75b79e514bb6346b23d35687d9234f973d7520
+DIST openldap-OPENLDAP_REL_ENG_2_6_3.tar.gz 6244895 BLAKE2B 97792a1b368de44867b0ce9eef38601c3e64b7d40e4ca206295bee110097697c919040d2220eea6f0581812e09a2cc3e6afb4a243a5072a8a0a95f24f9fb354b SHA512 1c882a0cd0729b5d0f40b58588d0e36ae3b1cae6d569f0576e940c7c63d03c29ed2c9db87695a87594ba99a927ef4cba491bddba3ce049025fd5883463122ba7
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.6.3.ebuild b/net-nds/openldap/openldap-2.6.3.ebuild
new file mode 100644
index 000000000000..f083a43a675a
--- /dev/null
+++ b/net-nds/openldap/openldap-2.6.3.ebuild
@@ -0,0 +1,796 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
+
+MY_PV="$(ver_rs 1-2 _)"
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.openldap.org/"
+SRC_URI="
+	https://gitlab.com/openldap/${PN}/-/archive/OPENLDAP_REL_ENG_${MY_PV}/${PN}-OPENLDAP_REL_ENG_${MY_PV}.tar.gz
+	mirror://gentoo/${BIS_P}
+"
+S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
+
+LICENSE="OPENLDAP GPL-2"
+# Subslot added for bug #835654
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
+IUSE_OVERLAY="overlays perl autoca"
+IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog test"
+IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
+IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
+IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+RESTRICT="!test? ( test )"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( cleartext sasl )
+	autoca? ( !gnutls )
+	?? ( test minimal )"
+
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	kernel_linux? ( sys-apps/util-linux )
+	ssl? (
+		!gnutls? (
+			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		dev-libs/libltdl
+		sys-fs/e2fsprogs
+		>=dev-db/lmdb-0.9.18:=
+		argon2? ( app-crypt/argon2:= )
+		crypt? ( virtual/libcrypt:= )
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			dev-libs/openssl:0=
+		)
+		smbkrb5passwd? (
+			dev-libs/openssl:0=
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+		)
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+BDEPEND="!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+)
+"
+
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+	"${FILESDIR}"/${PN}-2.6.1-system-mdb.patch
+	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
+	"${FILESDIR}"/${PN}-2.6.1-flags.patch
+	"${FILESDIR}"/${PN}-2.6.1-fix-missing-mapping.patch
+	"${FILESDIR}"/${PN}-2.6.1-fix-bashism-configure.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	# TODO: remove this as we dropped bdb support (gone upstream) in 2.6.1?
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
+
+	for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do
+		iconv -f iso-8859-1 -t utf-8 "$filename" > "$filename.utf8"
+		mv "$filename.utf8" "$filename"
+	done
+
+	default
+
+	sed -i \
+		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
+		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to remove to early stripping"
+	popd &>/dev/null || die
+
+	eautoreconf
+	multilib_copy_sources
+}
+
+build_contrib_module() {
+	# <dir> [<target>]
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $1"
+	local target="${2:-all}"
+	emake \
+		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
+		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
+		"$target"
+	popd &>/dev/null || die
+}
+
+multilib_src_configure() {
+	# Optional Features
+	myconf+=(
+		--enable-option-checking
+		$(use_enable debug)
+		--enable-dynamic
+		$(use_enable syslog)
+		$(use_enable ipv6)
+		--enable-local
+	)
+
+	# Optional Packages
+	myconf+=(
+		--without-fetch
+	)
+
+	if ! use minimal && multilib_is_native_abi; then
+		# SLAPD (Standalone LDAP Daemon) Options
+		# overlay chaining requires '--enable-ldap' #296567
+		# see https://www.openldap.org/doc/admin26/overlays.html#Chaining
+		myconf+=(
+			--enable-ldap=yes
+			--enable-slapd
+			$(use_enable cleartext)
+			$(use_enable crypt)
+			$(multilib_native_use_enable sasl spasswd)
+			--disable-slp
+			$(use_enable tcpd wrappers)
+		)
+		if use experimental ; then
+			# connectionless ldap per bug #342439
+			# connectionless is a unsupported feature according to Howard Chu
+			# see https://bugs.openldap.org/show_bug.cgi?id=9739
+			append-cppflags -DLDAP_CONNECTIONLESS
+
+			myconf+=(
+				--enable-dynacl
+				# ACI build as dynamic module not supported (yet)
+				--enable-aci=yes
+			)
+		fi
+
+		for option in modules rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# static SLAPD backends
+		for backend in mdb; do
+			myconf+=( --enable-${backend}=yes )
+		done
+
+		# module SLAPD backends
+		for backend in asyncmeta dnssrv meta null passwd relay sock; do
+			# missing modules: wiredtiger (not available in portage)
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		use perl && myconf+=( --enable-perl=mod )
+
+		if use odbc ; then
+			myconf+=( --enable-sql=mod )
+			if use iodbc ; then
+				myconf+=( --with-odbc="iodbc" )
+				append-cflags -I"${EPREFIX}"/usr/include/iodbc
+			else
+				myconf+=( --with-odbc="unixodbc" )
+			fi
+		fi
+
+		use overlays && myconf+=( --enable-overlays=mod )
+		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
+		# compile-in the syncprov
+		myconf+=( --enable-syncprov=yes )
+
+		# SLAPD Password Module Options
+		myconf+=(
+			$(use_enable argon2)
+		)
+
+		# Optional Packages
+		myconf+=(
+			$(use_with systemd)
+			$(multilib_native_use_with sasl cyrus-sasl)
+		)
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-mdb
+			--disable-overlays
+			--disable-autoca
+			--disable-syslog
+			--without-systemd
+		)
+	fi
+
+	# Library Generation & Linking Options
+	myconf+=(
+		$(use_enable static-libs static)
+		--enable-shared
+		--enable-versioning
+		--with-pic
+	)
+
+	# some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		if use gnutls ; then
+			myconf+=( --with-tls="gnutls" )
+		else
+			# disable MD2 hash function
+			append-cflags -DOPENSSL_NO_MD2
+			myconf+=( --with-tls="openssl" )
+		fi
+	else
+		myconf+=( --with-tls="no" )
+	fi
+
+	tc-export AR CC CXX
+
+	ECONF_SOURCE="${S}" econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		--localstatedir="${EPREFIX}"/var \
+		--runstatedir="${EPREFIX}"/run \
+		--sharedstatedir="${EPREFIX}"/var/lib \
+		"${myconf[@]}"
+
+	# argument '--runstatedir' seems to have no effect therefore this workaround
+	sed -i \
+		-e 's:^runstatedir=.*:runstatedir=${EPREFIX}/run:' \
+		configure contrib/ldapc++/configure contrib/ldaptcl/configure || die 'could not set runstatedir'
+
+	sed -i \
+		-e "s:/var/run/sasl2/mux:${EPREFIX}/run/sasl2/mux:" \
+		doc/guide/admin/security.sdf || die 'could not fix run path in doc'
+
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# we have to run it AFTER the main build, not just after the main configure
+	local myconf_ldapcpp=(
+		--with-libldap="${E}/lib"
+		--with-ldap-includes="${S}/include"
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die "could not create ${BUILD_DIR}/contrib/ldapc++ directory"
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+	local LDFLAGS=${LDFLAGS}
+	local CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}"
+	popd &>/dev/null || die "popd contrib/ldapc++"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			build_contrib_module "passwd" "pw-kerberos.la"
+		fi
+
+		if use pbkdf2; then
+			build_contrib_module "passwd/pbkdf2"
+		fi
+
+		if use sha2 ; then
+			build_contrib_module "passwd/sha2"
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		build_contrib_module "passwd" "pw-netscape.la"
+
+		#build_contrib_module "acl" "posixgroup.la" # example code only
+		#build_contrib_module "acl" "gssacl.la" # example code only, also needs kerberos
+		build_contrib_module "addpartial"
+		build_contrib_module "allop"
+		build_contrib_module "allowed"
+		build_contrib_module "autogroup"
+		build_contrib_module "cloak"
+		# build_contrib_module "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop"
+		build_contrib_module "dsaschema"
+		build_contrib_module "dupent"
+		build_contrib_module "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod"
+		build_contrib_module "noopsrch"
+		#build_contrib_module "nops" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" RESO:LATER
+		build_contrib_module "trace"
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		$(tc-getCC) -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd "tests"
+		pwd
+		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
+		# emake partests => runs ALL of the tests in parallel
+		# wt/WiredTiger is not supported in Gentoo
+		TESTS=( plloadd pmdb )
+		#TESTS+=( pldif ) # not done by default, so also exclude here
+		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
+		emake "${TESTS[@]}"
+	fi
+}
+
+multilib_src_install() {
+	emake CC="$(tc-getCC)" \
+		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		einfo "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# if built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			libtool --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		tmpfiles_process slapd.conf
+
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-07-15  3:31 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-07-15  3:31 UTC (permalink / raw
  To: gentoo-commits

commit:     9f3ccaef1d850cc0d18376a4ad84a40dcbed7886
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 15 03:09:04 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 15 03:09:04 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f3ccaef

net-nds/openldap: drop 2.5.4-r1, 2.6.1-r1

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/Manifest                 |   2 -
 net-nds/openldap/openldap-2.5.4-r1.ebuild | 836 ------------------------------
 net-nds/openldap/openldap-2.6.1-r1.ebuild | 799 ----------------------------
 3 files changed, 1637 deletions(-)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index dd98473ce9c1..f2e1b6fd5424 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,7 +1,5 @@
 DIST openldap-2.4.57.tgz 5883912 BLAKE2B 439605e1bebcf34968f0a552aaade1b72b7671ae2a94a0b700a84f9f715acd162e7b8dadfdd3ffd5b0a785f9306b5f5033ab956cf0ffd26b66119a7110d0aa57 SHA512 b929bced0f5ba9a90e015a24b8037c8958fbb7282db272bd0cacf43b5f7540ab42159a3c4441148074340228bb5f07f93651c0dbb2affde961be156058f99ce5
 DIST openldap-2.4.58.tgz 5885225 BLAKE2B effb618dba03497796a497cd7f53ec52e389133769321dd242433bed5ec4b1f66cf7353f08a49d5f3465880f6bcfc9afc9c7d2a28e075b66f5fd926b02213541 SHA512 2fa2aa36117692eca44e55559f162c8c796f78469e6c2aee91b06d46f2b755d416979c913a3d89bbf9db14cc84881ecffee69af75b48e1d16b7aa9d2e3873baa
 DIST openldap-2.4.59.tgz 5886272 BLAKE2B a2a8bed1d2af97fd41d651668152fd4740871bc5a8abf4b50390839228af82ac103346b3500ae0f8dd31b708acabb30435b90cd48dfafe510e648df5150d96b8 SHA512 233459ab446da6e107a7fc4ecd5668d6b08c11a11359ee76449550393e8f586a29b59d7ae09a050a1fca4fcf388ea61438ef60831b3ae802d92c048365ae3968
-DIST openldap-2.5.4.tgz 6415235 BLAKE2B 16e466d01dc7642786bb88a101854513f1239f1e817fd05145e89deb54bc1b911a5dc5f42b132747f14bdd2a3355e7c398b8b14937e7093361f4a96bfb7e9197 SHA512 00b57c9179acf3b1bde738e91604f3b09b5f5309106362bb947154d131868f233713eaa75c9af9771bfad731902d67406e8fb429851bad227fc48054cace16a8
-DIST openldap-OPENLDAP_REL_ENG_2_6_1.tar.gz 6211863 BLAKE2B 81f4591db483a214351c2e02631fef2875e17e0890fc621182d2ed61d927c3c029a4f290ee6c0788952495d6f7a76ed15e62557b8d8f2e241d867e19fdf223b7 SHA512 ca61c1dccf3194d8d149ca0c45a4834d6fadf67a3676cf348f5f62ab92c94bc7501216d7da681c3a6f87f646a18d0f3d116c3d3a24d2e5cbebc6c695c986e517
 DIST openldap-OPENLDAP_REL_ENG_2_6_2.tar.gz 6216063 BLAKE2B 51c8d5ee712971c1aeeaedfc7bb89e65b2ccc2dc171bd0fb99e2b568d70ea5c66903194ab92a66de88fd9bc78511ffee0ab595b13a725933c7084943ac8c624a SHA512 0668165e194a7b1a483f88bf6b0f6eab2707c404f6c3164948cb11896c5e5411972a0677a927c0e509e98bfebb75b79e514bb6346b23d35687d9234f973d7520
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.5.4-r1.ebuild b/net-nds/openldap/openldap-2.5.4-r1.ebuild
deleted file mode 100644
index 4582bc9b5067..000000000000
--- a/net-nds/openldap/openldap-2.5.4-r1.ebuild
+++ /dev/null
@@ -1,836 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="https://www.OpenLDAP.org/"
-
-# upstream mirrors are mostly not working, using canonical URI
-SRC_URI="
-	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
-	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
-	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
-	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
-	mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS=""
-
-IUSE_DAEMON="crypt samba tcpd experimental minimal"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	?? ( test minimal )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 4.8}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-COMMON_DEPEND="
-	ssl? (
-		!gnutls? (
-			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		dev-libs/libltdl
-		sys-fs/e2fsprogs
-		>=dev-db/lmdb-0.9.18:=
-		crypt? ( virtual/libcrypt:= )
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			dev-libs/openssl:0=
-		)
-		smbkrb5passwd? (
-			dev-libs/openssl:0=
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)
-"
-DEPEND="${COMMON_DEPEND}
-	sys-apps/groff
-"
-RDEPEND="${COMMON_DEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-
-# The user/group are only used for running daemons which are
-# disabled in minimal builds, so elide the accounts too.
-BDEPEND="!minimal? (
-		acct-group/ldap
-		acct-user/ldap
-)
-"
-
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		-i include/ldap_defaults.h || die
-
-	default
-	rm -r libraries/liblmdb || die
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-	popd &>/dev/null || die
-
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-	popd &>/dev/null || die
-}
-
-src_configure() {
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			--disable-slp
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	CONFIG_SHELL="/bin/sh" \
-	ECONF_SOURCE="${S}" \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-	popd &>/dev/null || die
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake CC="${CC}" CXX="${CXX}"
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-			popd &>/dev/null || die
-		fi
-
-		if use pbkdf2; then
-			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-			popd &>/dev/null || die
-		fi
-
-		if use sha2 ; then
-			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
-			einfo "Compiling contrib-module: pw-sha2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o sha2.lo \
-				-c sha2.c || die "compiling pw-sha2 failed"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o slapd-sha2.lo \
-				-c slapd-sha2.c || die "compiling pw-sha2 failed"
-			einfo "Linking contrib-module: pw-sha2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-sha2.la \
-				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
-			popd &>/dev/null || die
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		popd &>/dev/null || die
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		einfo "populate config with built backends"
-		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"/etc/init.d/slapd \
-				|| die
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		tmpfiles_process slapd.conf
-
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		if [[ -d "${EROOT}"/var/run/openldap ]]; then
-			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
-			chmod 0755 "${EROOT}"/var/run/openldap || die
-		fi
-		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
-		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}

diff --git a/net-nds/openldap/openldap-2.6.1-r1.ebuild b/net-nds/openldap/openldap-2.6.1-r1.ebuild
deleted file mode 100644
index 698e662ce9cc..000000000000
--- a/net-nds/openldap/openldap-2.6.1-r1.ebuild
+++ /dev/null
@@ -1,799 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
-
-MY_PV="$(ver_rs 1-2 _)"
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="https://www.OpenLDAP.org/"
-
-SRC_URI="
-	https://gitlab.com/openldap/${PN}/-/archive/OPENLDAP_REL_ENG_${MY_PV}/${PN}-OPENLDAP_REL_ENG_${MY_PV}.tar.gz
-	mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-# Subslot added for bug #835654
-SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
-IUSE_OVERLAY="overlays perl autoca"
-IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog test"
-IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
-IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
-IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-RESTRICT="!test? ( test )"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( cleartext sasl )
-	autoca? ( !gnutls )
-	?? ( test minimal )"
-
-S=${WORKDIR}/${PN}-OPENLDAP_REL_ENG_${MY_PV}
-
-# openssl is needed to generate lanman-passwords required by samba
-COMMON_DEPEND="
-	kernel_linux? ( sys-apps/util-linux )
-	ssl? (
-		!gnutls? (
-			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		dev-libs/libltdl
-		sys-fs/e2fsprogs
-		>=dev-db/lmdb-0.9.18:=
-		argon2? ( app-crypt/argon2:= )
-		crypt? ( virtual/libcrypt:= )
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			dev-libs/openssl:0=
-		)
-		smbkrb5passwd? (
-			dev-libs/openssl:0=
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-		)
-	)
-"
-DEPEND="${COMMON_DEPEND}
-	sys-apps/groff
-"
-RDEPEND="${COMMON_DEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-
-# The user/group are only used for running daemons which are
-# disabled in minimal builds, so elide the accounts too.
-BDEPEND="!minimal? (
-		acct-group/ldap
-		acct-user/ldap
-)
-"
-
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-	"${FILESDIR}"/${PN}-2.6.1-system-mdb.patch
-	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
-	"${FILESDIR}"/${PN}-2.6.1-flags.patch
-	"${FILESDIR}"/${PN}-2.6.1-fix-missing-mapping.patch
-	"${FILESDIR}"/${PN}-2.6.1-make-flags.patch
-	"${FILESDIR}"/${PN}-2.6.1-fix-bashism-configure.patch
-	"${FILESDIR}"/${PN}-2.6.1-parallel-build.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	# TODO: remove this as we dropped bdb support (gone upstream) in 2.6.1?
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-}
-
-src_prepare() {
-	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
-
-	for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do
-		iconv -f iso-8859-1 -t utf-8 "$filename" > "$filename.utf8"
-		mv "$filename.utf8" "$filename"
-	done
-
-	default
-
-	sed -i \
-		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
-		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to remove to early stripping"
-	popd &>/dev/null || die
-
-	eautoreconf
-	multilib_copy_sources
-}
-
-build_contrib_module() {
-	# <dir> [<target>]
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $1"
-	local target="${2:-all}"
-	emake \
-		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
-		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
-		"$target"
-	popd &>/dev/null || die
-}
-
-multilib_src_configure() {
-	# Optional Features
-	myconf+=(
-		--enable-option-checking
-		$(use_enable debug)
-		--enable-dynamic
-		$(use_enable syslog)
-		$(use_enable ipv6)
-		--enable-local
-	)
-
-	# Optional Packages
-	myconf+=(
-		--without-fetch
-	)
-
-	if ! use minimal && multilib_is_native_abi; then
-		# SLAPD (Standalone LDAP Daemon) Options
-		# overlay chaining requires '--enable-ldap' #296567
-		# see https://www.openldap.org/doc/admin26/overlays.html#Chaining
-		myconf+=(
-			--enable-ldap=yes
-			--enable-slapd
-			$(use_enable cleartext)
-			$(use_enable crypt)
-			$(multilib_native_use_enable sasl spasswd)
-			--disable-slp
-			$(use_enable tcpd wrappers)
-		)
-		if use experimental ; then
-			# connectionless ldap per bug #342439
-			# connectionless is a unsupported feature according to Howard Chu
-			# see https://bugs.openldap.org/show_bug.cgi?id=9739
-			append-cppflags -DLDAP_CONNECTIONLESS
-
-			myconf+=(
-				--enable-dynacl
-				# ACI build as dynamic module not supported (yet)
-				--enable-aci=yes
-			)
-		fi
-
-		for option in modules rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# static SLAPD backends
-		for backend in mdb; do
-			myconf+=( --enable-${backend}=yes )
-		done
-
-		# module SLAPD backends
-		for backend in asyncmeta dnssrv meta null passwd relay sock; do
-			# missing modules: wiredtiger (not available in portage)
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		use perl && myconf+=( --enable-perl=mod )
-
-		if use odbc ; then
-			myconf+=( --enable-sql=mod )
-			if use iodbc ; then
-				myconf+=( --with-odbc="iodbc" )
-				append-cflags -I"${EPREFIX}"/usr/include/iodbc
-			else
-				myconf+=( --with-odbc="unixodbc" )
-			fi
-		fi
-
-		use overlays && myconf+=( --enable-overlays=mod )
-		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
-		# compile-in the syncprov
-		myconf+=( --enable-syncprov=yes )
-
-		# SLAPD Password Module Options
-		myconf+=(
-			$(use_enable argon2)
-		)
-
-		# Optional Packages
-		myconf+=(
-			$(use_with systemd)
-			$(multilib_native_use_with sasl cyrus-sasl)
-		)
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-mdb
-			--disable-overlays
-			--disable-autoca
-			--disable-syslog
-			--without-systemd
-		)
-	fi
-
-	# Library Generation & Linking Options
-	myconf+=(
-		$(use_enable static-libs static)
-		--enable-shared
-		--enable-versioning
-		--with-pic
-	)
-
-	# some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		if use gnutls ; then
-			myconf+=( --with-tls="gnutls" )
-		else
-			# disable MD2 hash function
-			append-cflags -DOPENSSL_NO_MD2
-			myconf+=( --with-tls="openssl" )
-		fi
-	else
-		myconf+=( --with-tls="no" )
-	fi
-
-	tc-export AR CC CXX
-
-	ECONF_SOURCE="${S}" econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		--localstatedir="${EPREFIX}"/var \
-		--runstatedir="${EPREFIX}"/run \
-		--sharedstatedir="${EPREFIX}"/var/lib \
-		"${myconf[@]}"
-
-	# argument '--runstatedir' seems to have no effect therefore this workaround
-	sed -i \
-		-e 's:^runstatedir=.*:runstatedir=${EPREFIX}/run:' \
-		configure contrib/ldapc++/configure contrib/ldaptcl/configure || die 'could not set runstatedir'
-
-	sed -i \
-		-e "s:/var/run/sasl2/mux:${EPREFIX}/run/sasl2/mux:" \
-		doc/guide/admin/security.sdf || die 'could not fix run path in doc'
-
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# we have to run it AFTER the main build, not just after the main configure
-	local myconf_ldapcpp=(
-		--with-libldap="${E}/lib"
-		--with-ldap-includes="${S}/include"
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die "could not create ${BUILD_DIR}/contrib/ldapc++ directory"
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-	local LDFLAGS=${LDFLAGS}
-	local CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}"
-	popd &>/dev/null || die "popd contrib/ldapc++"
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			build_contrib_module "passwd" "pw-kerberos.la"
-		fi
-
-		if use pbkdf2; then
-			build_contrib_module "passwd/pbkdf2"
-		fi
-
-		if use sha2 ; then
-			build_contrib_module "passwd/sha2"
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		build_contrib_module "passwd" "pw-netscape.la"
-
-		#build_contrib_module "acl" "posixgroup.la" # example code only
-		#build_contrib_module "acl" "gssacl.la" # example code only, also needs kerberos
-		build_contrib_module "addpartial"
-		build_contrib_module "allop"
-		build_contrib_module "allowed"
-		build_contrib_module "autogroup"
-		build_contrib_module "cloak"
-		# build_contrib_module "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop"
-		build_contrib_module "dsaschema"
-		build_contrib_module "dupent"
-		build_contrib_module "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod"
-		build_contrib_module "noopsrch"
-		#build_contrib_module "nops" https://bugs.gentoo.org/641576
-		#build_contrib_module "nssov" RESO:LATER
-		build_contrib_module "trace"
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		$(tc-getCC) -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd "tests"
-		pwd
-		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
-		# emake partests => runs ALL of the tests in parallel
-		# wt/WiredTiger is not supported in Gentoo
-		TESTS=( plloadd pmdb )
-		#TESTS+=( pldif ) # not done by default, so also exclude here
-		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
-		emake "${TESTS[@]}"
-	fi
-}
-
-multilib_src_install() {
-	emake CC="$(tc-getCC)" \
-		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		einfo "populate config with built backends"
-		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# if built without SLP, we don't need to be before avahi
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"/etc/init.d/slapd \
-				|| die
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			libtool --mode=install cp ${l} \
-				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		tmpfiles_process slapd.conf
-
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		if [[ -d "${EROOT}"/var/run/openldap ]]; then
-			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
-			chmod 0755 "${EROOT}"/var/run/openldap || die
-		fi
-		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
-		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
-}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-07-29  3:12 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-07-29  3:12 UTC (permalink / raw
  To: gentoo-commits

commit:     120dbccb1599ee5b0fb46983a6f53c27dbea324c
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 29 03:12:43 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 29 03:12:43 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=120dbccb

net-nds/openldap: add github upstream metadata

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/metadata.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net-nds/openldap/metadata.xml b/net-nds/openldap/metadata.xml
index d19853eda044..f005b31e7a9f 100644
--- a/net-nds/openldap/metadata.xml
+++ b/net-nds/openldap/metadata.xml
@@ -24,6 +24,7 @@
 	<upstream>
 		<bugs-to>https://bugs.openldap.org/</bugs-to>
 		<remote-id type="cpe">cpe:/a:openldap:openldap</remote-id>
+		<remote-id type="github">openldap/openldap</remote-id>
 		<remote-id type="gitlab">openldap/openldap</remote-id>
 	</upstream>
 </pkgmetadata>


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-11-20  4:25 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-11-20  4:25 UTC (permalink / raw
  To: gentoo-commits

commit:     474d34d3ba0c126554b10b1f400a65133ee451e8
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 20 04:24:47 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov 20 04:24:47 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=474d34d3

net-nds/openldap: drop 2.6.2

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/Manifest              |   1 -
 net-nds/openldap/openldap-2.6.2.ebuild | 798 ---------------------------------
 2 files changed, 799 deletions(-)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index afda18553753..3ae98a98eccd 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,6 +1,5 @@
 DIST openldap-2.4.57.tgz 5883912 BLAKE2B 439605e1bebcf34968f0a552aaade1b72b7671ae2a94a0b700a84f9f715acd162e7b8dadfdd3ffd5b0a785f9306b5f5033ab956cf0ffd26b66119a7110d0aa57 SHA512 b929bced0f5ba9a90e015a24b8037c8958fbb7282db272bd0cacf43b5f7540ab42159a3c4441148074340228bb5f07f93651c0dbb2affde961be156058f99ce5
 DIST openldap-2.4.58.tgz 5885225 BLAKE2B effb618dba03497796a497cd7f53ec52e389133769321dd242433bed5ec4b1f66cf7353f08a49d5f3465880f6bcfc9afc9c7d2a28e075b66f5fd926b02213541 SHA512 2fa2aa36117692eca44e55559f162c8c796f78469e6c2aee91b06d46f2b755d416979c913a3d89bbf9db14cc84881ecffee69af75b48e1d16b7aa9d2e3873baa
 DIST openldap-2.4.59.tgz 5886272 BLAKE2B a2a8bed1d2af97fd41d651668152fd4740871bc5a8abf4b50390839228af82ac103346b3500ae0f8dd31b708acabb30435b90cd48dfafe510e648df5150d96b8 SHA512 233459ab446da6e107a7fc4ecd5668d6b08c11a11359ee76449550393e8f586a29b59d7ae09a050a1fca4fcf388ea61438ef60831b3ae802d92c048365ae3968
-DIST openldap-OPENLDAP_REL_ENG_2_6_2.tar.gz 6216063 BLAKE2B 51c8d5ee712971c1aeeaedfc7bb89e65b2ccc2dc171bd0fb99e2b568d70ea5c66903194ab92a66de88fd9bc78511ffee0ab595b13a725933c7084943ac8c624a SHA512 0668165e194a7b1a483f88bf6b0f6eab2707c404f6c3164948cb11896c5e5411972a0677a927c0e509e98bfebb75b79e514bb6346b23d35687d9234f973d7520
 DIST openldap-OPENLDAP_REL_ENG_2_6_3.tar.gz 6244895 BLAKE2B 97792a1b368de44867b0ce9eef38601c3e64b7d40e4ca206295bee110097697c919040d2220eea6f0581812e09a2cc3e6afb4a243a5072a8a0a95f24f9fb354b SHA512 1c882a0cd0729b5d0f40b58588d0e36ae3b1cae6d569f0576e940c7c63d03c29ed2c9db87695a87594ba99a927ef4cba491bddba3ce049025fd5883463122ba7
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.6.2.ebuild b/net-nds/openldap/openldap-2.6.2.ebuild
deleted file mode 100644
index ada8b4ae1615..000000000000
--- a/net-nds/openldap/openldap-2.6.2.ebuild
+++ /dev/null
@@ -1,798 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
-
-MY_PV="$(ver_rs 1-2 _)"
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="https://www.OpenLDAP.org/"
-
-SRC_URI="
-	https://gitlab.com/openldap/${PN}/-/archive/OPENLDAP_REL_ENG_${MY_PV}/${PN}-OPENLDAP_REL_ENG_${MY_PV}.tar.gz
-	mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-# Subslot added for bug #835654
-SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
-IUSE_OVERLAY="overlays perl autoca"
-IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog test"
-IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
-IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
-IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-RESTRICT="!test? ( test )"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( cleartext sasl )
-	autoca? ( !gnutls )
-	?? ( test minimal )"
-
-S=${WORKDIR}/${PN}-OPENLDAP_REL_ENG_${MY_PV}
-
-# openssl is needed to generate lanman-passwords required by samba
-COMMON_DEPEND="
-	kernel_linux? ( sys-apps/util-linux )
-	ssl? (
-		!gnutls? (
-			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		dev-libs/libltdl
-		sys-fs/e2fsprogs
-		>=dev-db/lmdb-0.9.18:=
-		argon2? ( app-crypt/argon2:= )
-		crypt? ( virtual/libcrypt:= )
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			dev-libs/openssl:0=
-		)
-		smbkrb5passwd? (
-			dev-libs/openssl:0=
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-		)
-	)
-"
-DEPEND="${COMMON_DEPEND}
-	sys-apps/groff
-"
-RDEPEND="${COMMON_DEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-
-# The user/group are only used for running daemons which are
-# disabled in minimal builds, so elide the accounts too.
-BDEPEND="!minimal? (
-		acct-group/ldap
-		acct-user/ldap
-)
-"
-
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-	"${FILESDIR}"/${PN}-2.6.1-system-mdb.patch
-	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
-	"${FILESDIR}"/${PN}-2.6.1-flags.patch
-	"${FILESDIR}"/${PN}-2.6.1-fix-missing-mapping.patch
-	"${FILESDIR}"/${PN}-2.6.1-fix-bashism-configure.patch
-	"${FILESDIR}"/${PN}-2.6.1-parallel-build.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	# TODO: remove this as we dropped bdb support (gone upstream) in 2.6.1?
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-}
-
-src_prepare() {
-	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
-
-	for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do
-		iconv -f iso-8859-1 -t utf-8 "$filename" > "$filename.utf8"
-		mv "$filename.utf8" "$filename"
-	done
-
-	default
-
-	sed -i \
-		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
-		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to remove to early stripping"
-	popd &>/dev/null || die
-
-	eautoreconf
-	multilib_copy_sources
-}
-
-build_contrib_module() {
-	# <dir> [<target>]
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $1"
-	local target="${2:-all}"
-	emake \
-		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
-		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
-		"$target"
-	popd &>/dev/null || die
-}
-
-multilib_src_configure() {
-	# Optional Features
-	myconf+=(
-		--enable-option-checking
-		$(use_enable debug)
-		--enable-dynamic
-		$(use_enable syslog)
-		$(use_enable ipv6)
-		--enable-local
-	)
-
-	# Optional Packages
-	myconf+=(
-		--without-fetch
-	)
-
-	if ! use minimal && multilib_is_native_abi; then
-		# SLAPD (Standalone LDAP Daemon) Options
-		# overlay chaining requires '--enable-ldap' #296567
-		# see https://www.openldap.org/doc/admin26/overlays.html#Chaining
-		myconf+=(
-			--enable-ldap=yes
-			--enable-slapd
-			$(use_enable cleartext)
-			$(use_enable crypt)
-			$(multilib_native_use_enable sasl spasswd)
-			--disable-slp
-			$(use_enable tcpd wrappers)
-		)
-		if use experimental ; then
-			# connectionless ldap per bug #342439
-			# connectionless is a unsupported feature according to Howard Chu
-			# see https://bugs.openldap.org/show_bug.cgi?id=9739
-			append-cppflags -DLDAP_CONNECTIONLESS
-
-			myconf+=(
-				--enable-dynacl
-				# ACI build as dynamic module not supported (yet)
-				--enable-aci=yes
-			)
-		fi
-
-		for option in modules rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# static SLAPD backends
-		for backend in mdb; do
-			myconf+=( --enable-${backend}=yes )
-		done
-
-		# module SLAPD backends
-		for backend in asyncmeta dnssrv meta null passwd relay sock; do
-			# missing modules: wiredtiger (not available in portage)
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		use perl && myconf+=( --enable-perl=mod )
-
-		if use odbc ; then
-			myconf+=( --enable-sql=mod )
-			if use iodbc ; then
-				myconf+=( --with-odbc="iodbc" )
-				append-cflags -I"${EPREFIX}"/usr/include/iodbc
-			else
-				myconf+=( --with-odbc="unixodbc" )
-			fi
-		fi
-
-		use overlays && myconf+=( --enable-overlays=mod )
-		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
-		# compile-in the syncprov
-		myconf+=( --enable-syncprov=yes )
-
-		# SLAPD Password Module Options
-		myconf+=(
-			$(use_enable argon2)
-		)
-
-		# Optional Packages
-		myconf+=(
-			$(use_with systemd)
-			$(multilib_native_use_with sasl cyrus-sasl)
-		)
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-mdb
-			--disable-overlays
-			--disable-autoca
-			--disable-syslog
-			--without-systemd
-		)
-	fi
-
-	# Library Generation & Linking Options
-	myconf+=(
-		$(use_enable static-libs static)
-		--enable-shared
-		--enable-versioning
-		--with-pic
-	)
-
-	# some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		if use gnutls ; then
-			myconf+=( --with-tls="gnutls" )
-		else
-			# disable MD2 hash function
-			append-cflags -DOPENSSL_NO_MD2
-			myconf+=( --with-tls="openssl" )
-		fi
-	else
-		myconf+=( --with-tls="no" )
-	fi
-
-	tc-export AR CC CXX
-
-	ECONF_SOURCE="${S}" econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		--localstatedir="${EPREFIX}"/var \
-		--runstatedir="${EPREFIX}"/run \
-		--sharedstatedir="${EPREFIX}"/var/lib \
-		"${myconf[@]}"
-
-	# argument '--runstatedir' seems to have no effect therefore this workaround
-	sed -i \
-		-e 's:^runstatedir=.*:runstatedir=${EPREFIX}/run:' \
-		configure contrib/ldapc++/configure contrib/ldaptcl/configure || die 'could not set runstatedir'
-
-	sed -i \
-		-e "s:/var/run/sasl2/mux:${EPREFIX}/run/sasl2/mux:" \
-		doc/guide/admin/security.sdf || die 'could not fix run path in doc'
-
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# we have to run it AFTER the main build, not just after the main configure
-	local myconf_ldapcpp=(
-		--with-libldap="${E}/lib"
-		--with-ldap-includes="${S}/include"
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die "could not create ${BUILD_DIR}/contrib/ldapc++ directory"
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-	local LDFLAGS=${LDFLAGS}
-	local CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}"
-	popd &>/dev/null || die "popd contrib/ldapc++"
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			build_contrib_module "passwd" "pw-kerberos.la"
-		fi
-
-		if use pbkdf2; then
-			build_contrib_module "passwd/pbkdf2"
-		fi
-
-		if use sha2 ; then
-			build_contrib_module "passwd/sha2"
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		build_contrib_module "passwd" "pw-netscape.la"
-
-		#build_contrib_module "acl" "posixgroup.la" # example code only
-		#build_contrib_module "acl" "gssacl.la" # example code only, also needs kerberos
-		build_contrib_module "addpartial"
-		build_contrib_module "allop"
-		build_contrib_module "allowed"
-		build_contrib_module "autogroup"
-		build_contrib_module "cloak"
-		# build_contrib_module "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop"
-		build_contrib_module "dsaschema"
-		build_contrib_module "dupent"
-		build_contrib_module "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod"
-		build_contrib_module "noopsrch"
-		#build_contrib_module "nops" https://bugs.gentoo.org/641576
-		#build_contrib_module "nssov" RESO:LATER
-		build_contrib_module "trace"
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		$(tc-getCC) -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd "tests"
-		pwd
-		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
-		# emake partests => runs ALL of the tests in parallel
-		# wt/WiredTiger is not supported in Gentoo
-		TESTS=( plloadd pmdb )
-		#TESTS+=( pldif ) # not done by default, so also exclude here
-		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
-		emake "${TESTS[@]}"
-	fi
-}
-
-multilib_src_install() {
-	emake CC="$(tc-getCC)" \
-		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		einfo "populate config with built backends"
-		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# if built without SLP, we don't need to be before avahi
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"/etc/init.d/slapd \
-				|| die
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			libtool --mode=install cp ${l} \
-				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		tmpfiles_process slapd.conf
-
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		if [[ -d "${EROOT}"/var/run/openldap ]]; then
-			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
-			chmod 0755 "${EROOT}"/var/run/openldap || die
-		fi
-		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
-		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
-}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-12-14  1:53 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-12-14  1:53 UTC (permalink / raw
  To: gentoo-commits

commit:     5f2ee690c0eca8bdf4bcfda166fa813147f7123f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 14 01:52:56 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Dec 14 01:52:56 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f2ee690

net-nds/openldap: drop 2.6.3

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3.ebuild | 796 ---------------------------------
 1 file changed, 796 deletions(-)

diff --git a/net-nds/openldap/openldap-2.6.3.ebuild b/net-nds/openldap/openldap-2.6.3.ebuild
deleted file mode 100644
index f083a43a675a..000000000000
--- a/net-nds/openldap/openldap-2.6.3.ebuild
+++ /dev/null
@@ -1,796 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
-
-MY_PV="$(ver_rs 1-2 _)"
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="https://www.openldap.org/"
-SRC_URI="
-	https://gitlab.com/openldap/${PN}/-/archive/OPENLDAP_REL_ENG_${MY_PV}/${PN}-OPENLDAP_REL_ENG_${MY_PV}.tar.gz
-	mirror://gentoo/${BIS_P}
-"
-S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
-
-LICENSE="OPENLDAP GPL-2"
-# Subslot added for bug #835654
-SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
-IUSE_OVERLAY="overlays perl autoca"
-IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog test"
-IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
-IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
-IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-RESTRICT="!test? ( test )"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( cleartext sasl )
-	autoca? ( !gnutls )
-	?? ( test minimal )"
-
-# openssl is needed to generate lanman-passwords required by samba
-COMMON_DEPEND="
-	kernel_linux? ( sys-apps/util-linux )
-	ssl? (
-		!gnutls? (
-			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		dev-libs/libltdl
-		sys-fs/e2fsprogs
-		>=dev-db/lmdb-0.9.18:=
-		argon2? ( app-crypt/argon2:= )
-		crypt? ( virtual/libcrypt:= )
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			dev-libs/openssl:0=
-		)
-		smbkrb5passwd? (
-			dev-libs/openssl:0=
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-		)
-	)
-"
-DEPEND="${COMMON_DEPEND}
-	sys-apps/groff
-"
-RDEPEND="${COMMON_DEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-
-# The user/group are only used for running daemons which are
-# disabled in minimal builds, so elide the accounts too.
-BDEPEND="!minimal? (
-		acct-group/ldap
-		acct-user/ldap
-)
-"
-
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-	"${FILESDIR}"/${PN}-2.6.1-system-mdb.patch
-	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
-	"${FILESDIR}"/${PN}-2.6.1-flags.patch
-	"${FILESDIR}"/${PN}-2.6.1-fix-missing-mapping.patch
-	"${FILESDIR}"/${PN}-2.6.1-fix-bashism-configure.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	# TODO: remove this as we dropped bdb support (gone upstream) in 2.6.1?
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-}
-
-src_prepare() {
-	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
-
-	for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do
-		iconv -f iso-8859-1 -t utf-8 "$filename" > "$filename.utf8"
-		mv "$filename.utf8" "$filename"
-	done
-
-	default
-
-	sed -i \
-		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
-		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to remove to early stripping"
-	popd &>/dev/null || die
-
-	eautoreconf
-	multilib_copy_sources
-}
-
-build_contrib_module() {
-	# <dir> [<target>]
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $1"
-	local target="${2:-all}"
-	emake \
-		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
-		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
-		"$target"
-	popd &>/dev/null || die
-}
-
-multilib_src_configure() {
-	# Optional Features
-	myconf+=(
-		--enable-option-checking
-		$(use_enable debug)
-		--enable-dynamic
-		$(use_enable syslog)
-		$(use_enable ipv6)
-		--enable-local
-	)
-
-	# Optional Packages
-	myconf+=(
-		--without-fetch
-	)
-
-	if ! use minimal && multilib_is_native_abi; then
-		# SLAPD (Standalone LDAP Daemon) Options
-		# overlay chaining requires '--enable-ldap' #296567
-		# see https://www.openldap.org/doc/admin26/overlays.html#Chaining
-		myconf+=(
-			--enable-ldap=yes
-			--enable-slapd
-			$(use_enable cleartext)
-			$(use_enable crypt)
-			$(multilib_native_use_enable sasl spasswd)
-			--disable-slp
-			$(use_enable tcpd wrappers)
-		)
-		if use experimental ; then
-			# connectionless ldap per bug #342439
-			# connectionless is a unsupported feature according to Howard Chu
-			# see https://bugs.openldap.org/show_bug.cgi?id=9739
-			append-cppflags -DLDAP_CONNECTIONLESS
-
-			myconf+=(
-				--enable-dynacl
-				# ACI build as dynamic module not supported (yet)
-				--enable-aci=yes
-			)
-		fi
-
-		for option in modules rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# static SLAPD backends
-		for backend in mdb; do
-			myconf+=( --enable-${backend}=yes )
-		done
-
-		# module SLAPD backends
-		for backend in asyncmeta dnssrv meta null passwd relay sock; do
-			# missing modules: wiredtiger (not available in portage)
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		use perl && myconf+=( --enable-perl=mod )
-
-		if use odbc ; then
-			myconf+=( --enable-sql=mod )
-			if use iodbc ; then
-				myconf+=( --with-odbc="iodbc" )
-				append-cflags -I"${EPREFIX}"/usr/include/iodbc
-			else
-				myconf+=( --with-odbc="unixodbc" )
-			fi
-		fi
-
-		use overlays && myconf+=( --enable-overlays=mod )
-		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
-		# compile-in the syncprov
-		myconf+=( --enable-syncprov=yes )
-
-		# SLAPD Password Module Options
-		myconf+=(
-			$(use_enable argon2)
-		)
-
-		# Optional Packages
-		myconf+=(
-			$(use_with systemd)
-			$(multilib_native_use_with sasl cyrus-sasl)
-		)
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-mdb
-			--disable-overlays
-			--disable-autoca
-			--disable-syslog
-			--without-systemd
-		)
-	fi
-
-	# Library Generation & Linking Options
-	myconf+=(
-		$(use_enable static-libs static)
-		--enable-shared
-		--enable-versioning
-		--with-pic
-	)
-
-	# some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		if use gnutls ; then
-			myconf+=( --with-tls="gnutls" )
-		else
-			# disable MD2 hash function
-			append-cflags -DOPENSSL_NO_MD2
-			myconf+=( --with-tls="openssl" )
-		fi
-	else
-		myconf+=( --with-tls="no" )
-	fi
-
-	tc-export AR CC CXX
-
-	ECONF_SOURCE="${S}" econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		--localstatedir="${EPREFIX}"/var \
-		--runstatedir="${EPREFIX}"/run \
-		--sharedstatedir="${EPREFIX}"/var/lib \
-		"${myconf[@]}"
-
-	# argument '--runstatedir' seems to have no effect therefore this workaround
-	sed -i \
-		-e 's:^runstatedir=.*:runstatedir=${EPREFIX}/run:' \
-		configure contrib/ldapc++/configure contrib/ldaptcl/configure || die 'could not set runstatedir'
-
-	sed -i \
-		-e "s:/var/run/sasl2/mux:${EPREFIX}/run/sasl2/mux:" \
-		doc/guide/admin/security.sdf || die 'could not fix run path in doc'
-
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# we have to run it AFTER the main build, not just after the main configure
-	local myconf_ldapcpp=(
-		--with-libldap="${E}/lib"
-		--with-ldap-includes="${S}/include"
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die "could not create ${BUILD_DIR}/contrib/ldapc++ directory"
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-	local LDFLAGS=${LDFLAGS}
-	local CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}"
-	popd &>/dev/null || die "popd contrib/ldapc++"
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			build_contrib_module "passwd" "pw-kerberos.la"
-		fi
-
-		if use pbkdf2; then
-			build_contrib_module "passwd/pbkdf2"
-		fi
-
-		if use sha2 ; then
-			build_contrib_module "passwd/sha2"
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		build_contrib_module "passwd" "pw-netscape.la"
-
-		#build_contrib_module "acl" "posixgroup.la" # example code only
-		#build_contrib_module "acl" "gssacl.la" # example code only, also needs kerberos
-		build_contrib_module "addpartial"
-		build_contrib_module "allop"
-		build_contrib_module "allowed"
-		build_contrib_module "autogroup"
-		build_contrib_module "cloak"
-		# build_contrib_module "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop"
-		build_contrib_module "dsaschema"
-		build_contrib_module "dupent"
-		build_contrib_module "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod"
-		build_contrib_module "noopsrch"
-		#build_contrib_module "nops" https://bugs.gentoo.org/641576
-		#build_contrib_module "nssov" RESO:LATER
-		build_contrib_module "trace"
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		$(tc-getCC) -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd "tests"
-		pwd
-		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
-		# emake partests => runs ALL of the tests in parallel
-		# wt/WiredTiger is not supported in Gentoo
-		TESTS=( plloadd pmdb )
-		#TESTS+=( pldif ) # not done by default, so also exclude here
-		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
-		emake "${TESTS[@]}"
-	fi
-}
-
-multilib_src_install() {
-	emake CC="$(tc-getCC)" \
-		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		einfo "populate config with built backends"
-		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# if built without SLP, we don't need to be before avahi
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"/etc/init.d/slapd \
-				|| die
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			libtool --mode=install cp ${l} \
-				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		tmpfiles_process slapd.conf
-
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		if [[ -d "${EROOT}"/var/run/openldap ]]; then
-			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
-			chmod 0755 "${EROOT}"/var/run/openldap || die
-		fi
-		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
-		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
-}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-12-14  5:19 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-12-14  5:19 UTC (permalink / raw
  To: gentoo-commits

commit:     c923e32e5e9fd1d55437cfffed777054642e6677
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 14 05:18:49 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Dec 14 05:18:49 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c923e32e

net-nds/openldap: Stabilize 2.6.3-r3 x86, #873568

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r3.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r3.ebuild b/net-nds/openldap/openldap-2.6.3-r3.ebuild
index 98e863435dae..e494e314b828 100644
--- a/net-nds/openldap/openldap-2.6.3-r3.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r3.ebuild
@@ -22,7 +22,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-12-16  6:26 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2022-12-16  6:26 UTC (permalink / raw
  To: gentoo-commits

commit:     592058c8a5099184be492bcc897288de796123e3
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 16 06:26:08 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Dec 16 06:26:12 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=592058c8

net-nds/openldap: fix merged-usr for systemd units

I can't reproduce the failure but this seems good enough.

Bug: https://bugs.gentoo.org/885457
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r4.ebuild | 803 ++++++++++++++++++++++++++++++
 1 file changed, 803 insertions(+)

diff --git a/net-nds/openldap/openldap-2.6.3-r4.ebuild b/net-nds/openldap/openldap-2.6.3-r4.ebuild
new file mode 100644
index 000000000000..d180bd321343
--- /dev/null
+++ b/net-nds/openldap/openldap-2.6.3-r4.ebuild
@@ -0,0 +1,803 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
+
+MY_PV="$(ver_rs 1-2 _)"
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.openldap.org/"
+SRC_URI="
+	https://gitlab.com/openldap/${PN}/-/archive/OPENLDAP_REL_ENG_${MY_PV}/${PN}-OPENLDAP_REL_ENG_${MY_PV}.tar.gz
+	mirror://gentoo/${BIS_P}
+"
+S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
+
+LICENSE="OPENLDAP GPL-2"
+# Subslot added for bug #835654
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
+IUSE_OVERLAY="overlays perl autoca"
+IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog test"
+IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
+IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
+IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+RESTRICT="!test? ( test )"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( cleartext sasl )
+	autoca? ( !gnutls )
+	?? ( test minimal )"
+
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	kernel_linux? ( sys-apps/util-linux )
+	ssl? (
+		!gnutls? (
+			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		dev-libs/libltdl
+		sys-fs/e2fsprogs
+		>=dev-db/lmdb-0.9.18:=
+		argon2? ( app-crypt/argon2:= )
+		crypt? ( virtual/libcrypt:= )
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			dev-libs/openssl:0=
+		)
+		smbkrb5passwd? (
+			dev-libs/openssl:0=
+			kerberos? ( app-crypt/heimdal )
+			)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+		)
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+BDEPEND="!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+)
+"
+
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+	"${FILESDIR}"/${PN}-2.6.1-system-mdb.patch
+	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
+	"${FILESDIR}"/${PN}-2.6.1-flags.patch
+	"${FILESDIR}"/${PN}-2.6.1-fix-missing-mapping.patch
+	"${FILESDIR}"/${PN}-2.6.1-fix-bashism-configure.patch
+	"${FILESDIR}"/${PN}-2.6.3-clang16.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	# TODO: remove this as we dropped bdb support (gone upstream) in 2.6.1?
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		local fail=0
+		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. check that your data is intact."
+	eerror "11. set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
+
+	for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do
+		iconv -f iso-8859-1 -t utf-8 "$filename" > "$filename.utf8"
+		mv "$filename.utf8" "$filename"
+	done
+
+	default
+
+	sed -i \
+		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
+		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
+
+	# Hack for bug #885457
+	sed -i \
+		-e "s:systemdsystemunitdir=/usr/lib/systemd/system:systemdsystemunitdir=$(systemd_get_systemunitdir):" \
+		-e "s:systemdsystemunitdir=/lib/systemd/system:systemdsystemunitdir=$(systemd_get_systemunitdir):" \
+		configure.ac || die
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to remove to early stripping"
+	popd &>/dev/null || die
+
+	eautoreconf
+	multilib_copy_sources
+}
+
+build_contrib_module() {
+	# <dir> [<target>]
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $1"
+	local target="${2:-all}"
+	emake \
+		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
+		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
+		"$target"
+	popd &>/dev/null || die
+}
+
+multilib_src_configure() {
+	# Optional Features
+	myconf+=(
+		--enable-option-checking
+		$(use_enable debug)
+		--enable-dynamic
+		$(use_enable syslog)
+		$(use_enable ipv6)
+		--enable-local
+	)
+
+	# Optional Packages
+	myconf+=(
+		--without-fetch
+	)
+
+	if ! use minimal && multilib_is_native_abi; then
+		# SLAPD (Standalone LDAP Daemon) Options
+		# overlay chaining requires '--enable-ldap' #296567
+		# see https://www.openldap.org/doc/admin26/overlays.html#Chaining
+		myconf+=(
+			--enable-ldap=yes
+			--enable-slapd
+			$(use_enable cleartext)
+			$(use_enable crypt)
+			$(multilib_native_use_enable sasl spasswd)
+			--disable-slp
+			$(use_enable tcpd wrappers)
+		)
+		if use experimental ; then
+			# connectionless ldap per bug #342439
+			# connectionless is a unsupported feature according to Howard Chu
+			# see https://bugs.openldap.org/show_bug.cgi?id=9739
+			append-cppflags -DLDAP_CONNECTIONLESS
+
+			myconf+=(
+				--enable-dynacl
+				# ACI build as dynamic module not supported (yet)
+				--enable-aci=yes
+			)
+		fi
+
+		for option in modules rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# static SLAPD backends
+		for backend in mdb; do
+			myconf+=( --enable-${backend}=yes )
+		done
+
+		# module SLAPD backends
+		for backend in asyncmeta dnssrv meta null passwd relay sock; do
+			# missing modules: wiredtiger (not available in portage)
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		use perl && myconf+=( --enable-perl=mod )
+
+		if use odbc ; then
+			myconf+=( --enable-sql=mod )
+			if use iodbc ; then
+				myconf+=( --with-odbc="iodbc" )
+				append-cflags -I"${EPREFIX}"/usr/include/iodbc
+			else
+				myconf+=( --with-odbc="unixodbc" )
+			fi
+		fi
+
+		use overlays && myconf+=( --enable-overlays=mod )
+		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
+		# compile-in the syncprov
+		myconf+=( --enable-syncprov=yes )
+
+		# SLAPD Password Module Options
+		myconf+=(
+			$(use_enable argon2)
+		)
+
+		# Optional Packages
+		myconf+=(
+			$(use_with systemd)
+			$(multilib_native_use_with sasl cyrus-sasl)
+		)
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-mdb
+			--disable-overlays
+			--disable-autoca
+			--disable-syslog
+			--without-systemd
+		)
+	fi
+
+	# Library Generation & Linking Options
+	myconf+=(
+		$(use_enable static-libs static)
+		--enable-shared
+		--enable-versioning
+		--with-pic
+	)
+
+	# some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		if use gnutls ; then
+			myconf+=( --with-tls="gnutls" )
+		else
+			# disable MD2 hash function
+			append-cflags -DOPENSSL_NO_MD2
+			myconf+=( --with-tls="openssl" )
+		fi
+	else
+		myconf+=( --with-tls="no" )
+	fi
+
+	tc-export AR CC CXX
+
+	ECONF_SOURCE="${S}" econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		--localstatedir="${EPREFIX}"/var \
+		--runstatedir="${EPREFIX}"/run \
+		--sharedstatedir="${EPREFIX}"/var/lib \
+		"${myconf[@]}"
+
+	# argument '--runstatedir' seems to have no effect therefore this workaround
+	sed -i \
+		-e 's:^runstatedir=.*:runstatedir=${EPREFIX}/run:' \
+		configure contrib/ldapc++/configure contrib/ldaptcl/configure || die 'could not set runstatedir'
+
+	sed -i \
+		-e "s:/var/run/sasl2/mux:${EPREFIX}/run/sasl2/mux:" \
+		doc/guide/admin/security.sdf || die 'could not fix run path in doc'
+
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# we have to run it AFTER the main build, not just after the main configure
+	local myconf_ldapcpp=(
+		--with-libldap="${E}/lib"
+		--with-ldap-includes="${S}/include"
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die "could not create ${BUILD_DIR}/contrib/ldapc++ directory"
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+	local LDFLAGS=${LDFLAGS}
+	local CPPFLAGS=${CPPFLAGS}
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
+		-L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+	ECONF_SOURCE=${S}/contrib/ldapc++ \
+	econf "${myconf_ldapcpp[@]}"
+	popd &>/dev/null || die "popd contrib/ldapc++"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			build_contrib_module "passwd" "pw-kerberos.la"
+		fi
+
+		if use pbkdf2; then
+			build_contrib_module "passwd/pbkdf2"
+		fi
+
+		if use sha2 ; then
+			build_contrib_module "passwd/sha2"
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		build_contrib_module "passwd" "pw-netscape.la"
+
+		#build_contrib_module "acl" "posixgroup.la" # example code only
+		#build_contrib_module "acl" "gssacl.la" # example code only, also needs kerberos
+		build_contrib_module "addpartial"
+		build_contrib_module "allop"
+		build_contrib_module "allowed"
+		build_contrib_module "autogroup"
+		build_contrib_module "cloak"
+		# build_contrib_module "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop"
+		build_contrib_module "dsaschema"
+		build_contrib_module "dupent"
+		build_contrib_module "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod"
+		build_contrib_module "noopsrch"
+		#build_contrib_module "nops" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" RESO:LATER
+		build_contrib_module "trace"
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		$(tc-getCC) -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd "tests"
+		pwd
+		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
+		# emake partests => runs ALL of the tests in parallel
+		# wt/WiredTiger is not supported in Gentoo
+		TESTS=( plloadd pmdb )
+		#TESTS+=( pldif ) # not done by default, so also exclude here
+		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
+		emake "${TESTS[@]}"
+	fi
+}
+
+multilib_src_install() {
+	emake CC="$(tc-getCC)" \
+		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		einfo "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
+
+		einfo "Install systemd service"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
+		systemd_dounit "${T}"/slapd.service
+		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+
+		# if built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			libtool --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		tmpfiles_process slapd.conf
+
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2022-12-23 21:05 Mike Gilbert
  0 siblings, 0 replies; 187+ messages in thread
From: Mike Gilbert @ 2022-12-23 21:05 UTC (permalink / raw
  To: gentoo-commits

commit:     d7c74b87e45f95c143e87b122dee9afea290ab53
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 23 21:02:53 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Dec 23 21:05:17 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d7c74b87

net-nds/openldap: add REQUIRED_USE for conflicting features

Closes: https://bugs.gentoo.org/885359
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.57-r2.ebuild | 3 ++-
 net-nds/openldap/openldap-2.4.58-r2.ebuild | 3 ++-
 net-nds/openldap/openldap-2.4.59-r2.ebuild | 3 ++-
 net-nds/openldap/openldap-2.6.3-r3.ebuild  | 5 +++--
 net-nds/openldap/openldap-2.6.3-r4.ebuild  | 5 +++--
 5 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.57-r2.ebuild b/net-nds/openldap/openldap-2.4.57-r2.ebuild
index 92d0abe3c671..eee236d147bd 100644
--- a/net-nds/openldap/openldap-2.4.57-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.57-r2.ebuild
@@ -36,7 +36,8 @@ RESTRICT="!test? ( test )"
 REQUIRED_USE="cxx? ( sasl )
 	pbkdf2? ( ssl )
 	test? ( berkdb )
-	?? ( test minimal )"
+	?? ( test minimal )
+	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
 
 # always list newer first
 # Do not add any AGPL-3 BDB here!

diff --git a/net-nds/openldap/openldap-2.4.58-r2.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild
index 41c31f8ea973..bf9fe1d3e87b 100644
--- a/net-nds/openldap/openldap-2.4.58-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.58-r2.ebuild
@@ -36,7 +36,8 @@ RESTRICT="!test? ( test )"
 REQUIRED_USE="cxx? ( sasl )
 	pbkdf2? ( ssl )
 	test? ( berkdb )
-	?? ( test minimal )"
+	?? ( test minimal )
+	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
 
 # always list newer first
 # Do not add any AGPL-3 BDB here!

diff --git a/net-nds/openldap/openldap-2.4.59-r2.ebuild b/net-nds/openldap/openldap-2.4.59-r2.ebuild
index f04abefec1a4..2a36b6a3884a 100644
--- a/net-nds/openldap/openldap-2.4.59-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.59-r2.ebuild
@@ -36,7 +36,8 @@ RESTRICT="!test? ( test )"
 REQUIRED_USE="cxx? ( sasl )
 	pbkdf2? ( ssl )
 	test? ( berkdb )
-	?? ( test minimal )"
+	?? ( test minimal )
+	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
 
 # always list newer first
 # Do not add any AGPL-3 BDB here!

diff --git a/net-nds/openldap/openldap-2.6.3-r3.ebuild b/net-nds/openldap/openldap-2.6.3-r3.ebuild
index e494e314b828..00691826a18e 100644
--- a/net-nds/openldap/openldap-2.6.3-r3.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r3.ebuild
@@ -37,7 +37,8 @@ REQUIRED_USE="cxx? ( sasl )
 	pbkdf2? ( ssl )
 	test? ( cleartext sasl )
 	autoca? ( !gnutls )
-	?? ( test minimal )"
+	?? ( test minimal )
+	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
 
 # openssl is needed to generate lanman-passwords required by samba
 COMMON_DEPEND="
@@ -68,7 +69,7 @@ COMMON_DEPEND="
 		smbkrb5passwd? (
 			dev-libs/openssl:0=
 			kerberos? ( app-crypt/heimdal )
-			)
+		)
 		kerberos? (
 			virtual/krb5
 			kinit? ( !app-crypt/heimdal )

diff --git a/net-nds/openldap/openldap-2.6.3-r4.ebuild b/net-nds/openldap/openldap-2.6.3-r4.ebuild
index d180bd321343..14a589aac4b0 100644
--- a/net-nds/openldap/openldap-2.6.3-r4.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r4.ebuild
@@ -37,7 +37,8 @@ REQUIRED_USE="cxx? ( sasl )
 	pbkdf2? ( ssl )
 	test? ( cleartext sasl )
 	autoca? ( !gnutls )
-	?? ( test minimal )"
+	?? ( test minimal )
+	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
 
 # openssl is needed to generate lanman-passwords required by samba
 COMMON_DEPEND="
@@ -68,7 +69,7 @@ COMMON_DEPEND="
 		smbkrb5passwd? (
 			dev-libs/openssl:0=
 			kerberos? ( app-crypt/heimdal )
-			)
+		)
 		kerberos? (
 			virtual/krb5
 			kinit? ( !app-crypt/heimdal )


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-01-13 16:38 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-01-13 16:38 UTC (permalink / raw
  To: gentoo-commits

commit:     4c2149331d0cf4dc99d8e551f223b0f285b4f3e0
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 13 16:38:29 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 16:38:29 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4c214933

net-nds/openldap: Stabilize 2.6.3-r3 sparc, #873568

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r3.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r3.ebuild b/net-nds/openldap/openldap-2.6.3-r3.ebuild
index 00691826a18e..4daecf09072a 100644
--- a/net-nds/openldap/openldap-2.6.3-r3.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -22,7 +22,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-01-13 16:39 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-01-13 16:39 UTC (permalink / raw
  To: gentoo-commits

commit:     b163c160b0252b50e36bec1b060226c9698d5729
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 13 16:39:28 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 16:39:28 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b163c160

net-nds/openldap: Stabilize 2.6.3-r3 amd64, #873568

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r3.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r3.ebuild b/net-nds/openldap/openldap-2.6.3-r3.ebuild
index 4daecf09072a..0b722760737a 100644
--- a/net-nds/openldap/openldap-2.6.3-r3.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r3.ebuild
@@ -22,7 +22,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-01-13 16:39 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-01-13 16:39 UTC (permalink / raw
  To: gentoo-commits

commit:     87d3efd6ccb4c4a4c47cfb9e4bdd3884b3f59aeb
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 13 16:39:38 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 16:39:38 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=87d3efd6

net-nds/openldap: Stabilize 2.6.3-r3 hppa, #873568

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r3.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r3.ebuild b/net-nds/openldap/openldap-2.6.3-r3.ebuild
index f7ce90347a5f..fccec9c055ec 100644
--- a/net-nds/openldap/openldap-2.6.3-r3.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r3.ebuild
@@ -22,7 +22,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-01-13 16:39 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-01-13 16:39 UTC (permalink / raw
  To: gentoo-commits

commit:     d21fcfdfeba3055fdd74e9bd7aa632998baa2a36
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 13 16:39:35 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 16:39:35 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d21fcfdf

net-nds/openldap: Stabilize 2.6.3-r3 arm64, #873568

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r3.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r3.ebuild b/net-nds/openldap/openldap-2.6.3-r3.ebuild
index 96aa968821bc..f7ce90347a5f 100644
--- a/net-nds/openldap/openldap-2.6.3-r3.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r3.ebuild
@@ -22,7 +22,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-01-13 16:39 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-01-13 16:39 UTC (permalink / raw
  To: gentoo-commits

commit:     6a5e42d6f3911d9d659b02224cd59338ea016029
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 13 16:39:31 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 16:39:31 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a5e42d6

net-nds/openldap: Stabilize 2.6.3-r3 arm, #873568

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r3.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r3.ebuild b/net-nds/openldap/openldap-2.6.3-r3.ebuild
index 0b722760737a..96aa968821bc 100644
--- a/net-nds/openldap/openldap-2.6.3-r3.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r3.ebuild
@@ -22,7 +22,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-01-19 18:02 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-01-19 18:02 UTC (permalink / raw
  To: gentoo-commits

commit:     1a6f6a7a4036bd03613aef8cf2e9443a5f7105c8
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 19 18:00:08 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jan 19 18:02:32 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a6f6a7a

net-nds/openldap: drop 2.4.57-r2

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/Manifest                  |   1 -
 net-nds/openldap/openldap-2.4.57-r2.ebuild | 905 -----------------------------
 2 files changed, 906 deletions(-)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 3ae98a98eccd..6ae8e93ddfc6 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,4 +1,3 @@
-DIST openldap-2.4.57.tgz 5883912 BLAKE2B 439605e1bebcf34968f0a552aaade1b72b7671ae2a94a0b700a84f9f715acd162e7b8dadfdd3ffd5b0a785f9306b5f5033ab956cf0ffd26b66119a7110d0aa57 SHA512 b929bced0f5ba9a90e015a24b8037c8958fbb7282db272bd0cacf43b5f7540ab42159a3c4441148074340228bb5f07f93651c0dbb2affde961be156058f99ce5
 DIST openldap-2.4.58.tgz 5885225 BLAKE2B effb618dba03497796a497cd7f53ec52e389133769321dd242433bed5ec4b1f66cf7353f08a49d5f3465880f6bcfc9afc9c7d2a28e075b66f5fd926b02213541 SHA512 2fa2aa36117692eca44e55559f162c8c796f78469e6c2aee91b06d46f2b755d416979c913a3d89bbf9db14cc84881ecffee69af75b48e1d16b7aa9d2e3873baa
 DIST openldap-2.4.59.tgz 5886272 BLAKE2B a2a8bed1d2af97fd41d651668152fd4740871bc5a8abf4b50390839228af82ac103346b3500ae0f8dd31b708acabb30435b90cd48dfafe510e648df5150d96b8 SHA512 233459ab446da6e107a7fc4ecd5668d6b08c11a11359ee76449550393e8f586a29b59d7ae09a050a1fca4fcf388ea61438ef60831b3ae802d92c048365ae3968
 DIST openldap-OPENLDAP_REL_ENG_2_6_3.tar.gz 6244895 BLAKE2B 97792a1b368de44867b0ce9eef38601c3e64b7d40e4ca206295bee110097697c919040d2220eea6f0581812e09a2cc3e6afb4a243a5072a8a0a95f24f9fb354b SHA512 1c882a0cd0729b5d0f40b58588d0e36ae3b1cae6d569f0576e940c7c63d03c29ed2c9db87695a87594ba99a927ef4cba491bddba3ce049025fd5883463122ba7

diff --git a/net-nds/openldap/openldap-2.4.57-r2.ebuild b/net-nds/openldap/openldap-2.4.57-r2.ebuild
deleted file mode 100644
index eee236d147bd..000000000000
--- a/net-nds/openldap/openldap-2.4.57-r2.ebuild
+++ /dev/null
@@ -1,905 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools db-use flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="https://www.OpenLDAP.org/"
-
-# upstream mirrors are mostly not working, using canonical URI
-SRC_URI="
-	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
-	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
-	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
-	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
-	mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( berkdb )
-	?? ( test minimal )
-	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 4.8}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-COMMON_DEPEND="
-	ssl? (
-		!gnutls? (
-			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		dev-libs/libltdl
-		sys-fs/e2fsprogs
-		>=dev-db/lmdb-0.9.18:=
-		crypt? ( virtual/libcrypt:= )
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			dev-libs/openssl:0=
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			dev-libs/openssl:0=
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)
-"
-DEPEND="${COMMON_DEPEND}
-	sys-apps/groff
-"
-RDEPEND="${COMMON_DEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-
-# The user/group are only used for running daemons which are
-# disabled in minimal builds, so elide the accounts too.
-BDEPEND="!minimal? (
-		acct-group/ldap
-		acct-user/ldap
-)
-"
-
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
-	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# unbundle lmdb
-	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-
-	# fix some compiler warnings
-	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in ${BDB_SLOTS} ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "${NEWVER}" ]] && break
-			done
-		fi
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		-i include/ldap_defaults.h || die
-
-	default
-	rm -r libraries/liblmdb || die
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-	popd &>/dev/null || die
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed \
-		-e 's|/bin/sh|/bin/bash|g' \
-		-i tests/scripts/* || die "sed failed"
-
-	# Required for autoconf-2.70 #765043
-	sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.in || die
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-	popd &>/dev/null || die
-}
-
-src_configure() {
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
-			einfo "Using ${DBINCLUDE} for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			--disable-slp
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	CONFIG_SHELL="/bin/sh" \
-	ECONF_SOURCE="${S}" \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-	popd &>/dev/null || die
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake CC="${CC}" CXX="${CXX}"
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-			popd &>/dev/null || die
-		fi
-
-		if use pbkdf2; then
-			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-			popd &>/dev/null || die
-		fi
-
-		if use sha2 ; then
-			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
-			einfo "Compiling contrib-module: pw-sha2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o sha2.lo \
-				-c sha2.c || die "compiling pw-sha2 failed"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o slapd-sha2.lo \
-				-c slapd-sha2.c || die "compiling pw-sha2 failed"
-			einfo "Linking contrib-module: pw-sha2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-sha2.la \
-				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
-			popd &>/dev/null || die
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		popd &>/dev/null || die
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		einfo "populate config with built backends"
-		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"/etc/init.d/slapd \
-				|| die
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		tmpfiles_process slapd.conf
-
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		if [[ -d "${EROOT}"/var/run/openldap ]]; then
-			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
-			chmod 0755 "${EROOT}"/var/run/openldap || die
-		fi
-		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
-		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-01-28 19:33 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-01-28 19:33 UTC (permalink / raw
  To: gentoo-commits

commit:     f4533f3c7775bebb3a6b9c054439c502e7414e82
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 28 19:32:51 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Jan 28 19:32:51 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4533f3c

net-nds/openldap: Stabilize 2.6.3-r5 sparc, #891861

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r5.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r5.ebuild b/net-nds/openldap/openldap-2.6.3-r5.ebuild
index 95dd0945a1af..fce9b4e30bc3 100644
--- a/net-nds/openldap/openldap-2.6.3-r5.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r5.ebuild
@@ -22,7 +22,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-01-28 19:33 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-01-28 19:33 UTC (permalink / raw
  To: gentoo-commits

commit:     2d32615d19c8bbbb62344244b652fe701e07faf4
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 28 19:32:48 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Jan 28 19:32:48 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d32615d

net-nds/openldap: Stabilize 2.6.3-r5 hppa, #891861

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r5.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r5.ebuild b/net-nds/openldap/openldap-2.6.3-r5.ebuild
index b1a770aed43d..95dd0945a1af 100644
--- a/net-nds/openldap/openldap-2.6.3-r5.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r5.ebuild
@@ -22,7 +22,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-01-28 21:49 Jakov Smolić
  0 siblings, 0 replies; 187+ messages in thread
From: Jakov Smolić @ 2023-01-28 21:49 UTC (permalink / raw
  To: gentoo-commits

commit:     4bbdfa795f28b0be26d634573d745cdecc9e4ffc
Author:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 28 21:48:42 2023 +0000
Commit:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
CommitDate: Sat Jan 28 21:48:42 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4bbdfa79

net-nds/openldap: Stabilize 2.6.3-r5 arm, #891861

Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r5.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r5.ebuild b/net-nds/openldap/openldap-2.6.3-r5.ebuild
index fce9b4e30bc3..fd8c88d836b7 100644
--- a/net-nds/openldap/openldap-2.6.3-r5.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r5.ebuild
@@ -22,7 +22,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha ~amd64 arm ~arm64 hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-01-30 15:26 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-01-30 15:26 UTC (permalink / raw
  To: gentoo-commits

commit:     8158ac15cee26d20d72b2c70e105b8706e477a8d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 30 15:25:32 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jan 30 15:25:32 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8158ac15

net-nds/openldap: Stabilize 2.6.3-r5 amd64, #891861

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r5.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r5.ebuild b/net-nds/openldap/openldap-2.6.3-r5.ebuild
index fd8c88d836b7..e054e232a44d 100644
--- a/net-nds/openldap/openldap-2.6.3-r5.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r5.ebuild
@@ -22,7 +22,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 arm ~arm64 hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-01-30 15:26 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-01-30 15:26 UTC (permalink / raw
  To: gentoo-commits

commit:     1a5357f82d2439e911f8445bb851479d8e0ec690
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 30 15:25:35 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jan 30 15:25:35 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a5357f8

net-nds/openldap: Stabilize 2.6.3-r5 arm64, #891861

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r5.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r5.ebuild b/net-nds/openldap/openldap-2.6.3-r5.ebuild
index e054e232a44d..1c5ad42fa254 100644
--- a/net-nds/openldap/openldap-2.6.3-r5.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r5.ebuild
@@ -22,7 +22,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-01-30 15:26 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-01-30 15:26 UTC (permalink / raw
  To: gentoo-commits

commit:     55e5d7882e9d304e120b13a62ae2e37b0d81dc25
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 30 15:25:38 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jan 30 15:25:38 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55e5d788

net-nds/openldap: Stabilize 2.6.3-r5 ppc64, #891861

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r5.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r5.ebuild b/net-nds/openldap/openldap-2.6.3-r5.ebuild
index 1c5ad42fa254..96d3a30492af 100644
--- a/net-nds/openldap/openldap-2.6.3-r5.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r5.ebuild
@@ -22,7 +22,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-01-30 16:46 Mike Gilbert
  0 siblings, 0 replies; 187+ messages in thread
From: Mike Gilbert @ 2023-01-30 16:46 UTC (permalink / raw
  To: gentoo-commits

commit:     3a18977dfe87fa97e472701a98a7e1640c5176f7
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 30 16:43:19 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Jan 30 16:44:29 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a18977d

net-nds/openldap: adjust systemd unit install logic

Only install slapd.service when USE=systemd; it has Type=notify and is
therefore uselesss without sd_notify.

Also remove the upstream unit file to prevent weirdness with split-usr.

Closes: https://bugs.gentoo.org/892627
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r6.ebuild | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r6.ebuild b/net-nds/openldap/openldap-2.6.3-r6.ebuild
index 96d3a30492af..2645e95da094 100644
--- a/net-nds/openldap/openldap-2.6.3-r6.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r6.ebuild
@@ -326,12 +326,6 @@ src_prepare() {
 		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
 		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
 
-	# Hack for bug #885457
-	sed -i \
-		-e "s:systemdsystemunitdir=/usr/lib/systemd/system:systemdsystemunitdir=$(systemd_get_systemunitdir):" \
-		-e "s:systemdsystemunitdir=/lib/systemd/system:systemdsystemunitdir=$(systemd_get_systemunitdir):" \
-		configure.ac || die
-
 	pushd build &>/dev/null || die "pushd build"
 	einfo "Making sure upstream build strip does not do stripping too early"
 	sed -i.orig \
@@ -669,11 +663,15 @@ multilib_src_install() {
 		doinitd "${T}"/slapd
 		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
 
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+		if use systemd; then
+			# The systemd unit uses Type=notify, so it is useless without USE=systemd
+			einfo "Install systemd service"
+			rm -rf "${ED}"/{,usr/}lib/systemd
+			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
+			systemd_dounit "${T}"/slapd.service
+			systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+			newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+		fi
 
 		# if built without SLP, we don't need to be before avahi
 			sed -i \
@@ -763,7 +761,9 @@ pkg_preinst() {
 
 pkg_postinst() {
 	if ! use minimal ; then
-		tmpfiles_process slapd.conf
+		if use systemd; then
+			tmpfiles_process slapd.conf
+		fi
 
 		# You cannot build SSL certificates during src_install that will make
 		# binary packages containing your SSL key, which is both a security risk


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-02-08  1:55 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-02-08  1:55 UTC (permalink / raw
  To: gentoo-commits

commit:     c7a2be13f19326cf632100f8ad8f325c340d5384
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  8 01:54:30 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb  8 01:54:35 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c7a2be13

net-nds/openldap: adapt safety check for 2.4->2.6 upgrade

Drops berkdb.

See https://forums.gentoo.org/viewtopic-p-8775222.html.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...{openldap-2.6.3-r6.ebuild => openldap-2.6.3-r7.ebuild} | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r6.ebuild b/net-nds/openldap/openldap-2.6.3-r7.ebuild
similarity index 97%
rename from net-nds/openldap/openldap-2.6.3-r6.ebuild
rename to net-nds/openldap/openldap-2.6.3-r7.ebuild
index 2645e95da094..0c699006bb9c 100644
--- a/net-nds/openldap/openldap-2.6.3-r6.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r7.ebuild
@@ -231,7 +231,16 @@ openldap_find_versiontags() {
 		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
 			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
 		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+
+		if has_version "${CATEGORY}/${PN}[berkdb]" ; then
+			eerror "	OpenLDAP >= 2.6.x has dropped support for Berkeley DB."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted to mdb!"
+			echo
+			fail=1
+		elif [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
 			:
 			# Nothing wrong here.
 		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
@@ -287,8 +296,8 @@ openldap_upgrade_howto() {
 	eerror " 7. slapadd -l ${l}"
 	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
 	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
+	eerror "10. Check that your data is intact."
+	eerror "11. Set up the new replication system."
 	eerror
 	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
 		die "You need to upgrade your database first"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-02-10  1:05 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-02-10  1:05 UTC (permalink / raw
  To: gentoo-commits

commit:     c035192e22ba5714ccc15672f335e9b97aaeb568
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 10 01:02:06 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 10 01:05:03 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c035192e

net-nds/openldap: fix lmdb version, add version check

We must use at least the version of lmdb bundled with OpenLDAP.

Bug: https://bugs.gentoo.org/588792
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../{openldap-2.6.4.ebuild => openldap-2.6.4-r1.ebuild} | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.4.ebuild b/net-nds/openldap/openldap-2.6.4-r1.ebuild
similarity index 97%
rename from net-nds/openldap/openldap-2.6.4.ebuild
rename to net-nds/openldap/openldap-2.6.4-r1.ebuild
index 3cd2bdeb87d7..56617abc986c 100644
--- a/net-nds/openldap/openldap-2.6.4.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r1.ebuild
@@ -40,6 +40,7 @@ REQUIRED_USE="cxx? ( sasl )
 	?? ( test minimal )
 	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
 
+SYSTEM_LMDB_VER=0.9.30
 # openssl is needed to generate lanman-passwords required by samba
 COMMON_DEPEND="
 	kernel_linux? ( sys-apps/util-linux )
@@ -56,7 +57,7 @@ COMMON_DEPEND="
 	!minimal? (
 		dev-libs/libltdl
 		sys-fs/e2fsprogs
-		>=dev-db/lmdb-0.9.18:=
+		>=dev-db/lmdb-${SYSTEM_LMDB_VER}:=
 		argon2? ( app-crypt/argon2:= )
 		crypt? ( virtual/libcrypt:= )
 		tcpd? ( sys-apps/tcp-wrappers )
@@ -332,6 +333,20 @@ pkg_setup() {
 }
 
 src_prepare() {
+	# The system copy of dev-db/lmdb must match the version that this copy
+	# of OpenLDAP shipped with! See bug #588792.
+	#
+	# Fish out MDB_VERSION_MAJOR/MDB_VERSION_MINOR/MDB_VERSION_PATCH from
+	# the bundled lmdb's header to find out the version.
+	local bundled_lmdb_version=$(sed -En '/^#define MDB_VERSION_(MAJOR|MINOR|PATCH)(\s+)?/{s/[^0-9.]//gp}' libraries/liblmdb/lmdb.h || die)
+	bundled_lmdb_version=$(printf "%s." ${bundled_lmdb_version})
+
+	if [[ ${SYSTEM_LMDB_VER}. != ${bundled_lmdb_version} ]] ; then
+		eerror "Source lmdb version: ${bundled_lmdb_version}"
+		eerror "Ebuild lmdb version: ${SYSTEM_LMDB_VER}"
+		die "Ebuild needs to update SYSTEM_LMDB_VER!"
+	fi
+
 	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
 
 	local filename


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-02-12  6:22 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-02-12  6:22 UTC (permalink / raw
  To: gentoo-commits

commit:     b234dd8bbcf255937a8357d10eaa334e68b0bd5f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 05:56:24 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 06:10:19 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b234dd8b

net-nds/openldap: increase test timeouts

In the past, we've seen segfaults or (IIRC) a sigbus once on timeouts,
and the test in question here passes on sparc when running outside
of Portage anyway. Let's give it a go.

Bug: https://bugs.gentoo.org/894012
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.4-r1.ebuild | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net-nds/openldap/openldap-2.6.4-r1.ebuild b/net-nds/openldap/openldap-2.6.4-r1.ebuild
index 56617abc986c..51316d05feb1 100644
--- a/net-nds/openldap/openldap-2.6.4-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r1.ebuild
@@ -642,6 +642,7 @@ multilib_src_compile() {
 		$(tc-getCC) -shared \
 			-I"${BUILD_DIR}"/include \
 			-I../../../include \
+			${CPPFLAGS} \
 			${CFLAGS} \
 			-fPIC \
 			${LDFLAGS} \
@@ -656,6 +657,13 @@ multilib_src_test() {
 		cd tests || die
 		pwd
 
+		# Increase various test timeouts/delays, bug #894012
+		# We can't just double everything as there's a cumulative effect.
+		export SLEEP0=2 # originally 1
+		export SLEEP1=10 # originally 7
+		export SLEEP2=20 # originally 15
+		export TIMEOUT=16 # originally 8
+
 		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
 		# emake partests => runs ALL of the tests in parallel
 		# wt/WiredTiger is not supported in Gentoo


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-02-12  6:49 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-02-12  6:49 UTC (permalink / raw
  To: gentoo-commits

commit:     49716aa3092dd865ec5f944c7fd663934db50245
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 06:48:52 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 06:48:52 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49716aa3

net-nds/openldap: Stabilize 2.6.3-r3 ppc64, #873568

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.3-r3.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.3-r3.ebuild b/net-nds/openldap/openldap-2.6.3-r3.ebuild
index 55df096bb65f..5cc8ecdf048e 100644
--- a/net-nds/openldap/openldap-2.6.3-r3.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r3.ebuild
@@ -22,7 +22,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-02-12  6:49 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-02-12  6:49 UTC (permalink / raw
  To: gentoo-commits

commit:     46326dfdd093d644f002c28d698bb6a19edf263b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 06:48:49 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 06:48:49 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=46326dfd

net-nds/openldap: Stabilize 2.4.58-r2 sparc, #818739

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.58-r2.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.58-r2.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild
index bf9fe1d3e87b..f23db2eef5f9 100644
--- a/net-nds/openldap/openldap-2.4.58-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.58-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-02-12  6:52 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-02-12  6:52 UTC (permalink / raw
  To: gentoo-commits

commit:     764f9e98e0172bbcb490418e15da79989ae13acc
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 06:52:21 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 06:52:30 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=764f9e98

net-nds/openldap: drop 2.4.58-r2, 2.6.3-r3

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/Manifest                  |   1 -
 net-nds/openldap/openldap-2.4.58-r2.ebuild | 905 -----------------------------
 net-nds/openldap/openldap-2.6.3-r3.ebuild  | 798 -------------------------
 3 files changed, 1704 deletions(-)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 576ad995662b..9d6fb9452f28 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,4 +1,3 @@
-DIST openldap-2.4.58.tgz 5885225 BLAKE2B effb618dba03497796a497cd7f53ec52e389133769321dd242433bed5ec4b1f66cf7353f08a49d5f3465880f6bcfc9afc9c7d2a28e075b66f5fd926b02213541 SHA512 2fa2aa36117692eca44e55559f162c8c796f78469e6c2aee91b06d46f2b755d416979c913a3d89bbf9db14cc84881ecffee69af75b48e1d16b7aa9d2e3873baa
 DIST openldap-2.4.59.tgz 5886272 BLAKE2B a2a8bed1d2af97fd41d651668152fd4740871bc5a8abf4b50390839228af82ac103346b3500ae0f8dd31b708acabb30435b90cd48dfafe510e648df5150d96b8 SHA512 233459ab446da6e107a7fc4ecd5668d6b08c11a11359ee76449550393e8f586a29b59d7ae09a050a1fca4fcf388ea61438ef60831b3ae802d92c048365ae3968
 DIST openldap-OPENLDAP_REL_ENG_2_6_3.tar.gz 6244895 BLAKE2B 97792a1b368de44867b0ce9eef38601c3e64b7d40e4ca206295bee110097697c919040d2220eea6f0581812e09a2cc3e6afb4a243a5072a8a0a95f24f9fb354b SHA512 1c882a0cd0729b5d0f40b58588d0e36ae3b1cae6d569f0576e940c7c63d03c29ed2c9db87695a87594ba99a927ef4cba491bddba3ce049025fd5883463122ba7
 DIST openldap-OPENLDAP_REL_ENG_2_6_4.tar.bz2 5043227 BLAKE2B 9bec77dbace0e52d1607d9ac13a77349e7d0b8876aa81fa635893638d00db58ec6bf8412f11fd266bba0440887be1aa21eb4a876122152f7f6de9fd8f75b6b4c SHA512 bff11bf1ae125bcabbd307f6c4e1c102a8df6f1091f84f5e7053fdbaa89ccd6aa0c86cc8dcce4fb9b6ffd853b5f8d3c933733f5713aeb4d6a9d77ab145293b48

diff --git a/net-nds/openldap/openldap-2.4.58-r2.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild
deleted file mode 100644
index f23db2eef5f9..000000000000
--- a/net-nds/openldap/openldap-2.4.58-r2.ebuild
+++ /dev/null
@@ -1,905 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools db-use flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="https://www.OpenLDAP.org/"
-
-# upstream mirrors are mostly not working, using canonical URI
-SRC_URI="
-	https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
-	http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
-	http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
-	http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
-	mirror://gentoo/${BIS_P}"
-
-LICENSE="OPENLDAP GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="crypt samba tcpd experimental minimal"
-IUSE_BACKEND="+berkdb"
-IUSE_OVERLAY="overlays perl"
-IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test"
-IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
-IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
-IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( berkdb )
-	?? ( test minimal )
-	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
-
-# always list newer first
-# Do not add any AGPL-3 BDB here!
-# See bug 525110, comment 15.
-# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
-BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 4.8}"
-BDB_PKGS=''
-for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
-
-# openssl is needed to generate lanman-passwords required by samba
-COMMON_DEPEND="
-	ssl? (
-		!gnutls? (
-			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		dev-libs/libltdl
-		sys-fs/e2fsprogs
-		>=dev-db/lmdb-0.9.18:=
-		crypt? ( virtual/libcrypt:= )
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			dev-libs/openssl:0=
-		)
-		berkdb? (
-			<sys-libs/db-6.0:=
-			|| ( ${BDB_PKGS} )
-			)
-		smbkrb5passwd? (
-			dev-libs/openssl:0=
-			kerberos? ( app-crypt/heimdal )
-			)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-			)
-		cxx? ( dev-libs/cyrus-sasl:= )
-	)
-"
-DEPEND="${COMMON_DEPEND}
-	sys-apps/groff
-"
-RDEPEND="${COMMON_DEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-
-# The user/group are only used for running daemons which are
-# disabled in minimal builds, so elide the accounts too.
-BDEPEND="!minimal? (
-		acct-group/ldap
-		acct-user/ldap
-)
-"
-
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.17-gcc44.patch
-
-	"${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
-	"${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
-
-	# bug #116045 - still present in 2.4.28
-	"${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
-	# bug #408077 - samba4
-	"${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
-
-	# bug #189817
-	"${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
-
-	# bug #233633
-	"${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
-
-	# bug #281495
-	"${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
-
-	# bug #294350
-	"${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
-
-	# unbreak /bin/sh -> dash
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-
-	# bug #420959
-	"${FILESDIR}"/${PN}-2.4.31-gcc47.patch
-
-	# unbundle lmdb
-	"${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
-
-	# fix some compiler warnings
-	"${FILESDIR}"/${PN}-2.4.47-warnings.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		if use berkdb; then
-			# find which one would be used
-			for bdb_slot in ${BDB_SLOTS} ; do
-				NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
-				[[ -n "${NEWVER}" ]] && break
-			done
-		fi
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-}
-
-src_prepare() {
-	# ensure correct SLAPI path by default
-	sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
-		-i include/ldap_defaults.h || die
-
-	default
-	rm -r libraries/liblmdb || die
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to block stripping"
-	popd &>/dev/null || die
-
-	# wrong assumption that /bin/sh is /bin/bash
-	sed \
-		-e 's|/bin/sh|/bin/bash|g' \
-		-i tests/scripts/* || die "sed failed"
-
-	# Required for autoconf-2.70 #765043
-	sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.in || die
-	AT_NOEAUTOMAKE=yes eautoreconf
-}
-
-build_contrib_module() {
-	# <dir> <sources> <outputname>
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $3"
-	# Make sure it's uppercase
-	local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
-	"${lt}" --mode=compile --tag=CC \
-		"${CC}" \
-		-D${define_name}=SLAPD_MOD_DYNAMIC \
-		-I"${BUILD_DIR}"/include \
-		-I../../../include -I../../../servers/slapd ${CFLAGS} \
-		-o ${2%.c}.lo -c $2 || die "compiling $3 failed"
-	einfo "Linking contrib-module: $3"
-	"${lt}" --mode=link --tag=CC \
-		"${CC}" -module \
-		${CFLAGS} \
-		${LDFLAGS} \
-		-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-		-o $3.la ${2%.c}.lo || die "linking $3 failed"
-	popd &>/dev/null || die
-}
-
-src_configure() {
-	# connectionless ldap per bug #342439
-	append-cppflags -DLDAP_CONNECTIONLESS
-
-	multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
-	local myconf=()
-
-	use debug && myconf+=( $(use_enable debug) )
-
-	# ICU exists only in the configure, nowhere in the codebase, bug #510858
-	export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
-
-	if ! use minimal && multilib_is_native_abi; then
-		local CPPFLAGS=${CPPFLAGS}
-
-		# re-enable serverside overlay chains per bug #296567
-		# see ldap docs chaper 12.3.1 for details
-		myconf+=( --enable-ldap )
-
-		# backends
-		myconf+=( --enable-slapd )
-		if use berkdb ; then
-			einfo "Using Berkeley DB for local backend"
-			myconf+=( --enable-bdb --enable-hdb )
-			DBINCLUDE=$(db_includedir ${BDB_SLOTS})
-			einfo "Using ${DBINCLUDE} for sys-libs/db version"
-			# We need to include the slotted db.h dir for FreeBSD
-			append-cppflags -I${DBINCLUDE}
-		else
-			myconf+=( --disable-bdb --disable-hdb )
-		fi
-		for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		myconf+=( $(use_enable perl perl mod) )
-
-		myconf+=( $(use_enable odbc sql mod) )
-		if use odbc ; then
-			local odbc_lib="unixodbc"
-			if use iodbc ; then
-				odbc_lib="iodbc"
-				append-cppflags -I"${EPREFIX}"/usr/include/iodbc
-			fi
-			myconf+=( --with-odbc=${odbc_lib} )
-		fi
-
-		# slapd options
-		myconf+=(
-			$(use_enable crypt)
-			--disable-slp
-			$(use_enable samba lmpasswd)
-			$(use_enable syslog)
-		)
-		if use experimental ; then
-			myconf+=(
-				--enable-dynacl
-				--enable-aci=mod
-			)
-		fi
-		for option in aci cleartext modules rewrite rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# slapd overlay options
-		# Compile-in the syncprov, the others as module
-		myconf+=( --enable-syncprov=yes )
-		use overlays && myconf+=( --enable-overlays=mod )
-
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-bdb
-			--disable-hdb
-			--disable-mdb
-			--disable-overlays
-			--disable-syslog
-		)
-	fi
-
-	# basic functionality stuff
-	myconf+=(
-		$(use_enable ipv6)
-		$(multilib_native_use_with sasl cyrus-sasl)
-		$(multilib_native_use_enable sasl spasswd)
-		$(use_enable tcpd wrappers)
-	)
-
-	# Some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		ssl_lib="openssl"
-		use gnutls && ssl_lib="gnutls"
-	fi
-
-	myconf+=( --with-tls=${ssl_lib} )
-
-	for basicflag in dynamic local proctitle shared; do
-		myconf+=( --enable-${basicflag} )
-	done
-
-	tc-export AR CC CXX
-	CONFIG_SHELL="/bin/sh" \
-	ECONF_SOURCE="${S}" \
-	STRIP=/bin/true \
-	econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		$(use_enable static-libs static) \
-		"${myconf[@]}"
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# So we have to run it AFTER the main build, not just after the main
-	# configure.
-	local myconf_ldapcpp=(
-		--with-ldap-includes="${S}"/include
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-
-	local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}" \
-		CC="${CC}" \
-		CXX="${CXX}"
-	popd &>/dev/null || die
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
-	local lt="${BUILD_DIR}/libtool"
-	export echo="echo"
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake CC="${CC}" CXX="${CXX}"
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-			einfo "Compiling contrib-module: pw-kerberos"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../include \
-				${CFLAGS} \
-				$(krb5-config --cflags) \
-				-DHAVE_KRB5 \
-				-o kerberos.lo \
-				-c kerberos.c || die "compiling pw-kerberos failed"
-			einfo "Linking contrib-module: pw-kerberos"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-kerberos.la \
-				kerberos.lo || die "linking pw-kerberos failed"
-			popd &>/dev/null || die
-		fi
-
-		if use pbkdf2; then
-			pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
-			einfo "Compiling contrib-module: pw-pbkdf2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o pbkdf2.lo \
-				-c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
-			einfo "Linking contrib-module: pw-pbkdf2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-pbkdf2.la \
-				pbkdf2.lo || die "linking pw-pbkdf2 failed"
-			popd &>/dev/null || die
-		fi
-
-		if use sha2 ; then
-			pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
-			einfo "Compiling contrib-module: pw-sha2"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o sha2.lo \
-				-c sha2.c || die "compiling pw-sha2 failed"
-			"${lt}" --mode=compile --tag=CC \
-				"${CC}" \
-				-I"${BUILD_DIR}"/include \
-				-I../../../../include \
-				${CFLAGS} \
-				-o slapd-sha2.lo \
-				-c slapd-sha2.c || die "compiling pw-sha2 failed"
-			einfo "Linking contrib-module: pw-sha2"
-			"${lt}" --mode=link --tag=CC \
-				"${CC}" -module \
-				${CFLAGS} \
-				${LDFLAGS} \
-				-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-				-o pw-sha2.la \
-				sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
-			popd &>/dev/null || die
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
-		einfo "Compiling contrib-module: pw-netscape"
-		"${lt}" --mode=compile --tag=CC \
-			"${CC}" \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-o netscape.lo \
-			-c netscape.c || die "compiling pw-netscape failed"
-		einfo "Linking contrib-module: pw-netscape"
-		"${lt}" --mode=link --tag=CC \
-			"${CC}" -module \
-			${CFLAGS} \
-			${LDFLAGS} \
-			-rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
-			-o pw-netscape.la \
-			netscape.lo || die "linking pw-netscape failed"
-
-		#build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
-		#build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
-		build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
-		build_contrib_module "allop" "allop.c" "overlay-allop"
-		build_contrib_module "allowed" "allowed.c" "allowed"
-		build_contrib_module "autogroup" "autogroup.c" "autogroup"
-		build_contrib_module "cloak" "cloak.c" "cloak"
-		# build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop" "denyop.c" "denyop-overlay"
-		build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
-		build_contrib_module "dupent" "dupent.c" "dupent"
-		build_contrib_module "lastbind" "lastbind.c" "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod" "lastmod.c" "lastmod"
-		build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
-		#build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
-		#build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
-		build_contrib_module "trace" "trace.c" "trace"
-		popd &>/dev/null || die
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		"${CC}" -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd tests || die
-		emake tests
-	fi
-}
-
-multilib_src_install() {
-	local lt="${BUILD_DIR}/libtool"
-	emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
-		configfile="${ED}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		einfo "populate config with built backends"
-		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# If built without SLP, we don't need to be before avahi
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"/etc/init.d/slapd \
-				|| die
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			"${lt}" --mode=install cp ${l} \
-				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		tmpfiles_process slapd.conf
-
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		if [[ -d "${EROOT}"/var/run/openldap ]]; then
-			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
-			chmod 0755 "${EROOT}"/var/run/openldap || die
-		fi
-		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
-		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-		elog "---"
-		elog "An example file for tuning BDB backends with openldap is"
-		elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
-}

diff --git a/net-nds/openldap/openldap-2.6.3-r3.ebuild b/net-nds/openldap/openldap-2.6.3-r3.ebuild
deleted file mode 100644
index 5cc8ecdf048e..000000000000
--- a/net-nds/openldap/openldap-2.6.3-r3.ebuild
+++ /dev/null
@@ -1,798 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
-
-MY_PV="$(ver_rs 1-2 _)"
-
-BIS_PN=rfc2307bis.schema
-BIS_PV=20140524
-BIS_P="${BIS_PN}-${BIS_PV}"
-
-DESCRIPTION="LDAP suite of application and development tools"
-HOMEPAGE="https://www.openldap.org/"
-SRC_URI="
-	https://gitlab.com/openldap/${PN}/-/archive/OPENLDAP_REL_ENG_${MY_PV}/${PN}-OPENLDAP_REL_ENG_${MY_PV}.tar.gz
-	mirror://gentoo/${BIS_P}
-"
-S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
-
-LICENSE="OPENLDAP GPL-2"
-# Subslot added for bug #835654
-SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
-
-IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
-IUSE_OVERLAY="overlays perl autoca"
-IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog test"
-IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
-IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
-IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-RESTRICT="!test? ( test )"
-
-RESTRICT="!test? ( test )"
-REQUIRED_USE="cxx? ( sasl )
-	pbkdf2? ( ssl )
-	test? ( cleartext sasl )
-	autoca? ( !gnutls )
-	?? ( test minimal )
-	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
-
-# openssl is needed to generate lanman-passwords required by samba
-COMMON_DEPEND="
-	kernel_linux? ( sys-apps/util-linux )
-	ssl? (
-		!gnutls? (
-			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
-		)
-		gnutls? (
-			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
-			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
-		)
-	)
-	sasl? ( dev-libs/cyrus-sasl:= )
-	!minimal? (
-		dev-libs/libltdl
-		sys-fs/e2fsprogs
-		>=dev-db/lmdb-0.9.18:=
-		argon2? ( app-crypt/argon2:= )
-		crypt? ( virtual/libcrypt:= )
-		tcpd? ( sys-apps/tcp-wrappers )
-		odbc? ( !iodbc? ( dev-db/unixODBC )
-			iodbc? ( dev-db/libiodbc ) )
-		perl? ( dev-lang/perl:=[-build(-)] )
-		samba? (
-			dev-libs/openssl:0=
-		)
-		smbkrb5passwd? (
-			dev-libs/openssl:0=
-			kerberos? ( app-crypt/heimdal )
-		)
-		kerberos? (
-			virtual/krb5
-			kinit? ( !app-crypt/heimdal )
-		)
-	)
-"
-DEPEND="${COMMON_DEPEND}
-	sys-apps/groff
-"
-RDEPEND="${COMMON_DEPEND}
-	selinux? ( sec-policy/selinux-ldap )
-"
-
-# The user/group are only used for running daemons which are
-# disabled in minimal builds, so elide the accounts too.
-BDEPEND="!minimal? (
-		acct-group/ldap
-		acct-user/ldap
-)
-"
-
-# for tracking versions
-OPENLDAP_VERSIONTAG=".version-tag"
-OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
-
-MULTILIB_WRAPPED_HEADERS=(
-	# USE=cxx
-	/usr/include/LDAPAsynConnection.h
-	/usr/include/LDAPAttrType.h
-	/usr/include/LDAPAttribute.h
-	/usr/include/LDAPAttributeList.h
-	/usr/include/LDAPConnection.h
-	/usr/include/LDAPConstraints.h
-	/usr/include/LDAPControl.h
-	/usr/include/LDAPControlSet.h
-	/usr/include/LDAPEntry.h
-	/usr/include/LDAPEntryList.h
-	/usr/include/LDAPException.h
-	/usr/include/LDAPExtResult.h
-	/usr/include/LDAPMessage.h
-	/usr/include/LDAPMessageQueue.h
-	/usr/include/LDAPModList.h
-	/usr/include/LDAPModification.h
-	/usr/include/LDAPObjClass.h
-	/usr/include/LDAPRebind.h
-	/usr/include/LDAPRebindAuth.h
-	/usr/include/LDAPReferenceList.h
-	/usr/include/LDAPResult.h
-	/usr/include/LDAPSaslBindResult.h
-	/usr/include/LDAPSchema.h
-	/usr/include/LDAPSearchReference.h
-	/usr/include/LDAPSearchResult.h
-	/usr/include/LDAPSearchResults.h
-	/usr/include/LDAPUrl.h
-	/usr/include/LDAPUrlList.h
-	/usr/include/LdifReader.h
-	/usr/include/LdifWriter.h
-	/usr/include/SaslInteraction.h
-	/usr/include/SaslInteractionHandler.h
-	/usr/include/StringList.h
-	/usr/include/TlsOptions.h
-)
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
-	"${FILESDIR}"/${PN}-2.6.1-system-mdb.patch
-	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
-	"${FILESDIR}"/${PN}-2.6.1-flags.patch
-	"${FILESDIR}"/${PN}-2.6.1-fix-missing-mapping.patch
-	"${FILESDIR}"/${PN}-2.6.1-fix-bashism-configure.patch
-	"${FILESDIR}"/${PN}-2.6.3-clang16.patch
-)
-
-openldap_filecount() {
-	local dir="$1"
-	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
-}
-
-openldap_find_versiontags() {
-	# scan for all datadirs
-	local openldap_datadirs=()
-	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
-		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
-	fi
-	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
-
-	einfo
-	einfo "Scanning datadir(s) from slapd.conf and"
-	einfo "the default installdir for Versiontags"
-	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
-	einfo
-
-	# scan datadirs if we have a version tag
-	openldap_found_tag=0
-	have_files=0
-	for each in ${openldap_datadirs[@]} ; do
-		CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
-		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
-		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
-			einfo "- Checking ${each}..."
-			if [[ -r "${CURRENT_TAG}" ]] ; then
-				# yey, we have one :)
-				einfo "   Found Versiontag in ${each}"
-				source "${CURRENT_TAG}"
-				if [[ "${OLDPF}" == "" ]] ; then
-					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
-					eerror "Please delete it"
-					eerror
-					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
-				fi
-
-				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
-
-				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
-
-				# are we on the same branch?
-				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
-					ewarn "   Versiontag doesn't match current major release!"
-					if [[ "${have_files}" == "1" ]] ; then
-						eerror "   Versiontag says other major and you (probably) have datafiles!"
-						echo
-						openldap_upgrade_howto
-					else
-						einfo "   No real problem, seems there's no database."
-					fi
-				else
-					einfo "   Versiontag is fine here :)"
-				fi
-			else
-				einfo "   Non-tagged dir ${each}"
-				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
-				if [[ "${have_files}" == "1" ]] ; then
-					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
-					echo
-
-					eerror
-					eerror "Your OpenLDAP Installation has a non tagged datadir that"
-					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
-					eerror
-					eerror "Please export data if any entered and empty or remove"
-					eerror "the directory, installation has been stopped so you"
-					eerror "can take required action"
-					eerror
-					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
-					eerror
-					openldap_upgrade_howto
-					die "Please move the datadir ${CURRENT_TAGDIR} away"
-				fi
-			fi
-			einfo
-		fi
-	done
-	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
-
-	# Now we must check for the major version of sys-libs/db linked against.
-	# TODO: remove this as we dropped bdb support (gone upstream) in 2.6.1?
-	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
-	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
-		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
-			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
-		local fail=0
-		if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			:
-			# Nothing wrong here.
-		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was not built against"
-			eerror "	any version of sys-libs/db, but the new one will build"
-			eerror "	against	${NEWVER} and your database may be inaccessible."
-			echo
-			fail=1
-		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
-			eerror "	built against any version and your database may be"
-			eerror "	inaccessible."
-			echo
-			fail=1
-		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
-			eerror "	Your existing version of OpenLDAP was built against"
-			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
-			eerror "	${NEWVER} and your database would be inaccessible."
-			echo
-			fail=1
-		fi
-		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
-	fi
-
-	echo
-	einfo
-	einfo "All datadirs are fine, proceeding with merge now..."
-	einfo
-}
-
-openldap_upgrade_howto() {
-	local d l i
-	eerror
-	eerror "A (possible old) installation of OpenLDAP was detected,"
-	eerror "installation will not proceed for now."
-	eerror
-	eerror "As major version upgrades can corrupt your database,"
-	eerror "you need to dump your database and re-create it afterwards."
-	eerror
-	eerror "Additionally, rebuilding against different major versions of the"
-	eerror "sys-libs/db libraries will cause your database to be inaccessible."
-	eerror ""
-	d="$(date -u +%s)"
-	l="/root/ldapdump.${d}"
-	i="${l}.raw"
-	eerror " 1. /etc/init.d/slapd stop"
-	eerror " 2. slapcat -l ${i}"
-	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
-	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
-	eerror " 5. emerge --update \=net-nds/${PF}"
-	eerror " 6. etc-update, and ensure that you apply the changes"
-	eerror " 7. slapadd -l ${l}"
-	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
-	eerror " 9. /etc/init.d/slapd start"
-	eerror "10. check that your data is intact."
-	eerror "11. set up the new replication system."
-	eerror
-	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
-		die "You need to upgrade your database first"
-	else
-		eerror "You have the magical FORCE_UPGRADE=1 in place."
-		eerror "Don't say you weren't warned about data loss."
-	fi
-}
-
-pkg_setup() {
-	if ! use sasl && use cxx ; then
-		die "To build the ldapc++ library you must emerge openldap with sasl support"
-	fi
-	# Bug #322787
-	if use minimal && ! has_version "net-nds/openldap" ; then
-		einfo "No datadir scan needed, openldap not installed"
-	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
-		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
-	else
-		openldap_find_versiontags
-	fi
-}
-
-src_prepare() {
-	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
-
-	for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do
-		iconv -f iso-8859-1 -t utf-8 "$filename" > "$filename.utf8"
-		mv "$filename.utf8" "$filename"
-	done
-
-	default
-
-	sed -i \
-		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
-		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
-
-	pushd build &>/dev/null || die "pushd build"
-	einfo "Making sure upstream build strip does not do stripping too early"
-	sed -i.orig \
-		-e '/^STRIP/s,-s,,g' \
-		top.mk || die "Failed to remove to early stripping"
-	popd &>/dev/null || die
-
-	eautoreconf
-	multilib_copy_sources
-}
-
-build_contrib_module() {
-	# <dir> [<target>]
-	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
-	einfo "Compiling contrib-module: $1"
-	local target="${2:-all}"
-	emake \
-		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
-		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
-		"$target"
-	popd &>/dev/null || die
-}
-
-multilib_src_configure() {
-	# Optional Features
-	myconf+=(
-		--enable-option-checking
-		$(use_enable debug)
-		--enable-dynamic
-		$(use_enable syslog)
-		$(use_enable ipv6)
-		--enable-local
-	)
-
-	# Optional Packages
-	myconf+=(
-		--without-fetch
-	)
-
-	if ! use minimal && multilib_is_native_abi; then
-		# SLAPD (Standalone LDAP Daemon) Options
-		# overlay chaining requires '--enable-ldap' #296567
-		# see https://www.openldap.org/doc/admin26/overlays.html#Chaining
-		myconf+=(
-			--enable-ldap=yes
-			--enable-slapd
-			$(use_enable cleartext)
-			$(use_enable crypt)
-			$(multilib_native_use_enable sasl spasswd)
-			--disable-slp
-			$(use_enable tcpd wrappers)
-		)
-		if use experimental ; then
-			# connectionless ldap per bug #342439
-			# connectionless is a unsupported feature according to Howard Chu
-			# see https://bugs.openldap.org/show_bug.cgi?id=9739
-			append-cppflags -DLDAP_CONNECTIONLESS
-
-			myconf+=(
-				--enable-dynacl
-				# ACI build as dynamic module not supported (yet)
-				--enable-aci=yes
-			)
-		fi
-
-		for option in modules rlookups slapi; do
-			myconf+=( --enable-${option} )
-		done
-
-		# static SLAPD backends
-		for backend in mdb; do
-			myconf+=( --enable-${backend}=yes )
-		done
-
-		# module SLAPD backends
-		for backend in asyncmeta dnssrv meta null passwd relay sock; do
-			# missing modules: wiredtiger (not available in portage)
-			myconf+=( --enable-${backend}=mod )
-		done
-
-		use perl && myconf+=( --enable-perl=mod )
-
-		if use odbc ; then
-			myconf+=( --enable-sql=mod )
-			if use iodbc ; then
-				myconf+=( --with-odbc="iodbc" )
-				append-cflags -I"${EPREFIX}"/usr/include/iodbc
-			else
-				myconf+=( --with-odbc="unixodbc" )
-			fi
-		fi
-
-		use overlays && myconf+=( --enable-overlays=mod )
-		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
-		# compile-in the syncprov
-		myconf+=( --enable-syncprov=yes )
-
-		# SLAPD Password Module Options
-		myconf+=(
-			$(use_enable argon2)
-		)
-
-		# Optional Packages
-		myconf+=(
-			$(use_with systemd)
-			$(multilib_native_use_with sasl cyrus-sasl)
-		)
-	else
-		myconf+=(
-			--disable-backends
-			--disable-slapd
-			--disable-mdb
-			--disable-overlays
-			--disable-autoca
-			--disable-syslog
-			--without-systemd
-		)
-	fi
-
-	# Library Generation & Linking Options
-	myconf+=(
-		$(use_enable static-libs static)
-		--enable-shared
-		--enable-versioning
-		--with-pic
-	)
-
-	# some cross-compiling tests don't pan out well.
-	tc-is-cross-compiler && myconf+=(
-		--with-yielding-select=yes
-	)
-
-	local ssl_lib="no"
-	if use ssl || ( ! use minimal && use samba ) ; then
-		if use gnutls ; then
-			myconf+=( --with-tls="gnutls" )
-		else
-			# disable MD2 hash function
-			append-cflags -DOPENSSL_NO_MD2
-			myconf+=( --with-tls="openssl" )
-		fi
-	else
-		myconf+=( --with-tls="no" )
-	fi
-
-	tc-export AR CC CXX
-
-	ECONF_SOURCE="${S}" econf \
-		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
-		--localstatedir="${EPREFIX}"/var \
-		--runstatedir="${EPREFIX}"/run \
-		--sharedstatedir="${EPREFIX}"/var/lib \
-		"${myconf[@]}"
-
-	# argument '--runstatedir' seems to have no effect therefore this workaround
-	sed -i \
-		-e 's:^runstatedir=.*:runstatedir=${EPREFIX}/run:' \
-		configure contrib/ldapc++/configure contrib/ldaptcl/configure || die 'could not set runstatedir'
-
-	sed -i \
-		-e "s:/var/run/sasl2/mux:${EPREFIX}/run/sasl2/mux:" \
-		doc/guide/admin/security.sdf || die 'could not fix run path in doc'
-
-	emake depend
-}
-
-src_configure_cxx() {
-	# This needs the libraries built by the first build run.
-	# we have to run it AFTER the main build, not just after the main configure
-	local myconf_ldapcpp=(
-		--with-libldap="${E}/lib"
-		--with-ldap-includes="${S}/include"
-	)
-
-	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die "could not create ${BUILD_DIR}/contrib/ldapc++ directory"
-	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-	local LDFLAGS=${LDFLAGS}
-	local CPPFLAGS=${CPPFLAGS}
-	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
-		-L"${BUILD_DIR}"/libraries/libldap/.libs
-	append-cppflags -I"${BUILD_DIR}"/include
-	ECONF_SOURCE=${S}/contrib/ldapc++ \
-	econf "${myconf_ldapcpp[@]}"
-	popd &>/dev/null || die "popd contrib/ldapc++"
-}
-
-multilib_src_compile() {
-	tc-export AR CC CXX
-	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
-
-	if ! use minimal && multilib_is_native_abi ; then
-		if use cxx ; then
-			einfo "Building contrib library: ldapc++"
-			src_configure_cxx
-			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
-			emake
-			popd &>/dev/null || die
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Building contrib-module: smbk5pwd"
-			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
-
-			MY_DEFS="-DDO_SHADOW"
-			if use samba ; then
-				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
-				MY_KRB5_INC=""
-			fi
-			if use kerberos ; then
-				MY_DEFS="${MY_DEFS} -DDO_KRB5"
-				MY_KRB5_INC="$(krb5-config --cflags)"
-			fi
-
-			emake \
-				DEFS="${MY_DEFS}" \
-				KRB5_INC="${MY_KRB5_INC}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use overlays ; then
-			einfo "Building contrib-module: samba4"
-			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
-
-			emake \
-				LDAP_BUILD="${BUILD_DIR}" \
-				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
-			popd &>/dev/null || die
-		fi
-
-		if use kerberos ; then
-			if use kinit ; then
-				build_contrib_module "kinit" "kinit.c" "kinit"
-			fi
-			build_contrib_module "passwd" "pw-kerberos.la"
-		fi
-
-		if use pbkdf2; then
-			build_contrib_module "passwd/pbkdf2"
-		fi
-
-		if use sha2 ; then
-			build_contrib_module "passwd/sha2"
-		fi
-
-		# We could build pw-radius if GNURadius would install radlib.h
-		build_contrib_module "passwd" "pw-netscape.la"
-
-		#build_contrib_module "acl" "posixgroup.la" # example code only
-		#build_contrib_module "acl" "gssacl.la" # example code only, also needs kerberos
-		build_contrib_module "addpartial"
-		build_contrib_module "allop"
-		build_contrib_module "allowed"
-		build_contrib_module "autogroup"
-		build_contrib_module "cloak"
-		# build_contrib_module "comp_match" # really complex, adds new external deps, questionable demand
-		build_contrib_module "denyop"
-		build_contrib_module "dsaschema"
-		build_contrib_module "dupent"
-		build_contrib_module "lastbind"
-		# lastmod may not play well with other overlays
-		build_contrib_module "lastmod"
-		build_contrib_module "noopsrch"
-		#build_contrib_module "nops" https://bugs.gentoo.org/641576
-		#build_contrib_module "nssov" RESO:LATER
-		build_contrib_module "trace"
-		# build slapi-plugins
-		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
-		einfo "Building contrib-module: addrdnvalues plugin"
-		$(tc-getCC) -shared \
-			-I"${BUILD_DIR}"/include \
-			-I../../../include \
-			${CFLAGS} \
-			-fPIC \
-			${LDFLAGS} \
-			-o libaddrdnvalues-plugin.so \
-			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
-		popd &>/dev/null || die
-	fi
-}
-
-multilib_src_test() {
-	if multilib_is_native_abi; then
-		cd "tests"
-		pwd
-		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
-		# emake partests => runs ALL of the tests in parallel
-		# wt/WiredTiger is not supported in Gentoo
-		TESTS=( plloadd pmdb )
-		#TESTS+=( pldif ) # not done by default, so also exclude here
-		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
-		emake "${TESTS[@]}"
-	fi
-}
-
-multilib_src_install() {
-	emake CC="$(tc-getCC)" \
-		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
-
-	if ! use minimal && multilib_is_native_abi; then
-		# openldap modules go here
-		# TODO: write some code to populate slapd.conf with moduleload statements
-		keepdir /usr/$(get_libdir)/openldap/openldap/
-
-		# initial data storage dir
-		keepdir /var/lib/openldap-data
-		use prefix || fowners ldap:ldap /var/lib/openldap-data
-		fperms 0700 /var/lib/openldap-data
-
-		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
-
-		# use our config
-		rm "${ED}"/etc/openldap/slapd.conf
-		insinto /etc/openldap
-		newins "${FILESDIR}"/${PN}-2.6.3-slapd-conf slapd.conf
-		configfile="${ED}"/etc/openldap/slapd.conf
-
-		# populate with built backends
-		einfo "populate config with built backends"
-		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
-			einfo "Adding $(basename ${x})"
-			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
-		done
-		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
-		use prefix || fowners root:ldap /etc/openldap/slapd.conf
-		fperms 0640 /etc/openldap/slapd.conf
-		cp "${configfile}" "${configfile}".default || die
-
-		# install our own init scripts and systemd unit files
-		einfo "Install init scripts"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
-		doinitd "${T}"/slapd
-		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
-
-		einfo "Install systemd service"
-		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
-		systemd_dounit "${T}"/slapd.service
-		systemd_install_serviced "${FILESDIR}"/slapd.service.conf
-		newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
-
-		# if built without SLP, we don't need to be before avahi
-			sed -i \
-				-e '/before/{s/avahi-daemon//g}' \
-				"${ED}"/etc/init.d/slapd \
-				|| die
-
-		if use cxx ; then
-			einfo "Install the ldapc++ library"
-			cd "${BUILD_DIR}/contrib/ldapc++" || die
-			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			cd "${S}"/contrib/ldapc++ || die
-			newdoc README ldapc++-README
-		fi
-
-		if use smbkrb5passwd ; then
-			einfo "Install the smbk5pwd module"
-			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README smbk5pwd-README
-		fi
-
-		if use overlays ; then
-			einfo "Install the samba4 module"
-			cd "${S}/contrib/slapd-modules/samba4" || die
-			emake DESTDIR="${D}" \
-				LDAP_BUILD="${BUILD_DIR}" \
-				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
-			newdoc README samba4-README
-		fi
-
-		einfo "Installing contrib modules"
-		cd "${S}/contrib/slapd-modules" || die
-		for l in */*.la */*/*.la; do
-			[[ -e ${l} ]] || continue
-			libtool --mode=install cp ${l} \
-				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
-				die "installing ${l} failed"
-		done
-
-		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
-		docinto contrib
-		doman */*.5
-		#newdoc acl/README*
-		newdoc addpartial/README addpartial-README
-		newdoc allop/README allop-README
-		newdoc allowed/README allowed-README
-		newdoc autogroup/README autogroup-README
-		newdoc dsaschema/README dsaschema-README
-		newdoc passwd/README passwd-README
-		cd "${S}/contrib/slapi-plugins" || die
-		insinto /usr/$(get_libdir)/openldap/openldap
-		doins */*.so
-		docinto contrib
-		newdoc addrdnvalues/README addrdnvalues-README
-
-		insinto /etc/openldap/schema
-		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
-
-		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
-		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
-
-		dosbin "${S}"/contrib/slapd-tools/statslog
-		newdoc "${S}"/contrib/slapd-tools/README README.statslog
-	fi
-
-	if ! use static-libs ; then
-		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
-	fi
-}
-
-multilib_src_install_all() {
-	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
-	docinto rfc ; dodoc doc/rfc/*.txt
-}
-
-pkg_preinst() {
-	# keep old libs if any
-	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
-	# bug 440470, only display the getting started help there was no openldap before,
-	# or we are going to a non-minimal build
-	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
-	OPENLDAP_PRINT_MESSAGES=$((! $?))
-}
-
-pkg_postinst() {
-	if ! use minimal ; then
-		tmpfiles_process slapd.conf
-
-		# You cannot build SSL certificates during src_install that will make
-		# binary packages containing your SSL key, which is both a security risk
-		# and a misconfiguration if multiple machines use the same key and cert.
-		if use ssl; then
-			install_cert /etc/openldap/ssl/ldap
-			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
-			ewarn "add 'TLS_REQCERT allow' if you want to use them."
-		fi
-
-		if use prefix; then
-			# Warn about prefix issues with slapd
-			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
-			eerror "to start up, and requires that certain files directories be owned by"
-			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
-			eerror "directories, you will have to manually fix this yourself."
-		fi
-
-		# These lines force the permissions of various content to be correct
-		if [[ -d "${EROOT}"/var/run/openldap ]]; then
-			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
-			chmod 0755 "${EROOT}"/var/run/openldap || die
-		fi
-		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
-		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
-		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
-	fi
-
-	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
-		elog "Getting started using OpenLDAP? There is some documentation available:"
-		elog "Gentoo Guide to OpenLDAP Authentication"
-		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
-	fi
-
-	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
-}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-02-12  6:52 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-02-12  6:52 UTC (permalink / raw
  To: gentoo-commits

commit:     b7c9ff66ff5040aa696b385161a71d902da87254
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 06:52:06 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 06:52:30 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7c9ff66

net-nds/openldap: stabilize 2.4.59-r2

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.59-r2.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.59-r2.ebuild b/net-nds/openldap/openldap-2.4.59-r2.ebuild
index 2a36b6a3884a..f23db2eef5f9 100644
--- a/net-nds/openldap/openldap-2.4.59-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.59-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -22,7 +22,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-02-12 23:39 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2023-02-12 23:39 UTC (permalink / raw
  To: gentoo-commits

commit:     662ab2abb56e4a81f1d0053901fb1da466b34918
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 23:38:51 2023 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 23:38:51 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=662ab2ab

net-nds/openldap: fix /run creation

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
Closes: https://bugs.gentoo.org/836725

 net-nds/openldap/openldap-2.6.3-r7.ebuild | 2 ++
 net-nds/openldap/openldap-2.6.4-r1.ebuild | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/net-nds/openldap/openldap-2.6.3-r7.ebuild b/net-nds/openldap/openldap-2.6.3-r7.ebuild
index dd5276bf5a17..dd199fb41605 100644
--- a/net-nds/openldap/openldap-2.6.3-r7.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r7.ebuild
@@ -344,6 +344,8 @@ src_prepare() {
 
 	sed -i \
 		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
+		-e '/MKDIR.*.(DESTDIR)\/run/d' \
+		-e '/MKDIR.*.(DESTDIR).*.(runstatedir)/d' \
 		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
 
 	pushd build &>/dev/null || die "pushd build"

diff --git a/net-nds/openldap/openldap-2.6.4-r1.ebuild b/net-nds/openldap/openldap-2.6.4-r1.ebuild
index 51316d05feb1..836a5b52f960 100644
--- a/net-nds/openldap/openldap-2.6.4-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r1.ebuild
@@ -359,6 +359,8 @@ src_prepare() {
 
 	sed -i \
 		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
+		-e '/MKDIR.*.(DESTDIR)\/run/d' \
+		-e '/MKDIR.*.(DESTDIR).*.(runstatedir)/d' \
 		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
 
 	pushd build &>/dev/null || die "pushd build"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-03-19  3:22 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-03-19  3:22 UTC (permalink / raw
  To: gentoo-commits

commit:     849ed2778d87b605e764e603d9acbff6ca7c2045
Author:     Tomáš Mózes <hydrapolic <AT> gmail <DOT> com>
AuthorDate: Sun Mar 12 19:19:21 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar 19 03:18:52 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=849ed277

net-nds/openldap: add 2.5.14 (LTS)

Closes: https://bugs.gentoo.org/900621
Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/30080
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.5.14.ebuild | 858 ++++++++++++++++++++++++++++++++
 2 files changed, 859 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 9d6fb9452f28..b68584180cce 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,4 +1,5 @@
 DIST openldap-2.4.59.tgz 5886272 BLAKE2B a2a8bed1d2af97fd41d651668152fd4740871bc5a8abf4b50390839228af82ac103346b3500ae0f8dd31b708acabb30435b90cd48dfafe510e648df5150d96b8 SHA512 233459ab446da6e107a7fc4ecd5668d6b08c11a11359ee76449550393e8f586a29b59d7ae09a050a1fca4fcf388ea61438ef60831b3ae802d92c048365ae3968
+DIST openldap-OPENLDAP_REL_ENG_2_5_14.tar.bz2 5024359 BLAKE2B ffdffbd47e76545c2dc2d433d290945ab6eebd910031a60249cd8f6eac24f67841098e61c7e57864428e20a183a46d36dac422bba8cf6f3596f97439875af96b SHA512 abd1e8bda0762500db028f283fe2da9480a419072927295d6f3e1448cae130592511f385a87585843cf88217417c90ef57174ca919cfcf163eb41642a72bb4e3
 DIST openldap-OPENLDAP_REL_ENG_2_6_3.tar.gz 6244895 BLAKE2B 97792a1b368de44867b0ce9eef38601c3e64b7d40e4ca206295bee110097697c919040d2220eea6f0581812e09a2cc3e6afb4a243a5072a8a0a95f24f9fb354b SHA512 1c882a0cd0729b5d0f40b58588d0e36ae3b1cae6d569f0576e940c7c63d03c29ed2c9db87695a87594ba99a927ef4cba491bddba3ce049025fd5883463122ba7
 DIST openldap-OPENLDAP_REL_ENG_2_6_4.tar.bz2 5043227 BLAKE2B 9bec77dbace0e52d1607d9ac13a77349e7d0b8876aa81fa635893638d00db58ec6bf8412f11fd266bba0440887be1aa21eb4a876122152f7f6de9fd8f75b6b4c SHA512 bff11bf1ae125bcabbd307f6c4e1c102a8df6f1091f84f5e7053fdbaa89ccd6aa0c86cc8dcce4fb9b6ffd853b5f8d3c933733f5713aeb4d6a9d77ab145293b48
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.5.14.ebuild b/net-nds/openldap/openldap-2.5.14.ebuild
new file mode 100644
index 000000000000..476048dc9e28
--- /dev/null
+++ b/net-nds/openldap/openldap-2.5.14.ebuild
@@ -0,0 +1,858 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
+
+MY_PV="$(ver_rs 1-2 _)"
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.openldap.org/"
+SRC_URI="
+	https://gitlab.com/openldap/${PN}/-/archive/OPENLDAP_REL_ENG_${MY_PV}/${PN}-OPENLDAP_REL_ENG_${MY_PV}.tar.bz2
+	mirror://gentoo/${BIS_P}
+"
+S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
+
+LICENSE="OPENLDAP GPL-2"
+# Subslot added for bug #835654
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+
+IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
+IUSE_OVERLAY="overlays perl autoca"
+IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog test"
+IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
+IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
+IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+RESTRICT="!test? ( test )"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( cleartext debug sasl )
+	autoca? ( !gnutls )
+	?? ( test minimal )
+	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
+
+SYSTEM_LMDB_VER=0.9.30
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	kernel_linux? ( sys-apps/util-linux )
+	ssl? (
+		!gnutls? (
+			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		dev-libs/libltdl
+		sys-fs/e2fsprogs
+		>=dev-db/lmdb-${SYSTEM_LMDB_VER}:=
+		argon2? ( app-crypt/argon2:= )
+		crypt? ( virtual/libcrypt:= )
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			dev-libs/openssl:0=
+		)
+		smbkrb5passwd? (
+			dev-libs/openssl:0=
+			kerberos? ( app-crypt/heimdal )
+		)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+		)
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+BDEPEND="!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+)
+"
+
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+	"${FILESDIR}"/${PN}-2.6.1-system-mdb.patch
+	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
+	"${FILESDIR}"/${PN}-2.6.1-flags.patch
+	"${FILESDIR}"/${PN}-2.6.4-clang16.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${EROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	# TODO: remove this as we dropped bdb support (gone upstream) in 2.6.1?
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		local fail=0
+
+		# This will not cover detection of cn=Config based configuration, but
+		# it's hopefully good enough.
+		if grep -sq '^backend.*shell' "${EROOT}"/etc/openldap/slapd.conf; then
+			eerror "    OpenLDAP >= 2.6.x has dropped support for Shell backend."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted away from backend shell!"
+			echo
+			fail=1
+		fi
+		if has_version "${CATEGORY}/${PN}[berkdb]" || grep -sq '^backend.*(bdb|hdb)' /etc/openldap/slapd.conf; then
+			eerror "	OpenLDAP >= 2.6.x has dropped support for Berkeley DB."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted to mdb!"
+			echo
+			fail=1
+		elif [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. Check that your data is intact."
+	eerror "11. Set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	# The system copy of dev-db/lmdb must match the version that this copy
+	# of OpenLDAP shipped with! See bug #588792.
+	#
+	# Fish out MDB_VERSION_MAJOR/MDB_VERSION_MINOR/MDB_VERSION_PATCH from
+	# the bundled lmdb's header to find out the version.
+	local bundled_lmdb_version=$(sed -En '/^#define MDB_VERSION_(MAJOR|MINOR|PATCH)(\s+)?/{s/[^0-9.]//gp}' libraries/liblmdb/lmdb.h || die)
+	bundled_lmdb_version=$(printf "%s." ${bundled_lmdb_version})
+
+	if [[ ${SYSTEM_LMDB_VER}. != ${bundled_lmdb_version} ]] ; then
+		eerror "Source lmdb version: ${bundled_lmdb_version}"
+		eerror "Ebuild lmdb version: ${SYSTEM_LMDB_VER}"
+		die "Ebuild needs to update SYSTEM_LMDB_VER!"
+	fi
+
+	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
+
+	local filename
+	for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do
+		iconv -f iso-8859-1 -t utf-8 "${filename}" > "${filename}.utf8"
+		mv "${filename}.utf8" "${filename}"
+	done
+
+	default
+
+	sed -i \
+		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
+		-e '/MKDIR.*.(DESTDIR)\/run/d' \
+		-e '/MKDIR.*.(DESTDIR).*.(runstatedir)/d' \
+		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to remove too early stripping"
+	popd &>/dev/null || die
+
+	# Fails with OpenSSL 3, bug #848894
+	# https://bugs.openldap.org/show_bug.cgi?id=10009
+	rm tests/scripts/test076-authid-rewrite || die
+
+	eautoreconf
+	multilib_copy_sources
+}
+
+build_contrib_module() {
+	# <dir> [<target>]
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $1"
+	local target="${2:-all}"
+	emake \
+		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
+		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
+		"${target}"
+	popd &>/dev/null || die
+}
+
+multilib_src_configure() {
+	# Optional Features
+	myconf+=(
+		--enable-option-checking
+		$(use_enable debug)
+		--enable-dynamic
+		$(use_enable syslog)
+		$(use_enable ipv6)
+		--enable-local
+	)
+
+	# Optional Packages
+	myconf+=(
+		--without-fetch
+	)
+
+	if use experimental ; then
+		# connectionless ldap per bug #342439
+		# connectionless is a unsupported feature according to Howard Chu
+		# see https://bugs.openldap.org/show_bug.cgi?id=9739
+		# (see also bug #892009)
+		append-flags -DLDAP_CONNECTIONLESS
+	fi
+
+	if ! use minimal && multilib_is_native_abi; then
+		# SLAPD (Standalone LDAP Daemon) Options
+		# overlay chaining requires '--enable-ldap' #296567
+		# see https://www.openldap.org/doc/admin26/overlays.html#Chaining
+		myconf+=(
+			--enable-ldap=yes
+			--enable-slapd
+			$(use_enable cleartext)
+			$(use_enable crypt)
+			$(multilib_native_use_enable sasl spasswd)
+			--disable-slp
+			$(use_enable tcpd wrappers)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				# ACI build as dynamic module not supported (yet)
+				--enable-aci=yes
+			)
+		fi
+
+		for option in modules rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# static SLAPD backends
+		for backend in mdb; do
+			myconf+=( --enable-${backend}=yes )
+		done
+
+		# module SLAPD backends
+		for backend in asyncmeta dnssrv meta null passwd relay sock; do
+			# missing modules: wiredtiger (not available in portage)
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		use perl && myconf+=( --enable-perl=mod )
+
+		if use odbc ; then
+			myconf+=( --enable-sql=mod )
+			if use iodbc ; then
+				myconf+=( --with-odbc="iodbc" )
+				append-cflags -I"${EPREFIX}"/usr/include/iodbc
+			else
+				myconf+=( --with-odbc="unixodbc" )
+			fi
+		fi
+
+		use overlays && myconf+=( --enable-overlays=mod )
+		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
+		# compile-in the syncprov
+		myconf+=( --enable-syncprov=yes )
+
+		# SLAPD Password Module Options
+		myconf+=(
+			$(use_enable argon2)
+		)
+
+		# Optional Packages
+		myconf+=(
+			$(use_with systemd)
+			$(multilib_native_use_with sasl cyrus-sasl)
+		)
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-mdb
+			--disable-overlays
+			--disable-autoca
+			--disable-syslog
+			--without-systemd
+		)
+	fi
+
+	# Library Generation & Linking Options
+	myconf+=(
+		$(use_enable static-libs static)
+		--enable-shared
+		--enable-versioning
+		--with-pic
+	)
+
+	# some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		if use gnutls ; then
+			myconf+=( --with-tls="gnutls" )
+		else
+			# disable MD2 hash function
+			append-cflags -DOPENSSL_NO_MD2
+			myconf+=( --with-tls="openssl" )
+		fi
+	else
+		myconf+=( --with-tls="no" )
+	fi
+
+	tc-export AR CC CXX
+
+	ECONF_SOURCE="${S}" econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		--localstatedir="${EPREFIX}"/var \
+		--runstatedir="${EPREFIX}"/run \
+		--sharedstatedir="${EPREFIX}"/var/lib \
+		"${myconf[@]}"
+
+	# argument '--runstatedir' seems to have no effect therefore this workaround
+	sed -i \
+		-e 's:^runstatedir=.*:runstatedir=${EPREFIX}/run:' \
+		configure contrib/ldapc++/configure contrib/ldaptcl/configure || die 'could not set runstatedir'
+
+	sed -i \
+		-e "s:/var/run/sasl2/mux:${EPREFIX}/run/sasl2/mux:" \
+		doc/guide/admin/security.sdf || die 'could not fix run path in doc'
+
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# we have to run it AFTER the main build, not just after the main configure
+	local myconf_ldapcpp=(
+		--with-libldap="${E}/lib"
+		--with-ldap-includes="${S}/include"
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die "could not create ${BUILD_DIR}/contrib/ldapc++ directory"
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS="${LDFLAGS}"
+	local CPPFLAGS="${CPPFLAGS}"
+
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs -L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+
+	ECONF_SOURCE="${S}"/contrib/ldapc++ econf "${myconf_ldapcpp[@]}"
+	popd &>/dev/null || die "popd contrib/ldapc++"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			build_contrib_module "passwd" "pw-kerberos.la"
+		fi
+
+		if use pbkdf2; then
+			build_contrib_module "passwd/pbkdf2"
+		fi
+
+		if use sha2 ; then
+			build_contrib_module "passwd/sha2"
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		build_contrib_module "passwd" "pw-netscape.la"
+
+		#build_contrib_module "acl" "posixgroup.la" # example code only
+		#build_contrib_module "acl" "gssacl.la" # example code only, also needs kerberos
+		build_contrib_module "addpartial"
+		build_contrib_module "allop"
+		build_contrib_module "allowed"
+		build_contrib_module "autogroup"
+		build_contrib_module "cloak"
+		# build_contrib_module "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop"
+		build_contrib_module "dsaschema"
+		build_contrib_module "dupent"
+		build_contrib_module "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod"
+		build_contrib_module "noopsrch"
+		#build_contrib_module "nops" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" RESO:LATER
+		build_contrib_module "trace"
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		$(tc-getCC) -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CPPFLAGS} \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		pwd
+
+		# Increase various test timeouts/delays, bug #894012
+		# We can't just double everything as there's a cumulative effect.
+		export SLEEP0=2 # originally 1
+		export SLEEP1=10 # originally 7
+		export SLEEP2=20 # originally 15
+		export TIMEOUT=16 # originally 8
+
+		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
+		# emake partests => runs ALL of the tests in parallel
+		# wt/WiredTiger is not supported in Gentoo
+		TESTS=( lloadd mdb )
+		#TESTS+=( pldif ) # not done by default, so also exclude here
+		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
+
+		emake "${TESTS[@]}"
+	fi
+}
+
+multilib_src_install() {
+	emake CC="$(tc-getCC)" \
+		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.6.3-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		einfo "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
+
+		if use systemd; then
+			# The systemd unit uses Type=notify, so it is useless without USE=systemd
+			einfo "Install systemd service"
+			rm -rf "${ED}"/{,usr/}lib/systemd
+			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
+			systemd_dounit "${T}"/slapd.service
+			systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+			newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+		fi
+
+		# if built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			libtool --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		if use systemd; then
+			tmpfiles_process slapd.conf
+		fi
+
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-03-19  3:22 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-03-19  3:22 UTC (permalink / raw
  To: gentoo-commits

commit:     32877cf7e18c0ad25c2fa7fded5d6f6725392bd2
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 19 03:19:44 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar 19 03:19:44 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32877cf7

net-nds/openldap: add LTS note

Bug: https://bugs.gentoo.org/900621
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.59-r2.ebuild | 3 +++
 net-nds/openldap/openldap-2.5.14.ebuild    | 3 +++
 net-nds/openldap/openldap-2.6.3-r7.ebuild  | 3 +++
 net-nds/openldap/openldap-2.6.4-r1.ebuild  | 3 +++
 4 files changed, 12 insertions(+)

diff --git a/net-nds/openldap/openldap-2.4.59-r2.ebuild b/net-nds/openldap/openldap-2.4.59-r2.ebuild
index f23db2eef5f9..a67487013a0d 100644
--- a/net-nds/openldap/openldap-2.4.59-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.59-r2.ebuild
@@ -3,6 +3,9 @@
 
 EAPI=7
 
+# Re cleanups:
+# 2.5.x is an LTS release so we want to keep it for a while.
+
 inherit autotools db-use flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
 
 BIS_PN=rfc2307bis.schema

diff --git a/net-nds/openldap/openldap-2.5.14.ebuild b/net-nds/openldap/openldap-2.5.14.ebuild
index 476048dc9e28..a135572a4d9c 100644
--- a/net-nds/openldap/openldap-2.5.14.ebuild
+++ b/net-nds/openldap/openldap-2.5.14.ebuild
@@ -3,6 +3,9 @@
 
 EAPI=7
 
+# Re cleanups:
+# 2.5.x is an LTS release so we want to keep it for a while.
+
 inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
 
 MY_PV="$(ver_rs 1-2 _)"

diff --git a/net-nds/openldap/openldap-2.6.3-r7.ebuild b/net-nds/openldap/openldap-2.6.3-r7.ebuild
index dd199fb41605..5849b15e0533 100644
--- a/net-nds/openldap/openldap-2.6.3-r7.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r7.ebuild
@@ -3,6 +3,9 @@
 
 EAPI=7
 
+# Re cleanups:
+# 2.5.x is an LTS release so we want to keep it for a while.
+
 inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
 
 MY_PV="$(ver_rs 1-2 _)"

diff --git a/net-nds/openldap/openldap-2.6.4-r1.ebuild b/net-nds/openldap/openldap-2.6.4-r1.ebuild
index 836a5b52f960..634d3ca12cac 100644
--- a/net-nds/openldap/openldap-2.6.4-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r1.ebuild
@@ -3,6 +3,9 @@
 
 EAPI=7
 
+# Re cleanups:
+# 2.5.x is an LTS release so we want to keep it for a while.
+
 inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
 
 MY_PV="$(ver_rs 1-2 _)"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-05-01  1:53 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-05-01  1:53 UTC (permalink / raw
  To: gentoo-commits

commit:     3bce51f9072f4177603ac0b29aba2ffa0202c784
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon May  1 01:50:42 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May  1 01:50:42 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3bce51f9

net-nds/openldap: Stabilize 2.5.14 amd64, #905309

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.5.14.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.5.14.ebuild b/net-nds/openldap/openldap-2.5.14.ebuild
index a135572a4d9c..eaeae7d91ad9 100644
--- a/net-nds/openldap/openldap-2.5.14.ebuild
+++ b/net-nds/openldap/openldap-2.5.14.ebuild
@@ -25,7 +25,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-05-05 15:45 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-05-05 15:45 UTC (permalink / raw
  To: gentoo-commits

commit:     ddfc5c42c59e46494a9c018713305034ca9420e2
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri May  5 15:44:38 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri May  5 15:44:38 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ddfc5c42

net-nds/openldap: Stabilize 2.5.14 arm64, #905309

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.5.14.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.5.14.ebuild b/net-nds/openldap/openldap-2.5.14.ebuild
index f86e58ec4125..c25e9eeb6cbe 100644
--- a/net-nds/openldap/openldap-2.5.14.ebuild
+++ b/net-nds/openldap/openldap-2.5.14.ebuild
@@ -25,7 +25,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-05-05 15:45 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-05-05 15:45 UTC (permalink / raw
  To: gentoo-commits

commit:     94ec18ef5431b79817722028cf9d9ca2bb020ce7
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri May  5 15:44:44 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri May  5 15:44:44 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94ec18ef

net-nds/openldap: Stabilize 2.5.14 ppc64, #905309

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.5.14.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.5.14.ebuild b/net-nds/openldap/openldap-2.5.14.ebuild
index c25e9eeb6cbe..3cca46644343 100644
--- a/net-nds/openldap/openldap-2.5.14.ebuild
+++ b/net-nds/openldap/openldap-2.5.14.ebuild
@@ -25,7 +25,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-05-05 15:45 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-05-05 15:45 UTC (permalink / raw
  To: gentoo-commits

commit:     8ee3cc5e66d6e2840e40c4b84ec8762deefe4273
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri May  5 15:44:35 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri May  5 15:44:35 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ee3cc5e

net-nds/openldap: Stabilize 2.5.14 arm, #905309

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.5.14.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.5.14.ebuild b/net-nds/openldap/openldap-2.5.14.ebuild
index eaeae7d91ad9..f86e58ec4125 100644
--- a/net-nds/openldap/openldap-2.5.14.ebuild
+++ b/net-nds/openldap/openldap-2.5.14.ebuild
@@ -25,7 +25,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-05-05 15:45 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-05-05 15:45 UTC (permalink / raw
  To: gentoo-commits

commit:     aa8bc7f03f3b5b02e2ee55f67164737c8bfd6961
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri May  5 15:44:47 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri May  5 15:44:47 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa8bc7f0

net-nds/openldap: Stabilize 2.5.14 hppa, #905309

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.5.14.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.5.14.ebuild b/net-nds/openldap/openldap-2.5.14.ebuild
index 3cca46644343..cf087253ece0 100644
--- a/net-nds/openldap/openldap-2.5.14.ebuild
+++ b/net-nds/openldap/openldap-2.5.14.ebuild
@@ -25,7 +25,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-05-05 15:45 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-05-05 15:45 UTC (permalink / raw
  To: gentoo-commits

commit:     e004d1471fcdadcd306fbc9acf7aa60e759a3bf1
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri May  5 15:45:48 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri May  5 15:45:48 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e004d147

net-nds/openldap: Stabilize 2.5.14 sparc, #905309

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.5.14.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.5.14.ebuild b/net-nds/openldap/openldap-2.5.14.ebuild
index cf087253ece0..4e58c93c9298 100644
--- a/net-nds/openldap/openldap-2.5.14.ebuild
+++ b/net-nds/openldap/openldap-2.5.14.ebuild
@@ -25,7 +25,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-05-06 16:08 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-05-06 16:08 UTC (permalink / raw
  To: gentoo-commits

commit:     2cc62c2cf5a029a7b2672583728c346609fa5135
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat May  6 16:08:22 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat May  6 16:08:22 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2cc62c2c

net-nds/openldap: Stabilize 2.5.14 x86, #905309

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.5.14.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.5.14.ebuild b/net-nds/openldap/openldap-2.5.14.ebuild
index 4e58c93c9298..849a23ab7f4b 100644
--- a/net-nds/openldap/openldap-2.5.14.ebuild
+++ b/net-nds/openldap/openldap-2.5.14.ebuild
@@ -25,7 +25,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-06-12 19:12 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-06-12 19:12 UTC (permalink / raw
  To: gentoo-commits

commit:     6d96da86faf72ced61b89d64ea7c6162d3c5e628
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 11 22:57:52 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 12 19:10:42 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d96da86

net-nds/openldap: microoptimize

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.5.14.ebuild   | 2 +-
 net-nds/openldap/openldap-2.6.4-r1.ebuild | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net-nds/openldap/openldap-2.5.14.ebuild b/net-nds/openldap/openldap-2.5.14.ebuild
index 8b5c4628b810..7a4195c78e9a 100644
--- a/net-nds/openldap/openldap-2.5.14.ebuild
+++ b/net-nds/openldap/openldap-2.5.14.ebuild
@@ -342,7 +342,7 @@ src_prepare() {
 	# Fish out MDB_VERSION_MAJOR/MDB_VERSION_MINOR/MDB_VERSION_PATCH from
 	# the bundled lmdb's header to find out the version.
 	local bundled_lmdb_version=$(sed -En '/^#define MDB_VERSION_(MAJOR|MINOR|PATCH)(\s+)?/{s/[^0-9.]//gp}' libraries/liblmdb/lmdb.h || die)
-	bundled_lmdb_version=$(printf "%s." ${bundled_lmdb_version})
+	printf -v bundled_lmdb_version "%s." ${bundled_lmdb_version}
 
 	if [[ ${SYSTEM_LMDB_VER}. != ${bundled_lmdb_version} ]] ; then
 		eerror "Source lmdb version: ${bundled_lmdb_version}"

diff --git a/net-nds/openldap/openldap-2.6.4-r1.ebuild b/net-nds/openldap/openldap-2.6.4-r1.ebuild
index 2747bc015832..15efe59d9ec6 100644
--- a/net-nds/openldap/openldap-2.6.4-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r1.ebuild
@@ -343,7 +343,7 @@ src_prepare() {
 	# Fish out MDB_VERSION_MAJOR/MDB_VERSION_MINOR/MDB_VERSION_PATCH from
 	# the bundled lmdb's header to find out the version.
 	local bundled_lmdb_version=$(sed -En '/^#define MDB_VERSION_(MAJOR|MINOR|PATCH)(\s+)?/{s/[^0-9.]//gp}' libraries/liblmdb/lmdb.h || die)
-	bundled_lmdb_version=$(printf "%s." ${bundled_lmdb_version})
+	printf -v bundled_lmdb_version "%s." ${bundled_lmdb_version}
 
 	if [[ ${SYSTEM_LMDB_VER}. != ${bundled_lmdb_version} ]] ; then
 		eerror "Source lmdb version: ${bundled_lmdb_version}"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-07-02 16:31 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-07-02 16:31 UTC (permalink / raw
  To: gentoo-commits

commit:     99bf799a11aa9bcad16de2c6538fceeb5bc01211
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 14 04:34:51 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul  2 16:31:37 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99bf799a

net-nds/openldap: destabilize for ~hppa

Unlikely that anybody wants to use net-nds/openldap on hppa & often has platform-specific bugs.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.59-r2.ebuild | 2 +-
 net-nds/openldap/openldap-2.5.14.ebuild    | 2 +-
 net-nds/openldap/openldap-2.6.3-r7.ebuild  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.59-r2.ebuild b/net-nds/openldap/openldap-2.4.59-r2.ebuild
index 94ed791adcc8..ace8b2025805 100644
--- a/net-nds/openldap/openldap-2.4.59-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.59-r2.ebuild
@@ -25,7 +25,7 @@ SRC_URI="
 
 LICENSE="OPENLDAP GPL-2"
 SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
 
 IUSE_DAEMON="crypt samba tcpd experimental minimal"
 IUSE_BACKEND="+berkdb"

diff --git a/net-nds/openldap/openldap-2.5.14.ebuild b/net-nds/openldap/openldap-2.5.14.ebuild
index 7a4195c78e9a..5ed1e5c3733a 100644
--- a/net-nds/openldap/openldap-2.5.14.ebuild
+++ b/net-nds/openldap/openldap-2.5.14.ebuild
@@ -25,7 +25,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"

diff --git a/net-nds/openldap/openldap-2.6.3-r7.ebuild b/net-nds/openldap/openldap-2.6.3-r7.ebuild
index 54b2eff97d77..2533d50f6a45 100644
--- a/net-nds/openldap/openldap-2.6.3-r7.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r7.ebuild
@@ -25,7 +25,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-07-04  5:07 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2023-07-04  5:07 UTC (permalink / raw
  To: gentoo-commits

commit:     758c24f7977bac2e8c5db4d708c20da2b049ddc4
Author:     Matt Jolly <Matt.Jolly <AT> footclan <DOT> ninja>
AuthorDate: Mon Jul  3 22:22:44 2023 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue Jul  4 05:07:38 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=758c24f7

net-nds/openldap: add 2.6.4-r2

- Build and install `lloadd` when ! USE minimal
- Drop ipv6 USE
- Remove no-op sed from slapd makefile.in
- Add missing multibuild inherit
- split long sed lines
- EAPI 7 -> 8

Closes: https://bugs.gentoo.org/909359
Closes: https://github.com/gentoo/gentoo/pull/31733
Signed-off-by: Matt Jolly <Matt.Jolly <AT> footclan.ninja>
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.4-r2.ebuild | 869 ++++++++++++++++++++++++++++++
 1 file changed, 869 insertions(+)

diff --git a/net-nds/openldap/openldap-2.6.4-r2.ebuild b/net-nds/openldap/openldap-2.6.4-r2.ebuild
new file mode 100644
index 000000000000..767192ee5982
--- /dev/null
+++ b/net-nds/openldap/openldap-2.6.4-r2.ebuild
@@ -0,0 +1,869 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Re cleanups:
+# 2.5.x is an LTS release so we want to keep it for a while.
+
+inherit autotools flag-o-matic multibuild multilib multilib-minimal preserve-libs
+inherit ssl-cert toolchain-funcs systemd tmpfiles
+
+MY_PV="$(ver_rs 1-2 _)"
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.openldap.org/"
+SRC_URI="
+	https://gitlab.com/openldap/${PN}/-/archive/OPENLDAP_REL_ENG_${MY_PV}/${PN}-OPENLDAP_REL_ENG_${MY_PV}.tar.bz2
+	mirror://gentoo/${BIS_P}
+"
+S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
+
+LICENSE="OPENLDAP GPL-2"
+# Subslot added for bug #835654
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
+IUSE_OVERLAY="overlays perl autoca"
+IUSE_OPTIONAL="debug gnutls iodbc odbc sasl ssl selinux static-libs +syslog test"
+IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
+IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
+IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+RESTRICT="!test? ( test )"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( cleartext sasl )
+	autoca? ( !gnutls )
+	?? ( test minimal )
+	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
+
+SYSTEM_LMDB_VER=0.9.30
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	kernel_linux? ( sys-apps/util-linux )
+	ssl? (
+		!gnutls? (
+			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		dev-libs/libevent:=
+		dev-libs/libltdl
+		sys-fs/e2fsprogs
+		>=dev-db/lmdb-${SYSTEM_LMDB_VER}:=
+		argon2? ( app-crypt/argon2:= )
+		crypt? ( virtual/libcrypt:= )
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			dev-libs/openssl:0=
+		)
+		smbkrb5passwd? (
+			dev-libs/openssl:0=
+			kerberos? ( app-crypt/heimdal )
+		)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+		)
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+BDEPEND="!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+)
+"
+
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+	"${FILESDIR}"/${PN}-2.6.1-system-mdb.patch
+	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
+	"${FILESDIR}"/${PN}-2.6.1-flags.patch
+	"${FILESDIR}"/${PN}-2.6.1-fix-missing-mapping.patch
+	"${FILESDIR}"/${PN}-2.6.4-clang16.patch
+	"${FILESDIR}"/${PN}-2.6.4-libressl.patch #903001
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${EROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	# TODO: remove this as we dropped bdb support (gone upstream) in 2.6.1?
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		local fail=0
+
+		# This will not cover detection of cn=Config based configuration, but
+		# it's hopefully good enough.
+		if grep -sq '^backend.*shell' "${EROOT}"/etc/openldap/slapd.conf; then
+			eerror "    OpenLDAP >= 2.6.x has dropped support for Shell backend."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted away from backend shell!"
+			echo
+			fail=1
+		fi
+		if has_version "${CATEGORY}/${PN}[berkdb]" || grep -sq '^backend.*(bdb|hdb)' /etc/openldap/slapd.conf; then
+			eerror "	OpenLDAP >= 2.6.x has dropped support for Berkeley DB."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted to mdb!"
+			echo
+			fail=1
+		elif [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. Check that your data is intact."
+	eerror "11. Set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	# The system copy of dev-db/lmdb must match the version that this copy
+	# of OpenLDAP shipped with! See bug #588792.
+	#
+	# Fish out MDB_VERSION_MAJOR/MDB_VERSION_MINOR/MDB_VERSION_PATCH from
+	# the bundled lmdb's header to find out the version.
+	local bundled_lmdb_version=$(sed -En '/^#define MDB_VERSION_(MAJOR|MINOR|PATCH)(\s+)?/{s/[^0-9.]//gp}' \
+		libraries/liblmdb/lmdb.h || die)
+	printf -v bundled_lmdb_version "%s." ${bundled_lmdb_version}
+
+	if [[ ${SYSTEM_LMDB_VER}. != ${bundled_lmdb_version} ]] ; then
+		eerror "Source lmdb version: ${bundled_lmdb_version}"
+		eerror "Ebuild lmdb version: ${SYSTEM_LMDB_VER}"
+		die "Ebuild needs to update SYSTEM_LMDB_VER!"
+	fi
+
+	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
+
+	local filename
+	for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do
+		iconv -f iso-8859-1 -t utf-8 "${filename}" > "${filename}.utf8"
+		mv "${filename}.utf8" "${filename}"
+	done
+
+	default
+
+	sed -i \
+		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
+		-e '/MKDIR.*.(DESTDIR)\/run/d' \
+		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to remove too early stripping"
+	popd &>/dev/null || die
+
+	# Fails with OpenSSL 3, bug #848894
+	# https://bugs.openldap.org/show_bug.cgi?id=10009
+	rm tests/scripts/test076-authid-rewrite || die
+
+	eautoreconf
+	multilib_copy_sources
+}
+
+build_contrib_module() {
+	# <dir> [<target>]
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $1"
+	local target="${2:-all}"
+	emake \
+		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
+		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
+		"${target}"
+	popd &>/dev/null || die
+}
+
+multilib_src_configure() {
+	# Optional Features
+	myconf+=(
+		--enable-option-checking
+		$(use_enable debug)
+		--enable-dynamic
+		$(use_enable syslog)
+		--enable-ipv6
+		--enable-local
+	)
+
+	# Optional Packages
+	myconf+=(
+		--without-fetch
+	)
+
+	if use experimental ; then
+		# connectionless ldap per bug #342439
+		# connectionless is a unsupported feature according to Howard Chu
+		# see https://bugs.openldap.org/show_bug.cgi?id=9739
+		# (see also bug #892009)
+		append-flags -DLDAP_CONNECTIONLESS
+	fi
+
+	if ! use minimal && multilib_is_native_abi; then
+		# SLAPD (Standalone LDAP Daemon) Options
+		# overlay chaining requires '--enable-ldap' #296567
+		# see https://www.openldap.org/doc/admin26/overlays.html#Chaining
+		myconf+=(
+			--enable-ldap=yes
+			--enable-slapd
+			$(use_enable cleartext)
+			$(use_enable crypt)
+			$(multilib_native_use_enable sasl spasswd)
+			--disable-slp
+			$(use_enable tcpd wrappers)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				# ACI build as dynamic module not supported (yet)
+				--enable-aci=yes
+			)
+		fi
+
+		for option in modules rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# static SLAPD backends
+		for backend in mdb; do
+			myconf+=( --enable-${backend}=yes )
+		done
+
+		# module SLAPD backends
+		for backend in asyncmeta dnssrv meta null passwd relay sock; do
+			# missing modules: wiredtiger (not available in portage)
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		use perl && myconf+=( --enable-perl=mod )
+
+		if use odbc ; then
+			myconf+=( --enable-sql=mod )
+			if use iodbc ; then
+				myconf+=( --with-odbc="iodbc" )
+				append-cflags -I"${EPREFIX}"/usr/include/iodbc
+			else
+				myconf+=( --with-odbc="unixodbc" )
+			fi
+		fi
+
+		use overlays && myconf+=( --enable-overlays=mod )
+		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
+		# compile-in the syncprov
+		myconf+=( --enable-syncprov=yes )
+
+		# Build the standalone load balancer (lloadd) - also available as a slapd module; --enable-balancer=mod
+		myconf+=( --enable-balancer=yes )
+
+		# SLAPD Password Module Options
+		myconf+=(
+			$(use_enable argon2)
+		)
+
+		# Optional Packages
+		myconf+=(
+			$(use_with systemd)
+			$(multilib_native_use_with sasl cyrus-sasl)
+		)
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-mdb
+			--disable-overlays
+			--disable-autoca
+			--disable-syslog
+			--without-systemd
+		)
+	fi
+
+	# Library Generation & Linking Options
+	myconf+=(
+		$(use_enable static-libs static)
+		--enable-shared
+		--enable-versioning
+		--with-pic
+	)
+
+	# some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		if use gnutls ; then
+			myconf+=( --with-tls="gnutls" )
+		else
+			# disable MD2 hash function
+			append-cflags -DOPENSSL_NO_MD2
+			myconf+=( --with-tls="openssl" )
+		fi
+	else
+		myconf+=( --with-tls="no" )
+	fi
+
+	tc-export AR CC CXX
+
+	ECONF_SOURCE="${S}" econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		--localstatedir="${EPREFIX}"/var \
+		--runstatedir="${EPREFIX}"/run \
+		--sharedstatedir="${EPREFIX}"/var/lib \
+		"${myconf[@]}"
+
+	# argument '--runstatedir' seems to have no effect therefore this workaround
+	sed -i \
+		-e 's:^runstatedir=.*:runstatedir=${EPREFIX}/run:' \
+		configure contrib/ldapc++/configure contrib/ldaptcl/configure || die 'could not set runstatedir'
+
+	sed -i \
+		-e "s:/var/run/sasl2/mux:${EPREFIX}/run/sasl2/mux:" \
+		doc/guide/admin/security.sdf || die 'could not fix run path in doc'
+
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# we have to run it AFTER the main build, not just after the main configure
+	local myconf_ldapcpp=(
+		--with-libldap="${E}/lib"
+		--with-ldap-includes="${S}/include"
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die "could not create ${BUILD_DIR}/contrib/ldapc++ directory"
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS="${LDFLAGS}"
+	local CPPFLAGS="${CPPFLAGS}"
+
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs -L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+
+	ECONF_SOURCE="${S}"/contrib/ldapc++ econf "${myconf_ldapcpp[@]}"
+	popd &>/dev/null || die "popd contrib/ldapc++"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			build_contrib_module "passwd" "pw-kerberos.la"
+		fi
+
+		if use pbkdf2; then
+			build_contrib_module "passwd/pbkdf2"
+		fi
+
+		if use sha2 ; then
+			build_contrib_module "passwd/sha2"
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		build_contrib_module "passwd" "pw-netscape.la"
+
+		#build_contrib_module "acl" "posixgroup.la" # example code only
+		#build_contrib_module "acl" "gssacl.la" # example code only, also needs kerberos
+		build_contrib_module "addpartial"
+		build_contrib_module "allop"
+		build_contrib_module "allowed"
+		build_contrib_module "autogroup"
+		build_contrib_module "cloak"
+		# build_contrib_module "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop"
+		build_contrib_module "dsaschema"
+		build_contrib_module "dupent"
+		build_contrib_module "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod"
+		build_contrib_module "noopsrch"
+		#build_contrib_module "nops" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" RESO:LATER
+		build_contrib_module "trace"
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		$(tc-getCC) -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CPPFLAGS} \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		pwd
+
+		# Increase various test timeouts/delays, bug #894012
+		# We can't just double everything as there's a cumulative effect.
+		export SLEEP0=2 # originally 1
+		export SLEEP1=10 # originally 7
+		export SLEEP2=20 # originally 15
+		export TIMEOUT=16 # originally 8
+
+		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
+		# emake partests => runs ALL of the tests in parallel
+		# wt/WiredTiger is not supported in Gentoo
+		TESTS=( plloadd pmdb )
+		#TESTS+=( pldif ) # not done by default, so also exclude here
+		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
+
+		emake "${TESTS[@]}"
+	fi
+}
+
+multilib_src_install() {
+	emake CC="$(tc-getCC)" \
+		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.6.3-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		einfo "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" \
+			-i "${configfile}" || die
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
+
+		if use systemd; then
+			# The systemd unit uses Type=notify, so it is useless without USE=systemd
+			einfo "Install systemd service"
+			rm -rf "${ED}"/{,usr/}lib/systemd
+			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
+			systemd_dounit "${T}"/slapd.service
+			systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+			newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+		fi
+
+		# if built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			libtool --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		if use systemd; then
+			tmpfiles_process slapd.conf
+		fi
+
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-07-06  6:15 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-07-06  6:15 UTC (permalink / raw
  To: gentoo-commits

commit:     65df7312d74aad2099ee65a17e7f88172d649ee1
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jul  6 06:14:53 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jul  6 06:14:53 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65df7312

net-nds/openldap: fix version in ewarn

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.5.14.ebuild   | 2 +-
 net-nds/openldap/openldap-2.6.3-r7.ebuild | 4 ++--
 net-nds/openldap/openldap-2.6.4-r1.ebuild | 4 ++--
 net-nds/openldap/openldap-2.6.4-r2.ebuild | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/net-nds/openldap/openldap-2.5.14.ebuild b/net-nds/openldap/openldap-2.5.14.ebuild
index 5ed1e5c3733a..042d0617e57b 100644
--- a/net-nds/openldap/openldap-2.5.14.ebuild
+++ b/net-nds/openldap/openldap-2.5.14.ebuild
@@ -247,7 +247,7 @@ openldap_find_versiontags() {
 			fail=1
 		fi
 		if has_version "${CATEGORY}/${PN}[berkdb]" || grep -sq '^backend.*(bdb|hdb)' /etc/openldap/slapd.conf; then
-			eerror "	OpenLDAP >= 2.6.x has dropped support for Berkeley DB."
+			eerror "	OpenLDAP >= 2.5.x has dropped support for Berkeley DB."
 			eerror "	You will need to migrate per upstream's migration notes"
 			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
 			eerror "	Your existing database will not be accessible until it is"

diff --git a/net-nds/openldap/openldap-2.6.3-r7.ebuild b/net-nds/openldap/openldap-2.6.3-r7.ebuild
index 2533d50f6a45..807dbe901d7a 100644
--- a/net-nds/openldap/openldap-2.6.3-r7.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r7.ebuild
@@ -238,7 +238,7 @@ openldap_find_versiontags() {
 		# This will not cover detection of cn=Config based configuration, but
 		# it's hopefully good enough.
 		if grep -sq '^backend.*shell' "${EROOT}"/etc/openldap/slapd.conf; then
-			eerror "    OpenLDAP >= 2.6.x has dropped support for Shell backend."
+			eerror "    OpenLDAP >= 2.5.x has dropped support for Shell backend."
 			eerror "	You will need to migrate per upstream's migration notes"
 			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
 			eerror "	Your existing database will not be accessible until it is"
@@ -247,7 +247,7 @@ openldap_find_versiontags() {
 			fail=1
 		fi
 		if has_version "${CATEGORY}/${PN}[berkdb]" || grep -sq '^backend.*(bdb|hdb)' /etc/openldap/slapd.conf; then
-			eerror "	OpenLDAP >= 2.6.x has dropped support for Berkeley DB."
+			eerror "	OpenLDAP >= 2.5.x has dropped support for Berkeley DB."
 			eerror "	You will need to migrate per upstream's migration notes"
 			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
 			eerror "	Your existing database will not be accessible until it is"

diff --git a/net-nds/openldap/openldap-2.6.4-r1.ebuild b/net-nds/openldap/openldap-2.6.4-r1.ebuild
index 15efe59d9ec6..9ab2af209b71 100644
--- a/net-nds/openldap/openldap-2.6.4-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r1.ebuild
@@ -239,7 +239,7 @@ openldap_find_versiontags() {
 		# This will not cover detection of cn=Config based configuration, but
 		# it's hopefully good enough.
 		if grep -sq '^backend.*shell' "${EROOT}"/etc/openldap/slapd.conf; then
-			eerror "    OpenLDAP >= 2.6.x has dropped support for Shell backend."
+			eerror "    OpenLDAP >= 2.5.x has dropped support for Shell backend."
 			eerror "	You will need to migrate per upstream's migration notes"
 			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
 			eerror "	Your existing database will not be accessible until it is"
@@ -248,7 +248,7 @@ openldap_find_versiontags() {
 			fail=1
 		fi
 		if has_version "${CATEGORY}/${PN}[berkdb]" || grep -sq '^backend.*(bdb|hdb)' /etc/openldap/slapd.conf; then
-			eerror "	OpenLDAP >= 2.6.x has dropped support for Berkeley DB."
+			eerror "	OpenLDAP >= 2.5.x has dropped support for Berkeley DB."
 			eerror "	You will need to migrate per upstream's migration notes"
 			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
 			eerror "	Your existing database will not be accessible until it is"

diff --git a/net-nds/openldap/openldap-2.6.4-r2.ebuild b/net-nds/openldap/openldap-2.6.4-r2.ebuild
index 767192ee5982..b144468124f7 100644
--- a/net-nds/openldap/openldap-2.6.4-r2.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r2.ebuild
@@ -241,7 +241,7 @@ openldap_find_versiontags() {
 		# This will not cover detection of cn=Config based configuration, but
 		# it's hopefully good enough.
 		if grep -sq '^backend.*shell' "${EROOT}"/etc/openldap/slapd.conf; then
-			eerror "    OpenLDAP >= 2.6.x has dropped support for Shell backend."
+			eerror "    OpenLDAP >= 2.5.x has dropped support for Shell backend."
 			eerror "	You will need to migrate per upstream's migration notes"
 			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
 			eerror "	Your existing database will not be accessible until it is"
@@ -250,7 +250,7 @@ openldap_find_versiontags() {
 			fail=1
 		fi
 		if has_version "${CATEGORY}/${PN}[berkdb]" || grep -sq '^backend.*(bdb|hdb)' /etc/openldap/slapd.conf; then
-			eerror "	OpenLDAP >= 2.6.x has dropped support for Berkeley DB."
+			eerror "	OpenLDAP >= 2.5.x has dropped support for Berkeley DB."
 			eerror "	You will need to migrate per upstream's migration notes"
 			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
 			eerror "	Your existing database will not be accessible until it is"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-07-15  8:49 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-07-15  8:49 UTC (permalink / raw
  To: gentoo-commits

commit:     706352c1dc879c12332058ad26f4636a9a849a38
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 15 08:48:05 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Jul 15 08:48:05 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=706352c1

net-nds/openldap: Stabilize 2.6.4-r1 arm64, #908276

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.4-r1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.4-r1.ebuild b/net-nds/openldap/openldap-2.6.4-r1.ebuild
index 9ab2af209b71..59c0f019ab63 100644
--- a/net-nds/openldap/openldap-2.6.4-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r1.ebuild
@@ -25,7 +25,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+KEYWORDS="~alpha ~amd64 ~arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-07-17 21:47 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-07-17 21:47 UTC (permalink / raw
  To: gentoo-commits

commit:     5b1520ea69d410ab743eb7998b5d886bbf597375
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 17 21:47:26 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul 17 21:47:34 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b1520ea

net-nds/openldap: add 2.6.5

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/Manifest              |   1 +
 net-nds/openldap/openldap-2.6.5.ebuild | 870 +++++++++++++++++++++++++++++++++
 2 files changed, 871 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index b68584180cce..c197823a3d0b 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -2,4 +2,5 @@ DIST openldap-2.4.59.tgz 5886272 BLAKE2B a2a8bed1d2af97fd41d651668152fd4740871bc
 DIST openldap-OPENLDAP_REL_ENG_2_5_14.tar.bz2 5024359 BLAKE2B ffdffbd47e76545c2dc2d433d290945ab6eebd910031a60249cd8f6eac24f67841098e61c7e57864428e20a183a46d36dac422bba8cf6f3596f97439875af96b SHA512 abd1e8bda0762500db028f283fe2da9480a419072927295d6f3e1448cae130592511f385a87585843cf88217417c90ef57174ca919cfcf163eb41642a72bb4e3
 DIST openldap-OPENLDAP_REL_ENG_2_6_3.tar.gz 6244895 BLAKE2B 97792a1b368de44867b0ce9eef38601c3e64b7d40e4ca206295bee110097697c919040d2220eea6f0581812e09a2cc3e6afb4a243a5072a8a0a95f24f9fb354b SHA512 1c882a0cd0729b5d0f40b58588d0e36ae3b1cae6d569f0576e940c7c63d03c29ed2c9db87695a87594ba99a927ef4cba491bddba3ce049025fd5883463122ba7
 DIST openldap-OPENLDAP_REL_ENG_2_6_4.tar.bz2 5043227 BLAKE2B 9bec77dbace0e52d1607d9ac13a77349e7d0b8876aa81fa635893638d00db58ec6bf8412f11fd266bba0440887be1aa21eb4a876122152f7f6de9fd8f75b6b4c SHA512 bff11bf1ae125bcabbd307f6c4e1c102a8df6f1091f84f5e7053fdbaa89ccd6aa0c86cc8dcce4fb9b6ffd853b5f8d3c933733f5713aeb4d6a9d77ab145293b48
+DIST openldap-OPENLDAP_REL_ENG_2_6_5.tar.bz2 5040569 BLAKE2B d1835e560a81bc3df2eb44964162306057ad28869a1e41da7ab823460b4a33437cd385ec9448a6df9bc580afd04dff5c4680e0b91a2f16960ad2c5f3812410ba SHA512 d259ca5ac8fbdcf9bb477e24c0feaf05678ab660007164a54463a954f1b26c3f9740855d16155fa249adcb2652223fdcfc682bb4005b46a5f36e2d5cae37f158
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.6.5.ebuild b/net-nds/openldap/openldap-2.6.5.ebuild
new file mode 100644
index 000000000000..b8aa589bf011
--- /dev/null
+++ b/net-nds/openldap/openldap-2.6.5.ebuild
@@ -0,0 +1,870 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Re cleanups:
+# 2.5.x is an LTS release so we want to keep it for a while.
+
+inherit autotools flag-o-matic multibuild multilib multilib-minimal preserve-libs
+inherit ssl-cert toolchain-funcs systemd tmpfiles
+
+MY_PV="$(ver_rs 1-2 _)"
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.openldap.org/"
+SRC_URI="
+	https://gitlab.com/openldap/${PN}/-/archive/OPENLDAP_REL_ENG_${MY_PV}/${PN}-OPENLDAP_REL_ENG_${MY_PV}.tar.bz2
+	mirror://gentoo/${BIS_P}
+"
+S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
+
+LICENSE="OPENLDAP GPL-2"
+# Subslot added for bug #835654
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
+IUSE_OVERLAY="overlays perl autoca"
+IUSE_OPTIONAL="debug gnutls iodbc odbc sasl ssl selinux static-libs +syslog test"
+IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
+IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
+IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="
+	cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( cleartext sasl )
+	autoca? ( !gnutls )
+	?? ( test minimal )
+	kerberos? ( ?? ( kinit smbkrb5passwd ) )
+"
+
+SYSTEM_LMDB_VER=0.9.31
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	kernel_linux? ( sys-apps/util-linux )
+	ssl? (
+		!gnutls? (
+			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		dev-libs/libevent:=
+		dev-libs/libltdl
+		sys-fs/e2fsprogs
+		>=dev-db/lmdb-${SYSTEM_LMDB_VER}:=
+		argon2? ( app-crypt/argon2:= )
+		crypt? ( virtual/libcrypt:= )
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			dev-libs/openssl:0=
+		)
+		smbkrb5passwd? (
+			dev-libs/openssl:0=
+			kerberos? ( app-crypt/heimdal )
+		)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+		)
+	)
+"
+DEPEND="
+	${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="
+	${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+BDEPEND="
+	!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+	)
+"
+
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+	"${FILESDIR}"/${PN}-2.6.1-system-mdb.patch
+	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
+	"${FILESDIR}"/${PN}-2.6.1-flags.patch
+	"${FILESDIR}"/${PN}-2.6.1-fix-missing-mapping.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${EROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	# TODO: remove this as we dropped bdb support (gone upstream) in 2.6.1?
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		local fail=0
+
+		# This will not cover detection of cn=Config based configuration, but
+		# it's hopefully good enough.
+		if grep -sq '^backend.*shell' "${EROOT}"/etc/openldap/slapd.conf; then
+			eerror "    OpenLDAP >= 2.5.x has dropped support for Shell backend."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted away from backend shell!"
+			echo
+			fail=1
+		fi
+		if has_version "${CATEGORY}/${PN}[berkdb]" || grep -sq '^backend.*(bdb|hdb)' /etc/openldap/slapd.conf; then
+			eerror "	OpenLDAP >= 2.5.x has dropped support for Berkeley DB."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted to mdb!"
+			echo
+			fail=1
+		elif [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. Check that your data is intact."
+	eerror "11. Set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	# The system copy of dev-db/lmdb must match the version that this copy
+	# of OpenLDAP shipped with! See bug #588792.
+	#
+	# Fish out MDB_VERSION_MAJOR/MDB_VERSION_MINOR/MDB_VERSION_PATCH from
+	# the bundled lmdb's header to find out the version.
+	local bundled_lmdb_version=$(sed -En '/^#define MDB_VERSION_(MAJOR|MINOR|PATCH)(\s+)?/{s/[^0-9.]//gp}' \
+		libraries/liblmdb/lmdb.h || die)
+	printf -v bundled_lmdb_version "%s." ${bundled_lmdb_version}
+
+	if [[ ${SYSTEM_LMDB_VER}. != ${bundled_lmdb_version} ]] ; then
+		eerror "Source lmdb version: ${bundled_lmdb_version}"
+		eerror "Ebuild lmdb version: ${SYSTEM_LMDB_VER}"
+		die "Ebuild needs to update SYSTEM_LMDB_VER!"
+	fi
+
+	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
+
+	local filename
+	for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do
+		iconv -f iso-8859-1 -t utf-8 "${filename}" > "${filename}.utf8"
+		mv "${filename}.utf8" "${filename}"
+	done
+
+	default
+
+	sed -i \
+		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
+		-e '/MKDIR.*.(DESTDIR)\/run/d' \
+		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to remove too early stripping"
+	popd &>/dev/null || die
+
+	# Fails with OpenSSL 3, bug #848894
+	# https://bugs.openldap.org/show_bug.cgi?id=10009
+	rm tests/scripts/test076-authid-rewrite || die
+
+	eautoreconf
+	multilib_copy_sources
+}
+
+build_contrib_module() {
+	# <dir> [<target>]
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $1"
+	local target="${2:-all}"
+	emake \
+		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
+		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
+		"${target}"
+	popd &>/dev/null || die
+}
+
+multilib_src_configure() {
+	# Optional Features
+	myconf+=(
+		--enable-option-checking
+		$(use_enable debug)
+		--enable-dynamic
+		$(use_enable syslog)
+		--enable-ipv6
+		--enable-local
+	)
+
+	# Optional Packages
+	myconf+=(
+		--without-fetch
+	)
+
+	if use experimental ; then
+		# connectionless ldap per bug #342439
+		# connectionless is a unsupported feature according to Howard Chu
+		# see https://bugs.openldap.org/show_bug.cgi?id=9739
+		# (see also bug #892009)
+		append-flags -DLDAP_CONNECTIONLESS
+	fi
+
+	if ! use minimal && multilib_is_native_abi; then
+		# SLAPD (Standalone LDAP Daemon) Options
+		# overlay chaining requires '--enable-ldap' #296567
+		# see https://www.openldap.org/doc/admin26/overlays.html#Chaining
+		myconf+=(
+			--enable-ldap=yes
+			--enable-slapd
+			$(use_enable cleartext)
+			$(use_enable crypt)
+			$(multilib_native_use_enable sasl spasswd)
+			--disable-slp
+			$(use_enable tcpd wrappers)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				# ACI build as dynamic module not supported (yet)
+				--enable-aci=yes
+			)
+		fi
+
+		for option in modules rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# static SLAPD backends
+		for backend in mdb; do
+			myconf+=( --enable-${backend}=yes )
+		done
+
+		# module SLAPD backends
+		for backend in asyncmeta dnssrv meta null passwd relay sock; do
+			# missing modules: wiredtiger (not available in portage)
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		use perl && myconf+=( --enable-perl=mod )
+
+		if use odbc ; then
+			myconf+=( --enable-sql=mod )
+			if use iodbc ; then
+				myconf+=( --with-odbc="iodbc" )
+				append-cflags -I"${EPREFIX}"/usr/include/iodbc
+			else
+				myconf+=( --with-odbc="unixodbc" )
+			fi
+		fi
+
+		use overlays && myconf+=( --enable-overlays=mod )
+		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
+		# compile-in the syncprov
+		myconf+=( --enable-syncprov=yes )
+
+		# Build the standalone load balancer (lloadd) - also available as a slapd module; --enable-balancer=mod
+		myconf+=( --enable-balancer=yes )
+
+		# SLAPD Password Module Options
+		myconf+=(
+			$(use_enable argon2)
+		)
+
+		# Optional Packages
+		myconf+=(
+			$(use_with systemd)
+			$(multilib_native_use_with sasl cyrus-sasl)
+		)
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-mdb
+			--disable-overlays
+			--disable-autoca
+			--disable-syslog
+			--without-systemd
+		)
+	fi
+
+	# Library Generation & Linking Options
+	myconf+=(
+		$(use_enable static-libs static)
+		--enable-shared
+		--enable-versioning
+		--with-pic
+	)
+
+	# some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		if use gnutls ; then
+			myconf+=( --with-tls="gnutls" )
+		else
+			# disable MD2 hash function
+			append-cflags -DOPENSSL_NO_MD2
+			myconf+=( --with-tls="openssl" )
+		fi
+	else
+		myconf+=( --with-tls="no" )
+	fi
+
+	tc-export AR CC CXX
+
+	ECONF_SOURCE="${S}" econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		--localstatedir="${EPREFIX}"/var \
+		--runstatedir="${EPREFIX}"/run \
+		--sharedstatedir="${EPREFIX}"/var/lib \
+		"${myconf[@]}"
+
+	# argument '--runstatedir' seems to have no effect therefore this workaround
+	sed -i \
+		-e 's:^runstatedir=.*:runstatedir=${EPREFIX}/run:' \
+		configure contrib/ldapc++/configure contrib/ldaptcl/configure || die 'could not set runstatedir'
+
+	sed -i \
+		-e "s:/var/run/sasl2/mux:${EPREFIX}/run/sasl2/mux:" \
+		doc/guide/admin/security.sdf || die 'could not fix run path in doc'
+
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# we have to run it AFTER the main build, not just after the main configure
+	local myconf_ldapcpp=(
+		--with-libldap="${E}/lib"
+		--with-ldap-includes="${S}/include"
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die "could not create ${BUILD_DIR}/contrib/ldapc++ directory"
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS="${LDFLAGS}"
+	local CPPFLAGS="${CPPFLAGS}"
+
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs -L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+
+	ECONF_SOURCE="${S}"/contrib/ldapc++ econf "${myconf_ldapcpp[@]}"
+	popd &>/dev/null || die "popd contrib/ldapc++"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			build_contrib_module "passwd" "pw-kerberos.la"
+		fi
+
+		if use pbkdf2; then
+			build_contrib_module "passwd/pbkdf2"
+		fi
+
+		if use sha2 ; then
+			build_contrib_module "passwd/sha2"
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		build_contrib_module "passwd" "pw-netscape.la"
+
+		#build_contrib_module "acl" "posixgroup.la" # example code only
+		#build_contrib_module "acl" "gssacl.la" # example code only, also needs kerberos
+		build_contrib_module "addpartial"
+		build_contrib_module "allop"
+		build_contrib_module "allowed"
+		build_contrib_module "autogroup"
+		build_contrib_module "cloak"
+		# build_contrib_module "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop"
+		build_contrib_module "dsaschema"
+		build_contrib_module "dupent"
+		build_contrib_module "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod"
+		build_contrib_module "noopsrch"
+		#build_contrib_module "nops" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" RESO:LATER
+		build_contrib_module "trace"
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		$(tc-getCC) -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CPPFLAGS} \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		pwd
+
+		# Increase various test timeouts/delays, bug #894012
+		# We can't just double everything as there's a cumulative effect.
+		export SLEEP0=2 # originally 1
+		export SLEEP1=10 # originally 7
+		export SLEEP2=20 # originally 15
+		export TIMEOUT=16 # originally 8
+
+		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
+		# emake partests => runs ALL of the tests in parallel
+		# wt/WiredTiger is not supported in Gentoo
+		TESTS=( plloadd pmdb )
+		#TESTS+=( pldif ) # not done by default, so also exclude here
+		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
+
+		emake -Onone "${TESTS[@]}"
+	fi
+}
+
+multilib_src_install() {
+	emake CC="$(tc-getCC)" \
+		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.6.3-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		einfo "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" \
+			-i "${configfile}" || die
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
+
+		if use systemd; then
+			# The systemd unit uses Type=notify, so it is useless without USE=systemd
+			einfo "Install systemd service"
+			rm -rf "${ED}"/{,usr/}lib/systemd
+			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
+			systemd_dounit "${T}"/slapd.service
+			systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+			newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+		fi
+
+		# if built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			libtool --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		if use systemd; then
+			tmpfiles_process slapd.conf
+		fi
+
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-08-01  5:47 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-08-01  5:47 UTC (permalink / raw
  To: gentoo-commits

commit:     ae1f4eba942e16d63dd7790889fc8e1cc19100be
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  1 05:05:15 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Aug  1 05:33:21 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae1f4eba

net-nds/openldap: add 2.5.16

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/Manifest               |   1 +
 net-nds/openldap/openldap-2.5.16.ebuild | 860 ++++++++++++++++++++++++++++++++
 2 files changed, 861 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index c197823a3d0b..324190a52538 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,5 +1,6 @@
 DIST openldap-2.4.59.tgz 5886272 BLAKE2B a2a8bed1d2af97fd41d651668152fd4740871bc5a8abf4b50390839228af82ac103346b3500ae0f8dd31b708acabb30435b90cd48dfafe510e648df5150d96b8 SHA512 233459ab446da6e107a7fc4ecd5668d6b08c11a11359ee76449550393e8f586a29b59d7ae09a050a1fca4fcf388ea61438ef60831b3ae802d92c048365ae3968
 DIST openldap-OPENLDAP_REL_ENG_2_5_14.tar.bz2 5024359 BLAKE2B ffdffbd47e76545c2dc2d433d290945ab6eebd910031a60249cd8f6eac24f67841098e61c7e57864428e20a183a46d36dac422bba8cf6f3596f97439875af96b SHA512 abd1e8bda0762500db028f283fe2da9480a419072927295d6f3e1448cae130592511f385a87585843cf88217417c90ef57174ca919cfcf163eb41642a72bb4e3
+DIST openldap-OPENLDAP_REL_ENG_2_5_16.tar.bz2 5022608 BLAKE2B 829e416e3cf92d36df0d6642e44083f9b288ef9c3743a84aef3f03cdf7b08b21ea45231653a2659fe0da285ca47a346d336d02c8e0dda21f039fb9e49630262b SHA512 629b92e275b69a540b200e61165492a4706afdf7b15d21bfe2f1fd4c338ecf397ad0c918e36dcef54d1f0cede2f039a8f73d4735f00e892d64ce9a177d490a07
 DIST openldap-OPENLDAP_REL_ENG_2_6_3.tar.gz 6244895 BLAKE2B 97792a1b368de44867b0ce9eef38601c3e64b7d40e4ca206295bee110097697c919040d2220eea6f0581812e09a2cc3e6afb4a243a5072a8a0a95f24f9fb354b SHA512 1c882a0cd0729b5d0f40b58588d0e36ae3b1cae6d569f0576e940c7c63d03c29ed2c9db87695a87594ba99a927ef4cba491bddba3ce049025fd5883463122ba7
 DIST openldap-OPENLDAP_REL_ENG_2_6_4.tar.bz2 5043227 BLAKE2B 9bec77dbace0e52d1607d9ac13a77349e7d0b8876aa81fa635893638d00db58ec6bf8412f11fd266bba0440887be1aa21eb4a876122152f7f6de9fd8f75b6b4c SHA512 bff11bf1ae125bcabbd307f6c4e1c102a8df6f1091f84f5e7053fdbaa89ccd6aa0c86cc8dcce4fb9b6ffd853b5f8d3c933733f5713aeb4d6a9d77ab145293b48
 DIST openldap-OPENLDAP_REL_ENG_2_6_5.tar.bz2 5040569 BLAKE2B d1835e560a81bc3df2eb44964162306057ad28869a1e41da7ab823460b4a33437cd385ec9448a6df9bc580afd04dff5c4680e0b91a2f16960ad2c5f3812410ba SHA512 d259ca5ac8fbdcf9bb477e24c0feaf05678ab660007164a54463a954f1b26c3f9740855d16155fa249adcb2652223fdcfc682bb4005b46a5f36e2d5cae37f158

diff --git a/net-nds/openldap/openldap-2.5.16.ebuild b/net-nds/openldap/openldap-2.5.16.ebuild
new file mode 100644
index 000000000000..b55c20f3ef2f
--- /dev/null
+++ b/net-nds/openldap/openldap-2.5.16.ebuild
@@ -0,0 +1,860 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+# Re cleanups:
+# 2.5.x is an LTS release so we want to keep it for a while.
+
+inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
+
+MY_PV="$(ver_rs 1-2 _)"
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.openldap.org/"
+SRC_URI="
+	https://gitlab.com/openldap/${PN}/-/archive/OPENLDAP_REL_ENG_${MY_PV}/${PN}-OPENLDAP_REL_ENG_${MY_PV}.tar.bz2
+	mirror://gentoo/${BIS_P}
+"
+S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
+
+LICENSE="OPENLDAP GPL-2"
+# Subslot added for bug #835654
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
+IUSE_OVERLAY="overlays perl autoca"
+IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog test"
+IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
+IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
+IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+RESTRICT="!test? ( test )"
+
+RESTRICT="!test? ( test )"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( cleartext debug sasl )
+	autoca? ( !gnutls )
+	?? ( test minimal )
+	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
+
+SYSTEM_LMDB_VER=0.9.31
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	kernel_linux? ( sys-apps/util-linux )
+	ssl? (
+		!gnutls? (
+			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		dev-libs/libltdl
+		sys-fs/e2fsprogs
+		>=dev-db/lmdb-${SYSTEM_LMDB_VER}:=
+		argon2? ( app-crypt/argon2:= )
+		crypt? ( virtual/libcrypt:= )
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			dev-libs/openssl:0=
+		)
+		smbkrb5passwd? (
+			dev-libs/openssl:0=
+			kerberos? ( app-crypt/heimdal )
+		)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+		)
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+BDEPEND="!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+)
+"
+
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+	"${FILESDIR}"/${PN}-2.6.1-system-mdb.patch
+	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
+	"${FILESDIR}"/${PN}-2.6.1-flags.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${EROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	# TODO: remove this as we dropped bdb support (gone upstream) in 2.6.1?
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		local fail=0
+
+		# This will not cover detection of cn=Config based configuration, but
+		# it's hopefully good enough.
+		if grep -sq '^backend.*shell' "${EROOT}"/etc/openldap/slapd.conf; then
+			eerror "    OpenLDAP >= 2.6.x has dropped support for Shell backend."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted away from backend shell!"
+			echo
+			fail=1
+		fi
+		if has_version "${CATEGORY}/${PN}[berkdb]" || grep -sq '^backend.*(bdb|hdb)' /etc/openldap/slapd.conf; then
+			eerror "	OpenLDAP >= 2.5.x has dropped support for Berkeley DB."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted to mdb!"
+			echo
+			fail=1
+		elif [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. Check that your data is intact."
+	eerror "11. Set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	# The system copy of dev-db/lmdb must match the version that this copy
+	# of OpenLDAP shipped with! See bug #588792.
+	#
+	# Fish out MDB_VERSION_MAJOR/MDB_VERSION_MINOR/MDB_VERSION_PATCH from
+	# the bundled lmdb's header to find out the version.
+	local bundled_lmdb_version=$(sed -En '/^#define MDB_VERSION_(MAJOR|MINOR|PATCH)(\s+)?/{s/[^0-9.]//gp}' libraries/liblmdb/lmdb.h || die)
+	printf -v bundled_lmdb_version "%s." ${bundled_lmdb_version}
+
+	if [[ ${SYSTEM_LMDB_VER}. != ${bundled_lmdb_version} ]] ; then
+		eerror "Source lmdb version: ${bundled_lmdb_version}"
+		eerror "Ebuild lmdb version: ${SYSTEM_LMDB_VER}"
+		die "Ebuild needs to update SYSTEM_LMDB_VER!"
+	fi
+
+	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
+
+	local filename
+	for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do
+		iconv -f iso-8859-1 -t utf-8 "${filename}" > "${filename}.utf8"
+		mv "${filename}.utf8" "${filename}"
+	done
+
+	default
+
+	sed -i \
+		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
+		-e '/MKDIR.*.(DESTDIR)\/run/d' \
+		-e '/MKDIR.*.(DESTDIR).*.(runstatedir)/d' \
+		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to remove too early stripping"
+	popd &>/dev/null || die
+
+	# Fails with OpenSSL 3, bug #848894
+	# https://bugs.openldap.org/show_bug.cgi?id=10009
+	rm tests/scripts/test076-authid-rewrite || die
+
+	eautoreconf
+	multilib_copy_sources
+}
+
+build_contrib_module() {
+	# <dir> [<target>]
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $1"
+	local target="${2:-all}"
+	emake \
+		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
+		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
+		"${target}"
+	popd &>/dev/null || die
+}
+
+multilib_src_configure() {
+	# Optional Features
+	myconf+=(
+		--enable-option-checking
+		$(use_enable debug)
+		--enable-dynamic
+		$(use_enable syslog)
+		$(use_enable ipv6)
+		--enable-local
+	)
+
+	# Optional Packages
+	myconf+=(
+		--without-fetch
+	)
+
+	if use experimental ; then
+		# connectionless ldap per bug #342439
+		# connectionless is a unsupported feature according to Howard Chu
+		# see https://bugs.openldap.org/show_bug.cgi?id=9739
+		# (see also bug #892009)
+		append-flags -DLDAP_CONNECTIONLESS
+	fi
+
+	if ! use minimal && multilib_is_native_abi; then
+		# SLAPD (Standalone LDAP Daemon) Options
+		# overlay chaining requires '--enable-ldap' #296567
+		# see https://www.openldap.org/doc/admin26/overlays.html#Chaining
+		myconf+=(
+			--enable-ldap=yes
+			--enable-slapd
+			$(use_enable cleartext)
+			$(use_enable crypt)
+			$(multilib_native_use_enable sasl spasswd)
+			--disable-slp
+			$(use_enable tcpd wrappers)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				# ACI build as dynamic module not supported (yet)
+				--enable-aci=yes
+			)
+		fi
+
+		for option in modules rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# static SLAPD backends
+		for backend in mdb; do
+			myconf+=( --enable-${backend}=yes )
+		done
+
+		# module SLAPD backends
+		for backend in asyncmeta dnssrv meta null passwd relay sock; do
+			# missing modules: wiredtiger (not available in portage)
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		use perl && myconf+=( --enable-perl=mod )
+
+		if use odbc ; then
+			myconf+=( --enable-sql=mod )
+			if use iodbc ; then
+				myconf+=( --with-odbc="iodbc" )
+				append-cflags -I"${EPREFIX}"/usr/include/iodbc
+			else
+				myconf+=( --with-odbc="unixodbc" )
+			fi
+		fi
+
+		use overlays && myconf+=( --enable-overlays=mod )
+		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
+		# compile-in the syncprov
+		myconf+=( --enable-syncprov=yes )
+
+		# SLAPD Password Module Options
+		myconf+=(
+			$(use_enable argon2)
+		)
+
+		# Optional Packages
+		myconf+=(
+			$(use_with systemd)
+			$(multilib_native_use_with sasl cyrus-sasl)
+		)
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-mdb
+			--disable-overlays
+			--disable-autoca
+			--disable-syslog
+			--without-systemd
+		)
+	fi
+
+	# Library Generation & Linking Options
+	myconf+=(
+		$(use_enable static-libs static)
+		--enable-shared
+		--enable-versioning
+		--with-pic
+	)
+
+	# some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		if use gnutls ; then
+			myconf+=( --with-tls="gnutls" )
+		else
+			# disable MD2 hash function
+			append-cflags -DOPENSSL_NO_MD2
+			myconf+=( --with-tls="openssl" )
+		fi
+	else
+		myconf+=( --with-tls="no" )
+	fi
+
+	tc-export AR CC CXX
+
+	ECONF_SOURCE="${S}" econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		--localstatedir="${EPREFIX}"/var \
+		--runstatedir="${EPREFIX}"/run \
+		--sharedstatedir="${EPREFIX}"/var/lib \
+		"${myconf[@]}"
+
+	# argument '--runstatedir' seems to have no effect therefore this workaround
+	sed -i \
+		-e 's:^runstatedir=.*:runstatedir=${EPREFIX}/run:' \
+		configure contrib/ldapc++/configure contrib/ldaptcl/configure || die 'could not set runstatedir'
+
+	sed -i \
+		-e "s:/var/run/sasl2/mux:${EPREFIX}/run/sasl2/mux:" \
+		doc/guide/admin/security.sdf || die 'could not fix run path in doc'
+
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# we have to run it AFTER the main build, not just after the main configure
+	local myconf_ldapcpp=(
+		--with-libldap="${E}/lib"
+		--with-ldap-includes="${S}/include"
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die "could not create ${BUILD_DIR}/contrib/ldapc++ directory"
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS="${LDFLAGS}"
+	local CPPFLAGS="${CPPFLAGS}"
+
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs -L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+
+	ECONF_SOURCE="${S}"/contrib/ldapc++ econf "${myconf_ldapcpp[@]}"
+	popd &>/dev/null || die "popd contrib/ldapc++"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			build_contrib_module "passwd" "pw-kerberos.la"
+		fi
+
+		if use pbkdf2; then
+			build_contrib_module "passwd/pbkdf2"
+		fi
+
+		if use sha2 ; then
+			build_contrib_module "passwd/sha2"
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		build_contrib_module "passwd" "pw-netscape.la"
+
+		#build_contrib_module "acl" "posixgroup.la" # example code only
+		#build_contrib_module "acl" "gssacl.la" # example code only, also needs kerberos
+		build_contrib_module "addpartial"
+		build_contrib_module "allop"
+		build_contrib_module "allowed"
+		build_contrib_module "autogroup"
+		build_contrib_module "cloak"
+		# build_contrib_module "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop"
+		build_contrib_module "dsaschema"
+		build_contrib_module "dupent"
+		build_contrib_module "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod"
+		build_contrib_module "noopsrch"
+		#build_contrib_module "nops" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" RESO:LATER
+		build_contrib_module "trace"
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		$(tc-getCC) -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CPPFLAGS} \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		pwd
+
+		# Increase various test timeouts/delays, bug #894012
+		# We can't just double everything as there's a cumulative effect.
+		export SLEEP0=2 # originally 1
+		export SLEEP1=10 # originally 7
+		export SLEEP2=20 # originally 15
+		export TIMEOUT=16 # originally 8
+
+		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
+		# emake partests => runs ALL of the tests in parallel
+		# wt/WiredTiger is not supported in Gentoo
+		TESTS=( lloadd mdb )
+		#TESTS+=( pldif ) # not done by default, so also exclude here
+		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
+
+		emake -Onone "${TESTS[@]}"
+	fi
+}
+
+multilib_src_install() {
+	emake CC="$(tc-getCC)" \
+		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.6.3-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		einfo "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
+
+		if use systemd; then
+			# The systemd unit uses Type=notify, so it is useless without USE=systemd
+			einfo "Install systemd service"
+			rm -rf "${ED}"/{,usr/}lib/systemd
+			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
+			systemd_dounit "${T}"/slapd.service
+			systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+			newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+		fi
+
+		# if built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			libtool --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		if use systemd; then
+			tmpfiles_process slapd.conf
+		fi
+
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-08-01  5:47 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2023-08-01  5:47 UTC (permalink / raw
  To: gentoo-commits

commit:     ccd9d1f387c16150f1181a8ba028e80af25039cc
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  1 05:31:47 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Aug  1 05:33:22 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ccd9d1f3

net-nds/openldap: add 2.6.6

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/Manifest              |   1 +
 net-nds/openldap/openldap-2.6.6.ebuild | 870 +++++++++++++++++++++++++++++++++
 2 files changed, 871 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 324190a52538..987dc7f896b3 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -4,4 +4,5 @@ DIST openldap-OPENLDAP_REL_ENG_2_5_16.tar.bz2 5022608 BLAKE2B 829e416e3cf92d36df
 DIST openldap-OPENLDAP_REL_ENG_2_6_3.tar.gz 6244895 BLAKE2B 97792a1b368de44867b0ce9eef38601c3e64b7d40e4ca206295bee110097697c919040d2220eea6f0581812e09a2cc3e6afb4a243a5072a8a0a95f24f9fb354b SHA512 1c882a0cd0729b5d0f40b58588d0e36ae3b1cae6d569f0576e940c7c63d03c29ed2c9db87695a87594ba99a927ef4cba491bddba3ce049025fd5883463122ba7
 DIST openldap-OPENLDAP_REL_ENG_2_6_4.tar.bz2 5043227 BLAKE2B 9bec77dbace0e52d1607d9ac13a77349e7d0b8876aa81fa635893638d00db58ec6bf8412f11fd266bba0440887be1aa21eb4a876122152f7f6de9fd8f75b6b4c SHA512 bff11bf1ae125bcabbd307f6c4e1c102a8df6f1091f84f5e7053fdbaa89ccd6aa0c86cc8dcce4fb9b6ffd853b5f8d3c933733f5713aeb4d6a9d77ab145293b48
 DIST openldap-OPENLDAP_REL_ENG_2_6_5.tar.bz2 5040569 BLAKE2B d1835e560a81bc3df2eb44964162306057ad28869a1e41da7ab823460b4a33437cd385ec9448a6df9bc580afd04dff5c4680e0b91a2f16960ad2c5f3812410ba SHA512 d259ca5ac8fbdcf9bb477e24c0feaf05678ab660007164a54463a954f1b26c3f9740855d16155fa249adcb2652223fdcfc682bb4005b46a5f36e2d5cae37f158
+DIST openldap-OPENLDAP_REL_ENG_2_6_6.tar.bz2 5040213 BLAKE2B 2497b6698344674a9e8db5f2f2531541167065bb8ac9f512ecdb9349115140d5e83daef9b489e244eee08445de57599ddcfeeed71d4aab41edc58a3092910925 SHA512 3c235ff7b26f753afeb0176e95ecbf6a353bf76f00935c091323366bf97289f628d4d7b4ae3e2a31fe0797715d6c69e6704967dc79ccbae7add3023e226ad73b
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.6.6.ebuild b/net-nds/openldap/openldap-2.6.6.ebuild
new file mode 100644
index 000000000000..b8aa589bf011
--- /dev/null
+++ b/net-nds/openldap/openldap-2.6.6.ebuild
@@ -0,0 +1,870 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Re cleanups:
+# 2.5.x is an LTS release so we want to keep it for a while.
+
+inherit autotools flag-o-matic multibuild multilib multilib-minimal preserve-libs
+inherit ssl-cert toolchain-funcs systemd tmpfiles
+
+MY_PV="$(ver_rs 1-2 _)"
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.openldap.org/"
+SRC_URI="
+	https://gitlab.com/openldap/${PN}/-/archive/OPENLDAP_REL_ENG_${MY_PV}/${PN}-OPENLDAP_REL_ENG_${MY_PV}.tar.bz2
+	mirror://gentoo/${BIS_P}
+"
+S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
+
+LICENSE="OPENLDAP GPL-2"
+# Subslot added for bug #835654
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
+IUSE_OVERLAY="overlays perl autoca"
+IUSE_OPTIONAL="debug gnutls iodbc odbc sasl ssl selinux static-libs +syslog test"
+IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
+IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
+IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="
+	cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( cleartext sasl )
+	autoca? ( !gnutls )
+	?? ( test minimal )
+	kerberos? ( ?? ( kinit smbkrb5passwd ) )
+"
+
+SYSTEM_LMDB_VER=0.9.31
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	kernel_linux? ( sys-apps/util-linux )
+	ssl? (
+		!gnutls? (
+			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		dev-libs/libevent:=
+		dev-libs/libltdl
+		sys-fs/e2fsprogs
+		>=dev-db/lmdb-${SYSTEM_LMDB_VER}:=
+		argon2? ( app-crypt/argon2:= )
+		crypt? ( virtual/libcrypt:= )
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			dev-libs/openssl:0=
+		)
+		smbkrb5passwd? (
+			dev-libs/openssl:0=
+			kerberos? ( app-crypt/heimdal )
+		)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+		)
+	)
+"
+DEPEND="
+	${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="
+	${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+BDEPEND="
+	!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+	)
+"
+
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+	"${FILESDIR}"/${PN}-2.6.1-system-mdb.patch
+	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
+	"${FILESDIR}"/${PN}-2.6.1-flags.patch
+	"${FILESDIR}"/${PN}-2.6.1-fix-missing-mapping.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${EROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	# TODO: remove this as we dropped bdb support (gone upstream) in 2.6.1?
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		local fail=0
+
+		# This will not cover detection of cn=Config based configuration, but
+		# it's hopefully good enough.
+		if grep -sq '^backend.*shell' "${EROOT}"/etc/openldap/slapd.conf; then
+			eerror "    OpenLDAP >= 2.5.x has dropped support for Shell backend."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted away from backend shell!"
+			echo
+			fail=1
+		fi
+		if has_version "${CATEGORY}/${PN}[berkdb]" || grep -sq '^backend.*(bdb|hdb)' /etc/openldap/slapd.conf; then
+			eerror "	OpenLDAP >= 2.5.x has dropped support for Berkeley DB."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted to mdb!"
+			echo
+			fail=1
+		elif [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. Check that your data is intact."
+	eerror "11. Set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	# The system copy of dev-db/lmdb must match the version that this copy
+	# of OpenLDAP shipped with! See bug #588792.
+	#
+	# Fish out MDB_VERSION_MAJOR/MDB_VERSION_MINOR/MDB_VERSION_PATCH from
+	# the bundled lmdb's header to find out the version.
+	local bundled_lmdb_version=$(sed -En '/^#define MDB_VERSION_(MAJOR|MINOR|PATCH)(\s+)?/{s/[^0-9.]//gp}' \
+		libraries/liblmdb/lmdb.h || die)
+	printf -v bundled_lmdb_version "%s." ${bundled_lmdb_version}
+
+	if [[ ${SYSTEM_LMDB_VER}. != ${bundled_lmdb_version} ]] ; then
+		eerror "Source lmdb version: ${bundled_lmdb_version}"
+		eerror "Ebuild lmdb version: ${SYSTEM_LMDB_VER}"
+		die "Ebuild needs to update SYSTEM_LMDB_VER!"
+	fi
+
+	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
+
+	local filename
+	for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do
+		iconv -f iso-8859-1 -t utf-8 "${filename}" > "${filename}.utf8"
+		mv "${filename}.utf8" "${filename}"
+	done
+
+	default
+
+	sed -i \
+		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
+		-e '/MKDIR.*.(DESTDIR)\/run/d' \
+		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to remove too early stripping"
+	popd &>/dev/null || die
+
+	# Fails with OpenSSL 3, bug #848894
+	# https://bugs.openldap.org/show_bug.cgi?id=10009
+	rm tests/scripts/test076-authid-rewrite || die
+
+	eautoreconf
+	multilib_copy_sources
+}
+
+build_contrib_module() {
+	# <dir> [<target>]
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $1"
+	local target="${2:-all}"
+	emake \
+		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
+		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
+		"${target}"
+	popd &>/dev/null || die
+}
+
+multilib_src_configure() {
+	# Optional Features
+	myconf+=(
+		--enable-option-checking
+		$(use_enable debug)
+		--enable-dynamic
+		$(use_enable syslog)
+		--enable-ipv6
+		--enable-local
+	)
+
+	# Optional Packages
+	myconf+=(
+		--without-fetch
+	)
+
+	if use experimental ; then
+		# connectionless ldap per bug #342439
+		# connectionless is a unsupported feature according to Howard Chu
+		# see https://bugs.openldap.org/show_bug.cgi?id=9739
+		# (see also bug #892009)
+		append-flags -DLDAP_CONNECTIONLESS
+	fi
+
+	if ! use minimal && multilib_is_native_abi; then
+		# SLAPD (Standalone LDAP Daemon) Options
+		# overlay chaining requires '--enable-ldap' #296567
+		# see https://www.openldap.org/doc/admin26/overlays.html#Chaining
+		myconf+=(
+			--enable-ldap=yes
+			--enable-slapd
+			$(use_enable cleartext)
+			$(use_enable crypt)
+			$(multilib_native_use_enable sasl spasswd)
+			--disable-slp
+			$(use_enable tcpd wrappers)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				# ACI build as dynamic module not supported (yet)
+				--enable-aci=yes
+			)
+		fi
+
+		for option in modules rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# static SLAPD backends
+		for backend in mdb; do
+			myconf+=( --enable-${backend}=yes )
+		done
+
+		# module SLAPD backends
+		for backend in asyncmeta dnssrv meta null passwd relay sock; do
+			# missing modules: wiredtiger (not available in portage)
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		use perl && myconf+=( --enable-perl=mod )
+
+		if use odbc ; then
+			myconf+=( --enable-sql=mod )
+			if use iodbc ; then
+				myconf+=( --with-odbc="iodbc" )
+				append-cflags -I"${EPREFIX}"/usr/include/iodbc
+			else
+				myconf+=( --with-odbc="unixodbc" )
+			fi
+		fi
+
+		use overlays && myconf+=( --enable-overlays=mod )
+		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
+		# compile-in the syncprov
+		myconf+=( --enable-syncprov=yes )
+
+		# Build the standalone load balancer (lloadd) - also available as a slapd module; --enable-balancer=mod
+		myconf+=( --enable-balancer=yes )
+
+		# SLAPD Password Module Options
+		myconf+=(
+			$(use_enable argon2)
+		)
+
+		# Optional Packages
+		myconf+=(
+			$(use_with systemd)
+			$(multilib_native_use_with sasl cyrus-sasl)
+		)
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-mdb
+			--disable-overlays
+			--disable-autoca
+			--disable-syslog
+			--without-systemd
+		)
+	fi
+
+	# Library Generation & Linking Options
+	myconf+=(
+		$(use_enable static-libs static)
+		--enable-shared
+		--enable-versioning
+		--with-pic
+	)
+
+	# some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		if use gnutls ; then
+			myconf+=( --with-tls="gnutls" )
+		else
+			# disable MD2 hash function
+			append-cflags -DOPENSSL_NO_MD2
+			myconf+=( --with-tls="openssl" )
+		fi
+	else
+		myconf+=( --with-tls="no" )
+	fi
+
+	tc-export AR CC CXX
+
+	ECONF_SOURCE="${S}" econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		--localstatedir="${EPREFIX}"/var \
+		--runstatedir="${EPREFIX}"/run \
+		--sharedstatedir="${EPREFIX}"/var/lib \
+		"${myconf[@]}"
+
+	# argument '--runstatedir' seems to have no effect therefore this workaround
+	sed -i \
+		-e 's:^runstatedir=.*:runstatedir=${EPREFIX}/run:' \
+		configure contrib/ldapc++/configure contrib/ldaptcl/configure || die 'could not set runstatedir'
+
+	sed -i \
+		-e "s:/var/run/sasl2/mux:${EPREFIX}/run/sasl2/mux:" \
+		doc/guide/admin/security.sdf || die 'could not fix run path in doc'
+
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# we have to run it AFTER the main build, not just after the main configure
+	local myconf_ldapcpp=(
+		--with-libldap="${E}/lib"
+		--with-ldap-includes="${S}/include"
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die "could not create ${BUILD_DIR}/contrib/ldapc++ directory"
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS="${LDFLAGS}"
+	local CPPFLAGS="${CPPFLAGS}"
+
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs -L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+
+	ECONF_SOURCE="${S}"/contrib/ldapc++ econf "${myconf_ldapcpp[@]}"
+	popd &>/dev/null || die "popd contrib/ldapc++"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			build_contrib_module "passwd" "pw-kerberos.la"
+		fi
+
+		if use pbkdf2; then
+			build_contrib_module "passwd/pbkdf2"
+		fi
+
+		if use sha2 ; then
+			build_contrib_module "passwd/sha2"
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		build_contrib_module "passwd" "pw-netscape.la"
+
+		#build_contrib_module "acl" "posixgroup.la" # example code only
+		#build_contrib_module "acl" "gssacl.la" # example code only, also needs kerberos
+		build_contrib_module "addpartial"
+		build_contrib_module "allop"
+		build_contrib_module "allowed"
+		build_contrib_module "autogroup"
+		build_contrib_module "cloak"
+		# build_contrib_module "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop"
+		build_contrib_module "dsaschema"
+		build_contrib_module "dupent"
+		build_contrib_module "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod"
+		build_contrib_module "noopsrch"
+		#build_contrib_module "nops" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" RESO:LATER
+		build_contrib_module "trace"
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		$(tc-getCC) -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CPPFLAGS} \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		pwd
+
+		# Increase various test timeouts/delays, bug #894012
+		# We can't just double everything as there's a cumulative effect.
+		export SLEEP0=2 # originally 1
+		export SLEEP1=10 # originally 7
+		export SLEEP2=20 # originally 15
+		export TIMEOUT=16 # originally 8
+
+		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
+		# emake partests => runs ALL of the tests in parallel
+		# wt/WiredTiger is not supported in Gentoo
+		TESTS=( plloadd pmdb )
+		#TESTS+=( pldif ) # not done by default, so also exclude here
+		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
+
+		emake -Onone "${TESTS[@]}"
+	fi
+}
+
+multilib_src_install() {
+	emake CC="$(tc-getCC)" \
+		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.6.3-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		einfo "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" \
+			-i "${configfile}" || die
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
+
+		if use systemd; then
+			# The systemd unit uses Type=notify, so it is useless without USE=systemd
+			einfo "Install systemd service"
+			rm -rf "${ED}"/{,usr/}lib/systemd
+			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
+			systemd_dounit "${T}"/slapd.service
+			systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+			newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+		fi
+
+		# if built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			libtool --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		if use systemd; then
+			tmpfiles_process slapd.conf
+		fi
+
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-09-19 17:48 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-09-19 17:48 UTC (permalink / raw
  To: gentoo-commits

commit:     882f65b95b2861417792352abeeb6721402bfcfe
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 15 09:59:05 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Tue Sep 19 17:48:15 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=882f65b9

net-nds/openldap: fix VariableShadowed

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.4.59-r2.ebuild | 3 +--
 net-nds/openldap/openldap-2.5.14.ebuild    | 4 +---
 net-nds/openldap/openldap-2.5.16.ebuild    | 4 +---
 net-nds/openldap/openldap-2.6.3-r7.ebuild  | 4 +---
 net-nds/openldap/openldap-2.6.4-r1.ebuild  | 4 +---
 net-nds/openldap/openldap-2.6.4-r2.ebuild  | 4 +---
 net-nds/openldap/openldap-2.6.5.ebuild     | 2 +-
 net-nds/openldap/openldap-2.6.6.ebuild     | 2 +-
 8 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.59-r2.ebuild b/net-nds/openldap/openldap-2.4.59-r2.ebuild
index ace8b2025805..c40329c153ec 100644
--- a/net-nds/openldap/openldap-2.4.59-r2.ebuild
+++ b/net-nds/openldap/openldap-2.4.59-r2.ebuild
@@ -34,13 +34,12 @@ IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs
 IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
 IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
 IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-
-RESTRICT="!test? ( test )"
 REQUIRED_USE="cxx? ( sasl )
 	pbkdf2? ( ssl )
 	test? ( berkdb )
 	?? ( test minimal )
 	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
+RESTRICT="!test? ( test )"
 
 # always list newer first
 # Do not add any AGPL-3 BDB here!

diff --git a/net-nds/openldap/openldap-2.5.14.ebuild b/net-nds/openldap/openldap-2.5.14.ebuild
index 042d0617e57b..0abdc8dcb986 100644
--- a/net-nds/openldap/openldap-2.5.14.ebuild
+++ b/net-nds/openldap/openldap-2.5.14.ebuild
@@ -33,15 +33,13 @@ IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog
 IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
 IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
 IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-RESTRICT="!test? ( test )"
-
-RESTRICT="!test? ( test )"
 REQUIRED_USE="cxx? ( sasl )
 	pbkdf2? ( ssl )
 	test? ( cleartext debug sasl )
 	autoca? ( !gnutls )
 	?? ( test minimal )
 	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
+RESTRICT="!test? ( test )"
 
 SYSTEM_LMDB_VER=0.9.30
 # openssl is needed to generate lanman-passwords required by samba

diff --git a/net-nds/openldap/openldap-2.5.16.ebuild b/net-nds/openldap/openldap-2.5.16.ebuild
index b55c20f3ef2f..6d3babe45f1b 100644
--- a/net-nds/openldap/openldap-2.5.16.ebuild
+++ b/net-nds/openldap/openldap-2.5.16.ebuild
@@ -33,15 +33,13 @@ IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog
 IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
 IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
 IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-RESTRICT="!test? ( test )"
-
-RESTRICT="!test? ( test )"
 REQUIRED_USE="cxx? ( sasl )
 	pbkdf2? ( ssl )
 	test? ( cleartext debug sasl )
 	autoca? ( !gnutls )
 	?? ( test minimal )
 	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
+RESTRICT="!test? ( test )"
 
 SYSTEM_LMDB_VER=0.9.31
 # openssl is needed to generate lanman-passwords required by samba

diff --git a/net-nds/openldap/openldap-2.6.3-r7.ebuild b/net-nds/openldap/openldap-2.6.3-r7.ebuild
index 807dbe901d7a..b60d581438f2 100644
--- a/net-nds/openldap/openldap-2.6.3-r7.ebuild
+++ b/net-nds/openldap/openldap-2.6.3-r7.ebuild
@@ -33,15 +33,13 @@ IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog
 IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
 IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
 IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-RESTRICT="!test? ( test )"
-
-RESTRICT="!test? ( test )"
 REQUIRED_USE="cxx? ( sasl )
 	pbkdf2? ( ssl )
 	test? ( cleartext sasl )
 	autoca? ( !gnutls )
 	?? ( test minimal )
 	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
+RESTRICT="!test? ( test )"
 
 # openssl is needed to generate lanman-passwords required by samba
 COMMON_DEPEND="

diff --git a/net-nds/openldap/openldap-2.6.4-r1.ebuild b/net-nds/openldap/openldap-2.6.4-r1.ebuild
index 59c0f019ab63..eb26dad73bff 100644
--- a/net-nds/openldap/openldap-2.6.4-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r1.ebuild
@@ -33,15 +33,13 @@ IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog
 IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
 IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
 IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-RESTRICT="!test? ( test )"
-
-RESTRICT="!test? ( test )"
 REQUIRED_USE="cxx? ( sasl )
 	pbkdf2? ( ssl )
 	test? ( cleartext sasl )
 	autoca? ( !gnutls )
 	?? ( test minimal )
 	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
+RESTRICT="!test? ( test )"
 
 SYSTEM_LMDB_VER=0.9.30
 # openssl is needed to generate lanman-passwords required by samba

diff --git a/net-nds/openldap/openldap-2.6.4-r2.ebuild b/net-nds/openldap/openldap-2.6.4-r2.ebuild
index b144468124f7..4ff4b2c3d6d0 100644
--- a/net-nds/openldap/openldap-2.6.4-r2.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r2.ebuild
@@ -34,15 +34,13 @@ IUSE_OPTIONAL="debug gnutls iodbc odbc sasl ssl selinux static-libs +syslog test
 IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
 IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
 IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-RESTRICT="!test? ( test )"
-
-RESTRICT="!test? ( test )"
 REQUIRED_USE="cxx? ( sasl )
 	pbkdf2? ( ssl )
 	test? ( cleartext sasl )
 	autoca? ( !gnutls )
 	?? ( test minimal )
 	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
+RESTRICT="!test? ( test )"
 
 SYSTEM_LMDB_VER=0.9.30
 # openssl is needed to generate lanman-passwords required by samba

diff --git a/net-nds/openldap/openldap-2.6.5.ebuild b/net-nds/openldap/openldap-2.6.5.ebuild
index b8aa589bf011..e38e6c6522c5 100644
--- a/net-nds/openldap/openldap-2.6.5.ebuild
+++ b/net-nds/openldap/openldap-2.6.5.ebuild
@@ -34,7 +34,6 @@ IUSE_OPTIONAL="debug gnutls iodbc odbc sasl ssl selinux static-libs +syslog test
 IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
 IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
 IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-RESTRICT="!test? ( test )"
 REQUIRED_USE="
 	cxx? ( sasl )
 	pbkdf2? ( ssl )
@@ -43,6 +42,7 @@ REQUIRED_USE="
 	?? ( test minimal )
 	kerberos? ( ?? ( kinit smbkrb5passwd ) )
 "
+RESTRICT="!test? ( test )"
 
 SYSTEM_LMDB_VER=0.9.31
 # openssl is needed to generate lanman-passwords required by samba

diff --git a/net-nds/openldap/openldap-2.6.6.ebuild b/net-nds/openldap/openldap-2.6.6.ebuild
index b8aa589bf011..e38e6c6522c5 100644
--- a/net-nds/openldap/openldap-2.6.6.ebuild
+++ b/net-nds/openldap/openldap-2.6.6.ebuild
@@ -34,7 +34,6 @@ IUSE_OPTIONAL="debug gnutls iodbc odbc sasl ssl selinux static-libs +syslog test
 IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
 IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
 IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-RESTRICT="!test? ( test )"
 REQUIRED_USE="
 	cxx? ( sasl )
 	pbkdf2? ( ssl )
@@ -43,6 +42,7 @@ REQUIRED_USE="
 	?? ( test minimal )
 	kerberos? ( ?? ( kinit smbkrb5passwd ) )
 "
+RESTRICT="!test? ( test )"
 
 SYSTEM_LMDB_VER=0.9.31
 # openssl is needed to generate lanman-passwords required by samba


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-12-07 16:25 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-12-07 16:25 UTC (permalink / raw
  To: gentoo-commits

commit:     ada4ac6e2217f43d2ee35368176e6c739d517966
Author:     Matoro Mahri <matoro_gentoo <AT> matoro <DOT> tk>
AuthorDate: Thu Dec  7 05:53:19 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Thu Dec  7 16:25:24 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ada4ac6e

net-nds/openldap: Stabilize 2.6.4-r1 sparc, #908276

Signed-off-by: Matoro Mahri <matoro_gentoo <AT> matoro.tk>
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.4-r1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.4-r1.ebuild b/net-nds/openldap/openldap-2.6.4-r1.ebuild
index eb26dad73bff..d5ca265f007d 100644
--- a/net-nds/openldap/openldap-2.6.4-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r1.ebuild
@@ -25,7 +25,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+KEYWORDS="~alpha ~amd64 ~arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x86-linux"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2023-12-11  4:33 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2023-12-11  4:33 UTC (permalink / raw
  To: gentoo-commits

commit:     82af70a34601ccbe1f42a874297d710507a49fa7
Author:     Matoro Mahri <matoro_gentoo <AT> matoro <DOT> tk>
AuthorDate: Mon Dec 11 01:25:42 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Mon Dec 11 04:32:53 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82af70a3

net-nds/openldap: Stabilize 2.6.4-r1 x86, #908276

Signed-off-by: Matoro Mahri <matoro_gentoo <AT> matoro.tk>
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.4-r1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.4-r1.ebuild b/net-nds/openldap/openldap-2.6.4-r1.ebuild
index 312c1a44760c..4b72e0c28826 100644
--- a/net-nds/openldap/openldap-2.6.4-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r1.ebuild
@@ -25,7 +25,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x86-linux"
+KEYWORDS="~alpha ~amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2024-01-05 14:04 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2024-01-05 14:04 UTC (permalink / raw
  To: gentoo-commits

commit:     b750b158ab8ce00579901ef253c8a2594cee1886
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  5 14:04:23 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jan  5 14:04:23 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b750b158

net-nds/openldap: Stabilize 2.6.4-r1 amd64, #908276

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.4-r1.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net-nds/openldap/openldap-2.6.4-r1.ebuild b/net-nds/openldap/openldap-2.6.4-r1.ebuild
index 4b72e0c28826..2f6ab178605e 100644
--- a/net-nds/openldap/openldap-2.6.4-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -25,7 +25,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2024-03-29 18:47 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2024-03-29 18:47 UTC (permalink / raw
  To: gentoo-commits

commit:     7a8bb8b9e767e18a6524fdbfca58025a33e4c7de
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Fri Mar 29 18:07:39 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 29 18:45:16 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a8bb8b9

net-nds/openldap: fix automagic dependency on cyrus-sasl

The client programs can depend on sasl as well. But we never passed the
relevant options when building with USE=minimal, as is the default on
desktop profiles to avoid building the entire server infrastructure.

This was then detected on the official binhost, producing a totally
invalid package.

Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...ap-2.6.6-r1.ebuild => openldap-2.6.4-r3.ebuild} | 26 +++++++++-------------
 ...nldap-2.6.5.ebuild => openldap-2.6.5-r1.ebuild} |  4 ++--
 ...ap-2.6.6-r1.ebuild => openldap-2.6.6-r2.ebuild} |  2 +-
 3 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/net-nds/openldap/openldap-2.6.6-r1.ebuild b/net-nds/openldap/openldap-2.6.4-r3.ebuild
similarity index 98%
copy from net-nds/openldap/openldap-2.6.6-r1.ebuild
copy to net-nds/openldap/openldap-2.6.4-r3.ebuild
index 84848052995b..9478f6d4a4ea 100644
--- a/net-nds/openldap/openldap-2.6.6-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r3.ebuild
@@ -34,17 +34,15 @@ IUSE_OPTIONAL="debug gnutls iodbc odbc sasl ssl selinux static-libs +syslog test
 IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
 IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
 IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
-REQUIRED_USE="
-	cxx? ( sasl )
+REQUIRED_USE="cxx? ( sasl )
 	pbkdf2? ( ssl )
 	test? ( cleartext sasl )
 	autoca? ( !gnutls )
 	?? ( test minimal )
-	kerberos? ( ?? ( kinit smbkrb5passwd ) )
-"
+	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
 RESTRICT="!test? ( test )"
 
-SYSTEM_LMDB_VER=0.9.31
+SYSTEM_LMDB_VER=0.9.30
 # openssl is needed to generate lanman-passwords required by samba
 COMMON_DEPEND="
 	kernel_linux? ( sys-apps/util-linux )
@@ -82,22 +80,19 @@ COMMON_DEPEND="
 		)
 	)
 "
-DEPEND="
-	${COMMON_DEPEND}
+DEPEND="${COMMON_DEPEND}
 	sys-apps/groff
 "
-RDEPEND="
-	${COMMON_DEPEND}
+RDEPEND="${COMMON_DEPEND}
 	selinux? ( sec-policy/selinux-ldap )
 "
 
 # The user/group are only used for running daemons which are
 # disabled in minimal builds, so elide the accounts too.
-BDEPEND="
-	!minimal? (
+BDEPEND="!minimal? (
 		acct-group/ldap
 		acct-user/ldap
-	)
+)
 "
 
 # for tracking versions
@@ -148,7 +143,8 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
 	"${FILESDIR}"/${PN}-2.6.1-flags.patch
 	"${FILESDIR}"/${PN}-2.6.1-fix-missing-mapping.patch
-	"${FILESDIR}"/${PN}-2.6.6-fix-type-mismatch-lloadd.patch
+	"${FILESDIR}"/${PN}-2.6.4-clang16.patch
+	"${FILESDIR}"/${PN}-2.6.4-libressl.patch #903001
 )
 
 openldap_filecount() {
@@ -412,6 +408,7 @@ multilib_src_configure() {
 	# Optional Packages
 	myconf+=(
 		--without-fetch
+		$(multilib_native_use_with sasl cyrus-sasl)
 	)
 
 	if use experimental ; then
@@ -486,7 +483,6 @@ multilib_src_configure() {
 		# Optional Packages
 		myconf+=(
 			$(use_with systemd)
-			$(multilib_native_use_with sasl cyrus-sasl)
 		)
 	else
 		myconf+=(
@@ -684,7 +680,7 @@ multilib_src_test() {
 		#TESTS+=( pldif ) # not done by default, so also exclude here
 		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
 
-		emake -Onone "${TESTS[@]}"
+		emake "${TESTS[@]}"
 	fi
 }
 

diff --git a/net-nds/openldap/openldap-2.6.5.ebuild b/net-nds/openldap/openldap-2.6.5-r1.ebuild
similarity index 99%
rename from net-nds/openldap/openldap-2.6.5.ebuild
rename to net-nds/openldap/openldap-2.6.5-r1.ebuild
index e38e6c6522c5..66a264d48ad2 100644
--- a/net-nds/openldap/openldap-2.6.5.ebuild
+++ b/net-nds/openldap/openldap-2.6.5-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -411,6 +411,7 @@ multilib_src_configure() {
 	# Optional Packages
 	myconf+=(
 		--without-fetch
+		$(multilib_native_use_with sasl cyrus-sasl)
 	)
 
 	if use experimental ; then
@@ -485,7 +486,6 @@ multilib_src_configure() {
 		# Optional Packages
 		myconf+=(
 			$(use_with systemd)
-			$(multilib_native_use_with sasl cyrus-sasl)
 		)
 	else
 		myconf+=(

diff --git a/net-nds/openldap/openldap-2.6.6-r1.ebuild b/net-nds/openldap/openldap-2.6.6-r2.ebuild
similarity index 99%
rename from net-nds/openldap/openldap-2.6.6-r1.ebuild
rename to net-nds/openldap/openldap-2.6.6-r2.ebuild
index 84848052995b..965cce327fb3 100644
--- a/net-nds/openldap/openldap-2.6.6-r1.ebuild
+++ b/net-nds/openldap/openldap-2.6.6-r2.ebuild
@@ -412,6 +412,7 @@ multilib_src_configure() {
 	# Optional Packages
 	myconf+=(
 		--without-fetch
+		$(multilib_native_use_with sasl cyrus-sasl)
 	)
 
 	if use experimental ; then
@@ -486,7 +487,6 @@ multilib_src_configure() {
 		# Optional Packages
 		myconf+=(
 			$(use_with systemd)
-			$(multilib_native_use_with sasl cyrus-sasl)
 		)
 	else
 		myconf+=(


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2024-06-04 18:23 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2024-06-04 18:23 UTC (permalink / raw
  To: gentoo-commits

commit:     21cf0686fedc77261a74aff92a4af2c020a8efb9
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  4 18:23:24 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Tue Jun  4 18:23:24 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21cf0686

net-nds/openldap: Stabilize 2.6.4-r3 amd64, #932806

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.4-r3.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.4-r3.ebuild b/net-nds/openldap/openldap-2.6.4-r3.ebuild
index 9478f6d4a4ea..5ba0a364d71d 100644
--- a/net-nds/openldap/openldap-2.6.4-r3.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r3.ebuild
@@ -26,7 +26,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2024-06-04 18:23 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2024-06-04 18:23 UTC (permalink / raw
  To: gentoo-commits

commit:     1ebe3b528c3f9c72ec720ce7a9a1112c2362a60b
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  4 18:23:25 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Tue Jun  4 18:23:25 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ebe3b52

net-nds/openldap: Stabilize 2.6.4-r3 x86, #932806

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.4-r3.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.4-r3.ebuild b/net-nds/openldap/openldap-2.6.4-r3.ebuild
index 5ba0a364d71d..2949d8d49c3c 100644
--- a/net-nds/openldap/openldap-2.6.4-r3.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r3.ebuild
@@ -26,7 +26,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2024-06-05  7:16 Sam James
  0 siblings, 0 replies; 187+ messages in thread
From: Sam James @ 2024-06-05  7:16 UTC (permalink / raw
  To: gentoo-commits

commit:     ee6a5b271b04144c8443aedab1abc28631432a57
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  5 07:15:50 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun  5 07:15:50 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee6a5b27

net-nds/openldap: Stabilize 2.6.4-r3 arm64, #932806

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.4-r3.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.4-r3.ebuild b/net-nds/openldap/openldap-2.6.4-r3.ebuild
index b5f9c1af4ab5..cba05d444128 100644
--- a/net-nds/openldap/openldap-2.6.4-r3.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r3.ebuild
@@ -26,7 +26,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2024-08-25  0:57 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2024-08-25  0:57 UTC (permalink / raw
  To: gentoo-commits

commit:     7d86c9da1effdbc18444b00ff438859a20d7256e
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 25 00:45:39 2024 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Aug 25 00:56:45 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d86c9da

net-nds/openldap: bump; passes src_test

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 net-nds/openldap/Manifest               |   2 +
 net-nds/openldap/openldap-2.5.18.ebuild | 868 +++++++++++++++++++++++++++++++
 net-nds/openldap/openldap-2.6.8.ebuild  | 875 ++++++++++++++++++++++++++++++++
 3 files changed, 1745 insertions(+)

diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index 987dc7f896b3..13fcc87211c3 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,8 +1,10 @@
 DIST openldap-2.4.59.tgz 5886272 BLAKE2B a2a8bed1d2af97fd41d651668152fd4740871bc5a8abf4b50390839228af82ac103346b3500ae0f8dd31b708acabb30435b90cd48dfafe510e648df5150d96b8 SHA512 233459ab446da6e107a7fc4ecd5668d6b08c11a11359ee76449550393e8f586a29b59d7ae09a050a1fca4fcf388ea61438ef60831b3ae802d92c048365ae3968
 DIST openldap-OPENLDAP_REL_ENG_2_5_14.tar.bz2 5024359 BLAKE2B ffdffbd47e76545c2dc2d433d290945ab6eebd910031a60249cd8f6eac24f67841098e61c7e57864428e20a183a46d36dac422bba8cf6f3596f97439875af96b SHA512 abd1e8bda0762500db028f283fe2da9480a419072927295d6f3e1448cae130592511f385a87585843cf88217417c90ef57174ca919cfcf163eb41642a72bb4e3
 DIST openldap-OPENLDAP_REL_ENG_2_5_16.tar.bz2 5022608 BLAKE2B 829e416e3cf92d36df0d6642e44083f9b288ef9c3743a84aef3f03cdf7b08b21ea45231653a2659fe0da285ca47a346d336d02c8e0dda21f039fb9e49630262b SHA512 629b92e275b69a540b200e61165492a4706afdf7b15d21bfe2f1fd4c338ecf397ad0c918e36dcef54d1f0cede2f039a8f73d4735f00e892d64ce9a177d490a07
+DIST openldap-OPENLDAP_REL_ENG_2_5_18.tar.bz2 5026131 BLAKE2B 0f1a00995bd880b3ee42c4de2c3a405ebb7969de253f4b3866eb46c1856b61539ed7e1133a1b11636efc1da1ed5fc6cae53da60b22ab31486518000d34ff6324 SHA512 77a84950c905d2a4bd25f93108eb79f1416689176531246f12b4c3f6e8e3fe689504cd3f9875142e9bf665306a622ac8fe7e6b39aa4be67099f0965a16634526
 DIST openldap-OPENLDAP_REL_ENG_2_6_3.tar.gz 6244895 BLAKE2B 97792a1b368de44867b0ce9eef38601c3e64b7d40e4ca206295bee110097697c919040d2220eea6f0581812e09a2cc3e6afb4a243a5072a8a0a95f24f9fb354b SHA512 1c882a0cd0729b5d0f40b58588d0e36ae3b1cae6d569f0576e940c7c63d03c29ed2c9db87695a87594ba99a927ef4cba491bddba3ce049025fd5883463122ba7
 DIST openldap-OPENLDAP_REL_ENG_2_6_4.tar.bz2 5043227 BLAKE2B 9bec77dbace0e52d1607d9ac13a77349e7d0b8876aa81fa635893638d00db58ec6bf8412f11fd266bba0440887be1aa21eb4a876122152f7f6de9fd8f75b6b4c SHA512 bff11bf1ae125bcabbd307f6c4e1c102a8df6f1091f84f5e7053fdbaa89ccd6aa0c86cc8dcce4fb9b6ffd853b5f8d3c933733f5713aeb4d6a9d77ab145293b48
 DIST openldap-OPENLDAP_REL_ENG_2_6_5.tar.bz2 5040569 BLAKE2B d1835e560a81bc3df2eb44964162306057ad28869a1e41da7ab823460b4a33437cd385ec9448a6df9bc580afd04dff5c4680e0b91a2f16960ad2c5f3812410ba SHA512 d259ca5ac8fbdcf9bb477e24c0feaf05678ab660007164a54463a954f1b26c3f9740855d16155fa249adcb2652223fdcfc682bb4005b46a5f36e2d5cae37f158
 DIST openldap-OPENLDAP_REL_ENG_2_6_6.tar.bz2 5040213 BLAKE2B 2497b6698344674a9e8db5f2f2531541167065bb8ac9f512ecdb9349115140d5e83daef9b489e244eee08445de57599ddcfeeed71d4aab41edc58a3092910925 SHA512 3c235ff7b26f753afeb0176e95ecbf6a353bf76f00935c091323366bf97289f628d4d7b4ae3e2a31fe0797715d6c69e6704967dc79ccbae7add3023e226ad73b
+DIST openldap-OPENLDAP_REL_ENG_2_6_8.tar.bz2 5065637 BLAKE2B d55345c11bd8892a594c3f7114cd1368e017c2e29997da7a80bdd915308d498f62dfb5cc3a3360b50df78ef5f90a48a566a8ce3ace85ebf9aa6b288a37c4eff2 SHA512 556d1377afc73a84ee325c4d7bcc8446def936b67d3f07df4bd2a243ff30f268c5c0c298977482df1e1a86b2b7a0cd7846fc1f51d706748d39f67f5d621ccc04
 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e

diff --git a/net-nds/openldap/openldap-2.5.18.ebuild b/net-nds/openldap/openldap-2.5.18.ebuild
new file mode 100644
index 000000000000..41d46debc6b3
--- /dev/null
+++ b/net-nds/openldap/openldap-2.5.18.ebuild
@@ -0,0 +1,868 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+# Re cleanups:
+# 2.5.x is an LTS release so we want to keep it for a while.
+
+inherit autotools flag-o-matic multilib multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles
+
+MY_PV="$(ver_rs 1-2 _)"
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.openldap.org/"
+SRC_URI="
+	https://gitlab.com/openldap/${PN}/-/archive/OPENLDAP_REL_ENG_${MY_PV}/${PN}-OPENLDAP_REL_ENG_${MY_PV}.tar.bz2
+	mirror://gentoo/${BIS_P}
+"
+S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
+
+LICENSE="OPENLDAP GPL-2"
+# Subslot added for bug #835654
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
+IUSE_OVERLAY="overlays perl autoca"
+IUSE_OPTIONAL="debug gnutls iodbc ipv6 odbc sasl ssl selinux static-libs +syslog test"
+IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
+IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
+IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+REQUIRED_USE="cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( cleartext debug sasl )
+	autoca? ( !gnutls )
+	?? ( test minimal )
+	kerberos? ( ?? ( kinit smbkrb5passwd ) )"
+RESTRICT="!test? ( test )"
+
+SYSTEM_LMDB_VER=0.9.33
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	kernel_linux? ( sys-apps/util-linux )
+	ssl? (
+		!gnutls? (
+			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		dev-libs/libltdl
+		sys-fs/e2fsprogs
+		>=dev-db/lmdb-${SYSTEM_LMDB_VER}:=
+		argon2? ( app-crypt/argon2:= )
+		crypt? ( virtual/libcrypt:= )
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			dev-libs/openssl:0=
+		)
+		smbkrb5passwd? (
+			dev-libs/openssl:0=
+			kerberos? ( app-crypt/heimdal )
+		)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+		)
+	)
+"
+DEPEND="${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+BDEPEND="!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+)
+"
+
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+	"${FILESDIR}"/${PN}-2.6.1-system-mdb.patch
+	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
+	"${FILESDIR}"/${PN}-2.6.1-flags.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${EROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	# TODO: remove this as we dropped bdb support (gone upstream) in 2.6.1?
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		local fail=0
+
+		# This will not cover detection of cn=Config based configuration, but
+		# it's hopefully good enough.
+		if grep -sq '^backend.*shell' "${EROOT}"/etc/openldap/slapd.conf; then
+			eerror "    OpenLDAP >= 2.6.x has dropped support for Shell backend."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted away from backend shell!"
+			echo
+			fail=1
+		fi
+		if has_version "${CATEGORY}/${PN}[berkdb]" || grep -sq '^backend.*(bdb|hdb)' /etc/openldap/slapd.conf; then
+			eerror "	OpenLDAP >= 2.5.x has dropped support for Berkeley DB."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted to mdb!"
+			echo
+			fail=1
+		elif [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. Check that your data is intact."
+	eerror "11. Set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	# The system copy of dev-db/lmdb must match the version that this copy
+	# of OpenLDAP shipped with! See bug #588792.
+	#
+	# Fish out MDB_VERSION_MAJOR/MDB_VERSION_MINOR/MDB_VERSION_PATCH from
+	# the bundled lmdb's header to find out the version.
+	local bundled_lmdb_version=$(sed -En '/^#define MDB_VERSION_(MAJOR|MINOR|PATCH)(\s+)?/{s/[^0-9.]//gp}' libraries/liblmdb/lmdb.h || die)
+	printf -v bundled_lmdb_version "%s." ${bundled_lmdb_version}
+
+	if [[ ${SYSTEM_LMDB_VER}. != ${bundled_lmdb_version} ]] ; then
+		eerror "Source lmdb version: ${bundled_lmdb_version}"
+		eerror "Ebuild lmdb version: ${SYSTEM_LMDB_VER}"
+		die "Ebuild needs to update SYSTEM_LMDB_VER!"
+	fi
+
+	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
+
+	local filename
+	for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do
+		iconv -f iso-8859-1 -t utf-8 "${filename}" > "${filename}.utf8"
+		mv "${filename}.utf8" "${filename}"
+	done
+
+	default
+
+	sed -i \
+		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
+		-e '/MKDIR.*.(DESTDIR)\/run/d' \
+		-e '/MKDIR.*.(DESTDIR).*.(runstatedir)/d' \
+		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to remove too early stripping"
+	popd &>/dev/null || die
+
+	# Fails with OpenSSL 3, bug #848894
+	# https://bugs.openldap.org/show_bug.cgi?id=10009
+	rm tests/scripts/test076-authid-rewrite || die
+
+	eautoreconf
+	multilib_copy_sources
+}
+
+build_contrib_module() {
+	# <dir> [<target>]
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $1"
+	local target="${2:-all}"
+	emake \
+		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
+		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
+		"${target}"
+	popd &>/dev/null || die
+}
+
+multilib_src_configure() {
+	# Optional Features
+	myconf+=(
+		--enable-option-checking
+		$(use_enable debug)
+		--enable-dynamic
+		$(use_enable syslog)
+		$(use_enable ipv6)
+		--enable-local
+	)
+
+	# Optional Packages
+	myconf+=(
+		--without-fetch
+	)
+
+	# The configure scripts make some assumptions that aren't valid in newer GCC.
+	# https://bugs.gentoo.org/920380
+	append-flags $(test-flags-CC -Wno-error=implicit-int)
+	# conftest.c:113:16: error: passing argument 1 of 'pthread_detach' makes integer from pointer without a cast [-Wint-conversion]
+	append-flags $(test-flags-CC -Wno-error=int-conversion)
+	# error: passing argument 3 of ‘ldap_bv2rdn’ from incompatible pointer type [-Wincompatible-pointer-types]
+	# expected ‘char **’ but argument is of type ‘const char **’
+	append-flags $(test-flags-CC -Wno-error=incompatible-pointer-types)
+
+	if use experimental ; then
+		# connectionless ldap per bug #342439
+		# connectionless is a unsupported feature according to Howard Chu
+		# see https://bugs.openldap.org/show_bug.cgi?id=9739
+		# (see also bug #892009)
+		append-flags -DLDAP_CONNECTIONLESS
+	fi
+
+	if ! use minimal && multilib_is_native_abi; then
+		# SLAPD (Standalone LDAP Daemon) Options
+		# overlay chaining requires '--enable-ldap' #296567
+		# see https://www.openldap.org/doc/admin26/overlays.html#Chaining
+		myconf+=(
+			--enable-ldap=yes
+			--enable-slapd
+			$(use_enable cleartext)
+			$(use_enable crypt)
+			$(multilib_native_use_enable sasl spasswd)
+			--disable-slp
+			$(use_enable tcpd wrappers)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				# ACI build as dynamic module not supported (yet)
+				--enable-aci=yes
+			)
+		fi
+
+		for option in modules rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# static SLAPD backends
+		for backend in mdb; do
+			myconf+=( --enable-${backend}=yes )
+		done
+
+		# module SLAPD backends
+		for backend in asyncmeta dnssrv meta null passwd relay sock; do
+			# missing modules: wiredtiger (not available in portage)
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		use perl && myconf+=( --enable-perl=mod )
+
+		if use odbc ; then
+			myconf+=( --enable-sql=mod )
+			if use iodbc ; then
+				myconf+=( --with-odbc="iodbc" )
+				append-cflags -I"${EPREFIX}"/usr/include/iodbc
+			else
+				myconf+=( --with-odbc="unixodbc" )
+			fi
+		fi
+
+		use overlays && myconf+=( --enable-overlays=mod )
+		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
+		# compile-in the syncprov
+		myconf+=( --enable-syncprov=yes )
+
+		# SLAPD Password Module Options
+		myconf+=(
+			$(use_enable argon2)
+		)
+
+		# Optional Packages
+		myconf+=(
+			$(use_with systemd)
+			$(multilib_native_use_with sasl cyrus-sasl)
+		)
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-mdb
+			--disable-overlays
+			--disable-autoca
+			--disable-syslog
+			--without-systemd
+		)
+	fi
+
+	# Library Generation & Linking Options
+	myconf+=(
+		$(use_enable static-libs static)
+		--enable-shared
+		--enable-versioning
+		--with-pic
+	)
+
+	# some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		if use gnutls ; then
+			myconf+=( --with-tls="gnutls" )
+		else
+			# disable MD2 hash function
+			append-cflags -DOPENSSL_NO_MD2
+			myconf+=( --with-tls="openssl" )
+		fi
+	else
+		myconf+=( --with-tls="no" )
+	fi
+
+	tc-export AR CC CXX
+
+	ECONF_SOURCE="${S}" econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		--localstatedir="${EPREFIX}"/var \
+		--runstatedir="${EPREFIX}"/run \
+		--sharedstatedir="${EPREFIX}"/var/lib \
+		"${myconf[@]}"
+
+	# argument '--runstatedir' seems to have no effect therefore this workaround
+	sed -i \
+		-e 's:^runstatedir=.*:runstatedir=${EPREFIX}/run:' \
+		configure contrib/ldapc++/configure contrib/ldaptcl/configure || die 'could not set runstatedir'
+
+	sed -i \
+		-e "s:/var/run/sasl2/mux:${EPREFIX}/run/sasl2/mux:" \
+		doc/guide/admin/security.sdf || die 'could not fix run path in doc'
+
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# we have to run it AFTER the main build, not just after the main configure
+	local myconf_ldapcpp=(
+		--with-libldap="${E}/lib"
+		--with-ldap-includes="${S}/include"
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die "could not create ${BUILD_DIR}/contrib/ldapc++ directory"
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS="${LDFLAGS}"
+	local CPPFLAGS="${CPPFLAGS}"
+
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs -L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+
+	ECONF_SOURCE="${S}"/contrib/ldapc++ econf "${myconf_ldapcpp[@]}"
+	popd &>/dev/null || die "popd contrib/ldapc++"
+}
+
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			build_contrib_module "passwd" "pw-kerberos.la"
+		fi
+
+		if use pbkdf2; then
+			build_contrib_module "passwd/pbkdf2"
+		fi
+
+		if use sha2 ; then
+			build_contrib_module "passwd/sha2"
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		build_contrib_module "passwd" "pw-netscape.la"
+
+		#build_contrib_module "acl" "posixgroup.la" # example code only
+		#build_contrib_module "acl" "gssacl.la" # example code only, also needs kerberos
+		build_contrib_module "addpartial"
+		build_contrib_module "allop"
+		build_contrib_module "allowed"
+		build_contrib_module "autogroup"
+		build_contrib_module "cloak"
+		# build_contrib_module "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop"
+		build_contrib_module "dsaschema"
+		build_contrib_module "dupent"
+		build_contrib_module "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod"
+		build_contrib_module "noopsrch"
+		#build_contrib_module "nops" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" RESO:LATER
+		build_contrib_module "trace"
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		$(tc-getCC) -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CPPFLAGS} \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		pwd
+
+		# Increase various test timeouts/delays, bug #894012
+		# We can't just double everything as there's a cumulative effect.
+		export SLEEP0=2 # originally 1
+		export SLEEP1=10 # originally 7
+		export SLEEP2=20 # originally 15
+		export TIMEOUT=16 # originally 8
+
+		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
+		# emake partests => runs ALL of the tests in parallel
+		# wt/WiredTiger is not supported in Gentoo
+		TESTS=( lloadd mdb )
+		#TESTS+=( pldif ) # not done by default, so also exclude here
+		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
+
+		emake -Onone "${TESTS[@]}"
+	fi
+}
+
+multilib_src_install() {
+	emake CC="$(tc-getCC)" \
+		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.6.3-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		einfo "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
+
+		if use systemd; then
+			# The systemd unit uses Type=notify, so it is useless without USE=systemd
+			einfo "Install systemd service"
+			rm -rf "${ED}"/{,usr/}lib/systemd
+			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
+			systemd_dounit "${T}"/slapd.service
+			systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+			newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+		fi
+
+		# if built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			libtool --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		if use systemd; then
+			tmpfiles_process slapd.conf
+		fi
+
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+}

diff --git a/net-nds/openldap/openldap-2.6.8.ebuild b/net-nds/openldap/openldap-2.6.8.ebuild
new file mode 100644
index 000000000000..61f2eedf6751
--- /dev/null
+++ b/net-nds/openldap/openldap-2.6.8.ebuild
@@ -0,0 +1,875 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Re cleanups:
+# 2.5.x is an LTS release so we want to keep it for a while.
+
+inherit autotools flag-o-matic multilib multilib-minimal preserve-libs
+inherit ssl-cert toolchain-funcs systemd tmpfiles
+
+MY_PV="$(ver_rs 1-2 _)"
+
+BIS_PN=rfc2307bis.schema
+BIS_PV=20140524
+BIS_P="${BIS_PN}-${BIS_PV}"
+
+DESCRIPTION="LDAP suite of application and development tools"
+HOMEPAGE="https://www.openldap.org/"
+SRC_URI="
+	https://gitlab.com/openldap/${PN}/-/archive/OPENLDAP_REL_ENG_${MY_PV}/${PN}-OPENLDAP_REL_ENG_${MY_PV}.tar.bz2
+	mirror://gentoo/${BIS_P}
+"
+S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
+
+LICENSE="OPENLDAP GPL-2"
+# Subslot added for bug #835654
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
+IUSE_OVERLAY="overlays perl autoca"
+IUSE_OPTIONAL="debug gnutls iodbc odbc sasl ssl selinux static-libs +syslog test"
+IUSE_CONTRIB="kerberos kinit pbkdf2 sha2 smbkrb5passwd"
+IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
+IUSE="systemd ${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
+REQUIRED_USE="
+	cxx? ( sasl )
+	pbkdf2? ( ssl )
+	test? ( cleartext sasl )
+	autoca? ( !gnutls )
+	?? ( test minimal )
+	kerberos? ( ?? ( kinit smbkrb5passwd ) )
+"
+RESTRICT="!test? ( test )"
+
+SYSTEM_LMDB_VER=0.9.33
+# openssl is needed to generate lanman-passwords required by samba
+COMMON_DEPEND="
+	kernel_linux? ( sys-apps/util-linux )
+	ssl? (
+		!gnutls? (
+			>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
+		)
+		gnutls? (
+			>=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
+			>=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
+		)
+	)
+	sasl? ( dev-libs/cyrus-sasl:= )
+	!minimal? (
+		dev-libs/libevent:=
+		dev-libs/libltdl
+		sys-fs/e2fsprogs
+		>=dev-db/lmdb-${SYSTEM_LMDB_VER}:=
+		argon2? ( app-crypt/argon2:= )
+		crypt? ( virtual/libcrypt:= )
+		tcpd? ( sys-apps/tcp-wrappers )
+		odbc? ( !iodbc? ( dev-db/unixODBC )
+			iodbc? ( dev-db/libiodbc ) )
+		perl? ( dev-lang/perl:=[-build(-)] )
+		samba? (
+			dev-libs/openssl:0=
+		)
+		smbkrb5passwd? (
+			dev-libs/openssl:0=
+			kerberos? ( app-crypt/heimdal )
+		)
+		kerberos? (
+			virtual/krb5
+			kinit? ( !app-crypt/heimdal )
+		)
+	)
+"
+DEPEND="
+	${COMMON_DEPEND}
+	sys-apps/groff
+"
+RDEPEND="
+	${COMMON_DEPEND}
+	selinux? ( sec-policy/selinux-ldap )
+"
+
+# The user/group are only used for running daemons which are
+# disabled in minimal builds, so elide the accounts too.
+BDEPEND="
+	!minimal? (
+		acct-group/ldap
+		acct-user/ldap
+	)
+"
+
+# for tracking versions
+OPENLDAP_VERSIONTAG=".version-tag"
+OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
+
+MULTILIB_WRAPPED_HEADERS=(
+	# USE=cxx
+	/usr/include/LDAPAsynConnection.h
+	/usr/include/LDAPAttrType.h
+	/usr/include/LDAPAttribute.h
+	/usr/include/LDAPAttributeList.h
+	/usr/include/LDAPConnection.h
+	/usr/include/LDAPConstraints.h
+	/usr/include/LDAPControl.h
+	/usr/include/LDAPControlSet.h
+	/usr/include/LDAPEntry.h
+	/usr/include/LDAPEntryList.h
+	/usr/include/LDAPException.h
+	/usr/include/LDAPExtResult.h
+	/usr/include/LDAPMessage.h
+	/usr/include/LDAPMessageQueue.h
+	/usr/include/LDAPModList.h
+	/usr/include/LDAPModification.h
+	/usr/include/LDAPObjClass.h
+	/usr/include/LDAPRebind.h
+	/usr/include/LDAPRebindAuth.h
+	/usr/include/LDAPReferenceList.h
+	/usr/include/LDAPResult.h
+	/usr/include/LDAPSaslBindResult.h
+	/usr/include/LDAPSchema.h
+	/usr/include/LDAPSearchReference.h
+	/usr/include/LDAPSearchResult.h
+	/usr/include/LDAPSearchResults.h
+	/usr/include/LDAPUrl.h
+	/usr/include/LDAPUrlList.h
+	/usr/include/LdifReader.h
+	/usr/include/LdifWriter.h
+	/usr/include/SaslInteraction.h
+	/usr/include/SaslInteractionHandler.h
+	/usr/include/StringList.h
+	/usr/include/TlsOptions.h
+)
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
+	"${FILESDIR}"/${PN}-2.6.1-system-mdb.patch
+	"${FILESDIR}"/${PN}-2.6.1-cloak.patch
+	"${FILESDIR}"/${PN}-2.6.1-flags.patch
+	"${FILESDIR}"/${PN}-2.6.1-fix-missing-mapping.patch
+	#"${FILESDIR}"/${PN}-2.6.6-fix-type-mismatch-lloadd.patch
+)
+
+openldap_filecount() {
+	local dir="$1"
+	find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
+}
+
+openldap_find_versiontags() {
+	# scan for all datadirs
+	local openldap_datadirs=()
+	if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
+		openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
+	fi
+	openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
+
+	einfo
+	einfo "Scanning datadir(s) from slapd.conf and"
+	einfo "the default installdir for Versiontags"
+	einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
+	einfo
+
+	# scan datadirs if we have a version tag
+	openldap_found_tag=0
+	have_files=0
+	for each in ${openldap_datadirs[@]} ; do
+		CURRENT_TAGDIR="${EROOT}$(sed "s:\/::" <<< ${each})"
+		CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
+		if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
+			einfo "- Checking ${each}..."
+			if [[ -r "${CURRENT_TAG}" ]] ; then
+				# yey, we have one :)
+				einfo "   Found Versiontag in ${each}"
+				source "${CURRENT_TAG}"
+				if [[ "${OLDPF}" == "" ]] ; then
+					eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
+					eerror "Please delete it"
+					eerror
+					die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
+				fi
+
+				OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
+
+				[[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
+
+				# are we on the same branch?
+				if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
+					ewarn "   Versiontag doesn't match current major release!"
+					if [[ "${have_files}" == "1" ]] ; then
+						eerror "   Versiontag says other major and you (probably) have datafiles!"
+						echo
+						openldap_upgrade_howto
+					else
+						einfo "   No real problem, seems there's no database."
+					fi
+				else
+					einfo "   Versiontag is fine here :)"
+				fi
+			else
+				einfo "   Non-tagged dir ${each}"
+				[[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
+				if [[ "${have_files}" == "1" ]] ; then
+					einfo "   EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
+					echo
+
+					eerror
+					eerror "Your OpenLDAP Installation has a non tagged datadir that"
+					eerror "possibly contains a database at ${CURRENT_TAGDIR}"
+					eerror
+					eerror "Please export data if any entered and empty or remove"
+					eerror "the directory, installation has been stopped so you"
+					eerror "can take required action"
+					eerror
+					eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
+					eerror
+					openldap_upgrade_howto
+					die "Please move the datadir ${CURRENT_TAGDIR} away"
+				fi
+			fi
+			einfo
+		fi
+	done
+	[[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
+
+	# Now we must check for the major version of sys-libs/db linked against.
+	# TODO: remove this as we dropped bdb support (gone upstream) in 2.6.1?
+	SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
+	if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
+		OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
+			| awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
+		local fail=0
+
+		# This will not cover detection of cn=Config based configuration, but
+		# it's hopefully good enough.
+		if grep -sq '^backend.*shell' "${EROOT}"/etc/openldap/slapd.conf; then
+			eerror "    OpenLDAP >= 2.5.x has dropped support for Shell backend."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted away from backend shell!"
+			echo
+			fail=1
+		fi
+		if has_version "${CATEGORY}/${PN}[berkdb]" || grep -sq '^backend.*(bdb|hdb)' /etc/openldap/slapd.conf; then
+			eerror "	OpenLDAP >= 2.5.x has dropped support for Berkeley DB."
+			eerror "	You will need to migrate per upstream's migration notes"
+			eerror "	at https://www.openldap.org/doc/admin25/appendix-upgrading.html."
+			eerror "	Your existing database will not be accessible until it is"
+			eerror "	converted to mdb!"
+			echo
+			fail=1
+		elif [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			:
+			# Nothing wrong here.
+		elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was not built against"
+			eerror "	any version of sys-libs/db, but the new one will build"
+			eerror "	against	${NEWVER} and your database may be inaccessible."
+			echo
+			fail=1
+		elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will not be"
+			eerror "	built against any version and your database may be"
+			eerror "	inaccessible."
+			echo
+			fail=1
+		elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
+			eerror "	Your existing version of OpenLDAP was built against"
+			eerror "	sys-libs/db:${OLDVER}, but the new one will build against"
+			eerror "	${NEWVER} and your database would be inaccessible."
+			echo
+			fail=1
+		fi
+		[[ "${fail}" == "1" ]] && openldap_upgrade_howto
+	fi
+
+	echo
+	einfo
+	einfo "All datadirs are fine, proceeding with merge now..."
+	einfo
+}
+
+openldap_upgrade_howto() {
+	local d l i
+	eerror
+	eerror "A (possible old) installation of OpenLDAP was detected,"
+	eerror "installation will not proceed for now."
+	eerror
+	eerror "As major version upgrades can corrupt your database,"
+	eerror "you need to dump your database and re-create it afterwards."
+	eerror
+	eerror "Additionally, rebuilding against different major versions of the"
+	eerror "sys-libs/db libraries will cause your database to be inaccessible."
+	eerror ""
+	d="$(date -u +%s)"
+	l="/root/ldapdump.${d}"
+	i="${l}.raw"
+	eerror " 1. /etc/init.d/slapd stop"
+	eerror " 2. slapcat -l ${i}"
+	eerror " 3. grep -E -v '^(entry|context)CSN:' <${i} >${l}"
+	eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
+	eerror " 5. emerge --update \=net-nds/${PF}"
+	eerror " 6. etc-update, and ensure that you apply the changes"
+	eerror " 7. slapadd -l ${l}"
+	eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
+	eerror " 9. /etc/init.d/slapd start"
+	eerror "10. Check that your data is intact."
+	eerror "11. Set up the new replication system."
+	eerror
+	if [[ "${FORCE_UPGRADE}" != "1" ]]; then
+		die "You need to upgrade your database first"
+	else
+		eerror "You have the magical FORCE_UPGRADE=1 in place."
+		eerror "Don't say you weren't warned about data loss."
+	fi
+}
+
+pkg_setup() {
+	if ! use sasl && use cxx ; then
+		die "To build the ldapc++ library you must emerge openldap with sasl support"
+	fi
+	# Bug #322787
+	if use minimal && ! has_version "net-nds/openldap" ; then
+		einfo "No datadir scan needed, openldap not installed"
+	elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
+		einfo "Skipping scan for previous datadirs as requested by minimal useflag"
+	else
+		openldap_find_versiontags
+	fi
+}
+
+src_prepare() {
+	# The system copy of dev-db/lmdb must match the version that this copy
+	# of OpenLDAP shipped with! See bug #588792.
+	#
+	# Fish out MDB_VERSION_MAJOR/MDB_VERSION_MINOR/MDB_VERSION_PATCH from
+	# the bundled lmdb's header to find out the version.
+	local bundled_lmdb_version=$(sed -En '/^#define MDB_VERSION_(MAJOR|MINOR|PATCH)(\s+)?/{s/[^0-9.]//gp}' \
+		libraries/liblmdb/lmdb.h || die)
+	printf -v bundled_lmdb_version "%s." ${bundled_lmdb_version}
+
+	if [[ ${SYSTEM_LMDB_VER}. != ${bundled_lmdb_version} ]] ; then
+		eerror "Source lmdb version: ${bundled_lmdb_version}"
+		eerror "Ebuild lmdb version: ${SYSTEM_LMDB_VER}"
+		die "Ebuild needs to update SYSTEM_LMDB_VER!"
+	fi
+
+	rm -r libraries/liblmdb || die 'could not removed bundled lmdb directory'
+
+	local filename
+	for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do
+		iconv -f iso-8859-1 -t utf-8 "${filename}" > "${filename}.utf8"
+		mv "${filename}.utf8" "${filename}"
+	done
+
+	default
+
+	sed -i \
+		-e "s:\$(localstatedir)/run:${EPREFIX}/run:" \
+		-e '/MKDIR.*.(DESTDIR)\/run/d' \
+		servers/slapd/Makefile.in || die 'adjusting slapd Makefile.in failed'
+
+	pushd build &>/dev/null || die "pushd build"
+	einfo "Making sure upstream build strip does not do stripping too early"
+	sed -i.orig \
+		-e '/^STRIP/s,-s,,g' \
+		top.mk || die "Failed to remove too early stripping"
+	popd &>/dev/null || die
+
+	# Fails with OpenSSL 3, bug #848894
+	# https://bugs.openldap.org/show_bug.cgi?id=10009
+	rm tests/scripts/test076-authid-rewrite || die
+
+	eautoreconf
+	multilib_copy_sources
+}
+
+build_contrib_module() {
+	# <dir> [<target>]
+	pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
+	einfo "Compiling contrib-module: $1"
+	local target="${2:-all}"
+	emake \
+		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
+		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
+		"${target}"
+	popd &>/dev/null || die
+}
+
+multilib_src_configure() {
+	# Optional Features
+	myconf+=(
+		--enable-option-checking
+		$(use_enable debug)
+		--enable-dynamic
+		$(use_enable syslog)
+		--enable-ipv6
+		--enable-local
+	)
+
+	# Optional Packages
+	myconf+=(
+		--without-fetch
+		$(multilib_native_use_with sasl cyrus-sasl)
+	)
+
+	# error: passing argument 3 of ‘ldap_bv2rdn’ from incompatible pointer type [-Wincompatible-pointer-types]
+	# expected ‘char **’ but argument is of type ‘const char **’
+	append-flags $(test-flags-CC -Wno-error=incompatible-pointer-types)
+
+	if use experimental ; then
+		# connectionless ldap per bug #342439
+		# connectionless is a unsupported feature according to Howard Chu
+		# see https://bugs.openldap.org/show_bug.cgi?id=9739
+		# (see also bug #892009)
+		append-flags -DLDAP_CONNECTIONLESS
+	fi
+
+	if ! use minimal && multilib_is_native_abi; then
+		# SLAPD (Standalone LDAP Daemon) Options
+		# overlay chaining requires '--enable-ldap' #296567
+		# see https://www.openldap.org/doc/admin26/overlays.html#Chaining
+		myconf+=(
+			--enable-ldap=yes
+			--enable-slapd
+			$(use_enable cleartext)
+			$(use_enable crypt)
+			$(multilib_native_use_enable sasl spasswd)
+			--disable-slp
+			$(use_enable tcpd wrappers)
+		)
+		if use experimental ; then
+			myconf+=(
+				--enable-dynacl
+				# ACI build as dynamic module not supported (yet)
+				--enable-aci=yes
+			)
+		fi
+
+		for option in modules rlookups slapi; do
+			myconf+=( --enable-${option} )
+		done
+
+		# static SLAPD backends
+		for backend in mdb; do
+			myconf+=( --enable-${backend}=yes )
+		done
+
+		# module SLAPD backends
+		for backend in asyncmeta dnssrv meta null passwd relay sock; do
+			# missing modules: wiredtiger (not available in portage)
+			myconf+=( --enable-${backend}=mod )
+		done
+
+		use perl && myconf+=( --enable-perl=mod )
+
+		if use odbc ; then
+			myconf+=( --enable-sql=mod )
+			if use iodbc ; then
+				myconf+=( --with-odbc="iodbc" )
+				append-cflags -I"${EPREFIX}"/usr/include/iodbc
+			else
+				myconf+=( --with-odbc="unixodbc" )
+			fi
+		fi
+
+		use overlays && myconf+=( --enable-overlays=mod )
+		use autoca && myconf+=( --enable-autoca=mod ) || myconf+=( --enable-autoca=no )
+		# compile-in the syncprov
+		myconf+=( --enable-syncprov=yes )
+
+		# Build the standalone load balancer (lloadd) - also available as a slapd module; --enable-balancer=mod
+		myconf+=( --enable-balancer=yes )
+
+		# SLAPD Password Module Options
+		myconf+=(
+			$(use_enable argon2)
+		)
+
+		# Optional Packages
+		myconf+=(
+			$(use_with systemd)
+		)
+	else
+		myconf+=(
+			--disable-backends
+			--disable-slapd
+			--disable-mdb
+			--disable-overlays
+			--disable-autoca
+			--disable-syslog
+			--without-systemd
+		)
+	fi
+
+	# Library Generation & Linking Options
+	myconf+=(
+		$(use_enable static-libs static)
+		--enable-shared
+		--enable-versioning
+		--with-pic
+	)
+
+	# some cross-compiling tests don't pan out well.
+	tc-is-cross-compiler && myconf+=(
+		--with-yielding-select=yes
+	)
+
+	local ssl_lib="no"
+	if use ssl || ( ! use minimal && use samba ) ; then
+		if use gnutls ; then
+			myconf+=( --with-tls="gnutls" )
+		else
+			# disable MD2 hash function
+			append-cflags -DOPENSSL_NO_MD2
+			myconf+=( --with-tls="openssl" )
+		fi
+	else
+		myconf+=( --with-tls="no" )
+	fi
+
+	tc-export AR CC CXX
+
+	ECONF_SOURCE="${S}" econf \
+		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
+		--localstatedir="${EPREFIX}"/var \
+		--runstatedir="${EPREFIX}"/run \
+		--sharedstatedir="${EPREFIX}"/var/lib \
+		"${myconf[@]}"
+
+	# argument '--runstatedir' seems to have no effect therefore this workaround
+	sed -i \
+		-e 's:^runstatedir=.*:runstatedir=${EPREFIX}/run:' \
+		configure contrib/ldapc++/configure contrib/ldaptcl/configure || die 'could not set runstatedir'
+
+	sed -i \
+		-e "s:/var/run/sasl2/mux:${EPREFIX}/run/sasl2/mux:" \
+		doc/guide/admin/security.sdf || die 'could not fix run path in doc'
+
+	emake depend
+}
+
+src_configure_cxx() {
+	# This needs the libraries built by the first build run.
+	# we have to run it AFTER the main build, not just after the main configure
+	local myconf_ldapcpp=(
+		--with-libldap="${E}/lib"
+		--with-ldap-includes="${S}/include"
+	)
+
+	mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die "could not create ${BUILD_DIR}/contrib/ldapc++ directory"
+	pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+
+	local LDFLAGS="${LDFLAGS}"
+	local CPPFLAGS="${CPPFLAGS}"
+
+	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs -L"${BUILD_DIR}"/libraries/libldap/.libs
+	append-cppflags -I"${BUILD_DIR}"/include
+
+	ECONF_SOURCE="${S}"/contrib/ldapc++ econf "${myconf_ldapcpp[@]}"
+	popd &>/dev/null || die "popd contrib/ldapc++"
+}
+
+multilib_src_compile() {
+	tc-export AR CC CXX
+	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
+
+	if ! use minimal && multilib_is_native_abi ; then
+		if use cxx ; then
+			einfo "Building contrib library: ldapc++"
+			src_configure_cxx
+			pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
+			emake
+			popd &>/dev/null || die
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Building contrib-module: smbk5pwd"
+			pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
+
+			MY_DEFS="-DDO_SHADOW"
+			if use samba ; then
+				MY_DEFS="${MY_DEFS} -DDO_SAMBA"
+				MY_KRB5_INC=""
+			fi
+			if use kerberos ; then
+				MY_DEFS="${MY_DEFS} -DDO_KRB5"
+				MY_KRB5_INC="$(krb5-config --cflags)"
+			fi
+
+			emake \
+				DEFS="${MY_DEFS}" \
+				KRB5_INC="${MY_KRB5_INC}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use overlays ; then
+			einfo "Building contrib-module: samba4"
+			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
+
+			emake \
+				LDAP_BUILD="${BUILD_DIR}" \
+				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+			popd &>/dev/null || die
+		fi
+
+		if use kerberos ; then
+			if use kinit ; then
+				build_contrib_module "kinit" "kinit.c" "kinit"
+			fi
+			build_contrib_module "passwd" "pw-kerberos.la"
+		fi
+
+		if use pbkdf2; then
+			build_contrib_module "passwd/pbkdf2"
+		fi
+
+		if use sha2 ; then
+			build_contrib_module "passwd/sha2"
+		fi
+
+		# We could build pw-radius if GNURadius would install radlib.h
+		build_contrib_module "passwd" "pw-netscape.la"
+
+		#build_contrib_module "acl" "posixgroup.la" # example code only
+		#build_contrib_module "acl" "gssacl.la" # example code only, also needs kerberos
+		build_contrib_module "addpartial"
+		build_contrib_module "allop"
+		build_contrib_module "allowed"
+		build_contrib_module "autogroup"
+		build_contrib_module "cloak"
+		# build_contrib_module "comp_match" # really complex, adds new external deps, questionable demand
+		build_contrib_module "denyop"
+		build_contrib_module "dsaschema"
+		build_contrib_module "dupent"
+		build_contrib_module "lastbind"
+		# lastmod may not play well with other overlays
+		build_contrib_module "lastmod"
+		build_contrib_module "noopsrch"
+		#build_contrib_module "nops" https://bugs.gentoo.org/641576
+		#build_contrib_module "nssov" RESO:LATER
+		build_contrib_module "trace"
+		# build slapi-plugins
+		pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
+		einfo "Building contrib-module: addrdnvalues plugin"
+		$(tc-getCC) -shared \
+			-I"${BUILD_DIR}"/include \
+			-I../../../include \
+			${CPPFLAGS} \
+			${CFLAGS} \
+			-fPIC \
+			${LDFLAGS} \
+			-o libaddrdnvalues-plugin.so \
+			addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
+		popd &>/dev/null || die
+	fi
+}
+
+multilib_src_test() {
+	if multilib_is_native_abi; then
+		cd tests || die
+		pwd
+
+		# Increase various test timeouts/delays, bug #894012
+		# We can't just double everything as there's a cumulative effect.
+		export SLEEP0=2 # originally 1
+		export SLEEP1=10 # originally 7
+		export SLEEP2=20 # originally 15
+		export TIMEOUT=16 # originally 8
+
+		# emake test => runs only lloadd & mdb, in serial; skips ldif,sql,wt,regression
+		# emake partests => runs ALL of the tests in parallel
+		# wt/WiredTiger is not supported in Gentoo
+		TESTS=( plloadd pmdb )
+		#TESTS+=( pldif ) # not done by default, so also exclude here
+		#use odbc && TESTS+=( psql ) # not done by default, so also exclude here
+
+		emake -Onone "${TESTS[@]}"
+	fi
+}
+
+multilib_src_install() {
+	emake CC="$(tc-getCC)" \
+		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+
+	if ! use minimal && multilib_is_native_abi; then
+		# openldap modules go here
+		# TODO: write some code to populate slapd.conf with moduleload statements
+		keepdir /usr/$(get_libdir)/openldap/openldap/
+
+		# initial data storage dir
+		keepdir /var/lib/openldap-data
+		use prefix || fowners ldap:ldap /var/lib/openldap-data
+		fperms 0700 /var/lib/openldap-data
+
+		echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# do NOT delete this. it is used"	>> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+		echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
+
+		# use our config
+		rm "${ED}"/etc/openldap/slapd.conf
+		insinto /etc/openldap
+		newins "${FILESDIR}"/${PN}-2.6.3-slapd-conf slapd.conf
+		configfile="${ED}"/etc/openldap/slapd.conf
+
+		# populate with built backends
+		einfo "populate config with built backends"
+		for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
+			einfo "Adding $(basename ${x})"
+			sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
+		done
+		sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" \
+			-i "${configfile}" || die
+		use prefix || fowners root:ldap /etc/openldap/slapd.conf
+		fperms 0640 /etc/openldap/slapd.conf
+		cp "${configfile}" "${configfile}".default || die
+
+		# install our own init scripts and systemd unit files
+		einfo "Install init scripts"
+		sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
+		doinitd "${T}"/slapd
+		newconfd "${FILESDIR}"/slapd-confd-2.6.1 slapd
+
+		if use systemd; then
+			# The systemd unit uses Type=notify, so it is useless without USE=systemd
+			einfo "Install systemd service"
+			rm -rf "${ED}"/{,usr/}lib/systemd
+			sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-2.6.1.service > "${T}"/slapd.service || die
+			systemd_dounit "${T}"/slapd.service
+			systemd_install_serviced "${FILESDIR}"/slapd.service.conf
+			newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf
+		fi
+
+		# if built without SLP, we don't need to be before avahi
+			sed -i \
+				-e '/before/{s/avahi-daemon//g}' \
+				"${ED}"/etc/init.d/slapd \
+				|| die
+
+		if use cxx ; then
+			einfo "Install the ldapc++ library"
+			cd "${BUILD_DIR}/contrib/ldapc++" || die
+			emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			cd "${S}"/contrib/ldapc++ || die
+			newdoc README ldapc++-README
+		fi
+
+		if use smbkrb5passwd ; then
+			einfo "Install the smbk5pwd module"
+			cd "${S}/contrib/slapd-modules/smbk5pwd" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README smbk5pwd-README
+		fi
+
+		if use overlays ; then
+			einfo "Install the samba4 module"
+			cd "${S}/contrib/slapd-modules/samba4" || die
+			emake DESTDIR="${D}" \
+				LDAP_BUILD="${BUILD_DIR}" \
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
+			newdoc README samba4-README
+		fi
+
+		einfo "Installing contrib modules"
+		cd "${S}/contrib/slapd-modules" || die
+		for l in */*.la */*/*.la; do
+			[[ -e ${l} ]] || continue
+			libtool --mode=install cp ${l} \
+				"${ED}"/usr/$(get_libdir)/openldap/openldap || \
+				die "installing ${l} failed"
+		done
+
+		dodoc "${FILESDIR}"/DB_CONFIG.fast.example
+		docinto contrib
+		doman */*.5
+		#newdoc acl/README*
+		newdoc addpartial/README addpartial-README
+		newdoc allop/README allop-README
+		newdoc allowed/README allowed-README
+		newdoc autogroup/README autogroup-README
+		newdoc dsaschema/README dsaschema-README
+		newdoc passwd/README passwd-README
+		cd "${S}/contrib/slapi-plugins" || die
+		insinto /usr/$(get_libdir)/openldap/openldap
+		doins */*.so
+		docinto contrib
+		newdoc addrdnvalues/README addrdnvalues-README
+
+		insinto /etc/openldap/schema
+		newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
+
+		docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
+		docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
+
+		dosbin "${S}"/contrib/slapd-tools/statslog
+		newdoc "${S}"/contrib/slapd-tools/README README.statslog
+	fi
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
+	docinto rfc ; dodoc doc/rfc/*.txt
+}
+
+pkg_preinst() {
+	# keep old libs if any
+	preserve_old_lib /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+	# bug 440470, only display the getting started help there was no openldap before,
+	# or we are going to a non-minimal build
+	! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
+	OPENLDAP_PRINT_MESSAGES=$((! $?))
+}
+
+pkg_postinst() {
+	if ! use minimal ; then
+		if use systemd; then
+			tmpfiles_process slapd.conf
+		fi
+
+		# You cannot build SSL certificates during src_install that will make
+		# binary packages containing your SSL key, which is both a security risk
+		# and a misconfiguration if multiple machines use the same key and cert.
+		if use ssl; then
+			install_cert /etc/openldap/ssl/ldap
+			use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
+			ewarn "add 'TLS_REQCERT allow' if you want to use them."
+		fi
+
+		if use prefix; then
+			# Warn about prefix issues with slapd
+			eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
+			eerror "to start up, and requires that certain files directories be owned by"
+			eerror "ldap:ldap.  As Prefix does not support changing ownership of files and"
+			eerror "directories, you will have to manually fix this yourself."
+		fi
+
+		# These lines force the permissions of various content to be correct
+		if [[ -d "${EROOT}"/var/run/openldap ]]; then
+			use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
+			chmod 0755 "${EROOT}"/var/run/openldap || die
+		fi
+		use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
+		chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
+		use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
+	fi
+
+	if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
+		elog "Getting started using OpenLDAP? There is some documentation available:"
+		elog "Gentoo Guide to OpenLDAP Authentication"
+		elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
+	fi
+
+	preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.4$(get_libname 0)
+}


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2024-08-25 20:00 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2024-08-25 20:00 UTC (permalink / raw
  To: gentoo-commits

commit:     a6311ebbdd9edc68c6e1590ca3d0b3928a4847ba
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 25 20:00:15 2024 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Aug 25 20:00:32 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6311ebb

net-nds/openldap: cleanup unused empty dir

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
Closes: https://bugs.gentoo.org/926725

 net-nds/openldap/openldap-2.6.6-r2.ebuild | 1 +
 net-nds/openldap/openldap-2.6.8.ebuild    | 1 +
 2 files changed, 2 insertions(+)

diff --git a/net-nds/openldap/openldap-2.6.6-r2.ebuild b/net-nds/openldap/openldap-2.6.6-r2.ebuild
index f63e7a4effc9..fd2f6205da49 100644
--- a/net-nds/openldap/openldap-2.6.6-r2.ebuild
+++ b/net-nds/openldap/openldap-2.6.6-r2.ebuild
@@ -817,6 +817,7 @@ multilib_src_install() {
 multilib_src_install_all() {
 	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
 	docinto rfc ; dodoc doc/rfc/*.txt
+	rmdir -p "${D}"/var/openldap-lloadd # Created but not used by any part of current codebase.
 }
 
 pkg_preinst() {

diff --git a/net-nds/openldap/openldap-2.6.8.ebuild b/net-nds/openldap/openldap-2.6.8.ebuild
index d8034c51fae3..894ea2a9ae3a 100644
--- a/net-nds/openldap/openldap-2.6.8.ebuild
+++ b/net-nds/openldap/openldap-2.6.8.ebuild
@@ -821,6 +821,7 @@ multilib_src_install() {
 multilib_src_install_all() {
 	dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
 	docinto rfc ; dodoc doc/rfc/*.txt
+	rmdir -p "${D}"/var/openldap-lloadd # Created but not used by any part of current codebase.
 }
 
 pkg_preinst() {


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2024-08-25 20:12 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2024-08-25 20:12 UTC (permalink / raw
  To: gentoo-commits

commit:     7b3ab00f0043adb296acfac9135a4865dcab10ac
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 25 20:12:19 2024 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Aug 25 20:12:19 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b3ab00f

net-nds/openldap: QA trivial fix configure.in

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
Bug: https://bugs.gentoo.org/658674

 net-nds/openldap/openldap-2.4.59-r3.ebuild | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/net-nds/openldap/openldap-2.4.59-r3.ebuild b/net-nds/openldap/openldap-2.4.59-r3.ebuild
index 9de40ce840dd..367fb900d9bf 100644
--- a/net-nds/openldap/openldap-2.4.59-r3.ebuild
+++ b/net-nds/openldap/openldap-2.4.59-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -383,8 +383,12 @@ src_prepare() {
 		-e 's|/bin/sh|/bin/bash|g' \
 		-i tests/scripts/* || die "sed failed"
 
+	if test -e configure.in -a ! -e configure.ac ; then
+		mv -f configure.in configure.ac
+	fi
+
 	# Required for autoconf-2.70 #765043
-	sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.in || die
+	sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.ac || die
 	AT_NOEAUTOMAKE=yes eautoreconf
 }
 


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2024-08-25 20:34 Robin H. Johnson
  0 siblings, 0 replies; 187+ messages in thread
From: Robin H. Johnson @ 2024-08-25 20:34 UTC (permalink / raw
  To: gentoo-commits

commit:     9fe404138fa2136da29108e542713187e5d13b75
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 25 20:32:39 2024 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Aug 25 20:34:25 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9fe40413

net-nds/openldap: QA fix, false positive on strip

STRIP was already patched out in all the paths that actually generated
final objects or binaries, but that wasn't enough to stop the QA test
firing. Fix it a bit more (package output is identical).

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
Closes: https://bugs.gentoo.org/show_bug.cgi?id=840451

 net-nds/openldap/openldap-2.6.8.ebuild | 33 +++++++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 8 deletions(-)

diff --git a/net-nds/openldap/openldap-2.6.8.ebuild b/net-nds/openldap/openldap-2.6.8.ebuild
index 894ea2a9ae3a..250d4ce0b66e 100644
--- a/net-nds/openldap/openldap-2.6.8.ebuild
+++ b/net-nds/openldap/openldap-2.6.8.ebuild
@@ -394,8 +394,11 @@ build_contrib_module() {
 	einfo "Compiling contrib-module: $1"
 	local target="${2:-all}"
 	emake \
-		LDAP_BUILD="${BUILD_DIR}" prefix="${EPREFIX}/usr" \
-		CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
+		CC="${CC}" \
+		LDAP_BUILD="${BUILD_DIR}" \
+		libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
+		prefix="${EPREFIX}/usr" \
+		STRIP=/bin/true \
 		"${target}"
 	popd &>/dev/null || die
 }
@@ -534,7 +537,9 @@ multilib_src_configure() {
 
 	tc-export AR CC CXX
 
-	ECONF_SOURCE="${S}" econf \
+	ECONF_SOURCE="${S}" \
+	STRIP=/bin/true \
+		econf \
 		--libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
 		--localstatedir="${EPREFIX}"/var \
 		--runstatedir="${EPREFIX}"/run \
@@ -570,13 +575,19 @@ src_configure_cxx() {
 	append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs -L"${BUILD_DIR}"/libraries/libldap/.libs
 	append-cppflags -I"${BUILD_DIR}"/include
 
-	ECONF_SOURCE="${S}"/contrib/ldapc++ econf "${myconf_ldapcpp[@]}"
+	ECONF_SOURCE="${S}"/contrib/ldapc++ \
+	STRIP=/bin/true \
+		econf \
+		"${myconf_ldapcpp[@]}"
 	popd &>/dev/null || die "popd contrib/ldapc++"
 }
 
 multilib_src_compile() {
 	tc-export AR CC CXX
-	emake CC="$(tc-getCC)" SHELL="${EPREFIX}"/bin/sh
+	emake \
+		CC="$(tc-getCC)" \
+		SHELL="${EPREFIX}"/bin/sh \
+		STRIP="/bin/true"
 
 	if ! use minimal && multilib_is_native_abi ; then
 		if use cxx ; then
@@ -614,8 +625,10 @@ multilib_src_compile() {
 			pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
 
 			emake \
+				CC="$(tc-getCC)" \
 				LDAP_BUILD="${BUILD_DIR}" \
-				CC="$(tc-getCC)" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
+				libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
+				STRIP=/bin/true
 			popd &>/dev/null || die
 		fi
 
@@ -695,8 +708,12 @@ multilib_src_test() {
 }
 
 multilib_src_install() {
-	emake CC="$(tc-getCC)" \
-		DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
+	emake \
+		CC="$(tc-getCC)" \
+		DESTDIR="${D}" \
+		SHELL="${EPREFIX}"/bin/sh \
+		STRIP=/bin/true \
+		install
 
 	if ! use minimal && multilib_is_native_abi; then
 		# openldap modules go here


^ permalink raw reply related	[flat|nested] 187+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
@ 2024-09-12  6:13 Arthur Zamarin
  0 siblings, 0 replies; 187+ messages in thread
From: Arthur Zamarin @ 2024-09-12  6:13 UTC (permalink / raw
  To: gentoo-commits

commit:     8bdbffa2b4a994b762c17063467de1a0ae447a7c
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 12 06:13:03 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Thu Sep 12 06:13:03 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bdbffa2

net-nds/openldap: Stabilize 2.6.4-r3 ppc, #901943

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 net-nds/openldap/openldap-2.6.4-r3.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net-nds/openldap/openldap-2.6.4-r3.ebuild b/net-nds/openldap/openldap-2.6.4-r3.ebuild
index 7194cc597604..7d695f0d195d 100644
--- a/net-nds/openldap/openldap-2.6.4-r3.ebuild
+++ b/net-nds/openldap/openldap-2.6.4-r3.ebuild
@@ -26,7 +26,7 @@ S="${WORKDIR}"/${PN}-OPENLDAP_REL_ENG_${MY_PV}
 LICENSE="OPENLDAP GPL-2"
 # Subslot added for bug #835654
 SLOT="0/$(ver_cut 1-2)"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
 
 IUSE_DAEMON="argon2 +cleartext crypt experimental minimal samba tcpd"
 IUSE_OVERLAY="overlays perl autoca"


^ permalink raw reply related	[flat|nested] 187+ messages in thread

end of thread, other threads:[~2024-09-12  6:13 UTC | newest]

Thread overview: 187+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-03  8:16 [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/ Agostino Sarubbo
  -- strict thread matches above, loose matches on Subject: below --
2024-09-12  6:13 Arthur Zamarin
2024-08-25 20:34 Robin H. Johnson
2024-08-25 20:12 Robin H. Johnson
2024-08-25 20:00 Robin H. Johnson
2024-08-25  0:57 Robin H. Johnson
2024-06-05  7:16 Sam James
2024-06-04 18:23 Arthur Zamarin
2024-06-04 18:23 Arthur Zamarin
2024-03-29 18:47 Sam James
2024-01-05 14:04 Sam James
2023-12-11  4:33 Arthur Zamarin
2023-12-07 16:25 Arthur Zamarin
2023-09-19 17:48 Arthur Zamarin
2023-08-01  5:47 Sam James
2023-08-01  5:47 Sam James
2023-07-17 21:47 Sam James
2023-07-15  8:49 Arthur Zamarin
2023-07-06  6:15 Sam James
2023-07-04  5:07 Robin H. Johnson
2023-07-02 16:31 Sam James
2023-06-12 19:12 Sam James
2023-05-06 16:08 Arthur Zamarin
2023-05-05 15:45 Arthur Zamarin
2023-05-05 15:45 Arthur Zamarin
2023-05-05 15:45 Arthur Zamarin
2023-05-05 15:45 Arthur Zamarin
2023-05-05 15:45 Arthur Zamarin
2023-05-01  1:53 Sam James
2023-03-19  3:22 Sam James
2023-03-19  3:22 Sam James
2023-02-12 23:39 Robin H. Johnson
2023-02-12  6:52 Sam James
2023-02-12  6:52 Sam James
2023-02-12  6:49 Sam James
2023-02-12  6:49 Sam James
2023-02-12  6:22 Sam James
2023-02-10  1:05 Sam James
2023-02-08  1:55 Sam James
2023-01-30 16:46 Mike Gilbert
2023-01-30 15:26 Sam James
2023-01-30 15:26 Sam James
2023-01-30 15:26 Sam James
2023-01-28 21:49 Jakov Smolić
2023-01-28 19:33 Arthur Zamarin
2023-01-28 19:33 Arthur Zamarin
2023-01-19 18:02 Sam James
2023-01-13 16:39 Arthur Zamarin
2023-01-13 16:39 Arthur Zamarin
2023-01-13 16:39 Arthur Zamarin
2023-01-13 16:39 Arthur Zamarin
2023-01-13 16:38 Arthur Zamarin
2022-12-23 21:05 Mike Gilbert
2022-12-16  6:26 Sam James
2022-12-14  5:19 Sam James
2022-12-14  1:53 Sam James
2022-11-20  4:25 Sam James
2022-07-29  3:12 Sam James
2022-07-15  3:31 Sam James
2022-07-15  3:31 Sam James
2022-06-01  5:20 Sam James
2022-05-15  1:00 Sam James
2022-05-13 20:04 Sam James
2022-05-13 12:19 WANG Xuerui
2022-04-15 19:35 Robin H. Johnson
2022-04-15 19:35 Robin H. Johnson
2022-03-22 23:32 Sam James
2022-03-22 23:32 Sam James
2022-03-20 23:08 Robin H. Johnson
2022-03-20 23:08 Robin H. Johnson
2022-03-20  0:53 Sam James
2022-03-19 22:39 Sam James
2022-03-19 22:39 Sam James
2022-01-02 17:49 David Seifert
2021-11-17  7:49 Sam James
2021-10-29  5:55 Agostino Sarubbo
2021-10-29  5:54 Agostino Sarubbo
2021-10-21 23:26 Sam James
2021-10-18 23:49 Sam James
2021-10-18 15:22 Agostino Sarubbo
2021-10-18 15:18 Agostino Sarubbo
2021-09-13 20:30 David Seifert
2021-07-30 23:31 Sam James
2021-06-22 19:59 Sam James
2021-06-22  6:26 Mikle Kolyada
2021-06-03 19:15 Sam James
2021-05-07  7:47 Mikle Kolyada
2021-03-19  9:56 Mikle Kolyada
2021-03-07 11:58 David Seifert
2021-01-26  9:53 Mikle Kolyada
2021-01-26  9:53 Mikle Kolyada
2021-01-24 14:17 Mikle Kolyada
2021-01-12 10:01 Lars Wendler
2020-12-27 17:57 Fabian Groffen
2020-12-18 14:13 Mikle Kolyada
2020-12-18 14:13 Mikle Kolyada
2020-11-21 14:12 Mikle Kolyada
2020-10-28 10:05 Mikle Kolyada
2020-10-28 10:05 Mikle Kolyada
2020-10-18 15:12 Mikle Kolyada
2020-10-18 15:12 Mikle Kolyada
2020-10-09 15:57 Mikle Kolyada
2020-09-25 19:22 Mikle Kolyada
2020-09-11  8:52 Mikle Kolyada
2020-09-11  8:52 Mikle Kolyada
2020-08-26 18:42 Mikle Kolyada
2020-08-26  7:38 Mikle Kolyada
2020-05-17 16:55 Aaron Bauman
2020-05-08 10:21 Mikle Kolyada
2020-05-08 10:21 Mikle Kolyada
2020-05-08 10:21 Mikle Kolyada
2020-05-08 10:21 Mikle Kolyada
2020-05-08 10:21 Mikle Kolyada
2020-05-07 17:11 Sergei Trofimovich
2020-05-04  6:16 Mart Raudsepp
2020-05-03 19:12 Agostino Sarubbo
2020-05-03 19:10 Agostino Sarubbo
2020-05-03 15:05 Agostino Sarubbo
2020-05-02 23:15 Robin H. Johnson
2020-03-18  1:34 Patrick McLean
2020-02-13  1:43 Thomas Deutschmann
2020-02-12 19:10 Mikle Kolyada
2020-02-12 19:07 Mikle Kolyada
2020-02-12 16:46 Mikle Kolyada
2020-02-12 16:38 Mikle Kolyada
2020-02-12 15:22 David Seifert
2019-12-11 14:18 Michał Górny
2019-11-09 22:55 Matt Turner
2019-11-08 15:08 Aaron Bauman
2019-11-01 11:09 Mikle Kolyada
2019-11-01  8:44 Mikle Kolyada
2019-10-11 15:37 Michał Górny
2019-10-03  8:14 Agostino Sarubbo
2019-10-03  8:12 Agostino Sarubbo
2019-10-03  8:09 Agostino Sarubbo
2019-09-29 19:26 Sergei Trofimovich
2019-07-25  6:46 Lars Wendler
2019-05-05 18:41 Mikle Kolyada
2019-04-28 10:48 Lars Wendler
2019-04-27 20:28 David Seifert
2019-02-22  1:42 Patrick McLean
2019-02-20 15:06 Lars Wendler
2019-02-16 18:58 Aaron Bauman
2018-11-30 20:18 Mikle Kolyada
2018-11-30 20:18 Mikle Kolyada
2018-11-30 20:18 Mikle Kolyada
2018-11-29 20:06 Sergei Trofimovich
2018-11-28 22:35 Sergei Trofimovich
2018-11-28 22:33 Sergei Trofimovich
2018-11-28 22:28 Sergei Trofimovich
2018-11-28 12:35 Mart Raudsepp
2018-11-27 21:55 Thomas Deutschmann
2018-11-27 16:01 Tobias Klausmann
2018-11-27 15:11 Mikle Kolyada
2018-07-15 11:45 Mart Raudsepp
2018-06-03 10:01 Mikle Kolyada
2018-03-16 22:50 Lars Wendler
2017-12-14 22:08 Robin H. Johnson
2017-11-26 23:23 David Seifert
2017-11-05 20:46 Robin H. Johnson
2017-09-02 14:15 Michael Palimaka
2017-07-22 19:37 Mike Gilbert
2017-07-17  0:02 Aaron Bauman
2017-06-23 16:34 Matt Thode
2017-06-21 19:23 Matt Thode
2017-05-26 10:27 David Seifert
2017-02-23 19:09 Robin H. Johnson
2017-02-20  0:36 Robin H. Johnson
2017-02-08 23:38 Robin H. Johnson
2017-02-07 20:07 Patrick McLean
2017-01-24  8:24 Agostino Sarubbo
2017-01-24  8:23 Agostino Sarubbo
2017-01-18 10:02 Agostino Sarubbo
2017-01-15 19:27 Jeroen Roovers
2017-01-13 16:51 Markus Meier
2016-11-28  5:15 Robin H. Johnson
2016-11-23  9:20 Tobias Klausmann
2016-11-19 13:55 Agostino Sarubbo
2016-11-19 13:53 Agostino Sarubbo
2016-11-10  5:00 Mike Frysinger
2016-11-10  5:00 Mike Frysinger
2016-09-29 21:36 Andreas Hüttel
2016-03-03 21:08 Zac Medico
2016-01-22  6:28 Matt Thode
2015-12-03 18:08 Tony Vroon
2015-12-03 18:08 Tony Vroon
2015-09-20 16:39 Julian Ospald

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox