diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2008-10-14 09:18:15 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2008-10-14 09:18:15 +0000 |
commit | 8e59158ef265228e02adf8e5c7f4f0a5a3238e83 (patch) | |
tree | 7766a4964c604b35123500989dca50467c6f3cf8 /net-nds | |
parent | Bump imlib2 dep for bug #196525 (diff) | |
download | historical-8e59158ef265228e02adf8e5c7f4f0a5a3238e83.tar.gz historical-8e59158ef265228e02adf8e5c7f4f0a5a3238e83.tar.bz2 historical-8e59158ef265228e02adf8e5c7f4f0a5a3238e83.zip |
Bug #189817, fix linking of libldap_r with as-needed.
Package-Manager: portage-2.2_rc11/cvs/Linux 2.6.27-rc1-10246-gca5de40 x86_64
Diffstat (limited to 'net-nds')
-rw-r--r-- | net-nds/openldap/ChangeLog | 8 | ||||
-rw-r--r-- | net-nds/openldap/Manifest | 4 | ||||
-rw-r--r-- | net-nds/openldap/files/openldap-2.4.11-libldap_r.patch | 11 | ||||
-rw-r--r-- | net-nds/openldap/openldap-2.4.11-r1.ebuild | 432 |
4 files changed, 453 insertions, 2 deletions
diff --git a/net-nds/openldap/ChangeLog b/net-nds/openldap/ChangeLog index 5d64173ec3e1..9dd18b59f850 100644 --- a/net-nds/openldap/ChangeLog +++ b/net-nds/openldap/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-nds/openldap # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-nds/openldap/ChangeLog,v 1.334 2008/10/14 08:59:42 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-nds/openldap/ChangeLog,v 1.335 2008/10/14 09:18:15 robbat2 Exp $ + +*openldap-2.4.11-r1 (14 Oct 2008) + + 14 Oct 2008; Robin H. Johnson <robbat2@gentoo.org> + +files/openldap-2.4.11-libldap_r.patch, +openldap-2.4.11-r1.ebuild: + Bug #189817, fix linking of libldap_r with as-needed. *openldap-2.3.43-r1 (14 Oct 2008) diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest index 7e64d63dfe8e..8103017c4463 100644 --- a/net-nds/openldap/Manifest +++ b/net-nds/openldap/Manifest @@ -7,6 +7,7 @@ AUX openldap-2.3.34-slapd-conf 2058 RMD160 08f15fb982898dbcda7b969c57c8a754f0f80 AUX openldap-2.3.37-libldap_r.patch 862 RMD160 1ab42b2cdc6f3d9d412ccdfa7a7a288c29733231 SHA1 c2f997f2e28b7452a3ef981db9c6d527342ad400 SHA256 82471cc13806a9260e441aea90c8dfe9ce21b6d3edabb71766a2afcff6f80dfb AUX openldap-2.4-disable-bdb46.patch 10249 RMD160 d989e7298722c99d104c96eb36dbb5923a00b2c7 SHA1 8a9c8f2f7b53bfdc1c478d3d7f59227c4e24e37f SHA256 b765619b06be4a3a48f8057527818af2ee9a4628c265cf02ed72797de1d1b014 AUX openldap-2.4-ppolicy.patch 455 RMD160 653695a9853bb7e1c9f53a779cb7ac2755edaf4e SHA1 8f419fddf0abf1fef48732b04617293c3ca1ed36 SHA256 355a8239355fcc5863ba7430d73af7ccad9e0211ae56180011d15d7418aa5b27 +AUX openldap-2.4.11-libldap_r.patch 515 RMD160 aa778bad59d498601bab84e215b2bcb6d125cf00 SHA1 e2c52828e719c137802966879f8da93a196cfde3 SHA256 3310a89d38bc39e6eb4333799d475411b274482b8bccab212b3edfd4385db70e AUX slapd-confd 436 RMD160 764d5e2915d9af33fd1db2489ceac6d953750984 SHA1 a16b4674b45ac1e1c8a8f9e84ad0de519c81aa11 SHA256 1ccb8a3b78b65b125b24779dd065cf8000e2d5e4da267bb0a892e730edd2055d AUX slapd-initd 584 RMD160 a759c9f99141587feff2df6193377f0c0ca2eb0a SHA1 80dfa52d417822d2d2e8f94a1ed849e8104f5084 SHA256 fecf5eeef83811bd91aca5884aa7f9c8608ce9416be2fa8a1eb7ea5b540175f7 AUX slurpd-initd 494 RMD160 9f3a06bcab2e4ce8e66783af506d26595bbbdcd2 SHA1 8ab66a984510fa91755cbcbac29883cea1435db7 SHA256 b23e010f701620ec34c39cd215891c7c0afc773341392a1e762e84166d9863ff @@ -24,7 +25,8 @@ EBUILD openldap-2.3.41.ebuild 17656 RMD160 01abbed03acbbc3574c8ab533eefb3e22d561 EBUILD openldap-2.3.43-r1.ebuild 17796 RMD160 df274823081fb94525a4249ab7f39772f50eb7d7 SHA1 9f93992c96b03bbd606c4b60ddc6d2ddc9d18338 SHA256 e0cb242aa05fff3b473e03e1ef8b88b0493817e3a4e2093ca74ed919e12dd4ea EBUILD openldap-2.3.43.ebuild 17750 RMD160 d413e98956f47b8b12e58d05f1fe7dc8635ee265 SHA1 591851f81fc3e25feb6646dfd27cd0e8d69aec11 SHA256 6068c190e12d339f976cc96a9d48baf987f6544ef9e688637740c93200e78c8c EBUILD openldap-2.4.10.ebuild 13887 RMD160 3a63c3a7270fdc0236922570b2b9b0bd233b75cb SHA1 6ad2722d0a1d11265e733d117d166589b18f5a6d SHA256 291ab646b54ac7f286f5c33dc9087921cd6a39957442540b4ed4f88d5e757aa3 +EBUILD openldap-2.4.11-r1.ebuild 14124 RMD160 2f6b01f53295d74e34a3211a654fff3ace4e7be5 SHA1 013aef84bdc33cf8f6c9221777dca0fd741e6466 SHA256 61b8f06396ffc662a6daa57214490def225b80c1a9123ce1883c5495ca9c8bad EBUILD openldap-2.4.11.ebuild 13885 RMD160 60891d864822b679200c8c6aca68275a307fb58f SHA1 93b50df0424a83e325f4a0ae6df4d40791314270 SHA256 749787c150151334ab7a424fc574453156b7720d9a313cd61e65c1adada2b977 EBUILD openldap-2.4.7.ebuild 11106 RMD160 093948db1357a06b60826d76dbb870d49985409a SHA1 a8fc14a97e6b8a78ad9b11b69ac8408b8351c0bd SHA256 01b233c023499c7c423c838106b73ff9f620ba70d0b50dd954c843f6799f5305 -MISC ChangeLog 56353 RMD160 55a3bb8c01c2fafe743337ea467c98c37722c654 SHA1 7403986418317406e13fa007906e57369befeb1b SHA256 ddd84d47693e3bb62c2389fba7bcfbfb427342ea7373812a383375ce9f31d21c +MISC ChangeLog 56568 RMD160 8925e014560c8bd3cebed970780fc63a56c174fa SHA1 719cabd29a5e12a3c0aa734041a0ea6cd20b7e81 SHA256 37df9b8af2f98d1fd1cc4f563669d3e6ad995eb9a39af5ec9835534f7f394205 MISC metadata.xml 493 RMD160 3fd70a0f5e5b400cce6f75e477c8c9eaf0244ff8 SHA1 324691bfdc993bd6de2fff7cbfc10cfad567d32d SHA256 d23200f9c2f9e95e5fa32808c597df2951cd5e88ca9c519c9d5186bc42b0981e diff --git a/net-nds/openldap/files/openldap-2.4.11-libldap_r.patch b/net-nds/openldap/files/openldap-2.4.11-libldap_r.patch new file mode 100644 index 000000000000..448249a3b583 --- /dev/null +++ b/net-nds/openldap/files/openldap-2.4.11-libldap_r.patch @@ -0,0 +1,11 @@ +diff -Nuar openldap-2.4.11.orig/servers/slapd/slapi/Makefile.in openldap-2.4.11/servers/slapd/slapi/Makefile.in +--- openldap-2.4.11.orig/servers/slapd/slapi/Makefile.in 2008-02-11 15:26:49.000000000 -0800 ++++ openldap-2.4.11/servers/slapd/slapi/Makefile.in 2008-10-14 02:10:18.402799262 -0700 +@@ -37,6 +37,7 @@ + XLIBS = $(LIBRARY) + XXLIBS = + NT_LINK_LIBS = $(AC_LIBS) ++UNIX_LINK_LIBS = ../../../libraries/libldap_r/libldap_r.la $(LTHREAD_LIBS) + + XINCPATH = -I$(srcdir)/.. -I$(srcdir) + XDEFS = $(MODULES_CPPFLAGS) diff --git a/net-nds/openldap/openldap-2.4.11-r1.ebuild b/net-nds/openldap/openldap-2.4.11-r1.ebuild new file mode 100644 index 000000000000..9accd31a7cba --- /dev/null +++ b/net-nds/openldap/openldap-2.4.11-r1.ebuild @@ -0,0 +1,432 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-nds/openldap/openldap-2.4.11-r1.ebuild,v 1.1 2008/10/14 09:18:15 robbat2 Exp $ + +EAPI="1" +inherit db-use eutils flag-o-matic multilib ssl-cert versionator toolchain-funcs + +DESCRIPTION="LDAP suite of application and development tools" +HOMEPAGE="http://www.OpenLDAP.org/" +SRC_URI="mirror://openldap/openldap-release/${P}.tgz" + +LICENSE="OPENLDAP" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" + +IUSE_DAEMON="crypt samba slp tcpd experimental minimal" +IUSE_BACKEND="+berkdb" +IUSE_OVERLAY="overlays perl" +IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 syslog selinux" +IUSE_CONTRIB="smbkrb5passwd kerberos" +IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}" + +# samba adding openssl is intentional --jokey +RDEPEND="sys-libs/ncurses + tcpd? ( sys-apps/tcp-wrappers ) + ssl? ( !gnutls? ( dev-libs/openssl ) + gnutls? ( net-libs/gnutls ) ) + sasl? ( dev-libs/cyrus-sasl ) + !minimal? ( + odbc? ( !iodbc? ( dev-db/unixODBC ) + iodbc? ( dev-db/libiodbc ) ) + slp? ( net-libs/openslp ) + perl? ( dev-lang/perl ) + samba? ( !gnutls? ( dev-libs/openssl ) + gnutls? ( net-libs/gnutls ) ) + berkdb? ( sys-libs/db:4.5 ) + smbkrb5passwd? ( + dev-libs/openssl + app-crypt/heimdal ) + ) + selinux? ( sec-policy/selinux-openldap )" +DEPEND="${RDEPEND}" + +# for tracking versions +OPENLDAP_VERSIONTAG=".version-tag" +OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data" + +openldap_find_versiontags() { + # scan for all datadirs + openldap_datadirs="" + if [ -f "${ROOT}"/etc/openldap/slapd.conf ]; then + openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${ROOT}/etc/openldap/slapd.conf)" + fi + openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}" + + einfo + einfo "Scanning datadir(s) from slapd.conf and" + einfo "the default installdir for Versiontags" + einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)" + einfo + + # scan datadirs if we have a version tag + openldap_found_tag=0 + for each in ${openldap_datadirs}; do + CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"` + CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG} + if [ -d ${CURRENT_TAGDIR} ] && [ ${openldap_found_tag} == 0 ] ; then + einfo "- Checking ${each}..." + if [ -r ${CURRENT_TAG} ] ; then + # yey, we have one :) + einfo " Found Versiontag in ${each}" + source ${CURRENT_TAG} + if [ "${OLDPF}" == "" ] ; then + eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}" + eerror "Please delete it" + eerror + die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}" + fi + + OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}` + + # are we on the same branch? + if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then + ewarn " Versiontag doesn't match current major release!" + if [[ `ls -a ${CURRENT_TAGDIR} | wc -l` -gt 5 ]] ; then + eerror " Versiontag says other major and you (probably) have datafiles!" + echo + openldap_upgrade_howto + else + einfo " No real problem, seems there's no database." + fi + else + einfo " Versiontag is fine here :)" + fi + else + einfo " Non-tagged dir ${each}" + if [[ `ls -a ${each} | wc -l` > 5 ]] ; then + einfo " EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files" + echo + + eerror + eerror "Your OpenLDAP Installation has a non tagged datadir that" + eerror "possibly contains a database at ${CURRENT_TAGDIR}" + eerror + eerror "Please export data if any entered and empty or remove" + eerror "the directory, installation has been stopped so you" + eerror "can take required action" + eerror + eerror "For a HOWTO on exporting the data, see instructions in the ebuild" + eerror + die "Please move the datadir ${CURRENT_TAGDIR} away" + fi + fi + einfo + fi + done + + echo + einfo + einfo "All datadirs are fine, proceeding with merge now..." + einfo +} + +openldap_upgrade_howto() { + eerror + eerror "A (possible old) installation of OpenLDAP was detected," + eerror "installation will not proceed for now." + eerror + eerror "As major version upgrades can corrupt your database," + eerror "you need to dump your database and re-create it afterwards." + eerror "" + d="$(date -u +%s)" + l="/root/ldapdump.${d}" + i="${l}.raw" + eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop" + eerror " 2. slapcat -l ${i}" + eerror " 3. egrep -v '^entryCSN:' <${i} >${l}" + eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/" + eerror " 5. emerge --update \=net-nds/${PF}" + eerror " 6. etc-update, and ensure that you apply the changes" + eerror " 7. slapadd -l ${l}" + eerror " 8. chown ldap:ldap /var/lib/openldap-data/*" + eerror " 9. /etc/init.d/slapd start" + eerror "10. check that your data is intact." + eerror "11. set up the new replication system." + eerror + if [ "${FORCE_UPGRADE}" != "1" ]; then + die "You need to upgrade your database first" + else + eerror "You have the magical FORCE_UPGRADE=1 in place." + eerror "Don't say you weren't warned about data loss." + fi +} + +pkg_setup() { + if use minimal && has_version "net-nds/openldap" && built_with_use net-nds/openldap minimal ; then + einfo + einfo "Skipping scan for previous datadirs as requested by minimal useflag" + einfo + else + openldap_find_versiontags + fi + + enewgroup ldap 439 + enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # ensure correct SLAPI path by default + sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "/var/run/openldap/slapd.sock",' \ + "${S}"/include/ldap_defaults.h + + epatch \ + "${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \ + "${FILESDIR}"/${PN}-2.4-disable-bdb46.patch \ + "${FILESDIR}"/${PN}-2.4-ppolicy.patch \ + + # bug #116045 + epatch "${FILESDIR}"/${PN}-2.3.24-contrib-smbk5pwd.patch + + + # bug #189817 + epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch + + cd "${S}"/build + einfo "Making sure upstream build strip does not do stripping too early" + sed -i.orig \ + -e '/^STRIP/s,-s,,g' \ + top.mk || die "Failed to block stripping" +} + +build_contrib_module() { + # <dir> <sources> <outputname> + cd "${S}/contrib/slapd-modules/$1" + einfo "Building contrib-module: $3" + $(tc-getCC) -shared \ + -I../../../include -I../../../servers/slapd ${CFLAGS} -fPIC \ + ${LDFLAGS} -o $3.so $2 || die "building $3 failed" +} + +src_compile() { + local myconf + + #Fix for glibc-2.8 and ucred. Bug 228457. + append-flags -D_GNU_SOURCE + + use debug && myconf="${myconf} $(use_enable debug)" + + if ! use minimal ; then + # backends + myconf="${myconf} --enable-slapd" + if use berkdb ; then + einfo "Using Berkeley DB for local backend" + myconf="${myconf} --enable-bdb --enable-hdb" + # We need to include the slotted db.h dir for FreeBSD + append-cppflags -I$(db_includedir 4.5) + else + ewarn + ewarn "Note: if you disable berkdb, you can only use remote-backends!" + ewarn + ebeep 5 + myconf="${myconf} --disable-bdb --disable-hdb" + fi + for backend in dnssrv ldap meta monitor null passwd relay shell sock; do + myconf="${myconf} --enable-${backend}=mod" + done + + myconf="${myconf} $(use_enable perl perl mod)" + + if use odbc ; then + local odbc_lib="unixodbc" + use iodbc && odbc_lib="iodbc" + myconf="${myconf} --enable-sql=mod --with-odbc=${odbc_lib}" + fi + + # slapd options + myconf="${myconf} $(use_enable crypt) $(use_enable slp)" + myconf="${myconf} $(use_enable samba lmpasswd)" + if use experimental ; then + myconf="${myconf} --enable-dynacl" + myconf="${myconf} --enable-aci=mod" + fi + for option in aci cleartext modules rewrite rlookups slapi; do + myconf="${myconf} --enable-${option}" + done + + # slapd overlay options + # Compile-in the syncprov, the others as module + myconf="${myconf} --enable-syncprov=yes" + use overlays && myconf="${myconf} --enable-overlays=mod" + else + myconf="${myconf} --disable-slapd --disable-bdb --disable-hdb" + myconf="${myconf} --disable-overlays" + fi + + # basic functionality stuff + myconf="${myconf} $(use_enable ipv6)" + myconf="${myconf} $(use_with sasl cyrus-sasl) $(use_enable sasl spasswd)" + myconf="${myconf} $(use_enable tcpd wrappers)" + + local ssl_lib="no" + if use ssl || ( use ! minimal && use samba ) ; then + ssl_lib="openssl" + use gnutls && ssl_lib="gnutls" + fi + + myconf="${myconf} --with-tls=${ssl_lib}" + + for basicflag in dynamic local proctitle shared static syslog; do + myconf="${myconf} --enable-${basicflag}" + done + + STRIP=/bin/true \ + econf \ + --libexecdir=/usr/$(get_libdir)/openldap \ + ${myconf} || die "configure failed" + + emake depend || die "emake depend failed" + emake CC=$(tc-getCC) AR=$(tc-getAR) || die "emake failed" + + if ! use minimal ; then + if use smbkrb5passwd ; then + einfo "Building contrib-module: smbk5pwd" + cd "${S}/contrib/slapd-modules/smbk5pwd" + + emake \ + DEFS="-DDO_SAMBA -DDO_KRB5" \ + KRB5_INC="-I/usr/include/heimdal" \ + CC=$(tc-getCC) \ + || die "emake smbk5pwd failed" + fi + + if use kerberos ; then + cd "${S}/contrib/slapd-modules/passwd" + einfo "Building contrib-module: pw-kerberos" + $(tc-getCC) -shared \ + -I../../../include ${CFLAGS} -DHAVE_KRB5 -fPIC \ + ${LDFLAGS} -o pw-kerberos.so kerberos.c || die "building pw-kerberos failed" + fi + # We could build pw-radius if GNURadius would install radlib.h + cd "${S}/contrib/slapd-modules/passwd" + einfo "Building contrib-module: pw-netscape" + $(tc-getCC) -shared \ + -I../../../include ${CFLAGS} -fPIC \ + ${LDFLAGS} -o pw-netscape.so netscape.c || die "building pw-netscape failed" + + build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay" + build_contrib_module "allop" "allop.c" "overlay-allop" + # TODO: autogroup + build_contrib_module "denyop" "denyop.c" "denyop-overlay" + build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin" + # TODO: lastmod + build_contrib_module "nops" "nops.c" "nops-overlay" + # TODO: trace + fi +} + +src_test() { + cd tests ; make tests || die "make tests failed" +} + +src_install() { + emake DESTDIR="${D}" install || die "make install failed" + + dodoc ANNOUNCEMENT CHANGES COPYRIGHT README "${FILESDIR}"/DB_CONFIG.fast.example + docinto rfc ; dodoc doc/rfc/*.txt + + # openldap modules go here + # TODO: write some code to populate slapd.conf with moduleload statements + keepdir /usr/$(get_libdir)/openldap/openldap/ + + # initial data storage dir + keepdir /var/lib/openldap-data + fowners ldap:ldap /var/lib/openldap-data + fperms 0700 /var/lib/openldap-data + + echo "OLDPF='${PF}'" > "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}" + echo "# do NOT delete this. it is used" >> "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}" + echo "# to track versions for upgrading." >> "${D}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}" + + # change slapd.pid location in configuration file + keepdir /var/run/openldap + fowners ldap:ldap /var/run/openldap + fperms 0755 /var/run/openldap + + if ! use minimal; then + # use our config + rm "${D}"etc/openldap/slapd.conf + insinto /etc/openldap + newins "${FILESDIR}"/${PN}-2.3.34-slapd-conf slapd.conf + configfile="${D}"etc/openldap/slapd.conf + + # populate with built backends + ebegin "populate config with built backends" + for x in "${D}"usr/$(get_libdir)/openldap/openldap/back_*.so; do + elog "Adding $(basename ${x})" + sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" + done + sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}" + fowners root:ldap /etc/openldap/slapd.conf + fperms 0640 /etc/openldap/slapd.conf + cp "${configfile}" "${configfile}".default + eend + + # install our own init scripts + newinitd "${FILESDIR}"/slapd-initd slapd + newconfd "${FILESDIR}"/slapd-confd slapd + if [ $(get_libdir) != lib ]; then + sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${D}"etc/init.d/slapd + fi + + if use smbkrb5passwd ; then + einfo "Install the smbk5pwd module" + cd "${S}/contrib/slapd-modules/smbk5pwd" + emake DESTDIR="${D}" libexecdir="/usr/$(get_libdir)/openldap" install-mod || die "emake install smbk5pwd failed" + newdoc README smbk5pwd-README + fi + + einfo "Installing contrib modules" + cd "${S}/contrib/slapd-modules" + insinto /usr/$(get_libdir)/openldap/openldap + doins */*.so + docinto contrib + newdoc addpartial/README addpartial-README + newdoc allop/README allop-README + doman allop/slapo-allop.5 + newdoc denyop/denyop.c denyop-denyop.c + newdoc dsaschema/README dsaschema-README + doman lastmod/slapo-lastmod.5 + doman nops/slapo-nops.5 + newdoc passwd/README passwd-README + fi +} + +pkg_preinst() { + # keep old libs if any + preserve_old_lib usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3.so.0 +} + +pkg_postinst() { + if ! use minimal ; then + # You cannot build SSL certificates during src_install that will make + # binary packages containing your SSL key, which is both a security risk + # and a misconfiguration if multiple machines use the same key and cert. + if use ssl; then + install_cert /etc/openldap/ssl/ldap + chown ldap:ldap "${ROOT}"etc/openldap/ssl/ldap.* + ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]" + ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]" + ewarn "add 'TLS_REQCERT never' if you want to use them." + fi + + # These lines force the permissions of various content to be correct + chown ldap:ldap "${ROOT}"var/run/openldap + chmod 0755 "${ROOT}"var/run/openldap + chown root:ldap "${ROOT}"etc/openldap/slapd.conf{,.default} + chmod 0640 "${ROOT}"etc/openldap/slapd.conf{,.default} + chown ldap:ldap "${ROOT}"var/lib/openldap-{data,ldbm} + fi + + elog "Getting started using OpenLDAP? There is some documentation available:" + elog "Gentoo Guide to OpenLDAP Authentication" + elog "(http://www.gentoo.org/doc/en/ldap-howto.xml)" + elog "---" + elog "An example file for tuning BDB backends with openldap is:" + elog "/usr/share/doc/${PF}/DB_CONFIG.fast.example.gz" + + preserve_old_lib_notify usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3.so.0 +} |