diff options
author | Pacho Ramos <pacho@gentoo.org> | 2013-09-18 20:59:14 +0000 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2013-09-18 20:59:14 +0000 |
commit | 360bce4755688203cd8b71857850137ba535dcf6 (patch) | |
tree | 85e976b0e764683a82f418c6c74ccdffe7d2d5ed /net-nds | |
parent | Version bump. (diff) | |
download | historical-360bce4755688203cd8b71857850137ba535dcf6.tar.gz historical-360bce4755688203cd8b71857850137ba535dcf6.tar.bz2 historical-360bce4755688203cd8b71857850137ba535dcf6.zip |
Add unit file (#485134 by Alexander Tsoy)
Package-Manager: portage-2.2.4/cvs/Linux x86_64
Manifest-Sign-Key: 0xA188FBD4
Diffstat (limited to 'net-nds')
-rw-r--r-- | net-nds/openldap/ChangeLog | 8 | ||||
-rw-r--r-- | net-nds/openldap/Manifest | 16 | ||||
-rw-r--r-- | net-nds/openldap/files/slapd.service | 12 | ||||
-rw-r--r-- | net-nds/openldap/files/slapd.service.conf | 12 | ||||
-rw-r--r-- | net-nds/openldap/files/slapd.tmpfilesd | 2 | ||||
-rw-r--r-- | net-nds/openldap/openldap-2.4.35-r1.ebuild | 675 |
6 files changed, 723 insertions, 2 deletions
diff --git a/net-nds/openldap/ChangeLog b/net-nds/openldap/ChangeLog index 262b12873a9e..5749f4c4270d 100644 --- a/net-nds/openldap/ChangeLog +++ b/net-nds/openldap/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-nds/openldap # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-nds/openldap/ChangeLog,v 1.443 2013/09/16 04:27:41 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-nds/openldap/ChangeLog,v 1.444 2013/09/18 20:59:10 pacho Exp $ + +*openldap-2.4.35-r1 (18 Sep 2013) + + 18 Sep 2013; Pacho Ramos <pacho@gentoo.org> +files/slapd.service, + +files/slapd.service.conf, +files/slapd.tmpfilesd, +openldap-2.4.35-r1.ebuild: + Add unit file (#485134 by Alexander Tsoy) 16 Sep 2013; Patrick Lauer <patrick@gentoo.org> openldap-2.3.43-r4.ebuild: Bring hang-fix in 2.3 to stable users diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest index 2814ddee8a58..20fabdc02bf9 100644 --- a/net-nds/openldap/Manifest +++ b/net-nds/openldap/Manifest @@ -1,3 +1,6 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + AUX DB_CONFIG.fast.example 746 SHA256 69fc9aa6e4f0b888bc02d3f75642fe1ebf9345c685257a5c1236b2e79ed56e0b SHA512 07199416b7c91864a1dd5ad45642367c4f79ee8b694214305289c47afb5b53420f0fb81cf7c8b117400c903535e88a2dd47bda28d57e969aeeec669debf6dc9e WHIRLPOOL 1d6a2adcdbbac2698d8d5ab1867ecfafee23c8561c34addaea30f59bde8b4bfad88c576ffd7df102aa428c2588ed3b9376de49606eb6608c8e873f8119326c5a AUX openldap-2.2.14-perlthreadsfix.patch 614 SHA256 bb719cc1fed47ff0f111c960f3295781ae6f0d9e98b4266a87751044b4bb3175 SHA512 e2579de72194c63e445108a39a85635622c1a629cec9d276df84ce9d770dbe7e2df2057663bac192558af3dee60fa2f0ae92f4cc34145c300fe141ae7f3f13b3 WHIRLPOOL 24cab36ff0368f81f555ba0fa0ea0f78d245d1863bf4c6c6d291536b16bdbe628a9a204ffccce12a6014b71717f3dd722c9f95061c1a519e273c0535316ad97d AUX openldap-2.2.6-ntlm.patch 5011 SHA256 1f7e766bcafb412ec336aad7e07295d6d62d2e2a62b6804b07b06a5056102243 SHA512 8140dba85c56f269c953b0b23b2ca7eecb42f8e5167f4d0f08511dc8c06c30bcb42c3e38ed3b77d5622780a94c0aa9eb65bb8e45af50075acab97e7f466a1a9d WHIRLPOOL 75c2394c46242f738b5ee0db8473b05b5e7e75821e89dcea3ca7a139e34cc61f5848d0601dc66499dad35beefdd02aed5486ed138cfd8e216041aa5ceb85c920 @@ -27,6 +30,9 @@ AUX slapd-confd-2.4.28-r1 1072 SHA256 5bca003ec3b67c7c78519aede1d82002579006ccfe AUX slapd-initd 1277 SHA256 b0769a9790a6da8adfedcffc53b6d0d21756c299d94894ea635c3d9dea506844 SHA512 8bc6384ccf83900cac17ecc001251dedbbae945d48d7d51a65c3aaa4d2714a4a2f9de558a16a39d679aa2b0bd45c66a1fe1704e14021756bc0dd8512ecbb1345 WHIRLPOOL 799de21cdd8c836dee1751830431d7823e1741327062795891e14aac3421f67fe01ee1fcef27f6b3b79817003708527049114503d0f539c5380c34d14bf7e930 AUX slapd-initd-2.4.28-r1 981 SHA256 1fc515a6816b8a750db513df0b3b9bf8dd8bd4c4e9051205521acadfdebeae0f SHA512 e57f1e26d3635cb9328aa021c7033abca5a02959eeb2ff9534c4cae6f89b1e4e4992590dd3ae9fcc5529fa6ab109973624d06bcfe3aac126214cfca08e8aed0e WHIRLPOOL bddd056cbf759ef5e9f510165eb786ed3153b1ed7f53191325ffff999adfc4360139da79873e2190d7988345559e62692dd5327f24fad1c28c7a8b6f38e8eb9f AUX slapd-initd2 622 SHA256 abd3ab5c58b18845f6946bbf93c987d833c8a94b88841c587ce453faf738cefa SHA512 36faef3b274fbb8f958893a6375e8ba99949705f73ed06d0022b09e7e4531ff3fdc1f87b026a787fafab05a9d227b3381d769c79d54662542c5bc15f1fec3afa WHIRLPOOL dba6e25b5e7ceb0f72c5a46f39d6271e0e76410296584dee96e46c5c18793a995183154fa98dd76f4f926c76a8dc988c87dbe1912e9d8048bd7cf1bbffc1103c +AUX slapd.service 288 SHA256 080df14a8dd845912fc5e533567de92c3917ff51325cf9e3bb481127ced01bd4 SHA512 32d2bd0c1d044954066459e01ff1f2567725473f8747a445ec63d5be0dd905097f7e5feac3491e19a78bf85e9c773d539f8d2f63d0b2952f5cf45075af2aa5c6 WHIRLPOOL a1e1b149d00dc06f6e702a9af793894fbf7d5042e50535bd842ab6e07b52c0e37d450bc37066578ecdaea49d11dc048be2094ee11e0a6fe885fe3cfdb053c090 +AUX slapd.service.conf 443 SHA256 462adb8f6fc1a9f742c792b4392346d30949eed523453dd19b64afc9dc448145 SHA512 be9cf4bf19111bd77c0ce481428e6f3cc183a6939775ed1a2d7606a5162da34178cb139d666288f6a35b8413bd4dc5f8f1bd60b39f3cca8f749557674b93910b WHIRLPOOL 8697c1c1c82c5c3fbb5d3fffc43e56f1a05a8bf23443270f2a051fde7d6ca0d1c5102611ac62d244b2c190c6bd1fb675cc46a5978a715d2df4e72f13c58db3c8 +AUX slapd.tmpfilesd 94 SHA256 29e53a0022d0079ed6b8f952fe8c4fd4a4c1dad83f1c5aa2c45e98f5e880b4bd SHA512 337e3c3a6320fbee902929476322cd08530fc4cc6d6d71035d3a08750b56e62e9764fe881521819fc02c929c93ed5c1b3c5644d43e3173e7e21d151f218d4da0 WHIRLPOOL 3bc3feec5eaf0e3a0e934b4750506f91d8e73c2abb112f7187dd0364ecaee6c042515056e2dcf7a2791ce0e772c29d99ebab8b2712d22aae12301fd6ce642a71 AUX slurpd-initd 494 SHA256 b23e010f701620ec34c39cd215891c7c0afc773341392a1e762e84166d9863ff SHA512 d47c8ea473f3d9495583449d455581766b7bd3b913a314d720c514cfeae6b4e01973f1f2aa060f5cc5f2335fe57c2f4e78a56d02ba7859fc113cf69f6c233359 WHIRLPOOL 60bd05139e6af4710d265e71efe4aacaec468ae4289e8524870f157c2a36f427ef480cefed0f94c53414a2e31864127a6f5bf9ce3ebe0a217ff5e6aeaea020ef DIST openldap-2.3.43.tgz 3803011 SHA256 d7d2dea05362c8ac7e11bb7bf1da4cdeb07225ba8dc16974bff9f51a9f3d37e1 SHA512 2b0ebb35adbeed34673e1a55cc7a89b348ddee7ad6ce7f915ca3745198cee992aba7281bf0d56197dcfd59665935d5d3764db0ba487975e4dbc2a2507d6ea7a6 WHIRLPOOL 7457112bbad83d75f7ad01230da97511a8d983a98f7e31357dbffd79a7ed7e53057af781002cae8c610d3ad7834dfeefbd7f223798d45aea8cd00b70f5ee0e39 DIST openldap-2.4.19.tgz 5474200 SHA256 b7a2642f620f98bebf6b52a227ba66b93c5028c68088bf107b7403d2ce6e1533 SHA512 f802fd91596aba9f406e68797008edaebbcc65f7c0a71088c792fa358553e787b82e087e4e2461a27db3f4ed7dd2fc6ac8dabb8a58788d84406061826651570d WHIRLPOOL 5cfe98e627484935d13d281040a3e4d7300288573a7b7b9891fb24b6dbb63ac7f1fb3cf65c9825add6cbee655615cd4915c20d754c37b63eea15ef28005619f1 @@ -60,6 +66,14 @@ EBUILD openldap-2.4.32.ebuild 22317 SHA256 fe078797113bf34a6a626a26c82007bb6dd4b EBUILD openldap-2.4.33-r1.ebuild 22128 SHA256 ff2b9a7d59b468f696156d91957b210fb0b5abe969a1eb399255f839c5dc5c4d SHA512 53b656324ee84a602cea474f9ae3bedb6fb57f9a653520292203dd368a77d5daa5bb49cf62488e1e2daf818aa98adcd0fb7ca58e5e02f78751a7255e92c71605 WHIRLPOOL 78748de28219108ea56898814ad0535ad98bc45af214df2f1ff521aef5de8bf96b949a981ed1fa9a8cd1adf3f3d84a960de89f3f979112ea631f81611246d1cc EBUILD openldap-2.4.33-r2.ebuild 22185 SHA256 90adbb7cdf8097ffcdcc3d6a2113bb32599f61d09b8b45dfc87241b2bc4291f7 SHA512 aec70ec1058d3fcd522b7e609bb8501494fab08ed74639f6810e310e2e85887e1358645ed873d99f213b9fb710d0cb060e962b45d1d2b1a935b6b67debea889c WHIRLPOOL 8b08999deec515f41c6ed0c927f6b9ec174f60ee861494db97271ca33874c3e05aa0e1c522089d1bcb30e25b8c6954f320ea145b5f37899c6f6e052502d2af29 EBUILD openldap-2.4.33.ebuild 22317 SHA256 0ce4a04acddb9bc60354329a543b67b41aa7750bff75e1487260df729e32e1fa SHA512 4b094db524df29aaa70bc75aee4aad2dfe87e78c77cd4eb8cd0d7dc227664f82c7b04716e26decf6a8b6f8315c693a417dda812c26844f8d51f97b2559476121 WHIRLPOOL cc3adda366efdf3334d879628b7541cb4650282e6123256a104486c82e678d12a9aad791ee24064da17497b4c9ed8fe32a26d02946747161b4d0efb62502fe6d +EBUILD openldap-2.4.35-r1.ebuild 22450 SHA256 df21de71d506a3abea5dc0f1af2cedf8bcf64205cbf241fcd7808ffd6ec8a77d SHA512 e775f47fa0836e7336da4b86ef5790891789780654e65d26f584afc657c6fb6d28f65706dacbbb4b5afc124e2b499614219bd79a6b256e7074cf08b675b8d474 WHIRLPOOL 0512b44692bb8859b84c4402f3f39c1d3df1eae0e05c183b5d1a36384438a64d5014592660fd590f000a1b558d5189fc486cfef970f3fcfc3b7fdbbaeec90aa2 EBUILD openldap-2.4.35.ebuild 22173 SHA256 8279211f8c3d28164cebf2edf8632820082759e004085c9d993d901237ba2fc4 SHA512 bc30c9303acbecafa727e998e76c513452f0562a9747e00c0d57ae0628fea1627eb684e2474add641e23855d9e8755d4cf50f2925d9d9979dcb5d87045abd7af WHIRLPOOL 20ec8d63012cc19a1c34f217b962f43e8192ce9c54ea08d22e8cc09ce5f980be6b7d78cde07a3edd88bf9188550ad938f2f59e9fc866a7748b3dd5181d3aea0e -MISC ChangeLog 77891 SHA256 cc76a8c288e7b0735ce5d2b5f1dcd44f7e4f53e20b550e77ec8f265e0ff95b92 SHA512 5207162ac55648023c4f2a323ea8d8d4f0fd1f7934aeb881f23d819bfb7a3e0d3b7acee5c5d4cac386576f2c8f9638dafe0dad0f4f6cbfd4a2462470170402ea WHIRLPOOL acee489e0aceafcc5e9066495fc8dd99e10038b2c93487dbcf3d388f59556ab645add99eb7c1649ad68009ecfce6c602598cc913dfa3f82b5a802e414afd982f +MISC ChangeLog 78118 SHA256 81a5672ca76e5a4cf1731070383e4cc7057b81a8c879a9dfeebdc9099b504012 SHA512 a0ad9448a6c2309aea5ca8ab3297ef1bff4685a286e1eb4176b43b17f2e482baf7a5a062012beeb18add24ee0cd68fb81ff5a8c4817ef92459639d94558d9af7 WHIRLPOOL caf3209b0dac27d811254cfc3a0f59e191f0ee7b218b8dc09c92c14c1d2891ecbe76c069d6e06cb6b021ca10428a5f058f422d219769769bc5b3216c62f254c8 MISC metadata.xml 664 SHA256 70c2b3ca29517c6cafffef5802fcd6a513517d320a118bf2205b0033ffa384ea SHA512 55e576a18ae7c71f3fa413b252a40945059d9f9308f4036739124bd241cc6c409816124c7e4fd30df965963d93907bce03ee117489fdb3443e62bf00dac9da25 WHIRLPOOL ce3c30df03e9026415bd72d5f3c132bb3273a597a6ca8e8928957baae1b4bc6d80ab8f7f0698d72cd8d5773a957ee2a929d3c2bdd4f5a6cd6ba88f9b9e0aa4c7 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.20 (GNU/Linux) + +iEYEAREIAAYFAlI6FB8ACgkQCaWpQKGI+9Q/pwCfRn6Z7ctbYNPGbOF8vlVyrXa0 +GDYAnRbHsltzMQYES+WYxZR70dxXQqx5 +=SeYe +-----END PGP SIGNATURE----- diff --git a/net-nds/openldap/files/slapd.service b/net-nds/openldap/files/slapd.service new file mode 100644 index 000000000000..a4df4c485155 --- /dev/null +++ b/net-nds/openldap/files/slapd.service @@ -0,0 +1,12 @@ +[Unit] +Description=OpenLDAP Server Daemon +After=network.target + +[Service] +Type=forking +PIDFile=/var/run/openldap/slapd.pid +ExecStartPre=/usr/sbin/slaptest -Q -u $SLAPD_OPTIONS +ExecStart=/usr/lib/openldap/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS + +[Install] +WantedBy=multi-user.target diff --git a/net-nds/openldap/files/slapd.service.conf b/net-nds/openldap/files/slapd.service.conf new file mode 100644 index 000000000000..812ea68ed475 --- /dev/null +++ b/net-nds/openldap/files/slapd.service.conf @@ -0,0 +1,12 @@ +[Service] +# Use the classical configuration file: +#Environment="SLAPD_OPTIONS=-f /etc/openldap/slapd.conf" +# Use the slapd configuration directory: +#Environment="SLAPD_OPTIONS=-F /etc/openldap/slapd.d" + +Environment="SLAPD_URLS=ldaps:/// ldap:/// ldapi:///" +# Other examples: +#Environment="SLAPD_URLS=ldap://127.0.0.1/ ldap://10.0.0.1:1389/ cldap:///" + +# Specify the kerberos keytab file +#Environment=KRB5_KTNAME=/etc/openldap/krb5-ldap.keytab diff --git a/net-nds/openldap/files/slapd.tmpfilesd b/net-nds/openldap/files/slapd.tmpfilesd new file mode 100644 index 000000000000..56aa32eed6ef --- /dev/null +++ b/net-nds/openldap/files/slapd.tmpfilesd @@ -0,0 +1,2 @@ +# openldap runtime directory for slapd.arg and slapd.pid +d /var/run/openldap 0755 ldap ldap - diff --git a/net-nds/openldap/openldap-2.4.35-r1.ebuild b/net-nds/openldap/openldap-2.4.35-r1.ebuild new file mode 100644 index 000000000000..f39e4812d650 --- /dev/null +++ b/net-nds/openldap/openldap-2.4.35-r1.ebuild @@ -0,0 +1,675 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-nds/openldap/openldap-2.4.35-r1.ebuild,v 1.1 2013/09/18 20:59:10 pacho Exp $ + +EAPI="4" + +inherit db-use eutils flag-o-matic multilib ssl-cert versionator toolchain-funcs autotools systemd + +BIS_PN=rfc2307bis.schema +BIS_PV=20120525 +BIS_P="${BIS_PN}-${BIS_PV}" + +DESCRIPTION="LDAP suite of application and development tools" +HOMEPAGE="http://www.OpenLDAP.org/" +SRC_URI="mirror://openldap/openldap-release/${P}.tgz + mirror://gentoo/${BIS_P}" + +LICENSE="OPENLDAP" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris" + +IUSE_DAEMON="crypt icu samba slp tcpd experimental minimal" +IUSE_BACKEND="+berkdb" +IUSE_OVERLAY="overlays perl" +IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux" +IUSE_CONTRIB="smbkrb5passwd kerberos" +IUSE_CONTRIB="${IUSE_CONTRIB} -cxx" +IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}" + +REQUIRED_USE="cxx? ( sasl )" + +# openssl is needed to generate lanman-passwords required by samba +RDEPEND="icu? ( dev-libs/icu ) + ssl? ( !gnutls? ( dev-libs/openssl ) + gnutls? ( net-libs/gnutls dev-libs/libgcrypt ) ) + sasl? ( dev-libs/cyrus-sasl ) + !minimal? ( + sys-devel/libtool + tcpd? ( sys-apps/tcp-wrappers ) + odbc? ( !iodbc? ( dev-db/unixODBC ) + iodbc? ( dev-db/libiodbc ) ) + slp? ( net-libs/openslp ) + perl? ( dev-lang/perl[-build(-)] ) + samba? ( dev-libs/openssl ) + berkdb? ( sys-libs/db ) + smbkrb5passwd? ( + dev-libs/openssl + app-crypt/heimdal ) + kerberos? ( virtual/krb5 ) + cxx? ( dev-libs/cyrus-sasl ) + ) + selinux? ( sec-policy/selinux-ldap )" +DEPEND="${RDEPEND} + sys-apps/groff" + +# for tracking versions +OPENLDAP_VERSIONTAG=".version-tag" +OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data" + +openldap_filecount() { + local dir="$1" + find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG.example' | wc -l +} + +openldap_find_versiontags() { + # scan for all datadirs + openldap_datadirs="" + if [ -f "${EROOT}"/etc/openldap/slapd.conf ]; then + openldap_datadirs="$(awk '{if($1 == "directory") print $2 }' ${EROOT}/etc/openldap/slapd.conf)" + fi + openldap_datadirs="${openldap_datadirs} ${OPENLDAP_DEFAULTDIR_VERSIONTAG}" + + einfo + einfo "Scanning datadir(s) from slapd.conf and" + einfo "the default installdir for Versiontags" + einfo "(${OPENLDAP_DEFAULTDIR_VERSIONTAG} may appear twice)" + einfo + + # scan datadirs if we have a version tag + openldap_found_tag=0 + have_files=0 + for each in ${openldap_datadirs}; do + CURRENT_TAGDIR=${ROOT}`echo ${each} | sed "s:\/::"` + CURRENT_TAG=${CURRENT_TAGDIR}/${OPENLDAP_VERSIONTAG} + if [ -d ${CURRENT_TAGDIR} ] && [ ${openldap_found_tag} == 0 ] ; then + einfo "- Checking ${each}..." + if [ -r ${CURRENT_TAG} ] ; then + # yey, we have one :) + einfo " Found Versiontag in ${each}" + source ${CURRENT_TAG} + if [ "${OLDPF}" == "" ] ; then + eerror "Invalid Versiontag found in ${CURRENT_TAGDIR}" + eerror "Please delete it" + eerror + die "Please kill the invalid versiontag in ${CURRENT_TAGDIR}" + fi + + OLD_MAJOR=`get_version_component_range 2-3 ${OLDPF}` + + [ $(openldap_filecount ${CURRENT_TAGDIR}) -gt 0 ] && have_files=1 + + # are we on the same branch? + if [ "${OLD_MAJOR}" != "${PV:0:3}" ] ; then + ewarn " Versiontag doesn't match current major release!" + if [[ "${have_files}" == "1" ]] ; then + eerror " Versiontag says other major and you (probably) have datafiles!" + echo + openldap_upgrade_howto + else + einfo " No real problem, seems there's no database." + fi + else + einfo " Versiontag is fine here :)" + fi + else + einfo " Non-tagged dir ${each}" + [ $(openldap_filecount ${each}) -gt 0 ] && have_files=1 + if [[ "${have_files}" == "1" ]] ; then + einfo " EEK! Non-empty non-tagged datadir, counting `ls -a ${each} | wc -l` files" + echo + + eerror + eerror "Your OpenLDAP Installation has a non tagged datadir that" + eerror "possibly contains a database at ${CURRENT_TAGDIR}" + eerror + eerror "Please export data if any entered and empty or remove" + eerror "the directory, installation has been stopped so you" + eerror "can take required action" + eerror + eerror "For a HOWTO on exporting the data, see instructions in the ebuild" + eerror + openldap_upgrade_howto + die "Please move the datadir ${CURRENT_TAGDIR} away" + fi + fi + einfo + fi + done + [ "${have_files}" == "1" ] && einfo "DB files present" || einfo "No DB files present" + + # Now we must check for the major version of sys-libs/db linked against. + SLAPD_PATH=${EROOT}/usr/$(get_libdir)/openldap/slapd + if [ "${have_files}" == "1" -a -f "${SLAPD_PATH}" ]; then + OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \ + | awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')" + NEWVER="$(use berkdb && db_findver sys-libs/db)" + local fail=0 + if [ -z "${OLDVER}" -a -z "${NEWVER}" ]; then + : + # Nothing wrong here. + elif [ -z "${OLDVER}" -a -n "${NEWVER}" ]; then + eerror " Your existing version of OpenLDAP was not built against" + eerror " any version of sys-libs/db, but the new one will build" + eerror " against ${NEWVER} and your database may be inaccessible." + echo + fail=1 + elif [ -n "${OLDVER}" -a -z "${NEWVER}" ]; then + eerror " Your existing version of OpenLDAP was built against" + eerror " sys-libs/db:${OLDVER}, but the new one will not be" + eerror " built against any version and your database may be" + eerror " inaccessible." + echo + fail=1 + elif [ "${OLDVER}" != "${NEWVER}" ]; then + eerror " Your existing version of OpenLDAP was built against" + eerror " sys-libs/db:${OLDVER}, but the new one will build against" + eerror " ${NEWVER} and your database would be inaccessible." + echo + fail=1 + fi + [ "${fail}" == "1" ] && openldap_upgrade_howto + fi + + echo + einfo + einfo "All datadirs are fine, proceeding with merge now..." + einfo +} + +openldap_upgrade_howto() { + eerror + eerror "A (possible old) installation of OpenLDAP was detected," + eerror "installation will not proceed for now." + eerror + eerror "As major version upgrades can corrupt your database," + eerror "you need to dump your database and re-create it afterwards." + eerror + eerror "Additionally, rebuilding against different major versions of the" + eerror "sys-libs/db libraries will cause your database to be inaccessible." + eerror "" + d="$(date -u +%s)" + l="/root/ldapdump.${d}" + i="${l}.raw" + eerror " 1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop" + eerror " 2. slapcat -l ${i}" + eerror " 3. egrep -v '^(entry|context)CSN:' <${i} >${l}" + eerror " 4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/" + eerror " 5. emerge --update \=net-nds/${PF}" + eerror " 6. etc-update, and ensure that you apply the changes" + eerror " 7. slapadd -l ${l}" + eerror " 8. chown ldap:ldap /var/lib/openldap-data/*" + eerror " 9. /etc/init.d/slapd start" + eerror "10. check that your data is intact." + eerror "11. set up the new replication system." + eerror + if [ "${FORCE_UPGRADE}" != "1" ]; then + die "You need to upgrade your database first" + else + eerror "You have the magical FORCE_UPGRADE=1 in place." + eerror "Don't say you weren't warned about data loss." + fi +} + +pkg_setup() { + if ! use sasl && use cxx ; then + die "To build the ldapc++ library you must emerge openldap with sasl support" + fi + # Bug #322787 + if use minimal && ! has_version "net-nds/openldap" ; then + einfo "No datadir scan needed, openldap not installed" + elif use minimal && has_version "net-nds/openldap" && built_with_use net-nds/openldap minimal ; then + einfo "Skipping scan for previous datadirs as requested by minimal useflag" + else + openldap_find_versiontags + fi + + enewgroup ldap 439 + enewuser ldap 439 -1 /usr/$(get_libdir)/openldap ldap +} + +src_prepare() { + # ensure correct SLAPI path by default + sed -i -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \ + "${S}"/include/ldap_defaults.h + + epatch "${FILESDIR}"/${PN}-2.4.17-gcc44.patch + + epatch \ + "${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch \ + "${FILESDIR}"/${PN}-2.4.15-ppolicy.patch + + # bug #116045 - still present in 2.4.28 + epatch "${FILESDIR}"/${PN}-2.4.35-contrib-smbk5pwd.patch + # bug #408077 - samba4 + epatch "${FILESDIR}"/${PN}-2.4.35-contrib-samba4.patch + + # bug #189817 + epatch "${FILESDIR}"/${PN}-2.4.11-libldap_r.patch + + # bug #233633 + epatch "${FILESDIR}"/${PN}-2.4.17-fix-lmpasswd-gnutls-symbols.patch + + # bug #281495 + epatch "${FILESDIR}"/${PN}-2.4.28-gnutls-gcrypt.patch + + # bug #294350 + epatch "${FILESDIR}"/${PN}-2.4.6-evolution-ntlm.patch + + # unbreak /bin/sh -> dash + epatch "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch + + # bug #420959 + epatch "${FILESDIR}"/${PN}-2.4.31-gcc47.patch + + # bug #421463 + epatch "${FILESDIR}"/${PN}-2.4.33-gnutls.patch + + 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" + + # wrong assumption that /bin/sh is /bin/bash + sed -i \ + -e 's|/bin/sh|/bin/bash|g' \ + "${S}"/tests/scripts/* || die "sed failed" + + cd "${S}" + AT_NOEAUTOMAKE=yes eautoreconf +} + +build_contrib_module() { + lt="${S}/libtool" + # <dir> <sources> <outputname> + cd "${S}/contrib/slapd-modules/$1" + einfo "Compiling contrib-module: $3" + # Make sure it's uppercase + local define_name="$(echo "SLAPD_OVER_${1}" | LC_ALL=C tr '[:lower:]' '[:upper:]')" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -D${define_name}=SLAPD_MOD_DYNAMIC \ + -I../../../include -I../../../servers/slapd ${CFLAGS} \ + -o ${2%.c}.lo -c $2 || die "compiling $3 failed" + einfo "Linking contrib-module: $3" + "${lt}" --mode=link --tag=CC \ + "${CC}" -module \ + ${CFLAGS} \ + ${LDFLAGS} \ + -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ + -o $3.la ${2%.c}.lo || die "linking $3 failed" +} + +src_configure() { + local myconf + + #Fix for glibc-2.8 and ucred. Bug 228457. + append-flags -D_GNU_SOURCE + + # Bug 408001 + use elibc_FreeBSD && append-flags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync + + use debug && myconf="${myconf} $(use_enable debug)" + + # ICU usage is not configurable + export ac_cv_header_unicode_utypes_h="$(use icu && echo yes || echo no)" + + if ! use minimal ; then + # re-enable serverside overlay chains per bug #296567 + # see ldap docs chaper 12.3.1 for details + myconf="${myconf} --enable-ldap" + + # 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) + 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)" + + myconf="${myconf} $(use_enable odbc sql mod)" + if use odbc ; then + local odbc_lib="unixodbc" + if use iodbc ; then + odbc_lib="iodbc" + append-cppflags -I"${EPREFIX}"/usr/include/iodbc + fi + myconf="${myconf} --with-odbc=${odbc_lib}" + fi + + # slapd options + myconf="${myconf} $(use_enable crypt) $(use_enable slp)" + myconf="${myconf} $(use_enable samba lmpasswd) $(use_enable syslog)" + 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 --disable-syslog" + 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; do + myconf="${myconf} --enable-${basicflag}" + done + + # connectionless ldap per bug #342439 + append-cppflags -DLDAP_CONNECTIONLESS + + tc-export CC AR CXX + STRIP=/bin/true \ + econf \ + --libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \ + ${myconf} || die "econf failed" +} + +src_configure_cxx() { + # This needs the libraries built by the first build run. + # So we have to run it AFTER the main build, not just after the main + # configure. + if ! use minimal ; then + if use cxx ; then + local myconf_ldapcpp + myconf_ldapcpp="${myconf_ldapcpp} --with-ldap-includes=../../include" + cd "${S}/contrib/ldapc++" + OLD_LDFLAGS="$LDFLAGS" + OLD_CPPFLAGS="$CPPFLAGS" + append-ldflags -L../../libraries/liblber/.libs -L../../libraries/libldap/.libs + append-ldflags -L../../../libraries/liblber/.libs -L../../../libraries/libldap/.libs + append-cppflags -I../../../include + econf ${myconf_ldapcpp} \ + CC="${CC}" \ + CXX="${CXX}" \ + || die "econf ldapc++ failed" + CPPFLAGS="$OLD_CPPFLAGS" + LDFLAGS="${OLD_LDFLAGS}" + fi + fi +} + +src_compile() { + emake depend || die "emake depend failed" + emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/bash || die "emake failed" + lt="${S}/libtool" + export echo="echo" + + if ! use minimal ; then + if use cxx ; then + einfo "Building contrib library: ldapc++" + src_configure_cxx + cd "${S}/contrib/ldapc++" + emake \ + CC="${CC}" CXX="${CXX}" \ + || die "emake ldapc++ failed" + fi + + if use smbkrb5passwd ; then + einfo "Building contrib-module: smbk5pwd" + cd "${S}/contrib/slapd-modules/smbk5pwd" + + emake \ + DEFS="-DDO_SAMBA -DDO_KRB5 -DDO_SHADOW" \ + KRB5_INC="$(krb5-config --cflags)" \ + CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \ + || die "emake smbk5pwd failed" + fi + + if use overlays ; then + einfo "Building contrib-module: samba4" + cd "${S}/contrib/slapd-modules/samba4" + + emake \ + CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap" \ + || die "emake samba4 failed" + fi + + if use kerberos ; then + cd "${S}/contrib/slapd-modules/passwd" + einfo "Compiling contrib-module: pw-kerberos" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I../../../include \ + ${CFLAGS} \ + $(krb5-config --cflags) \ + -DHAVE_KRB5 \ + -o kerberos.lo \ + -c kerberos.c || die "compiling pw-kerberos failed" + einfo "Linking contrib-module: pw-kerberos" + "${lt}" --mode=link --tag=CC \ + "${CC}" -module \ + ${CFLAGS} \ + ${LDFLAGS} \ + -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ + -o pw-kerberos.la \ + kerberos.lo || die "linking pw-kerberos failed" + fi + # We could build pw-radius if GNURadius would install radlib.h + cd "${S}/contrib/slapd-modules/passwd" + einfo "Compiling contrib-module: pw-netscape" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I../../../include \ + ${CFLAGS} \ + -o netscape.lo \ + -c netscape.c || die "compiling pw-netscape failed" + einfo "Linking contrib-module: pw-netscape" + "${lt}" --mode=link --tag=CC \ + "${CC}" -module \ + ${CFLAGS} \ + ${LDFLAGS} \ + -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ + -o pw-netscape.la \ + netscape.lo || die "linking pw-netscape failed" + + build_contrib_module "addpartial" "addpartial-overlay.c" "addpartial-overlay" + build_contrib_module "allop" "allop.c" "overlay-allop" + build_contrib_module "allowed" "allowed.c" "allowed" + build_contrib_module "autogroup" "autogroup.c" "autogroup" + build_contrib_module "denyop" "denyop.c" "denyop-overlay" + build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin" + # lastmod may not play well with other overlays + build_contrib_module "lastmod" "lastmod.c" "lastmod" + build_contrib_module "nops" "nops.c" "nops-overlay" + build_contrib_module "trace" "trace.c" "trace" + # build slapi-plugins + cd "${S}/contrib/slapi-plugins/addrdnvalues" + einfo "Building contrib-module: addrdnvalues plugin" + "${CC}" -shared \ + -I../../../include \ + ${CFLAGS} \ + -fPIC \ + ${LDFLAGS} \ + -o libaddrdnvalues-plugin.so \ + addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed" + + fi +} + +src_test() { + cd tests ; make tests || die "make tests failed" +} + +src_install() { + lt="${S}/libtool" + emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/bash install || die "make install failed" + + dodoc ANNOUNCEMENT CHANGES COPYRIGHT README "${FILESDIR}"/DB_CONFIG.fast.example + docinto rfc ; dodoc doc/rfc/*.txt + + if ! use minimal; then + # openldap modules go here + # TODO: write some code to populate slapd.conf with moduleload statements + keepdir /usr/$(get_libdir)/openldap/openldap/ + + # initial data storage dir + keepdir /var/lib/openldap-data + use prefix || fowners ldap:ldap /var/lib/openldap-data + fperms 0700 /var/lib/openldap-data + + echo "OLDPF='${PF}'" > "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}" + echo "# do NOT delete this. it is used" >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}" + echo "# to track versions for upgrading." >> "${ED}${OPENLDAP_DEFAULTDIR_VERSIONTAG}/${OPENLDAP_VERSIONTAG}" + + # use our config + rm "${ED}"etc/openldap/slapd.conf + insinto /etc/openldap + newins "${FILESDIR}"/${PN}-2.3.34-slapd-conf slapd.conf + configfile="${ED}"etc/openldap/slapd.conf + + # populate with built backends + ebegin "populate config with built backends" + for x in "${ED}"usr/$(get_libdir)/openldap/openldap/back_*.so; do + elog "Adding $(basename ${x})" + sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" + done + sed -e "s:###INSERTDYNAMICMODULESHERE###$:# modulepath\t${EPREFIX}/usr/$(get_libdir)/openldap/openldap:" -i "${configfile}" + use prefix || fowners root:ldap /etc/openldap/slapd.conf + fperms 0640 /etc/openldap/slapd.conf + cp "${configfile}" "${configfile}".default + eend + + # install our own init scripts and systemd unit files + newinitd "${FILESDIR}"/slapd-initd-2.4.28-r1 slapd + newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd + systemd_dounit "${FILESDIR}"/slapd.service + systemd_install_serviced "${FILESDIR}"/slapd.service.conf + systemd_newtmpfilesd "${FILESDIR}"/slapd.tmpfilesd slapd.conf + + if [ $(get_libdir) != lib ]; then + sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i \ + "${ED}"/etc/init.d/slapd \ + "${ED}"/usr/lib/systemd/system/slapd.service || die + fi + # If built without SLP, we don't need to be before avahi + use slp \ + || sed -i \ + -e '/before/{s/avahi-daemon//g}' \ + "${ED}"etc/init.d/slapd + + if use cxx ; then + einfo "Install the ldapc++ library" + cd "${S}/contrib/ldapc++" + emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install || die "emake install ldapc++ failed" + newdoc README ldapc++-README + fi + + if use smbkrb5passwd ; then + einfo "Install the smbk5pwd module" + cd "${S}/contrib/slapd-modules/smbk5pwd" + emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install || die "emake install smbk5pwd failed" + newdoc README smbk5pwd-README + fi + + if use overlays ; then + einfo "Install the samba4 module" + cd "${S}/contrib/slapd-modules/samba4" + emake DESTDIR="${D}" libexecdir="/usr/$(get_libdir)/openldap" install || die "emake install samba4 failed" + newdoc README samba4-README + fi + + einfo "Installing contrib modules" + cd "${S}/contrib/slapd-modules" + for l in */*.la; do + "${lt}" --mode=install cp ${l} \ + "${ED}"usr/$(get_libdir)/openldap/openldap || \ + die "installing ${l} failed" + done + docinto contrib + newdoc addpartial/README addpartial-README + newdoc allop/README allop-README + doman allop/slapo-allop.5 + newdoc autogroup/README autogroup-README + 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 + cd "${S}/contrib/slapi-plugins" + insinto /usr/$(get_libdir)/openldap/openldap + doins */*.so + docinto contrib + newdoc addrdnvalues/README addrdnvalues-README + + insinto /etc/openldap/schema + newins "${DISTDIR}"/${BIS_P} ${BIS_PN} + fi +} + +pkg_preinst() { + # keep old libs if any + preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 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 + use prefix || chown ldap:ldap "${EROOT}"etc/openldap/ssl/ldap.* + ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]" + ewarn "Self-signed SSL certificates are treated harshly by OpenLDAP 2.[12]" + ewarn "add 'TLS_REQCERT never' if you want to use them." + fi + + if use prefix; then + # Warn about prefix issues with slapd + eerror "slapd might NOT be usable on Prefix systems as it requires root privileges" + eerror "to start up, and requires that certain files directories be owned by" + eerror "ldap:ldap. As Prefix does not support changing ownership of files and" + eerror "directories, you will have to manually fix this yourself." + fi + + # These lines force the permissions of various content to be correct + use prefix || chown ldap:ldap "${EROOT}"var/run/openldap + chmod 0755 "${EROOT}"var/run/openldap + use prefix || chown root:ldap "${EROOT}"etc/openldap/slapd.conf{,.default} + chmod 0640 "${EROOT}"etc/openldap/slapd.conf{,.default} + use prefix || chown ldap:ldap "${EROOT}"var/lib/openldap-data + fi + + 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 "DB_CONFIG.fast.example in /usr/share/doc/${PF}/" + + preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0) +} |