Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-nds/openldap: openldap-2.4.17-r1.ebuild ChangeLog
Date: Tue, 28 Jul 2009 21:28:27
Message-Id: E1MVuDh-0006TF-2q@stork.gentoo.org
1 robbat2 09/07/28 21:28:25
2
3 Modified: ChangeLog
4 Added: openldap-2.4.17-r1.ebuild
5 Log:
6 Bug #219371: Install C++ libraries and headers as needed. Bug #233633: Fix compile with USE="samba gnutls". Bug #273699: Fix slapd init ordering. Bug #261186: Build plugins with libtool instead of directly. Bug #279461: Update smbk5pwd building.
7 (Portage version: 2.2_rc33/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.345 net-nds/openldap/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-nds/openldap/ChangeLog?rev=1.345&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-nds/openldap/ChangeLog?rev=1.345&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-nds/openldap/ChangeLog?r1=1.344&r2=1.345
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-nds/openldap/ChangeLog,v
19 retrieving revision 1.344
20 retrieving revision 1.345
21 diff -p -w -b -B -u -u -r1.344 -r1.345
22 --- ChangeLog 28 Jul 2009 02:11:25 -0000 1.344
23 +++ ChangeLog 28 Jul 2009 21:28:24 -0000 1.345
24 @@ -1,6 +1,17 @@
25 # ChangeLog for net-nds/openldap
26 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/net-nds/openldap/ChangeLog,v 1.344 2009/07/28 02:11:25 robbat2 Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/net-nds/openldap/ChangeLog,v 1.345 2009/07/28 21:28:24 robbat2 Exp $
29 +
30 +*openldap-2.4.17-r1 (28 Jul 2009)
31 +
32 + 28 Jul 2009; Robin H. Johnson <robbat2@g.o>
33 + +openldap-2.4.17-r1.ebuild, files/openldap-2.4.17-contrib-smbk5pwd.patch,
34 + +files/openldap-2.4.17-fix-lmpasswd-gnutls-symbols.patch,
35 + files/slapd-initd:
36 + Bug #219371: Install C++ libraries and headers as needed. Bug #233633: Fix
37 + compile with USE="samba gnutls". Bug #273699: Fix slapd init ordering. Bug
38 + #261186: Build plugins with libtool instead of directly. Bug #279461:
39 + Update smbk5pwd building.
40
41 *openldap-2.4.17 (28 Jul 2009)
42
43
44
45
46 1.1 net-nds/openldap/openldap-2.4.17-r1.ebuild
47
48 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-nds/openldap/openldap-2.4.17-r1.ebuild?rev=1.1&view=markup
49 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-nds/openldap/openldap-2.4.17-r1.ebuild?rev=1.1&content-type=text/plain
50
51 Index: openldap-2.4.17-r1.ebuild
52 ===================================================================
53 # Copyright 1999-2009 Gentoo Foundation
54 # Distributed under the terms of the GNU General Public License v2
55 # $Header: /var/cvsroot/gentoo-x86/net-nds/openldap/openldap-2.4.17-r1.ebuild,v 1.1 2009/07/28 21:28:24 robbat2 Exp $
56
57 EAPI="2"
58 inherit db-use eutils flag-o-matic multilib ssl-cert versionator toolchain-funcs
59
60 DESCRIPTION="LDAP suite of application and development tools"
61 HOMEPAGE="http://www.OpenLDAP.org/"
62 SRC_URI="mirror://openldap/openldap-release/${P}.tgz"
63
64 LICENSE="OPENLDAP"
65 SLOT="0"
66 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
67
68 IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal"
69 IUSE_BACKEND="+berkdb"
70 IUSE_OVERLAY="overlays perl"
71 IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 syslog selinux"
72 IUSE_CONTRIB="smbkrb5passwd kerberos"
73 IUSE_CONTRIB="${IUSE_CONTRIB} cxx"
74 IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}"
75
76 # openssl is needed to generate lanman-passwords required by samba
77 RDEPEND="sys-libs/ncurses
78 icu? ( dev-libs/icu )
79 tcpd? ( sys-apps/tcp-wrappers )
80 ssl? ( !gnutls? ( dev-libs/openssl )
81 gnutls? ( net-libs/gnutls ) )
82 sasl? ( dev-libs/cyrus-sasl )
83 !minimal? (
84 odbc? ( !iodbc? ( dev-db/unixODBC )
85 iodbc? ( dev-db/libiodbc ) )
86 slp? ( net-libs/openslp )
87 perl? ( dev-lang/perl[-build] )
88 samba? ( dev-libs/openssl )
89 berkdb? ( sys-libs/db )
90 smbkrb5passwd? (
91 dev-libs/openssl
92 app-crypt/heimdal )
93 kerberos? ( virtual/krb5 )
94 cxx? ( dev-libs/cyrus-sasl )
95 )
96 selinux? ( sec-policy/selinux-openldap )"
97 DEPEND="${RDEPEND}"
98
99 # for tracking versions
100 OPENLDAP_VERSIONTAG=".version-tag"
101 OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
102
103 openldap_find_versiontags() {
104 # scan for all datadirs
105 openldap_datadirs=""
106 if [ -f "${ROOT}"/etc/openldap/slapd.conf ]; then
107 openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${ROOT}/etc/openldap/slapd.conf)"
108 fi
109 openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
110
111 einfo
112 einfo "Scanning datadir(s) from slapd.conf and"
113 einfo "the default installdir for Versiontags"
114 einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
115 einfo
116
117 # scan datadirs if we have a version tag
118 openldap_found_tag=0
119 for each in ${openldap_datadirs}; do
120 CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
121 CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
122 if [ -d ${CURRENT_TAGDIR} ] && [ ${openldap_found_tag} == 0 ] ; then
123 einfo "- Checking ${each}..."
124 if [ -r ${CURRENT_TAG} ] ; then
125 # yey, we have one :)
126 einfo " Found Versiontag in ${each}"
127 source ${CURRENT_TAG}
128 if [ "${OLDPF}" == "" ] ; then
129 eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
130 eerror "Please delete it"
131 eerror
132 die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
133 fi
134
135 OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
136
137 # are we on the same branch?
138 if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
139 ewarn " Versiontag doesn't match current major release!"
140 if [[ `ls -a ${CURRENT_TAGDIR} | wc -l` -gt 5 ]] ; then
141 eerror " Versiontag says other major and you (probably) have datafiles!"
142 echo
143 openldap_upgrade_howto
144 else
145 einfo " No real problem, seems there's no database."
146 fi
147 else
148 einfo " Versiontag is fine here :)"
149 fi
150 else
151 einfo " Non-tagged dir ${each}"
152 if [[ `ls -a ${each} | wc -l` > 5 ]] ; then
153 einfo " EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
154 echo
155
156 eerror
157 eerror "Your OpenLDAP Installation has a non tagged datadir that"
158 eerror "possibly contains a database at ${CURRENT_TAGDIR}"
159 eerror
160 eerror "Please export data if any entered and empty or remove"
161 eerror "the directory, installation has been stopped so you"
162 eerror "can take required action"
163 eerror
164 eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
165 eerror
166 die "Please move the datadir ${CURRENT_TAGDIR} away"
167 fi
168 fi
169 einfo
170 fi
171 done
172
173 echo
174 einfo
175 einfo "All datadirs are fine, proceeding with merge now..."
176 einfo
177 }
178
179 openldap_upgrade_howto() {
180 eerror
181 eerror "A (possible old) installation of OpenLDAP was detected,"
182 eerror "installation will not proceed for now."
183 eerror
184 eerror "As major version upgrades can corrupt your database,"
185 eerror "you need to dump your database and re-create it afterwards."
186 eerror ""
187 d="$(date -u +%s)"
188 l="/root/ldapdump.${d}"
189 i="${l}.raw"
190 eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
191 eerror " 2. slapcat -l ${i}"
192 eerror " 3. egrep -v '^entryCSN:' <${i} >${l}"
193 eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
194 eerror " 5. emerge --update \=net-nds/${PF}"
195 eerror " 6. etc-update, and ensure that you apply the changes"
196 eerror " 7. slapadd -l ${l}"
197 eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
198 eerror " 9. /etc/init.d/slapd start"
199 eerror "10. check that your data is intact."
200 eerror "11. set up the new replication system."
201 eerror
202 if [ "${FORCE_UPGRADE}" != "1" ]; then
203 die "You need to upgrade your database first"
204 else
205 eerror "You have the magical FORCE_UPGRADE=1 in place."
206 eerror "Don't say you weren't warned about data loss."
207 fi
208 }
209
210 pkg_setup() {
211 if ! use sasl && use cxx ; then
212 die "To build the ldapc++ library you must emerge openldap with sasl support"
213 fi
214 if use minimal && has_version "net-nds/openldap" && built_with_use net-nds/openldap minimal ; then
215 einfo
216 einfo "Skipping scan for previous datadirs as requested by minimal useflag"
217 einfo
218 else
219 openldap_find_versiontags
220 fi
221
222 enewgroup ldap 439
223 enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
224 }
225
226 src_prepare() {
227 # ensure correct SLAPI path by default
228 sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "/var/run/openldap/slapd.sock",' \
229 "${S}"/include/ldap_defaults.h
230
231 epatch \
232 "${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \
233 "${FILESDIR}"/${PN}-2.4.15-ppolicy.patch
234
235 # bug #116045 - still present in 2.4.17
236 epatch "${FILESDIR}"/${PN}-2.4.17-contrib-smbk5pwd.patch
237
238 # bug #189817
239 epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch
240
241 # bug #233633
242 epatch "${FILESDIR}"/${PN}-2.4.17-fix-lmpasswd-gnutls-symbols.patch
243
244 cd "${S}"/build
245 einfo "Making sure upstream build strip does not do stripping too early"
246 sed -i.orig \
247 -e '/^STRIP/s,-s,,g' \
248 top.mk || die "Failed to block stripping"
249
250 # wrong assumption that /bin/sh is /bin/bash
251 sed -i \
252 -e 's|/bin/sh|/bin/bash|g' \
253 "${S}"/tests/scripts/* || die "sed failed"
254 }
255
256 build_contrib_module() {
257 lt="${S}/libtool"
258 # <dir> <sources> <outputname>
259 cd "${S}/contrib/slapd-modules/$1"
260 einfo "Compiling contrib-module: $3"
261 "${lt}" --mode=compile --tag=CC \
262 "${CC}" \
263 -I../../../include -I../../../servers/slapd ${CFLAGS} \
264 -o ${2%.c}.lo -c $2 || die "compiling $3 failed"
265 einfo "Linking contrib-module: $3"
266 "${lt}" --mode=link --tag=CC \
267 "${CC}" -module \
268 ${CFLAGS} \
269 ${LDFLAGS} \
270 -rpath /usr/$(get_libdir)/openldap/openldap \
271 -o $3.la ${2%.c}.lo || die "linking $3 failed"
272 }
273
274 src_configure() {
275 local myconf
276
277 #Fix for glibc-2.8 and ucred. Bug 228457.
278 append-flags -D_GNU_SOURCE
279
280 use debug && myconf="${myconf} $(use_enable debug)"
281
282 # ICU usage is not configurable
283 export ac_cv_header_unicode_utypes_h="$(use icu && echo yes || echo no)"
284
285 if ! use minimal ; then
286 # backends
287 myconf="${myconf} --enable-slapd"
288 if use berkdb ; then
289 einfo "Using Berkeley DB for local backend"
290 myconf="${myconf} --enable-bdb --enable-hdb"
291 # We need to include the slotted db.h dir for FreeBSD
292 append-cppflags -I$(db_includedir)
293 else
294 ewarn
295 ewarn "Note: if you disable berkdb, you can only use remote-backends!"
296 ewarn
297 ebeep 5
298 myconf="${myconf} --disable-bdb --disable-hdb"
299 fi
300 for backend in dnssrv ldap meta monitor null passwd relay shell sock; do
301 myconf="${myconf} --enable-${backend}=mod"
302 done
303
304 myconf="${myconf} $(use_enable perl perl mod)"
305
306 myconf="${myconf} $(use_enable odbc sql mod)"
307 if use odbc ; then
308 local odbc_lib="unixodbc"
309 use iodbc && odbc_lib="iodbc"
310 myconf="${myconf} --with-odbc=${odbc_lib}"
311 fi
312
313 # slapd options
314 myconf="${myconf} $(use_enable crypt) $(use_enable slp)"
315 myconf="${myconf} $(use_enable samba lmpasswd)"
316 if use experimental ; then
317 myconf="${myconf} --enable-dynacl"
318 myconf="${myconf} --enable-aci=mod"
319 fi
320 for option in aci cleartext modules rewrite rlookups slapi; do
321 myconf="${myconf} --enable-${option}"
322 done
323
324 # slapd overlay options
325 # Compile-in the syncprov, the others as module
326 myconf="${myconf} --enable-syncprov=yes"
327 use overlays && myconf="${myconf} --enable-overlays=mod"
328 else
329 myconf="${myconf} --disable-slapd --disable-bdb --disable-hdb"
330 myconf="${myconf} --disable-overlays"
331 fi
332
333 # basic functionality stuff
334 myconf="${myconf} $(use_enable ipv6)"
335 myconf="${myconf} $(use_with sasl cyrus-sasl) $(use_enable sasl spasswd)"
336 myconf="${myconf} $(use_enable tcpd wrappers)"
337
338 local ssl_lib="no"
339 if use ssl || ( use ! minimal && use samba ) ; then
340 ssl_lib="openssl"
341 use gnutls && ssl_lib="gnutls"
342 fi
343
344 myconf="${myconf} --with-tls=${ssl_lib}"
345
346 for basicflag in dynamic local proctitle shared static syslog; do
347 myconf="${myconf} --enable-${basicflag}"
348 done
349
350 tc-export CC AR CXX
351 STRIP=/bin/true \
352 econf \
353 --libexecdir=/usr/$(get_libdir)/openldap \
354 ${myconf}
355
356 if ! use minimal ; then
357 if use cxx ; then
358 local myconf_ldapcpp
359 myconf_ldapcpp="${myconf_ldapcpp} --with-ldap-includes=../../include"
360 cd "${S}/contrib/ldapc++"
361 OLD_LDFLAGS="$LDFLAGS"
362 OLD_CPPFLAGS="$CPPFLAGS"
363 append-ldflags "-L../../libraries/liblber/.libs -L../../libraries/libldap/.libs"
364 append-ldflags "-L../../../libraries/liblber/.libs -L../../../libraries/libldap/.libs"
365 append-cppflags "-I../../../include"
366 econf ${myconf_ldapcpp} \
367 CC="${CC}" \
368 CXX="${CXX}" \
369 || die "econf ldapc++ failed"
370 CPPFLAGS="$OLD_CPPFLAGS"
371 fi
372 fi
373 }
374
375 src_compile() {
376 emake depend || die "emake depend failed"
377 emake CC="${CC}" AR="${AR}" || die "emake failed"
378 lt="${S}/libtool"
379 export echo="echo"
380
381 if ! use minimal ; then
382 if use cxx ; then
383 einfo "Building contrib library: ldapc++"
384 cd "${S}/contrib/ldapc++"
385 emake \
386 CC="${CC}" CXX="${CXX}" \
387 || die "emake ldapc++ failed"
388 fi
389
390 if use smbkrb5passwd ; then
391 einfo "Building contrib-module: smbk5pwd"
392 cd "${S}/contrib/slapd-modules/smbk5pwd"
393
394 emake \
395 DEFS="-DDO_SAMBA -DDO_KRB5" \
396 KRB5_INC="$(krb5-config --cflags)" \
397 CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap" \
398 || die "emake smbk5pwd failed"
399 fi
400
401 if use kerberos ; then
402 cd "${S}/contrib/slapd-modules/passwd"
403 einfo "Compiling contrib-module: pw-kerberos"
404 "${lt}" --mode=compile --tag=CC \
405 "${CC}" \
406 -I../../../include \
407 ${CFLAGS} \
408 $(krb5-config --cflags) \
409 -DHAVE_KRB5 \
410 -o kerberos.lo \
411 -c kerberos.c || die "compiling pw-kerberos failed"
412 einfo "Linking contrib-module: pw-kerberos"
413 "${lt}" --mode=link --tag=CC \
414 "${CC}" -module \
415 ${CFLAGS} \
416 ${LDFLAGS} \
417 -rpath /usr/$(get_libdir)/openldap/openldap \
418 -o pw-kerberos.la \
419 kerberos.lo || die "linking pw-kerberos failed"
420 fi
421 # We could build pw-radius if GNURadius would install radlib.h
422 cd "${S}/contrib/slapd-modules/passwd"
423 einfo "Compiling contrib-module: pw-netscape"
424 "${lt}" --mode=compile --tag=CC \
425 "${CC}" \
426 -I../../../include \
427 ${CFLAGS} \
428 -o netscape.lo \
429 -c netscape.c || die "compiling pw-netscape failed"
430 einfo "Linking contrib-module: pw-netscape"
431 "${lt}" --mode=link --tag=CC \
432 "${CC}" -module \
433 ${CFLAGS} \
434 ${LDFLAGS} \
435 -rpath /usr/$(get_libdir)/openldap/openldap \
436 -o pw-netscape.la \
437 netscape.lo || die "linking pw-netscape failed"
438
439 build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay"
440 build_contrib_module "allop" "allop.c" "overlay-allop"
441 build_contrib_module "autogroup" "autogroup.c" "autogroup"
442 build_contrib_module "denyop" "denyop.c" "denyop-overlay"
443 build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin"
444 # lastmod may not play well with other overlays
445 build_contrib_module "lastmod" "lastmod.c" "lastmod"
446 build_contrib_module "nops" "nops.c" "nops-overlay"
447 build_contrib_module "trace" "trace.c" "trace"
448 # build slapi-plugins
449 cd "${S}/contrib/slapi-plugins/addrdnvalues"
450 einfo "Building contrib-module: addrdnvalues plugin"
451 "${CC}" -shared \
452 -I../../../include \
453 ${CFLAGS} \
454 -fPIC \
455 ${LDFLAGS} \
456 -o libaddrdnvalues-plugin.so \
457 addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed"
458
459 fi
460 }
461
462 src_test() {
463 cd tests ; make tests || die "make tests failed"
464 }
465
466 src_install() {
467 lt="${S}/libtool"
468 emake DESTDIR="${D}" install || die "make install failed"
469
470 dodoc ANNOUNCEMENT CHANGES COPYRIGHT README "${FILESDIR}"/DB_CONFIG.fast.example
471 docinto rfc ; dodoc doc/rfc/*.txt
472
473 # openldap modules go here
474 # TODO: write some code to populate slapd.conf with moduleload statements
475 keepdir /usr/$(get_libdir)/openldap/openldap/
476
477 # initial data storage dir
478 keepdir /var/lib/openldap-data
479 fowners ldap:ldap /var/lib/openldap-data
480 fperms 0700 /var/lib/openldap-data
481
482 echo "OLDPF='${PF}'" > "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
483 echo "# do NOT delete this. it is used" >> "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
484 echo "# to track versions for upgrading." >> "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
485
486 # change slapd.pid location in configuration file
487 keepdir /var/run/openldap
488 fowners ldap:ldap /var/run/openldap
489 fperms 0755 /var/run/openldap
490
491 if ! use minimal; then
492 # use our config
493 rm "${D}"etc/openldap/slapd.conf
494 insinto /etc/openldap
495 newins "${FILESDIR}"/${PN}-2.3.34-slapd-conf slapd.conf
496 configfile="${D}"etc/openldap/slapd.conf
497
498 # populate with built backends
499 ebegin "populate config with built backends"
500 for x in "${D}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
501 elog "Adding $(basename ${x})"
502 sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
503 done
504 sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
505 fowners root:ldap /etc/openldap/slapd.conf
506 fperms 0640 /etc/openldap/slapd.conf
507 cp "${configfile}" "${configfile}".default
508 eend
509
510 # install our own init scripts
511 newinitd "${FILESDIR}"/slapd-initd slapd
512 newconfd "${FILESDIR}"/slapd-confd slapd
513 if [ $(get_libdir) != lib ]; then
514 sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${D}"etc/init.d/slapd
515 fi
516
517 if use cxx ; then
518 einfo "Install the ldapc++ library"
519 cd "${S}/contrib/ldapc++"
520 emake DESTDIR="${D}" libexecdir="/usr/$(get_libdir)/openldap" install || die "emake install ldapc++ failed"
521 newdoc README ldapc++-README
522 fi
523
524 if use smbkrb5passwd ; then
525 einfo "Install the smbk5pwd module"
526 cd "${S}/contrib/slapd-modules/smbk5pwd"
527 emake DESTDIR="${D}" libexecdir="/usr/$(get_libdir)/openldap" install || die "emake install smbk5pwd failed"
528 newdoc README smbk5pwd-README
529 fi
530
531 einfo "Installing contrib modules"
532 cd "${S}/contrib/slapd-modules"
533 for l in */*.la; do
534 "${lt}" --mode=install cp ${l} \
535 "${D}"usr/$(get_libdir)/openldap/openldap || \
536 die "installing ${l} failed"
537 done
538 docinto contrib
539 newdoc addpartial/README addpartial-README
540 newdoc allop/README allop-README
541 doman allop/slapo-allop.5
542 newdoc autogroup/README autogroup-README
543 newdoc denyop/denyop.c denyop-denyop.c
544 newdoc dsaschema/README dsaschema-README
545 doman lastmod/slapo-lastmod.5
546 doman nops/slapo-nops.5
547 newdoc passwd/README passwd-README
548 cd "${S}/contrib/slapi-plugins"
549 insinto /usr/$(get_libdir)/openldap/openldap
550 doins */*.so
551 docinto contrib
552 newdoc addrdnvalues/README addrdnvalues-README
553 fi
554 }
555
556 pkg_preinst() {
557 # keep old libs if any
558 preserve_old_lib usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3.so.0
559 }
560
561 pkg_postinst() {
562 if ! use minimal ; then
563 # You cannot build SSL certificates during src_install that will make
564 # binary packages containing your SSL key, which is both a security risk
565 # and a misconfiguration if multiple machines use the same key and cert.
566 if use ssl; then
567 install_cert /etc/openldap/ssl/ldap
568 chown ldap:ldap "${ROOT}"etc/openldap/ssl/ldap.*
569 ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
570 ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
571 ewarn "add 'TLS_REQCERT never' if you want to use them."
572 fi
573
574 # These lines force the permissions of various content to be correct
575 chown ldap:ldap "${ROOT}"var/run/openldap
576 chmod 0755 "${ROOT}"var/run/openldap
577 chown root:ldap "${ROOT}"etc/openldap/slapd.conf{,.default}
578 chmod 0640 "${ROOT}"etc/openldap/slapd.conf{,.default}
579 chown ldap:ldap "${ROOT}"var/lib/openldap-{data,ldbm}
580 fi
581
582 elog "Getting started using OpenLDAP? There is some documentation available:"
583 elog "Gentoo Guide to OpenLDAP Authentication"
584 elog "(http://www.gentoo.org/doc/en/ldap-howto.xml)"
585 elog "---"
586 elog "An example file for tuning BDB backends with openldap is"
587 elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
588
589 preserve_old_lib_notify usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3.so.0
590 }