Gentoo Archives: gentoo-commits

From: Mikle Kolyada <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
Date: Wed, 28 Oct 2020 10:05:33
Message-Id: 1603879527.9aa47c8ea320b4b10200165638a39c2b65fad3ce.zlogene@gentoo
1 commit: 9aa47c8ea320b4b10200165638a39c2b65fad3ce
2 Author: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 28 10:04:53 2020 +0000
4 Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 28 10:05:27 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9aa47c8e
7
8 net-nds/openldap: Drop old
9
10 Package-Manager: Portage-3.0.8, Repoman-3.0.2
11 Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>
12
13 net-nds/openldap/Manifest | 1 -
14 net-nds/openldap/openldap-2.4.50.ebuild | 907 --------------------------------
15 2 files changed, 908 deletions(-)
16
17 diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
18 index 4f0734c20c4..a86662bb380 100644
19 --- a/net-nds/openldap/Manifest
20 +++ b/net-nds/openldap/Manifest
21 @@ -1,4 +1,3 @@
22 -DIST openldap-2.4.50.tgz 5712635 BLAKE2B 6a7d864a44c411b82cf703585c4a81954a02497e8510c84e29070dd120da0181e8425fd2b8bb7616e42e6e26d0f06db5ffdf50fb1cd97943d23f9914eb4f1260 SHA512 f528043ff9de36f7b65d8816c9a9c24f0ac400041b2969965178ee6eae62c92a11af33a0a883e4954e5fff98a0738a9f9aa2faf5b385d21974754e045aab31ae
23 DIST openldap-2.4.53.tgz 5883013 BLAKE2B 09d17d2a5438b09a4aa7f4a815e858d8b17ae7873580e5b3bc81d9569e97174703600472b9ecf79a28b7df561ba8214dfb6d08b467c823feeeae7d0cbdd37c6b SHA512 32dcbf18ffa53b3c2c5399f726c7a8970154d40fb88de85896d18ea2abd79c55ebe28fcf5fbfd52771f95561d70ab364db5f667fe2ec0e67b21e281f5112ec99
24 DIST openldap-2.4.54.tgz 5885717 BLAKE2B 804fec18146d673c78c414914fe37903976de6e1b0b1456f20c545665c9a78d15640e34cebfc4576d7781e67df377c33fed6de1deb984c2be2c9aeeaf4fcfacb SHA512 30cbe23f310f1901a0300ac0d123fc2e6fcc5bde8b15692f2fd8291d1f1e5b7e97426823eb1be9977a15d728fd175c8938c6790a57582a72d10be0b497c3ef5f
25 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e
26
27 diff --git a/net-nds/openldap/openldap-2.4.50.ebuild b/net-nds/openldap/openldap-2.4.50.ebuild
28 deleted file mode 100644
29 index 2c5a8f5c18c..00000000000
30 --- a/net-nds/openldap/openldap-2.4.50.ebuild
31 +++ /dev/null
32 @@ -1,907 +0,0 @@
33 -# Copyright 1999-2020 Gentoo Authors
34 -# Distributed under the terms of the GNU General Public License v2
35 -
36 -EAPI=7
37 -
38 -inherit autotools db-use flag-o-matic multilib-minimal ssl-cert preserve-libs toolchain-funcs user systemd
39 -
40 -BIS_PN=rfc2307bis.schema
41 -BIS_PV=20140524
42 -BIS_P="${BIS_PN}-${BIS_PV}"
43 -
44 -DESCRIPTION="LDAP suite of application and development tools"
45 -HOMEPAGE="https://www.OpenLDAP.org/"
46 -
47 -# upstream mirrors are mostly not working, using canonical URI
48 -SRC_URI="
49 - https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz
50 - http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz
51 - http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz
52 - http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz
53 - mirror://gentoo/${BIS_P}"
54 -
55 -LICENSE="OPENLDAP GPL-2"
56 -SLOT="0"
57 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~x86-solaris"
58 -
59 -IUSE_DAEMON="crypt samba tcpd experimental minimal"
60 -IUSE_BACKEND="+berkdb"
61 -IUSE_OVERLAY="overlays perl"
62 -IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 libressl +syslog selinux static-libs test"
63 -IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2"
64 -IUSE_CONTRIB="${IUSE_CONTRIB} -cxx"
65 -IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
66 -
67 -RESTRICT="!test? ( test )"
68 -REQUIRED_USE="cxx? ( sasl )
69 - pbkdf2? ( ssl )
70 - test? ( berkdb )
71 - ?? ( test minimal )"
72 -
73 -# always list newer first
74 -# Do not add any AGPL-3 BDB here!
75 -# See bug 525110, comment 15.
76 -# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build.
77 -BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}"
78 -BDB_PKGS=''
79 -for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done
80 -
81 -# openssl is needed to generate lanman-passwords required by samba
82 -COMMON_DEPEND="
83 - ssl? (
84 - !gnutls? (
85 - !libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
86 - libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
87 - )
88 - gnutls? (
89 - >=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}]
90 - >=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}]
91 - )
92 - )
93 - sasl? ( dev-libs/cyrus-sasl:= )
94 - !minimal? (
95 - sys-devel/libtool
96 - sys-libs/e2fsprogs-libs
97 - >=dev-db/lmdb-0.9.18:=
98 - tcpd? ( sys-apps/tcp-wrappers )
99 - odbc? ( !iodbc? ( dev-db/unixODBC )
100 - iodbc? ( dev-db/libiodbc ) )
101 - perl? ( dev-lang/perl:=[-build(-)] )
102 - samba? (
103 - !libressl? ( dev-libs/openssl:0= )
104 - libressl? ( dev-libs/libressl:0= )
105 - )
106 - berkdb? (
107 - <sys-libs/db-6.0:=
108 - || ( ${BDB_PKGS} )
109 - )
110 - smbkrb5passwd? (
111 - !libressl? ( dev-libs/openssl:0= )
112 - libressl? ( dev-libs/libressl:0= )
113 - kerberos? ( app-crypt/heimdal )
114 - )
115 - kerberos? (
116 - virtual/krb5
117 - kinit? ( !app-crypt/heimdal )
118 - )
119 - cxx? ( dev-libs/cyrus-sasl:= )
120 - )
121 -"
122 -DEPEND="${COMMON_DEPEND}
123 - sys-apps/groff
124 -"
125 -RDEPEND="${COMMON_DEPEND}
126 - selinux? ( sec-policy/selinux-ldap )
127 -"
128 -# for tracking versions
129 -OPENLDAP_VERSIONTAG=".version-tag"
130 -OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
131 -
132 -MULTILIB_WRAPPED_HEADERS=(
133 - # USE=cxx
134 - /usr/include/LDAPAsynConnection.h
135 - /usr/include/LDAPAttrType.h
136 - /usr/include/LDAPAttribute.h
137 - /usr/include/LDAPAttributeList.h
138 - /usr/include/LDAPConnection.h
139 - /usr/include/LDAPConstraints.h
140 - /usr/include/LDAPControl.h
141 - /usr/include/LDAPControlSet.h
142 - /usr/include/LDAPEntry.h
143 - /usr/include/LDAPEntryList.h
144 - /usr/include/LDAPException.h
145 - /usr/include/LDAPExtResult.h
146 - /usr/include/LDAPMessage.h
147 - /usr/include/LDAPMessageQueue.h
148 - /usr/include/LDAPModList.h
149 - /usr/include/LDAPModification.h
150 - /usr/include/LDAPObjClass.h
151 - /usr/include/LDAPRebind.h
152 - /usr/include/LDAPRebindAuth.h
153 - /usr/include/LDAPReferenceList.h
154 - /usr/include/LDAPResult.h
155 - /usr/include/LDAPSaslBindResult.h
156 - /usr/include/LDAPSchema.h
157 - /usr/include/LDAPSearchReference.h
158 - /usr/include/LDAPSearchResult.h
159 - /usr/include/LDAPSearchResults.h
160 - /usr/include/LDAPUrl.h
161 - /usr/include/LDAPUrlList.h
162 - /usr/include/LdifReader.h
163 - /usr/include/LdifWriter.h
164 - /usr/include/SaslInteraction.h
165 - /usr/include/SaslInteractionHandler.h
166 - /usr/include/StringList.h
167 - /usr/include/TlsOptions.h
168 -)
169 -
170 -PATCHES=(
171 - "${FILESDIR}"/${PN}-2.4.17-gcc44.patch
172 -
173 - "${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
174 - "${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
175 -
176 - # bug #116045 - still present in 2.4.28
177 - "${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch
178 - # bug #408077 - samba4
179 - "${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch
180 -
181 - # bug #189817
182 - "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
183 -
184 - # bug #233633
185 - "${FILESDIR}"/${PN}-2.4.45-fix-lmpasswd-gnutls-symbols.patch
186 -
187 - # bug #281495
188 - "${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch
189 -
190 - # bug #294350
191 - "${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch
192 -
193 - # unbreak /bin/sh -> dash
194 - "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch
195 -
196 - # bug #420959
197 - "${FILESDIR}"/${PN}-2.4.31-gcc47.patch
198 -
199 - # unbundle lmdb
200 - "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch
201 -
202 - # bug #622464
203 - "${FILESDIR}"/${PN}-2.4.47-libressl.patch
204 -
205 - # fix some compiler warnings
206 - "${FILESDIR}"/${PN}-2.4.47-warnings.patch
207 -)
208 -
209 -openldap_filecount() {
210 - local dir="$1"
211 - find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l
212 -}
213 -
214 -openldap_find_versiontags() {
215 - # scan for all datadirs
216 - local openldap_datadirs=()
217 - if [[ -f "${EROOT}"/etc/openldap/slapd.conf ]]; then
218 - openldap_datadirs=( $(awk '{if($1 == "directory") print $2 }' "${EROOT}"/etc/openldap/slapd.conf) )
219 - fi
220 - openldap_datadirs+=( ${OPENLDAP_DEFAULTDIR_VERSIONTAG} )
221 -
222 - einfo
223 - einfo "Scanning datadir(s) from slapd.conf and"
224 - einfo "the default installdir for Versiontags"
225 - einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
226 - einfo
227 -
228 - # scan datadirs if we have a version tag
229 - openldap_found_tag=0
230 - have_files=0
231 - for each in ${openldap_datadirs[@]} ; do
232 - CURRENT_TAGDIR="${ROOT}$(sed "s:\/::" <<< ${each})"
233 - CURRENT_TAG="${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}"
234 - if [[ -d "${CURRENT_TAGDIR}" ]] && [[ "${openldap_found_tag}" == 0 ]] ; then
235 - einfo "- Checking ${each}..."
236 - if [[ -r "${CURRENT_TAG}" ]] ; then
237 - # yey, we have one :)
238 - einfo " Found Versiontag in ${each}"
239 - source "${CURRENT_TAG}"
240 - if [[ "${OLDPF}" == "" ]] ; then
241 - eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
242 - eerror "Please delete it"
243 - eerror
244 - die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
245 - fi
246 -
247 - OLD_MAJOR=$(ver_cut 2-3 ${OLDPF})
248 -
249 - [[ "$(openldap_filecount ${CURRENT_TAGDIR})" -gt 0 ]] && have_files=1
250 -
251 - # are we on the same branch?
252 - if [[ "${OLD_MAJOR}" != "${PV:0:3}" ]] ; then
253 - ewarn " Versiontag doesn't match current major release!"
254 - if [[ "${have_files}" == "1" ]] ; then
255 - eerror " Versiontag says other major and you (probably) have datafiles!"
256 - echo
257 - openldap_upgrade_howto
258 - else
259 - einfo " No real problem, seems there's no database."
260 - fi
261 - else
262 - einfo " Versiontag is fine here :)"
263 - fi
264 - else
265 - einfo " Non-tagged dir ${each}"
266 - [[ "$(openldap_filecount ${each})" -gt 0 ]] && have_files=1
267 - if [[ "${have_files}" == "1" ]] ; then
268 - einfo " EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
269 - echo
270 -
271 - eerror
272 - eerror "Your OpenLDAP Installation has a non tagged datadir that"
273 - eerror "possibly contains a database at ${CURRENT_TAGDIR}"
274 - eerror
275 - eerror "Please export data if any entered and empty or remove"
276 - eerror "the directory, installation has been stopped so you"
277 - eerror "can take required action"
278 - eerror
279 - eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
280 - eerror
281 - openldap_upgrade_howto
282 - die "Please move the datadir ${CURRENT_TAGDIR} away"
283 - fi
284 - fi
285 - einfo
286 - fi
287 - done
288 - [[ "${have_files}" == "1" ]] && einfo "DB files present" || einfo "No DB files present"
289 -
290 - # Now we must check for the major version of sys-libs/db linked against.
291 - SLAPD_PATH="${EROOT}/usr/$(get_libdir)/openldap/slapd"
292 - if [[ "${have_files}" == "1" ]] && [[ -f "${SLAPD_PATH}" ]]; then
293 - OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \
294 - | awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')"
295 - if use berkdb; then
296 - # find which one would be used
297 - for bdb_slot in ${BDB_SLOTS} ; do
298 - NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")"
299 - [[ -n "${NEWVER}" ]] && break
300 - done
301 - fi
302 - local fail=0
303 - if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
304 - :
305 - # Nothing wrong here.
306 - elif [[ -z "${OLDVER}" ]] && [[ -n "${NEWVER}" ]]; then
307 - eerror " Your existing version of OpenLDAP was not built against"
308 - eerror " any version of sys-libs/db, but the new one will build"
309 - eerror " against ${NEWVER} and your database may be inaccessible."
310 - echo
311 - fail=1
312 - elif [[ -n "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then
313 - eerror " Your existing version of OpenLDAP was built against"
314 - eerror " sys-libs/db:${OLDVER}, but the new one will not be"
315 - eerror " built against any version and your database may be"
316 - eerror " inaccessible."
317 - echo
318 - fail=1
319 - elif [[ "${OLDVER}" != "${NEWVER}" ]]; then
320 - eerror " Your existing version of OpenLDAP was built against"
321 - eerror " sys-libs/db:${OLDVER}, but the new one will build against"
322 - eerror " ${NEWVER} and your database would be inaccessible."
323 - echo
324 - fail=1
325 - fi
326 - [[ "${fail}" == "1" ]] && openldap_upgrade_howto
327 - fi
328 -
329 - echo
330 - einfo
331 - einfo "All datadirs are fine, proceeding with merge now..."
332 - einfo
333 -}
334 -
335 -openldap_upgrade_howto() {
336 - local d l i
337 - eerror
338 - eerror "A (possible old) installation of OpenLDAP was detected,"
339 - eerror "installation will not proceed for now."
340 - eerror
341 - eerror "As major version upgrades can corrupt your database,"
342 - eerror "you need to dump your database and re-create it afterwards."
343 - eerror
344 - eerror "Additionally, rebuilding against different major versions of the"
345 - eerror "sys-libs/db libraries will cause your database to be inaccessible."
346 - eerror ""
347 - d="$(date -u +%s)"
348 - l="/root/ldapdump.${d}"
349 - i="${l}.raw"
350 - eerror " 1. /etc/init.d/slapd stop"
351 - eerror " 2. slapcat -l ${i}"
352 - eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
353 - eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
354 - eerror " 5. emerge --update \=net-nds/${PF}"
355 - eerror " 6. etc-update, and ensure that you apply the changes"
356 - eerror " 7. slapadd -l ${l}"
357 - eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
358 - eerror " 9. /etc/init.d/slapd start"
359 - eerror "10. check that your data is intact."
360 - eerror "11. set up the new replication system."
361 - eerror
362 - if [[ "${FORCE_UPGRADE}" != "1" ]]; then
363 - die "You need to upgrade your database first"
364 - else
365 - eerror "You have the magical FORCE_UPGRADE=1 in place."
366 - eerror "Don't say you weren't warned about data loss."
367 - fi
368 -}
369 -
370 -pkg_setup() {
371 - if ! use sasl && use cxx ; then
372 - die "To build the ldapc++ library you must emerge openldap with sasl support"
373 - fi
374 - # Bug #322787
375 - if use minimal && ! has_version "net-nds/openldap" ; then
376 - einfo "No datadir scan needed, openldap not installed"
377 - elif use minimal && has_version 'net-nds/openldap[minimal]' ; then
378 - einfo "Skipping scan for previous datadirs as requested by minimal useflag"
379 - else
380 - openldap_find_versiontags
381 - fi
382 -
383 - # The user/group are only used for running daemons which are
384 - # disabled in minimal builds, so elide the accounts too.
385 - if ! use minimal ; then
386 - enewgroup ldap 439
387 - enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
388 - fi
389 -}
390 -
391 -src_prepare() {
392 - # ensure correct SLAPI path by default
393 - sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \
394 - -i include/ldap_defaults.h || die
395 -
396 - default
397 - rm -r libraries/liblmdb || die
398 -
399 - pushd build &>/dev/null || die "pushd build"
400 - einfo "Making sure upstream build strip does not do stripping too early"
401 - sed -i.orig \
402 - -e '/^STRIP/s,-s,,g' \
403 - top.mk || die "Failed to block stripping"
404 - popd &>/dev/null || die
405 -
406 - # wrong assumption that /bin/sh is /bin/bash
407 - sed \
408 - -e 's|/bin/sh|/bin/bash|g' \
409 - -i tests/scripts/* || die "sed failed"
410 -
411 - AT_NOEAUTOMAKE=yes eautoreconf
412 -}
413 -
414 -build_contrib_module() {
415 - # <dir> <sources> <outputname>
416 - pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1"
417 - einfo "Compiling contrib-module: $3"
418 - # Make sure it's uppercase
419 - local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")"
420 - "${lt}" --mode=compile --tag=CC \
421 - "${CC}" \
422 - -D${define_name}=SLAPD_MOD_DYNAMIC \
423 - -I"${BUILD_DIR}"/include \
424 - -I../../../include -I../../../servers/slapd ${CFLAGS} \
425 - -o ${2%.c}.lo -c $2 || die "compiling $3 failed"
426 - einfo "Linking contrib-module: $3"
427 - "${lt}" --mode=link --tag=CC \
428 - "${CC}" -module \
429 - ${CFLAGS} \
430 - ${LDFLAGS} \
431 - -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
432 - -o $3.la ${2%.c}.lo || die "linking $3 failed"
433 - popd &>/dev/null || die
434 -}
435 -
436 -src_configure() {
437 - # Bug 408001
438 - use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync
439 -
440 - # connectionless ldap per bug #342439
441 - append-cppflags -DLDAP_CONNECTIONLESS
442 -
443 - multilib-minimal_src_configure
444 -}
445 -
446 -multilib_src_configure() {
447 - local myconf=()
448 -
449 - use debug && myconf+=( $(use_enable debug) )
450 -
451 - # ICU exists only in the configure, nowhere in the codebase, bug #510858
452 - export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no
453 -
454 - if ! use minimal && multilib_is_native_abi; then
455 - local CPPFLAGS=${CPPFLAGS}
456 -
457 - # re-enable serverside overlay chains per bug #296567
458 - # see ldap docs chaper 12.3.1 for details
459 - myconf+=( --enable-ldap )
460 -
461 - # backends
462 - myconf+=( --enable-slapd )
463 - if use berkdb ; then
464 - einfo "Using Berkeley DB for local backend"
465 - myconf+=( --enable-bdb --enable-hdb )
466 - DBINCLUDE=$(db_includedir ${BDB_SLOTS})
467 - einfo "Using ${DBINCLUDE} for sys-libs/db version"
468 - # We need to include the slotted db.h dir for FreeBSD
469 - append-cppflags -I${DBINCLUDE}
470 - else
471 - myconf+=( --disable-bdb --disable-hdb )
472 - fi
473 - for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do
474 - myconf+=( --enable-${backend}=mod )
475 - done
476 -
477 - myconf+=( $(use_enable perl perl mod) )
478 -
479 - myconf+=( $(use_enable odbc sql mod) )
480 - if use odbc ; then
481 - local odbc_lib="unixodbc"
482 - if use iodbc ; then
483 - odbc_lib="iodbc"
484 - append-cppflags -I"${EPREFIX}"/usr/include/iodbc
485 - fi
486 - myconf+=( --with-odbc=${odbc_lib} )
487 - fi
488 -
489 - # slapd options
490 - myconf+=(
491 - $(use_enable crypt)
492 - --disable-slp
493 - $(use_enable samba lmpasswd)
494 - $(use_enable syslog)
495 - )
496 - if use experimental ; then
497 - myconf+=(
498 - --enable-dynacl
499 - --enable-aci=mod
500 - )
501 - fi
502 - for option in aci cleartext modules rewrite rlookups slapi; do
503 - myconf+=( --enable-${option} )
504 - done
505 -
506 - # slapd overlay options
507 - # Compile-in the syncprov, the others as module
508 - myconf+=( --enable-syncprov=yes )
509 - use overlays && myconf+=( --enable-overlays=mod )
510 -
511 - else
512 - myconf+=(
513 - --disable-backends
514 - --disable-slapd
515 - --disable-bdb
516 - --disable-hdb
517 - --disable-mdb
518 - --disable-overlays
519 - --disable-syslog
520 - )
521 - fi
522 -
523 - # basic functionality stuff
524 - myconf+=(
525 - $(use_enable ipv6)
526 - $(multilib_native_use_with sasl cyrus-sasl)
527 - $(multilib_native_use_enable sasl spasswd)
528 - $(use_enable tcpd wrappers)
529 - )
530 -
531 - # Some cross-compiling tests don't pan out well.
532 - tc-is-cross-compiler && myconf+=(
533 - --with-yielding-select=yes
534 - )
535 -
536 - local ssl_lib="no"
537 - if use ssl || ( ! use minimal && use samba ) ; then
538 - ssl_lib="openssl"
539 - use gnutls && ssl_lib="gnutls"
540 - fi
541 -
542 - myconf+=( --with-tls=${ssl_lib} )
543 -
544 - for basicflag in dynamic local proctitle shared; do
545 - myconf+=( --enable-${basicflag} )
546 - done
547 -
548 - tc-export AR CC CXX
549 - CONFIG_SHELL="/bin/sh" \
550 - ECONF_SOURCE="${S}" \
551 - STRIP=/bin/true \
552 - econf \
553 - --libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \
554 - $(use_enable static-libs static) \
555 - "${myconf[@]}"
556 - emake depend
557 -}
558 -
559 -src_configure_cxx() {
560 - # This needs the libraries built by the first build run.
561 - # So we have to run it AFTER the main build, not just after the main
562 - # configure.
563 - local myconf_ldapcpp=(
564 - --with-ldap-includes="${S}"/include
565 - )
566 -
567 - mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die
568 - pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
569 -
570 - local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS}
571 - append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \
572 - -L"${BUILD_DIR}"/libraries/libldap/.libs
573 - append-cppflags -I"${BUILD_DIR}"/include
574 - ECONF_SOURCE=${S}/contrib/ldapc++ \
575 - econf "${myconf_ldapcpp[@]}" \
576 - CC="${CC}" \
577 - CXX="${CXX}"
578 - popd &>/dev/null || die
579 -}
580 -
581 -multilib_src_compile() {
582 - tc-export AR CC CXX
583 - emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh
584 - local lt="${BUILD_DIR}/libtool"
585 - export echo="echo"
586 -
587 - if ! use minimal && multilib_is_native_abi ; then
588 - if use cxx ; then
589 - einfo "Building contrib library: ldapc++"
590 - src_configure_cxx
591 - pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++"
592 - emake CC="${CC}" CXX="${CXX}"
593 - popd &>/dev/null || die
594 - fi
595 -
596 - if use smbkrb5passwd ; then
597 - einfo "Building contrib-module: smbk5pwd"
598 - pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd"
599 -
600 - MY_DEFS="-DDO_SHADOW"
601 - if use samba ; then
602 - MY_DEFS="${MY_DEFS} -DDO_SAMBA"
603 - MY_KRB5_INC=""
604 - fi
605 - if use kerberos ; then
606 - MY_DEFS="${MY_DEFS} -DDO_KRB5"
607 - MY_KRB5_INC="$(krb5-config --cflags)"
608 - fi
609 -
610 - emake \
611 - DEFS="${MY_DEFS}" \
612 - KRB5_INC="${MY_KRB5_INC}" \
613 - LDAP_BUILD="${BUILD_DIR}" \
614 - CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap"
615 - popd &>/dev/null || die
616 - fi
617 -
618 - if use overlays ; then
619 - einfo "Building contrib-module: samba4"
620 - pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4"
621 -
622 - emake \
623 - LDAP_BUILD="${BUILD_DIR}" \
624 - CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap"
625 - popd &>/dev/null || die
626 - fi
627 -
628 - if use kerberos ; then
629 - if use kinit ; then
630 - build_contrib_module "kinit" "kinit.c" "kinit"
631 - fi
632 - pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
633 - einfo "Compiling contrib-module: pw-kerberos"
634 - "${lt}" --mode=compile --tag=CC \
635 - "${CC}" \
636 - -I"${BUILD_DIR}"/include \
637 - -I../../../include \
638 - ${CFLAGS} \
639 - $(krb5-config --cflags) \
640 - -DHAVE_KRB5 \
641 - -o kerberos.lo \
642 - -c kerberos.c || die "compiling pw-kerberos failed"
643 - einfo "Linking contrib-module: pw-kerberos"
644 - "${lt}" --mode=link --tag=CC \
645 - "${CC}" -module \
646 - ${CFLAGS} \
647 - ${LDFLAGS} \
648 - -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
649 - -o pw-kerberos.la \
650 - kerberos.lo || die "linking pw-kerberos failed"
651 - popd &>/dev/null || die
652 - fi
653 -
654 - if use pbkdf2; then
655 - pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2"
656 - einfo "Compiling contrib-module: pw-pbkdf2"
657 - "${lt}" --mode=compile --tag=CC \
658 - "${CC}" \
659 - -I"${BUILD_DIR}"/include \
660 - -I../../../../include \
661 - ${CFLAGS} \
662 - -o pbkdf2.lo \
663 - -c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed"
664 - einfo "Linking contrib-module: pw-pbkdf2"
665 - "${lt}" --mode=link --tag=CC \
666 - "${CC}" -module \
667 - ${CFLAGS} \
668 - ${LDFLAGS} \
669 - -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
670 - -o pw-pbkdf2.la \
671 - pbkdf2.lo || die "linking pw-pbkdf2 failed"
672 - popd &>/dev/null || die
673 - fi
674 -
675 - if use sha2 ; then
676 - pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2"
677 - einfo "Compiling contrib-module: pw-sha2"
678 - "${lt}" --mode=compile --tag=CC \
679 - "${CC}" \
680 - -I"${BUILD_DIR}"/include \
681 - -I../../../../include \
682 - ${CFLAGS} \
683 - -o sha2.lo \
684 - -c sha2.c || die "compiling pw-sha2 failed"
685 - "${lt}" --mode=compile --tag=CC \
686 - "${CC}" \
687 - -I"${BUILD_DIR}"/include \
688 - -I../../../../include \
689 - ${CFLAGS} \
690 - -o slapd-sha2.lo \
691 - -c slapd-sha2.c || die "compiling pw-sha2 failed"
692 - einfo "Linking contrib-module: pw-sha2"
693 - "${lt}" --mode=link --tag=CC \
694 - "${CC}" -module \
695 - ${CFLAGS} \
696 - ${LDFLAGS} \
697 - -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
698 - -o pw-sha2.la \
699 - sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed"
700 - popd &>/dev/null || die
701 - fi
702 -
703 - # We could build pw-radius if GNURadius would install radlib.h
704 - pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd"
705 - einfo "Compiling contrib-module: pw-netscape"
706 - "${lt}" --mode=compile --tag=CC \
707 - "${CC}" \
708 - -I"${BUILD_DIR}"/include \
709 - -I../../../include \
710 - ${CFLAGS} \
711 - -o netscape.lo \
712 - -c netscape.c || die "compiling pw-netscape failed"
713 - einfo "Linking contrib-module: pw-netscape"
714 - "${lt}" --mode=link --tag=CC \
715 - "${CC}" -module \
716 - ${CFLAGS} \
717 - ${LDFLAGS} \
718 - -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \
719 - -o pw-netscape.la \
720 - netscape.lo || die "linking pw-netscape failed"
721 -
722 - #build_contrib_module "acl" "posixgroup.c" "posixGroup" # example code only
723 - #build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos
724 - build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
725 - build_contrib_module "allop" "allop.c" "overlay-allop"
726 - build_contrib_module "allowed" "allowed.c" "allowed"
727 - build_contrib_module "autogroup" "autogroup.c" "autogroup"
728 - build_contrib_module "cloak" "cloak.c" "cloak"
729 - # build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand
730 - build_contrib_module "denyop" "denyop.c" "denyop-overlay"
731 - build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
732 - build_contrib_module "dupent" "dupent.c" "dupent"
733 - build_contrib_module "lastbind" "lastbind.c" "lastbind"
734 - # lastmod may not play well with other overlays
735 - build_contrib_module "lastmod" "lastmod.c" "lastmod"
736 - build_contrib_module "noopsrch" "noopsrch.c" "noopsrch"
737 - #build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576
738 - #build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER
739 - build_contrib_module "trace" "trace.c" "trace"
740 - popd &>/dev/null || die
741 - # build slapi-plugins
742 - pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues"
743 - einfo "Building contrib-module: addrdnvalues plugin"
744 - "${CC}" -shared \
745 - -I"${BUILD_DIR}"/include \
746 - -I../../../include \
747 - ${CFLAGS} \
748 - -fPIC \
749 - ${LDFLAGS} \
750 - -o libaddrdnvalues-plugin.so \
751 - addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
752 - popd &>/dev/null || die
753 - fi
754 -}
755 -
756 -multilib_src_test() {
757 - if multilib_is_native_abi; then
758 - cd tests || die
759 - emake tests
760 - fi
761 -}
762 -
763 -multilib_src_install() {
764 - local lt="${BUILD_DIR}/libtool"
765 - emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install
766 -
767 - if ! use minimal && multilib_is_native_abi; then
768 - # openldap modules go here
769 - # TODO: write some code to populate slapd.conf with moduleload statements
770 - keepdir /usr/$(get_libdir)/openldap/openldap/
771 -
772 - # initial data storage dir
773 - keepdir /var/lib/openldap-data
774 - use prefix || fowners ldap:ldap /var/lib/openldap-data
775 - fperms 0700 /var/lib/openldap-data
776 -
777 - echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
778 - echo "# do NOT delete this. it is used" >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
779 - echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
780 -
781 - # use our config
782 - rm "${ED}"/etc/openldap/slapd.conf
783 - insinto /etc/openldap
784 - newins "${FILESDIR}"/${PN}-2.4.40-slapd-conf slapd.conf
785 - configfile="${ED}"/etc/openldap/slapd.conf
786 -
787 - # populate with built backends
788 - ebegin "populate config with built backends"
789 - for x in "${ED}"/usr/$(get_libdir)/openldap/openldap/back_*.so; do
790 - einfo "Adding $(basename ${x})"
791 - sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die
792 - done
793 - sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
794 - use prefix || fowners root:ldap /etc/openldap/slapd.conf
795 - fperms 0640 /etc/openldap/slapd.conf
796 - cp "${configfile}" "${configfile}".default || die
797 - eend
798 -
799 - # install our own init scripts and systemd unit files
800 - einfo "Install init scripts"
801 - sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die
802 - doinitd "${T}"/slapd
803 - newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
804 -
805 - einfo "Install systemd service"
806 - sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die
807 - systemd_dounit "${T}"/slapd.service
808 - systemd_install_serviced "${FILESDIR}"/slapd.service.conf
809 - systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf
810 -
811 - # If built without SLP, we don't need to be before avahi
812 - sed -i \
813 - -e '/before/{s/avahi-daemon//g}' \
814 - "${ED}"/etc/init.d/slapd \
815 - || die
816 -
817 - if use cxx ; then
818 - einfo "Install the ldapc++ library"
819 - cd "${BUILD_DIR}/contrib/ldapc++" || die
820 - emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
821 - cd "${S}"/contrib/ldapc++ || die
822 - newdoc README ldapc++-README
823 - fi
824 -
825 - if use smbkrb5passwd ; then
826 - einfo "Install the smbk5pwd module"
827 - cd "${S}/contrib/slapd-modules/smbk5pwd" || die
828 - emake DESTDIR="${D}" \
829 - LDAP_BUILD="${BUILD_DIR}" \
830 - libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install
831 - newdoc README smbk5pwd-README
832 - fi
833 -
834 - if use overlays ; then
835 - einfo "Install the samba4 module"
836 - cd "${S}/contrib/slapd-modules/samba4" || die
837 - emake DESTDIR="${D}" \
838 - LDAP_BUILD="${BUILD_DIR}" \
839 - libexecdir="/usr/$(get_libdir)/openldap" install
840 - newdoc README samba4-README
841 - fi
842 -
843 - einfo "Installing contrib modules"
844 - cd "${S}/contrib/slapd-modules" || die
845 - for l in */*.la */*/*.la; do
846 - [[ -e ${l} ]] || continue
847 - "${lt}" --mode=install cp ${l} \
848 - "${ED}"/usr/$(get_libdir)/openldap/openldap || \
849 - die "installing ${l} failed"
850 - done
851 -
852 - dodoc "${FILESDIR}"/DB_CONFIG.fast.example
853 - docinto contrib
854 - doman */*.5
855 - #newdoc acl/README*
856 - newdoc addpartial/README addpartial-README
857 - newdoc allop/README allop-README
858 - newdoc allowed/README allowed-README
859 - newdoc autogroup/README autogroup-README
860 - newdoc dsaschema/README dsaschema-README
861 - newdoc passwd/README passwd-README
862 - cd "${S}/contrib/slapi-plugins" || die
863 - insinto /usr/$(get_libdir)/openldap/openldap
864 - doins */*.so
865 - docinto contrib
866 - newdoc addrdnvalues/README addrdnvalues-README
867 -
868 - insinto /etc/openldap/schema
869 - newins "${DISTDIR}"/${BIS_P} ${BIS_PN}
870 -
871 - docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample*
872 - docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample*
873 - docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm
874 -
875 - dosbin "${S}"/contrib/slapd-tools/statslog
876 - newdoc "${S}"/contrib/slapd-tools/README README.statslog
877 - fi
878 -
879 - if ! use static-libs ; then
880 - find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die
881 - fi
882 -}
883 -
884 -multilib_src_install_all() {
885 - dodoc ANNOUNCEMENT CHANGES COPYRIGHT README
886 - docinto rfc ; dodoc doc/rfc/*.txt
887 -}
888 -
889 -pkg_preinst() {
890 - # keep old libs if any
891 - preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0)
892 - # bug 440470, only display the getting started help there was no openldap before,
893 - # or we are going to a non-minimal build
894 - ! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]'
895 - OPENLDAP_PRINT_MESSAGES=$((! $?))
896 -}
897 -
898 -pkg_postinst() {
899 - if ! use minimal ; then
900 - # You cannot build SSL certificates during src_install that will make
901 - # binary packages containing your SSL key, which is both a security risk
902 - # and a misconfiguration if multiple machines use the same key and cert.
903 - if use ssl; then
904 - install_cert /etc/openldap/ssl/ldap
905 - use prefix || chown ldap:ldap "${EROOT}"/etc/openldap/ssl/ldap.*
906 - ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
907 - ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
908 - ewarn "add 'TLS_REQCERT allow' if you want to use them."
909 - fi
910 -
911 - if use prefix; then
912 - # Warn about prefix issues with slapd
913 - eerror "slapd might NOT be usable on Prefix systems as it requires root privileges"
914 - eerror "to start up, and requires that certain files directories be owned by"
915 - eerror "ldap:ldap. As Prefix does not support changing ownership of files and"
916 - eerror "directories, you will have to manually fix this yourself."
917 - fi
918 -
919 - # These lines force the permissions of various content to be correct
920 - if [[ -d "${EROOT}"/var/run/openldap ]]; then
921 - use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; }
922 - chmod 0755 "${EROOT}"/var/run/openldap || die
923 - fi
924 - use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default}
925 - chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die
926 - use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data
927 - fi
928 -
929 - if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then
930 - elog "Getting started using OpenLDAP? There is some documentation available:"
931 - elog "Gentoo Guide to OpenLDAP Authentication"
932 - elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)"
933 - elog "---"
934 - elog "An example file for tuning BDB backends with openldap is"
935 - elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
936 - fi
937 -
938 - preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0)
939 -}