Gentoo Archives: gentoo-commits

From: Aaron Bauman <bman@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-nds/openldap/
Date: Mon, 17 Jul 2017 00:02:19
Message-Id: 1500249630.19c0a4ec55e0c9802b1b4fdf2bf7c1613ebfcd33.bman@gentoo
1 commit: 19c0a4ec55e0c9802b1b4fdf2bf7c1613ebfcd33
2 Author: Aaron Bauman <bman <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jul 17 00:00:30 2017 +0000
4 Commit: Aaron Bauman <bman <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 17 00:00:30 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19c0a4ec
7
8 net-nds/openldap: drop vulnerable wrt sec bug #560424
9
10 net-nds/openldap/Manifest | 1 -
11 net-nds/openldap/openldap-2.3.43-r3.ebuild | 541 ----------------------------
12 net-nds/openldap/openldap-2.3.43-r4.ebuild | 547 -----------------------------
13 3 files changed, 1089 deletions(-)
14
15 diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
16 index fa72c337aa0..09991fe1096 100644
17 --- a/net-nds/openldap/Manifest
18 +++ b/net-nds/openldap/Manifest
19 @@ -1,4 +1,3 @@
20 -DIST openldap-2.3.43.tgz 3803011 SHA256 d7d2dea05362c8ac7e11bb7bf1da4cdeb07225ba8dc16974bff9f51a9f3d37e1 SHA512 2b0ebb35adbeed34673e1a55cc7a89b348ddee7ad6ce7f915ca3745198cee992aba7281bf0d56197dcfd59665935d5d3764db0ba487975e4dbc2a2507d6ea7a6 WHIRLPOOL 7457112bbad83d75f7ad01230da97511a8d983a98f7e31357dbffd79a7ed7e53057af781002cae8c610d3ad7834dfeefbd7f223798d45aea8cd00b70f5ee0e39
21 DIST openldap-2.4.44.tgz 5658830 SHA256 d7de6bf3c67009c95525dde3a0212cc110d0a70b92af2af8e3ee800e81b88400 SHA512 132eb81798f59a364c9246d08697e1c7ebb6c2c3b983f786b14ec0233df09696cbad33a1f35f3076348b5efb77665a076ab854a24122c31e8b58310b7c7fd136 WHIRLPOOL 37399793d681a6489c369d663772970c62a4e1e370d4dc306bcb6fa3b9cb680139c9d940d9218aaac4618f50a63bc391b10f2aec0a134f84094ce4f7378c88ff
22 DIST openldap-2.4.45.tgz 5672845 SHA256 cdd6cffdebcd95161a73305ec13fc7a78e9707b46ca9f84fb897cd5626df3824 SHA512 1c9fc84efed8998f107ce6e1c6be3f5466388241afdca0cb3847720c9def0bc263a2dbc15bf0f9112d1b4c391fd01e8531a4fb08c5532c30fb86924c08daedab WHIRLPOOL b5855bfe2b2c3856a98fb8b07ab94e51ef995ff80d4f39f0e7edae64f9774f0af9987db3673e25f98df8a5856a3f8839f28f1aa9184c92862a4df22540b3ab49
23 DIST rfc2307bis.schema-20140524 12262 SHA256 6cd8154ad86be1d6bb88a79c303dc10a49bce4ce7d21bb417a951d6496df30b1 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e WHIRLPOOL 40cef24529fb4bfc1661d03088eccdb17d9056d696b2bf0e698fa248d03f508ba776784bf8abbaffb5f4c2c59b59b29525b4be2babc978fed681e5e3c88073de
24
25 diff --git a/net-nds/openldap/openldap-2.3.43-r3.ebuild b/net-nds/openldap/openldap-2.3.43-r3.ebuild
26 deleted file mode 100644
27 index 321b6b720fc..00000000000
28 --- a/net-nds/openldap/openldap-2.3.43-r3.ebuild
29 +++ /dev/null
30 @@ -1,541 +0,0 @@
31 -# Copyright 1999-2017 Gentoo Foundation
32 -# Distributed under the terms of the GNU General Public License v2
33 -
34 -EAPI="2"
35 -
36 -AT_M4DIR="./build"
37 -inherit autotools db-use eutils flag-o-matic multilib ssl-cert toolchain-funcs versionator user
38 -
39 -DESCRIPTION="LDAP suite of application and development tools"
40 -HOMEPAGE="http://www.OpenLDAP.org/"
41 -SRC_URI="mirror://openldap/openldap-release/${P}.tgz"
42 -
43 -LICENSE="OPENLDAP GPL-2"
44 -SLOT="0"
45 -KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
46 -IUSE="berkdb crypt debug gdbm ipv6 kerberos minimal odbc overlays perl samba sasl slp smbkrb5passwd ssl tcpd selinux"
47 -
48 -# note that the 'samba' USE flag pulling in OpenSSL is NOT an error. OpenLDAP
49 -# uses OpenSSL for LanMan/NTLM hashing (which is used in some enviroments, like
50 -# mine at work)!
51 -# Robin H. Johnson <robbat2@g.o> March 8, 2004
52 -
53 -RDEPEND="sys-libs/ncurses
54 - tcpd? ( sys-apps/tcp-wrappers )
55 - ssl? ( dev-libs/openssl )
56 - sasl? ( dev-libs/cyrus-sasl )
57 - !minimal? (
58 - odbc? ( dev-db/unixODBC )
59 - slp? ( net-libs/openslp )
60 - perl? ( || ( >=dev-lang/perl-5.16 <dev-lang/perl-5.16[-build] ) )
61 - samba? ( dev-libs/openssl )
62 - kerberos? ( virtual/krb5 )
63 - berkdb? (
64 - || ( sys-libs/db:4.5
65 - sys-libs/db:4.4
66 - sys-libs/db:4.3
67 - >=sys-libs/db-4.2.52_p2-r1:4.2
68 - )
69 - )
70 - !berkdb? (
71 - gdbm? ( sys-libs/gdbm )
72 - !gdbm? (
73 - || ( sys-libs/db:4.5
74 - sys-libs/db:4.4
75 - sys-libs/db:4.3
76 - >=sys-libs/db-4.2.52_p2-r1:4.2
77 - )
78 - )
79 - )
80 - smbkrb5passwd? (
81 - dev-libs/openssl
82 - app-crypt/heimdal
83 - )
84 - )
85 - selinux? ( sec-policy/selinux-ldap )"
86 -DEPEND="${RDEPEND}"
87 -
88 -# for tracking versions
89 -OPENLDAP_VERSIONTAG=".version-tag"
90 -OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
91 -
92 -openldap_upgrade_howto() {
93 - eerror
94 - eerror "A (possible old) installation of OpenLDAP was detected,"
95 - eerror "installation will not proceed for now."
96 - eerror
97 - eerror "As major version upgrades can corrupt your database,"
98 - eerror "you need to dump your database and re-create it afterwards."
99 - eerror ""
100 - d="$(date -u +%s)"
101 - l="/root/ldapdump.${d}"
102 - i="${l}.raw"
103 - eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
104 - eerror " 2. slapcat -l ${i}"
105 - eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
106 - eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
107 - eerror " 5. emerge --update \=net-nds/${PF}"
108 - eerror " 6. etc-update, and ensure that you apply the changes"
109 - eerror " 7. slapadd -l ${l}"
110 - eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
111 - eerror " 9. /etc/init.d/slapd start"
112 - eerror "10. check that your data is intact."
113 - eerror "11. set up the new replication system."
114 - eerror
115 - if [ "${FORCE_UPGRADE}" != "1" ]; then
116 - die "You need to upgrade your database first"
117 - else
118 - eerror "You have the magical FORCE_UPGRADE=1 in place."
119 - eerror "Don't say you weren't warned about data loss."
120 - fi
121 -}
122 -
123 -openldap_find_versiontags() {
124 - # scan for all datadirs
125 - openldap_datadirs=""
126 - if [ -f "${ROOT}"/etc/openldap/slapd.conf ]; then
127 - openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${ROOT}/etc/openldap/slapd.conf)"
128 - fi
129 - openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
130 -
131 - einfo
132 - einfo "Scanning datadir(s) from slapd.conf and"
133 - einfo "the default installdir for Versiontags"
134 - einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
135 - einfo
136 -
137 - # scan datadirs if we have a version tag
138 - openldap_found_tag=0
139 - for each in ${openldap_datadirs}; do
140 - CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
141 - CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
142 - if [ -d ${CURRENT_TAGDIR} ] && [ ${openldap_found_tag} == 0 ] ; then
143 - einfo "- Checking ${each}..."
144 - if [ -r ${CURRENT_TAG} ] ; then
145 - # yey, we have one :)
146 - einfo " Found Versiontag in ${each}"
147 - source ${CURRENT_TAG}
148 - if [ "${OLDPF}" == "" ] ; then
149 - eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
150 - eerror "Please delete it"
151 - eerror
152 - die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
153 - fi
154 -
155 - OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
156 -
157 - # are we on the same branch?
158 - if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
159 - ewarn " Versiontag doesn't match current major release!"
160 - if [[ `ls -a ${CURRENT_TAGDIR} | wc -l` -gt 5 ]] ; then
161 - eerror " Versiontag says other major and you (probably) have datafiles!"
162 - echo
163 - openldap_upgrade_howto
164 - else
165 - einfo " No real problem, seems there's no database."
166 - fi
167 - else
168 - einfo " Versiontag is fine here :)"
169 - fi
170 - else
171 - einfo " Non-tagged dir ${each}"
172 - if [[ `ls -a ${each} | wc -l` > 5 ]] ; then
173 - einfo " EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
174 - echo
175 -
176 - eerror
177 - eerror "Your OpenLDAP Installation has a non tagged datadir that"
178 - eerror "possibly contains a database at ${CURRENT_TAGDIR}"
179 - eerror
180 - eerror "Please export data if any entered and empty or remove"
181 - eerror "the directory, installation has been stopped so you"
182 - eerror "can take required action"
183 - eerror
184 - eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
185 - eerror
186 - die "Please move the datadir ${CURRENT_TAGDIR} away"
187 - fi
188 - fi
189 - einfo
190 - fi
191 - done
192 -
193 - echo
194 - einfo
195 - einfo "All datadirs are fine, proceeding with merge now..."
196 - einfo
197 -
198 -}
199 -
200 -pkg_setup() {
201 - if has_version "<=dev-lang/perl-5.8.8_rc1" && built_with_use dev-lang/perl minimal ; then
202 - die "You must have a complete (USE='-minimal') Perl install to use the perl backend!"
203 - fi
204 -
205 - if use samba && ! use ssl ; then
206 - eerror "LAN manager passwords need ssl flag set"
207 - die "Please set ssl useflag"
208 - fi
209 -
210 - if use minimal && has_version 'net-nds/openldap[minimal]' ; then
211 - einfo
212 - einfo "Skipping scan for previous datadirs as requested by minimal useflag"
213 - einfo
214 - else
215 - openldap_find_versiontags
216 - fi
217 -
218 - # The user/group are only used for running daemons which are
219 - # disabled in minimal builds, so elide the accounts too.
220 - if ! use minimal ; then
221 - enewgroup ldap 439
222 - enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
223 - fi
224 -}
225 -
226 -src_prepare() {
227 - # According to MDK, the link order needs to be changed so that
228 - # on systems w/ MD5 passwords the system crypt library is used
229 - # (the net result is that "passwd" can be used to change ldap passwords w/
230 - # proper pam support)
231 - sed -i -e 's/$(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)/$(LUTIL_LIBS) $(SECURITY_LIBS) $(LDIF_LIBS)/' \
232 - "${S}"/servers/slapd/Makefile.in
233 -
234 - # supersedes old fix for bug #31202
235 - EPATCH_OPTS="-p1 -d ${S}" epatch "${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
236 -
237 - # ensure correct SLAPI path by default
238 - sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "/var/run/openldap/slapd.sock",' \
239 - "${S}"/include/ldap_defaults.h
240 -
241 - EPATCH_OPTS="-p0 -d ${S}"
242 -
243 - # ximian connector 1.4.7 ntlm patch
244 - epatch "${FILESDIR}"/${PN}-2.2.6-ntlm.patch
245 -
246 - # bug #132263
247 - epatch "${FILESDIR}"/${PN}-2.3.21-ppolicy.patch
248 -
249 - # bug #189817
250 - epatch "${FILESDIR}"/${PN}-2.3.37-libldap_r.patch
251 -
252 - # fix up stuff for newer autoconf that simulates autoconf-2.13, but doesn't
253 - # do it perfectly.
254 - cd "${S}"/build
255 - ln -s shtool install
256 - ln -s shtool install.sh
257 - einfo "Making sure upstream build strip does not do stripping too early"
258 - sed -i.orig \
259 - -e '/^STRIP/s,-s,,g' \
260 - top.mk || die "Failed to block stripping"
261 -
262 - # bug #116045
263 - # patch contrib modules
264 - if ! use minimal ; then
265 - cd "${S}"/contrib
266 - epatch "${FILESDIR}"/${PN}-2.3.24-contrib-smbk5pwd.patch
267 - fi
268 - # Fix gcc-4.4 compat, bug 264761
269 - epatch "${FILESDIR}/openldap-2.3.XY-gcc44.patch"
270 -}
271 -
272 -src_configure() {
273 - local myconf
274 -
275 - #Fix for glibc-2.8 and ucred. Bug 228457.
276 - append-flags -D_GNU_SOURCE
277 -
278 - # HDB is only available with BerkDB
279 - myconf_berkdb='--enable-bdb --enable-ldbm-api=berkeley --enable-hdb=mod'
280 - myconf_gdbm='--disable-bdb --enable-ldbm-api=gdbm --disable-hdb'
281 -
282 - use debug && myconf="${myconf} --enable-debug" # there is no disable-debug
283 -
284 - # enable slapd/slurpd servers if not doing a minimal build
285 - if ! use minimal ; then
286 - myconf="${myconf} --enable-slapd --enable-slurpd"
287 - # base backend stuff
288 - myconf="${myconf} --enable-ldbm"
289 - if use berkdb ; then
290 - einfo "Using Berkeley DB for local backend"
291 - myconf="${myconf} ${myconf_berkdb}"
292 - # We need to include the slotted db.h dir for FreeBSD
293 - append-cppflags -I$(db_includedir 4.5 4.4 4.3 4.2 )
294 - elif use gdbm ; then
295 - einfo "Using GDBM for local backend"
296 - myconf="${myconf} ${myconf_gdbm}"
297 - else
298 - ewarn "Neither gdbm or berkdb USE flags present, falling back to"
299 - ewarn "Berkeley DB for local backend"
300 - myconf="${myconf} ${myconf_berkdb}"
301 - # We need to include the slotted db.h dir for FreeBSD
302 - append-cppflags -I$(db_includedir 4.5 4.4 4.3 4.2 )
303 - fi
304 - # extra backend stuff
305 - myconf="${myconf} --enable-passwd=mod --enable-phonetic=mod"
306 - myconf="${myconf} --enable-dnssrv=mod --enable-ldap"
307 - myconf="${myconf} --enable-meta=mod --enable-monitor=mod"
308 - myconf="${myconf} --enable-null=mod --enable-shell=mod"
309 - myconf="${myconf} --enable-relay=mod"
310 - myconf="${myconf} $(use_enable perl perl mod)"
311 - myconf="${myconf} $(use_enable odbc sql mod)"
312 - # slapd options
313 - myconf="${myconf} $(use_enable crypt) $(use_enable slp)"
314 - myconf="${myconf} --enable-rewrite --enable-rlookups"
315 - myconf="${myconf} --enable-aci --enable-modules"
316 - myconf="${myconf} --enable-cleartext --enable-slapi"
317 - myconf="${myconf} $(use_enable samba lmpasswd)"
318 - # slapd overlay options
319 - myconf="${myconf} --enable-dyngroup --enable-proxycache"
320 - use overlays && myconf="${myconf} --enable-overlays=mod"
321 - myconf="${myconf} --enable-syncprov"
322 - else
323 - myconf="${myconf} --disable-slapd --disable-slurpd"
324 - myconf="${myconf} --disable-bdb --disable-ldbm"
325 - myconf="${myconf} --disable-hdb --disable-monitor"
326 - myconf="${myconf} --disable-slurpd --disable-overlays"
327 - myconf="${myconf} --disable-relay"
328 - fi
329 -
330 - # basic functionality stuff
331 - myconf="${myconf} --enable-syslog --enable-dynamic"
332 - myconf="${myconf} --enable-local --enable-proctitle"
333 -
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) $(use_with ssl tls)"
337 -
338 - if [ $(get_libdir) != "lib" ] ; then
339 - append-ldflags -L/usr/$(get_libdir)
340 - fi
341 -
342 - STRIP=/bin/true \
343 - econf \
344 - --enable-static \
345 - --enable-shared \
346 - --libexecdir=/usr/$(get_libdir)/openldap \
347 - ${myconf} || die "configure failed"
348 -}
349 -
350 -src_compile() {
351 - emake depend || die "make depend failed"
352 - emake || die "make failed"
353 -
354 - # openldap/contrib
355 - tc-export CC
356 - if ! use minimal ; then
357 - # dsaschema
358 - einfo "Building contributed dsaschema"
359 - cd "${S}"/contrib/slapd-modules/dsaschema
360 - ${CC} -shared -I../../../include ${CFLAGS} -fPIC \
361 - -Wall -o libdsaschema-plugin.so dsaschema.c || \
362 - die "failed to compile dsaschema module"
363 - # kerberos passwd
364 - if use kerberos ; then
365 - einfo "Building contributed pw-kerberos"
366 - cd "${S}"/contrib/slapd-modules/passwd/ && \
367 - ${CC} -shared -I../../../include ${CFLAGS} -fPIC \
368 - $(krb5-config --cflags) \
369 - -DHAVE_KRB5 -o pw-kerberos.so kerberos.c || \
370 - die "failed to compile kerberos password module"
371 - fi
372 - # netscape mta-md5 password
373 - einfo "Building contributed pw-netscape"
374 - cd "${S}"/contrib/slapd-modules/passwd/ && \
375 - ${CC} -shared -I../../../include ${CFLAGS} -fPIC \
376 - -o pw-netscape.so netscape.c || \
377 - die "failed to compile netscape password module"
378 - # smbk5pwd overlay
379 - # Note: this modules builds, but may not work with
380 - # Gentoo's MIT-Kerberos. It was designed for Heimdal
381 - # Kerberos.
382 - if use smbkrb5passwd ; then
383 - einfo "Building contributed smbk5pwd"
384 - local mydef
385 - local mykrb5inc
386 - mydef="-DDO_SAMBA -DDO_KRB5"
387 - mykrb5inc="$(krb5-config --cflags)"
388 - cd "${S}"/contrib/slapd-modules/smbk5pwd && \
389 - libexecdir="/usr/$(get_libdir)/openldap" \
390 - DEFS="${mydef}" KRB5_INC="${mykrb5inc}" emake || \
391 - die "failed to compile smbk5pwd module"
392 - fi
393 - # addrdnvalues
394 - einfo "Building contributed addrdnvalues"
395 - cd "${S}"/contrib/slapi-plugins/addrdnvalues/ && \
396 - ${CC} -shared -I../../../include ${CFLAGS} -fPIC \
397 - -o libaddrdnvalues-plugin.so addrdnvalues.c || \
398 - die "failed to compile addrdnvalues plugin"
399 - fi
400 -}
401 -
402 -src_test() {
403 - einfo "Doing tests"
404 - cd tests ; make tests || die "make tests failed"
405 -}
406 -
407 -src_install() {
408 - emake DESTDIR="${D}" install || die "make install failed"
409 -
410 - dodoc ANNOUNCEMENT CHANGES COPYRIGHT README "${FILESDIR}"/DB_CONFIG.fast.example
411 - docinto rfc ; dodoc doc/rfc/*.txt
412 -
413 - # openldap modules go here
414 - # TODO: write some code to populate slapd.conf with moduleload statements
415 - keepdir /usr/$(get_libdir)/openldap/openldap/
416 -
417 - # make state directories
418 - local dirlist="data"
419 - if ! use minimal; then
420 - dirlist="${dirlist} slurp ldbm"
421 - fi
422 - for x in ${dirlist}; do
423 - keepdir /var/lib/openldap-${x}
424 - fowners ldap:ldap /var/lib/openldap-${x}
425 - fperms 0700 /var/lib/openldap-${x}
426 - done
427 -
428 - echo "OLDPF='${PF}'" > "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
429 - echo "# do NOT delete this. it is used" >> "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
430 - echo "# to track versions for upgrading." >> "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
431 -
432 - # manually remove /var/tmp references in .la
433 - # because it is packaged with an ancient libtool
434 - #for x in "${D}"/usr/$(get_libdir)/lib*.la; do
435 - # sed -i -e "s:-L${S}[/]*libraries::" ${x}
436 - #done
437 -
438 - # change slapd.pid location in configuration file
439 - keepdir /var/run/openldap
440 - fowners ldap:ldap /var/run/openldap
441 - fperms 0755 /var/run/openldap
442 -
443 - if ! use minimal; then
444 - # use our config
445 - rm "${D}"etc/openldap/slapd.con*
446 - insinto /etc/openldap
447 - newins "${FILESDIR}"/${PN}-2.3.34-slapd-conf slapd.conf
448 - configfile="${D}"etc/openldap/slapd.conf
449 -
450 - # populate with built backends
451 - ebegin "populate config with built backends"
452 - for x in "${D}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
453 - elog "Adding $(basename ${x})"
454 - sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
455 - done
456 - sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
457 - fowners root:ldap /etc/openldap/slapd.conf
458 - fperms 0640 /etc/openldap/slapd.conf
459 - cp "${configfile}" "${configfile}".default
460 - eend
461 -
462 - # install our own init scripts
463 - newinitd "${FILESDIR}"/slapd-initd slapd
464 - newinitd "${FILESDIR}"/slurpd-initd slurpd
465 - newconfd "${FILESDIR}"/slapd-confd slapd
466 -
467 - if [ $(get_libdir) != lib ]; then
468 - sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${D}"etc/init.d/{slapd,slurpd}
469 - fi
470 -
471 - # install contributed modules
472 - docinto /
473 - if [ -e "${S}"/contrib/slapd-modules/dsaschema/libdsaschema-plugin.so ];
474 - then
475 - cd "${S}"/contrib/slapd-modules/dsaschema/
476 - newdoc README README.contrib.dsaschema
477 - exeinto /usr/$(get_libdir)/openldap/openldap
478 - doexe libdsaschema-plugin.so || \
479 - die "failed to install dsaschema module"
480 - fi
481 - if [ -e "${S}"/contrib/slapd-modules/passwd/pw-kerberos.so ]; then
482 - cd "${S}"/contrib/slapd-modules/passwd/
483 - newdoc README README.contrib.passwd
484 - exeinto /usr/$(get_libdir)/openldap/openldap
485 - doexe pw-kerberos.so || \
486 - die "failed to install kerberos passwd module"
487 - fi
488 - if [ -e "${S}"/contrib/slapd-modules/passwd/pw-netscape.so ]; then
489 - cd "${S}"/contrib/slapd-modules/passwd/
490 - newdoc README README.contrib.passwd
491 - exeinto /usr/$(get_libdir)/openldap/openldap
492 - doexe "${S}"/contrib/slapd-modules/passwd/pw-netscape.so || \
493 - die "failed to install Netscape MTA-MD5 passwd module"
494 - fi
495 - if [ -e "${S}"/contrib/slapd-modules/smbk5pwd/.libs/smbk5pwd.so ]; then
496 - cd "${S}"/contrib/slapd-modules/smbk5pwd
497 - newdoc README README.contrib.smbk5pwd
498 - libexecdir="/usr/$(get_libdir)/openldap" \
499 - emake DESTDIR="${D}" install-mod || \
500 - die "failed to install smbk5pwd overlay module"
501 - fi
502 - if [ -e "${S}"/contrib/slapd-tools/statslog ]; then
503 - cd "${S}"/contrib/slapd-tools
504 - exeinto /usr/bin
505 - newexe statslog ldapstatslog || \
506 - die "failed to install ldapstatslog script"
507 - fi
508 - if [ -e "${S}"/contrib/slapi-plugins/addrdnvalues/libaddrdnvalues-plugin.so ];
509 - then
510 - cd "${S}"/contrib/slapi-plugins/addrdnvalues
511 - newdoc README README.contrib.addrdnvalues
512 - exeinto /usr/$(get_libdir)/openldap/openldap
513 - doexe libaddrdnvalues-plugin.so || \
514 - die "failed to install addrdnvalues plugin"
515 - fi
516 - fi
517 -}
518 -
519 -pkg_preinst() {
520 - # keep old libs if any
521 - LIBSUFFIXES=".so.2.0.130 -2.2.so.7"
522 - for LIBSUFFIX in ${LIBSUFFIXES} ; do
523 - for each in libldap libldap_r liblber ; do
524 - preserve_old_lib "usr/$(get_libdir)/${each}${LIBSUFFIX}"
525 - done
526 - done
527 -}
528 -
529 -pkg_postinst() {
530 - if ! use minimal ; then
531 - # You cannot build SSL certificates during src_install that will make
532 - # binary packages containing your SSL key, which is both a security risk
533 - # and a misconfiguration if multiple machines use the same key and cert.
534 - # Additionally, it overwrites
535 - if use ssl; then
536 - install_cert /etc/openldap/ssl/ldap
537 - chown ldap:ldap "${ROOT}"etc/openldap/ssl/ldap.*
538 - ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
539 - ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
540 - ewarn "add 'TLS_REQCERT never' if you want to use them."
541 - fi
542 - # These lines force the permissions of various content to be correct
543 - chown ldap:ldap "${ROOT}"var/run/openldap
544 - chmod 0755 "${ROOT}"var/run/openldap
545 - chown root:ldap "${ROOT}"etc/openldap/slapd.conf{,.default}
546 - chmod 0640 "${ROOT}"etc/openldap/slapd.conf{,.default}
547 - chown ldap:ldap "${ROOT}"var/lib/openldap-{data,ldbm,slurp}
548 - fi
549 -
550 - # Reference inclusion bug #77330
551 - echo
552 - elog
553 - elog "Getting started using OpenLDAP? There is some documentation available:"
554 - elog "Gentoo Guide to OpenLDAP Authentication"
555 - elog "(https://www.gentoo.org/doc/en/ldap-howto.xml)"
556 - elog
557 -
558 - # note to bug #110412
559 - echo
560 - elog
561 - elog "An example file for tuning BDB backends with openldap is"
562 - elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
563 - elog
564 -
565 - LIBSUFFIXES=".so.2.0.130 -2.2.so.7"
566 - for LIBSUFFIX in ${LIBSUFFIXES} ; do
567 - for each in liblber libldap libldap_r ; do
568 - preserve_old_lib_notify "usr/$(get_libdir)/${each}${LIBSUFFIX}"
569 - done
570 - done
571 -}
572
573 diff --git a/net-nds/openldap/openldap-2.3.43-r4.ebuild b/net-nds/openldap/openldap-2.3.43-r4.ebuild
574 deleted file mode 100644
575 index 663b6aa5e36..00000000000
576 --- a/net-nds/openldap/openldap-2.3.43-r4.ebuild
577 +++ /dev/null
578 @@ -1,547 +0,0 @@
579 -# Copyright 1999-2017 Gentoo Foundation
580 -# Distributed under the terms of the GNU General Public License v2
581 -
582 -EAPI="2"
583 -
584 -AT_M4DIR="./build"
585 -inherit autotools db-use eutils flag-o-matic multilib ssl-cert toolchain-funcs versionator user
586 -
587 -DESCRIPTION="LDAP suite of application and development tools"
588 -HOMEPAGE="http://www.OpenLDAP.org/"
589 -SRC_URI="mirror://openldap/openldap-release/${P}.tgz"
590 -
591 -LICENSE="OPENLDAP GPL-2"
592 -SLOT="0"
593 -KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd"
594 -IUSE="berkdb crypt debug gdbm ipv6 kerberos minimal odbc overlays perl samba sasl slp smbkrb5passwd ssl tcpd selinux"
595 -
596 -# note that the 'samba' USE flag pulling in OpenSSL is NOT an error. OpenLDAP
597 -# uses OpenSSL for LanMan/NTLM hashing (which is used in some enviroments, like
598 -# mine at work)!
599 -# Robin H. Johnson <robbat2@g.o> March 8, 2004
600 -
601 -RDEPEND="sys-libs/ncurses
602 - tcpd? ( sys-apps/tcp-wrappers )
603 - ssl? ( dev-libs/openssl )
604 - sasl? ( dev-libs/cyrus-sasl )
605 - !minimal? (
606 - odbc? ( dev-db/unixODBC )
607 - slp? ( net-libs/openslp )
608 - perl? ( || ( >=dev-lang/perl-5.16 <dev-lang/perl-5.16[-build] ) )
609 - samba? ( dev-libs/openssl )
610 - kerberos? ( virtual/krb5 )
611 - berkdb? (
612 - || ( sys-libs/db:4.5
613 - sys-libs/db:4.4
614 - sys-libs/db:4.3
615 - >=sys-libs/db-4.2.52_p2-r1:4.2
616 - )
617 - )
618 - !berkdb? (
619 - gdbm? ( sys-libs/gdbm )
620 - !gdbm? (
621 - || ( sys-libs/db:4.5
622 - sys-libs/db:4.4
623 - sys-libs/db:4.3
624 - >=sys-libs/db-4.2.52_p2-r1:4.2
625 - )
626 - )
627 - )
628 - smbkrb5passwd? (
629 - dev-libs/openssl
630 - app-crypt/heimdal
631 - )
632 - )
633 - selinux? ( sec-policy/selinux-ldap )"
634 -DEPEND="${RDEPEND}"
635 -
636 -# for tracking versions
637 -OPENLDAP_VERSIONTAG=".version-tag"
638 -OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data"
639 -
640 -openldap_upgrade_howto() {
641 - eerror
642 - eerror "A (possible old) installation of OpenLDAP was detected,"
643 - eerror "installation will not proceed for now."
644 - eerror
645 - eerror "As major version upgrades can corrupt your database,"
646 - eerror "you need to dump your database and re-create it afterwards."
647 - eerror ""
648 - d="$(date -u +%s)"
649 - l="/root/ldapdump.${d}"
650 - i="${l}.raw"
651 - eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop"
652 - eerror " 2. slapcat -l ${i}"
653 - eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}"
654 - eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/"
655 - eerror " 5. emerge --update \=net-nds/${PF}"
656 - eerror " 6. etc-update, and ensure that you apply the changes"
657 - eerror " 7. slapadd -l ${l}"
658 - eerror " 8. chown ldap:ldap /var/lib/openldap-data/*"
659 - eerror " 9. /etc/init.d/slapd start"
660 - eerror "10. check that your data is intact."
661 - eerror "11. set up the new replication system."
662 - eerror
663 - if [ "${FORCE_UPGRADE}" != "1" ]; then
664 - die "You need to upgrade your database first"
665 - else
666 - eerror "You have the magical FORCE_UPGRADE=1 in place."
667 - eerror "Don't say you weren't warned about data loss."
668 - fi
669 -}
670 -
671 -openldap_find_versiontags() {
672 - # scan for all datadirs
673 - openldap_datadirs=""
674 - if [ -f "${ROOT}"/etc/openldap/slapd.conf ]; then
675 - openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${ROOT}/etc/openldap/slapd.conf)"
676 - fi
677 - openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}"
678 -
679 - einfo
680 - einfo "Scanning datadir(s) from slapd.conf and"
681 - einfo "the default installdir for Versiontags"
682 - einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)"
683 - einfo
684 -
685 - # scan datadirs if we have a version tag
686 - openldap_found_tag=0
687 - for each in ${openldap_datadirs}; do
688 - CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"`
689 - CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG}
690 - if [ -d ${CURRENT_TAGDIR} ] && [ ${openldap_found_tag} == 0 ] ; then
691 - einfo "- Checking ${each}..."
692 - if [ -r ${CURRENT_TAG} ] ; then
693 - # yey, we have one :)
694 - einfo " Found Versiontag in ${each}"
695 - source ${CURRENT_TAG}
696 - if [ "${OLDPF}" == "" ] ; then
697 - eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}"
698 - eerror "Please delete it"
699 - eerror
700 - die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}"
701 - fi
702 -
703 - OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}`
704 -
705 - # are we on the same branch?
706 - if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then
707 - ewarn " Versiontag doesn't match current major release!"
708 - if [[ `ls -a ${CURRENT_TAGDIR} | wc -l` -gt 5 ]] ; then
709 - eerror " Versiontag says other major and you (probably) have datafiles!"
710 - echo
711 - openldap_upgrade_howto
712 - else
713 - einfo " No real problem, seems there's no database."
714 - fi
715 - else
716 - einfo " Versiontag is fine here :)"
717 - fi
718 - else
719 - einfo " Non-tagged dir ${each}"
720 - if [[ `ls -a ${each} | wc -l` > 5 ]] ; then
721 - einfo " EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files"
722 - echo
723 -
724 - eerror
725 - eerror "Your OpenLDAP Installation has a non tagged datadir that"
726 - eerror "possibly contains a database at ${CURRENT_TAGDIR}"
727 - eerror
728 - eerror "Please export data if any entered and empty or remove"
729 - eerror "the directory, installation has been stopped so you"
730 - eerror "can take required action"
731 - eerror
732 - eerror "For a HOWTO on exporting the data, see instructions in the ebuild"
733 - eerror
734 - die "Please move the datadir ${CURRENT_TAGDIR} away"
735 - fi
736 - fi
737 - einfo
738 - fi
739 - done
740 -
741 - echo
742 - einfo
743 - einfo "All datadirs are fine, proceeding with merge now..."
744 - einfo
745 -
746 -}
747 -
748 -pkg_setup() {
749 - if has_version "<=dev-lang/perl-5.8.8_rc1" && built_with_use dev-lang/perl minimal ; then
750 - die "You must have a complete (USE='-minimal') Perl install to use the perl backend!"
751 - fi
752 -
753 - if use samba && ! use ssl ; then
754 - eerror "LAN manager passwords need ssl flag set"
755 - die "Please set ssl useflag"
756 - fi
757 -
758 - if use minimal && has_version 'net-nds/openldap[minimal]' ; then
759 - einfo
760 - einfo "Skipping scan for previous datadirs as requested by minimal useflag"
761 - einfo
762 - else
763 - openldap_find_versiontags
764 - fi
765 -
766 - # The user/group are only used for running daemons which are
767 - # disabled in minimal builds, so elide the accounts too.
768 - if ! use minimal ; then
769 - enewgroup ldap 439
770 - enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap
771 - fi
772 -}
773 -
774 -src_prepare() {
775 - # According to MDK, the link order needs to be changed so that
776 - # on systems w/ MD5 passwords the system crypt library is used
777 - # (the net result is that "passwd" can be used to change ldap passwords w/
778 - # proper pam support)
779 - sed -i -e 's/$(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)/$(LUTIL_LIBS) $(SECURITY_LIBS) $(LDIF_LIBS)/' \
780 - "${S}"/servers/slapd/Makefile.in
781 -
782 - # supersedes old fix for bug #31202
783 - EPATCH_OPTS="-p1 -d ${S}" epatch "${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch
784 -
785 - # ensure correct SLAPI path by default
786 - sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "/var/run/openldap/slapd.sock",' \
787 - "${S}"/include/ldap_defaults.h
788 -
789 - EPATCH_OPTS="-p0 -d ${S}"
790 -
791 - # ximian connector 1.4.7 ntlm patch
792 - epatch "${FILESDIR}"/${PN}-2.2.6-ntlm.patch
793 -
794 - # bug #132263
795 - epatch "${FILESDIR}"/${PN}-2.3.21-ppolicy.patch
796 -
797 - # bug #189817
798 - epatch "${FILESDIR}"/${PN}-2.3.37-libldap_r.patch
799 -
800 - # fix up stuff for newer autoconf that simulates autoconf-2.13, but doesn't
801 - # do it perfectly.
802 - cd "${S}"/build
803 - ln -s shtool install
804 - ln -s shtool install.sh
805 - einfo "Making sure upstream build strip does not do stripping too early"
806 - sed -i.orig \
807 - -e '/^STRIP/s,-s,,g' \
808 - top.mk || die "Failed to block stripping"
809 -
810 - # bug #116045
811 - # patch contrib modules
812 - if ! use minimal ; then
813 - cd "${S}"/contrib
814 - epatch "${FILESDIR}"/${PN}-2.3.24-contrib-smbk5pwd.patch
815 - fi
816 - # Fix gcc-4.4 compat, bug 264761
817 - epatch "${FILESDIR}/openldap-2.3.XY-gcc44.patch"
818 -
819 - # Backport random-hang fix from 2.4
820 - # http://www.openldap.org/lists/openldap-technical/201208/msg00120.html
821 - EPATCH_OPTS=""
822 - cd "${S}"
823 - epatch "${FILESDIR}/openldap-2.3.43-fix-hang.patch"
824 -}
825 -
826 -src_configure() {
827 - local myconf
828 -
829 - #Fix for glibc-2.8 and ucred. Bug 228457.
830 - append-flags -D_GNU_SOURCE
831 -
832 - # HDB is only available with BerkDB
833 - myconf_berkdb='--enable-bdb --enable-ldbm-api=berkeley --enable-hdb=mod'
834 - myconf_gdbm='--disable-bdb --enable-ldbm-api=gdbm --disable-hdb'
835 -
836 - use debug && myconf="${myconf} --enable-debug" # there is no disable-debug
837 -
838 - # enable slapd/slurpd servers if not doing a minimal build
839 - if ! use minimal ; then
840 - myconf="${myconf} --enable-slapd --enable-slurpd"
841 - # base backend stuff
842 - myconf="${myconf} --enable-ldbm"
843 - if use berkdb ; then
844 - einfo "Using Berkeley DB for local backend"
845 - myconf="${myconf} ${myconf_berkdb}"
846 - # We need to include the slotted db.h dir for FreeBSD
847 - append-cppflags -I$(db_includedir 4.5 4.4 4.3 4.2 )
848 - elif use gdbm ; then
849 - einfo "Using GDBM for local backend"
850 - myconf="${myconf} ${myconf_gdbm}"
851 - else
852 - ewarn "Neither gdbm or berkdb USE flags present, falling back to"
853 - ewarn "Berkeley DB for local backend"
854 - myconf="${myconf} ${myconf_berkdb}"
855 - # We need to include the slotted db.h dir for FreeBSD
856 - append-cppflags -I$(db_includedir 4.5 4.4 4.3 4.2 )
857 - fi
858 - # extra backend stuff
859 - myconf="${myconf} --enable-passwd=mod --enable-phonetic=mod"
860 - myconf="${myconf} --enable-dnssrv=mod --enable-ldap"
861 - myconf="${myconf} --enable-meta=mod --enable-monitor=mod"
862 - myconf="${myconf} --enable-null=mod --enable-shell=mod"
863 - myconf="${myconf} --enable-relay=mod"
864 - myconf="${myconf} $(use_enable perl perl mod)"
865 - myconf="${myconf} $(use_enable odbc sql mod)"
866 - # slapd options
867 - myconf="${myconf} $(use_enable crypt) $(use_enable slp)"
868 - myconf="${myconf} --enable-rewrite --enable-rlookups"
869 - myconf="${myconf} --enable-aci --enable-modules"
870 - myconf="${myconf} --enable-cleartext --enable-slapi"
871 - myconf="${myconf} $(use_enable samba lmpasswd)"
872 - # slapd overlay options
873 - myconf="${myconf} --enable-dyngroup --enable-proxycache"
874 - use overlays && myconf="${myconf} --enable-overlays=mod"
875 - myconf="${myconf} --enable-syncprov"
876 - else
877 - myconf="${myconf} --disable-slapd --disable-slurpd"
878 - myconf="${myconf} --disable-bdb --disable-ldbm"
879 - myconf="${myconf} --disable-hdb --disable-monitor"
880 - myconf="${myconf} --disable-slurpd --disable-overlays"
881 - myconf="${myconf} --disable-relay"
882 - fi
883 -
884 - # basic functionality stuff
885 - myconf="${myconf} --enable-syslog --enable-dynamic"
886 - myconf="${myconf} --enable-local --enable-proctitle"
887 -
888 - myconf="${myconf} $(use_enable ipv6)"
889 - myconf="${myconf} $(use_with sasl cyrus-sasl) $(use_enable sasl spasswd)"
890 - myconf="${myconf} $(use_enable tcpd wrappers) $(use_with ssl tls)"
891 -
892 - if [ $(get_libdir) != "lib" ] ; then
893 - append-ldflags -L/usr/$(get_libdir)
894 - fi
895 -
896 - STRIP=/bin/true \
897 - econf \
898 - --enable-static \
899 - --enable-shared \
900 - --libexecdir=/usr/$(get_libdir)/openldap \
901 - ${myconf} || die "configure failed"
902 -}
903 -
904 -src_compile() {
905 - emake depend || die "make depend failed"
906 - emake || die "make failed"
907 -
908 - # openldap/contrib
909 - tc-export CC
910 - if ! use minimal ; then
911 - # dsaschema
912 - einfo "Building contributed dsaschema"
913 - cd "${S}"/contrib/slapd-modules/dsaschema
914 - ${CC} -shared -I../../../include ${CFLAGS} -fPIC \
915 - -Wall -o libdsaschema-plugin.so dsaschema.c || \
916 - die "failed to compile dsaschema module"
917 - # kerberos passwd
918 - if use kerberos ; then
919 - einfo "Building contributed pw-kerberos"
920 - cd "${S}"/contrib/slapd-modules/passwd/ && \
921 - ${CC} -shared -I../../../include ${CFLAGS} -fPIC \
922 - $(krb5-config --cflags) \
923 - -DHAVE_KRB5 -o pw-kerberos.so kerberos.c || \
924 - die "failed to compile kerberos password module"
925 - fi
926 - # netscape mta-md5 password
927 - einfo "Building contributed pw-netscape"
928 - cd "${S}"/contrib/slapd-modules/passwd/ && \
929 - ${CC} -shared -I../../../include ${CFLAGS} -fPIC \
930 - -o pw-netscape.so netscape.c || \
931 - die "failed to compile netscape password module"
932 - # smbk5pwd overlay
933 - # Note: this modules builds, but may not work with
934 - # Gentoo's MIT-Kerberos. It was designed for Heimdal
935 - # Kerberos.
936 - if use smbkrb5passwd ; then
937 - einfo "Building contributed smbk5pwd"
938 - local mydef
939 - local mykrb5inc
940 - mydef="-DDO_SAMBA -DDO_KRB5"
941 - mykrb5inc="$(krb5-config --cflags)"
942 - cd "${S}"/contrib/slapd-modules/smbk5pwd && \
943 - libexecdir="/usr/$(get_libdir)/openldap" \
944 - DEFS="${mydef}" KRB5_INC="${mykrb5inc}" emake || \
945 - die "failed to compile smbk5pwd module"
946 - fi
947 - # addrdnvalues
948 - einfo "Building contributed addrdnvalues"
949 - cd "${S}"/contrib/slapi-plugins/addrdnvalues/ && \
950 - ${CC} -shared -I../../../include ${CFLAGS} -fPIC \
951 - -o libaddrdnvalues-plugin.so addrdnvalues.c || \
952 - die "failed to compile addrdnvalues plugin"
953 - fi
954 -}
955 -
956 -src_test() {
957 - einfo "Doing tests"
958 - cd tests ; make tests || die "make tests failed"
959 -}
960 -
961 -src_install() {
962 - emake DESTDIR="${D}" install || die "make install failed"
963 -
964 - dodoc ANNOUNCEMENT CHANGES COPYRIGHT README "${FILESDIR}"/DB_CONFIG.fast.example
965 - docinto rfc ; dodoc doc/rfc/*.txt
966 -
967 - # openldap modules go here
968 - # TODO: write some code to populate slapd.conf with moduleload statements
969 - keepdir /usr/$(get_libdir)/openldap/openldap/
970 -
971 - # make state directories
972 - local dirlist="data"
973 - if ! use minimal; then
974 - dirlist="${dirlist} slurp ldbm"
975 - fi
976 - for x in ${dirlist}; do
977 - keepdir /var/lib/openldap-${x}
978 - fowners ldap:ldap /var/lib/openldap-${x}
979 - fperms 0700 /var/lib/openldap-${x}
980 - done
981 -
982 - echo "OLDPF='${PF}'" > "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
983 - echo "# do NOT delete this. it is used" >> "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
984 - echo "# to track versions for upgrading." >> "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}"
985 -
986 - # manually remove /var/tmp references in .la
987 - # because it is packaged with an ancient libtool
988 - #for x in "${D}"/usr/$(get_libdir)/lib*.la; do
989 - # sed -i -e "s:-L${S}[/]*libraries::" ${x}
990 - #done
991 -
992 - # change slapd.pid location in configuration file
993 - keepdir /var/run/openldap
994 - fowners ldap:ldap /var/run/openldap
995 - fperms 0755 /var/run/openldap
996 -
997 - if ! use minimal; then
998 - # use our config
999 - rm "${D}"etc/openldap/slapd.con*
1000 - insinto /etc/openldap
1001 - newins "${FILESDIR}"/${PN}-2.3.34-slapd-conf slapd.conf
1002 - configfile="${D}"etc/openldap/slapd.conf
1003 -
1004 - # populate with built backends
1005 - ebegin "populate config with built backends"
1006 - for x in "${D}"usr/$(get_libdir)/openldap/openldap/back_*.so; do
1007 - elog "Adding $(basename ${x})"
1008 - sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}"
1009 - done
1010 - sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}"
1011 - fowners root:ldap /etc/openldap/slapd.conf
1012 - fperms 0640 /etc/openldap/slapd.conf
1013 - cp "${configfile}" "${configfile}".default
1014 - eend
1015 -
1016 - # install our own init scripts
1017 - newinitd "${FILESDIR}"/slapd-initd slapd
1018 - newinitd "${FILESDIR}"/slurpd-initd slurpd
1019 - newconfd "${FILESDIR}"/slapd-confd slapd
1020 -
1021 - if [ $(get_libdir) != lib ]; then
1022 - sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${D}"etc/init.d/{slapd,slurpd}
1023 - fi
1024 -
1025 - # install contributed modules
1026 - docinto /
1027 - if [ -e "${S}"/contrib/slapd-modules/dsaschema/libdsaschema-plugin.so ];
1028 - then
1029 - cd "${S}"/contrib/slapd-modules/dsaschema/
1030 - newdoc README README.contrib.dsaschema
1031 - exeinto /usr/$(get_libdir)/openldap/openldap
1032 - doexe libdsaschema-plugin.so || \
1033 - die "failed to install dsaschema module"
1034 - fi
1035 - if [ -e "${S}"/contrib/slapd-modules/passwd/pw-kerberos.so ]; then
1036 - cd "${S}"/contrib/slapd-modules/passwd/
1037 - newdoc README README.contrib.passwd
1038 - exeinto /usr/$(get_libdir)/openldap/openldap
1039 - doexe pw-kerberos.so || \
1040 - die "failed to install kerberos passwd module"
1041 - fi
1042 - if [ -e "${S}"/contrib/slapd-modules/passwd/pw-netscape.so ]; then
1043 - cd "${S}"/contrib/slapd-modules/passwd/
1044 - newdoc README README.contrib.passwd
1045 - exeinto /usr/$(get_libdir)/openldap/openldap
1046 - doexe "${S}"/contrib/slapd-modules/passwd/pw-netscape.so || \
1047 - die "failed to install Netscape MTA-MD5 passwd module"
1048 - fi
1049 - if [ -e "${S}"/contrib/slapd-modules/smbk5pwd/.libs/smbk5pwd.so ]; then
1050 - cd "${S}"/contrib/slapd-modules/smbk5pwd
1051 - newdoc README README.contrib.smbk5pwd
1052 - libexecdir="/usr/$(get_libdir)/openldap" \
1053 - emake DESTDIR="${D}" install-mod || \
1054 - die "failed to install smbk5pwd overlay module"
1055 - fi
1056 - if [ -e "${S}"/contrib/slapd-tools/statslog ]; then
1057 - cd "${S}"/contrib/slapd-tools
1058 - exeinto /usr/bin
1059 - newexe statslog ldapstatslog || \
1060 - die "failed to install ldapstatslog script"
1061 - fi
1062 - if [ -e "${S}"/contrib/slapi-plugins/addrdnvalues/libaddrdnvalues-plugin.so ];
1063 - then
1064 - cd "${S}"/contrib/slapi-plugins/addrdnvalues
1065 - newdoc README README.contrib.addrdnvalues
1066 - exeinto /usr/$(get_libdir)/openldap/openldap
1067 - doexe libaddrdnvalues-plugin.so || \
1068 - die "failed to install addrdnvalues plugin"
1069 - fi
1070 - fi
1071 -}
1072 -
1073 -pkg_preinst() {
1074 - # keep old libs if any
1075 - LIBSUFFIXES=".so.2.0.130 -2.2.so.7"
1076 - for LIBSUFFIX in ${LIBSUFFIXES} ; do
1077 - for each in libldap libldap_r liblber ; do
1078 - preserve_old_lib "usr/$(get_libdir)/${each}${LIBSUFFIX}"
1079 - done
1080 - done
1081 -}
1082 -
1083 -pkg_postinst() {
1084 - if ! use minimal ; then
1085 - # You cannot build SSL certificates during src_install that will make
1086 - # binary packages containing your SSL key, which is both a security risk
1087 - # and a misconfiguration if multiple machines use the same key and cert.
1088 - # Additionally, it overwrites
1089 - if use ssl; then
1090 - install_cert /etc/openldap/ssl/ldap
1091 - chown ldap:ldap "${ROOT}"etc/openldap/ssl/ldap.*
1092 - ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
1093 - ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]"
1094 - ewarn "add 'TLS_REQCERT never' if you want to use them."
1095 - fi
1096 - # These lines force the permissions of various content to be correct
1097 - chown ldap:ldap "${ROOT}"var/run/openldap
1098 - chmod 0755 "${ROOT}"var/run/openldap
1099 - chown root:ldap "${ROOT}"etc/openldap/slapd.conf{,.default}
1100 - chmod 0640 "${ROOT}"etc/openldap/slapd.conf{,.default}
1101 - chown ldap:ldap "${ROOT}"var/lib/openldap-{data,ldbm,slurp}
1102 - fi
1103 -
1104 - # Reference inclusion bug #77330
1105 - echo
1106 - elog
1107 - elog "Getting started using OpenLDAP? There is some documentation available:"
1108 - elog "Gentoo Guide to OpenLDAP Authentication"
1109 - elog "(https://www.gentoo.org/doc/en/ldap-howto.xml)"
1110 - elog
1111 -
1112 - # note to bug #110412
1113 - echo
1114 - elog
1115 - elog "An example file for tuning BDB backends with openldap is"
1116 - elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
1117 - elog
1118 -
1119 - LIBSUFFIXES=".so.2.0.130 -2.2.so.7"
1120 - for LIBSUFFIX in ${LIBSUFFIXES} ; do
1121 - for each in liblber libldap libldap_r ; do
1122 - preserve_old_lib_notify "usr/$(get_libdir)/${each}${LIBSUFFIX}"
1123 - done
1124 - done
1125 -}