diff options
author | Patrick Lauer <patrick@gentoo.org> | 2013-09-13 02:30:55 +0000 |
---|---|---|
committer | Patrick Lauer <patrick@gentoo.org> | 2013-09-13 02:30:55 +0000 |
commit | cdf11c85e6d88f2079e665e98cd7010f0006f85e (patch) | |
tree | a63227a26317070e716a337d1c516d20c359435a /net-nds/openldap | |
parent | Remove unneeded useflag description from metadata.xml (diff) | |
download | historical-cdf11c85e6d88f2079e665e98cd7010f0006f85e.tar.gz historical-cdf11c85e6d88f2079e665e98cd7010f0006f85e.tar.bz2 historical-cdf11c85e6d88f2079e665e98cd7010f0006f85e.zip |
Backport connection-hang-fix from 2.4
Package-Manager: portage-2.2.3/cvs/Linux x86_64
Diffstat (limited to 'net-nds/openldap')
-rw-r--r-- | net-nds/openldap/ChangeLog | 8 | ||||
-rw-r--r-- | net-nds/openldap/Manifest | 24 | ||||
-rw-r--r-- | net-nds/openldap/files/openldap-2.3.43-fix-hang.patch | 19 | ||||
-rw-r--r-- | net-nds/openldap/openldap-2.3.43-r4.ebuild | 546 |
4 files changed, 575 insertions, 22 deletions
diff --git a/net-nds/openldap/ChangeLog b/net-nds/openldap/ChangeLog index 81e0e406f813..8094d46e0bed 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.441 2013/09/06 18:34:29 ago Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-nds/openldap/ChangeLog,v 1.442 2013/09/13 02:30:45 patrick Exp $ + +*openldap-2.3.43-r4 (13 Sep 2013) + + 13 Sep 2013; Patrick Lauer <patrick@gentoo.org> + +files/openldap-2.3.43-fix-hang.patch, +openldap-2.3.43-r4.ebuild: + Backport connection-hang-fix from 2.4 06 Sep 2013; Agostino Sarubbo <ago@gentoo.org> openldap-2.4.35.ebuild: Stable for sparc, wrt bug #480304 diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest index 1494135ad2a6..588938e196e8 100644 --- a/net-nds/openldap/Manifest +++ b/net-nds/openldap/Manifest @@ -1,6 +1,3 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA512 - 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 @@ -8,6 +5,7 @@ AUX openldap-2.3.21-ppolicy.patch 402 SHA256 97feaaff03e839aaad402024082ba62fb2c AUX openldap-2.3.24-contrib-smbk5pwd.patch 1631 SHA256 277990c6bc9e00c29bc5123d5074e1a741a224e884f92651b301375b02edc70e SHA512 7aaab44cdf84233bfd78555db3af7c5a435cb3f37cb8f243b57b32391381835ce1efff7604f80cdf58fee429f6ecedc486f88addec15b6d32ef78f526c6c8826 WHIRLPOOL fbb14366c31ff97b9a706b9ceb0073e45affcf513a1c58966548537dfa3d3185ce5d8f0b38b627a5a729a3084b38f5681565bea2c46d369179879223e66adc37 AUX openldap-2.3.34-slapd-conf 2067 SHA256 f7611233b83fa70dac313b4e734041dfe1ddac07c804bdb12a775d7cf88c36a1 SHA512 fa1c6051c8285cd8f91dd236289a7492efd30fe172d269b35a4941945623f87fd4ff0c8b47dae36e55e395e4d931cf680ab15c5f44fd7279be686678661971aa WHIRLPOOL 55384866d25d016a6135b443e9b25a8a321118a4e33214950f7f3ea51c357ba5a4b335d2f77aa941c04ebfd6131fcf48c87f29df8dc4fe685bad9f3aae61642a AUX openldap-2.3.37-libldap_r.patch 862 SHA256 82471cc13806a9260e441aea90c8dfe9ce21b6d3edabb71766a2afcff6f80dfb SHA512 b49260b4a1583e1084f695e55e80aa90b301c9d56cd9cc04f0a78c0beb2e7d645e4b2163cae2be940f3918802b5d766e30f8550fd7fe723f365829c415fe364c WHIRLPOOL b22350b4ee9a3505b7b78ae915e82d3c84b19e7140047733cecd37818c57606097bd5d199d670ecf0d3bc350c08703bcaa126ed359b7930ab0a9b58e66f4aa50 +AUX openldap-2.3.43-fix-hang.patch 645 SHA256 48d1f63a303142e535413b3a42e1fdfea89abaf3265de801c147ef3bdcf3c27e SHA512 3cc7f46bd69634844c5fdf893120928e2d8b6c93011aebfb01786608bbb40351fab3f5e346857ab95724d5199b4b0270d56d56c7f1a43be07951f26fb82b018e WHIRLPOOL ddb6314f72a70a92d2cdc96548a8d0f783e97b91c9d71971566d3028d8ef1527b6897e5cdd6557fcd223f317b510dfbd12666c5bce0e8c9f06451e077a766bd5 AUX openldap-2.3.XY-gcc44.patch 1169 SHA256 c799ad2adde0e0801bfd641c1a43860180121a04897b8e2a01ad000ea31e2a8d SHA512 9e7b726b384390dbf85c50cd344b6a614d09823293f1af2642cfb50c25f4f39254ae0b19cd0da0b30e6fbd270f61646487e1643406438bd2ec6b37883b03f9f2 WHIRLPOOL c5881dac9b095c28f3dd75fd71dfada84705bd42d643172389854f0c65e548a0f8721abef50568f63ebd85ac7bfeff68c64703dfdec0f7b42a57b92cf2f95097 AUX openldap-2.4.11-libldap_r.patch 515 SHA256 3310a89d38bc39e6eb4333799d475411b274482b8bccab212b3edfd4385db70e SHA512 44d97efb25d4f39ab10cd5571db43f3bfa7c617a5bb087085ae16c0298aca899b55c8742a502121ba743a73e6d77cd2056bc96cee63d6d0862dabc8fb5574357 WHIRLPOOL f0c115c60a1405bb6d34090d878ba82b454cced4a7718e1132bc8d118032ae656dcd0207640142740ea4f547403edf2b95c97ae2c7f67a2b656b83cb3a508e45 AUX openldap-2.4.15-ppolicy.patch 418 SHA256 98269fa1e8a1a0e62dad9acd36fd9a33614fca9a5830d6e7e606db8eb7f85de5 SHA512 59db36c9b4d16e7ccf4b318af2a8d0c6e29cda7e567641b3bcc6069bb7d610a8ac8b56e16ca72165b3e50841abb1ef693b9e2958f16997ac637554f3a67b7146 WHIRLPOOL ae52ce30b17e0413ee87db55070d64e06e4ab5e14adf96f808a0cfba39c3f946fc5b4e4431d8fc6123c025261acd6a16e2245a1b46e1eb7a131444e5ffc7825f @@ -46,6 +44,7 @@ DIST rfc2307bis.schema-20100722 9718 SHA256 c61c72e04b45d1e774de1e4084fb2a596210 DIST rfc2307bis.schema-20120525 11922 SHA256 41f90e2eafab34925b8223887fa378fc4bbb2801937fdfd3e5a8cf3517229c38 SHA512 cf313fcbbc79d2d1085f7547ed277f58605d931592d70298204f80f40092bf6450561162178e23add2fa5baf19c0b8fff82f69fbf9c2fde6744e9f29f4dac699 WHIRLPOOL b5dd02f0a5ab183b2f981995d886a6e193ec37c0247195a5eb30bc622aa8762130a053f6cad76923bffd55635e0c4e0904aabf0c1124dc9d69080d33f3f53e1c EBUILD openldap-2.3.43-r1.ebuild 18090 SHA256 aae9a6a1eac2e8ade42e262e4aabe9c5a363e4149a08253d500f2b4194d0e760 SHA512 73245ce0081b52bc9be58142c9640b1c2965a0cd433b26871e9852fbb70e37e89f5583f6ba3be9ab0549f7c5d97d6f9760689326896a746fa6a2e2949d5a1260 WHIRLPOOL 84bbe8da6ab7bb10e6c4b434f6afbf58209d3167226a6d08d1cdf0115a55802a11d8116cdf784fdb8ba3cae83335e17a5e86517f1232e6d0e53b8d51f3363389 EBUILD openldap-2.3.43-r3.ebuild 18089 SHA256 0cd0fa41bda28541c502aa4b9f195fdc5645c6496d75190956f74d9509833ed4 SHA512 9f8b8227840afe053de34255851c5ca65adca4621d147f8424023a29e13115e8cf6abb9b60d494b0eaa2a860252c010b67771a273b5e90de4bafbab04b7ebc1a WHIRLPOOL 85a1734e6fe638e1bbcb673f3607bca08d747d5a4d9f3185800e0eb2fefd954e2594feeaf6743bd93209ba07f438c7984c418f9b520045ac04b4a91add90a9f5 +EBUILD openldap-2.3.43-r4.ebuild 18292 SHA256 5b166082ffdf4ec5671e46328a06c42b07620c0a1de736beeb39e5afa97dc9f2 SHA512 cb6aa7e6970bfa909b412df65cdda44f8935136f8bd7365b05f7660e494dac7d2ff909c093d0ce36712b29ce8a5e908ae2192c569709710665501cb027140294 WHIRLPOOL 1c8423aec0338c95218df378f678b8c649137e8b581293341c9b99d72cc4cdd7b3585e92cdb2e04f3ff41ffb945ab0de069fd416decb2a9f97ef059059539a7d EBUILD openldap-2.4.19-r1.ebuild 19739 SHA256 b13cfe7371e4e139e92b74461bba139cd7202d613a416198fcdb5dbacb65e527 SHA512 33b2550dfbe4eff74cf39de433c5ab6f85f43b0b5ca4ac7ccfe7cc3061cde8acb5bc958ea708881f38e5c7d27bdbc5424a508b21133ec88c3d9bacf17c846741 WHIRLPOOL 5d51de159ae77c61248b8b8c1811f894bf86caf95ca542c16e7dca10ed178944b1fac7b071cffe0acdebfc44362360820423f2c72dde6e3b05303a2638724fd3 EBUILD openldap-2.4.21.ebuild 20075 SHA256 6ece30fb44180dcde40004381a76a75e7f09f8d0cfa64f88e0b354bc83596e23 SHA512 2cb96f28e8209d4562282c28c472c4fc1def4465beab734fa8b09f9ed3abcba88e2026a6f7c53d45aa355c790b7d5714bbb2923fe014c6179712d6868400e07a WHIRLPOOL 22bf233bd84562354b8e16c5940c99508b19a9e1ebf9a96d940953bb7c82f6e39d18d72cfd86191272bfc947fccfe186fc8589ec0c2a822ffb058bb4bb3a5978 EBUILD openldap-2.4.23.ebuild 20064 SHA256 be49b6abea0bbf5cb25179ffe4afb793617507915dc4d3fed213275ccb352e21 SHA512 fab787cd8a65223fd10b97fc36e9322d829d27fc90e530c0e9aaedd9b668689169aeeb59f20300a2a2e12b741ed49ada4946a039e05c77857574205db07768f6 WHIRLPOOL 8520f30d6abd3ef8ee6afe9d69448f861bf1e478131c805c8e40873abe99ed6f6c160a2700d6cdcc92719247f8a5ff038d8ccc5c81837b4cc584a9cc8add170f @@ -62,22 +61,5 @@ EBUILD openldap-2.4.33-r1.ebuild 22128 SHA256 ff2b9a7d59b468f696156d91957b210fb0 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.ebuild 22173 SHA256 8279211f8c3d28164cebf2edf8632820082759e004085c9d993d901237ba2fc4 SHA512 bc30c9303acbecafa727e998e76c513452f0562a9747e00c0d57ae0628fea1627eb684e2474add641e23855d9e8755d4cf50f2925d9d9979dcb5d87045abd7af WHIRLPOOL 20ec8d63012cc19a1c34f217b962f43e8192ce9c54ea08d22e8cc09ce5f980be6b7d78cde07a3edd88bf9188550ad938f2f59e9fc866a7748b3dd5181d3aea0e -MISC ChangeLog 77574 SHA256 7e16db1eb8c91893a1aa008823b529780e4fd1a8322112c5749ad0574490b7a5 SHA512 a89fef5439ab1fead0dca47d5433d238ff80481594a9a2da3852ed101867ed727c072c1d52a96a4e54473bc5175136d847e8841fb5010f3474fdfeacde0e454e WHIRLPOOL f546647d020d86bbfe920c7cd0a63d69324726224b0095b9fb4fe0aa1442ebb5f9e5772347494728455161a92252cee5c93a70d35d732e56fadcd9a00ff0234f +MISC ChangeLog 77773 SHA256 abccfaacdc85932705bc609adfa358f1e690aa1ad3fc6b49aa06658ed7b955cc SHA512 6fcc224faca0fbf9926fca580c2f2020d76024ed7fdef96d0d11c26b641d5d25670a07e656aadee5df2100a8e58052dc55a9389cc5b7ba3b5a343acab64111e9 WHIRLPOOL 3e2f5879f337a62e78560081e1a9995f019d81a2352d08b6588ad6e62953c464897be2296f3a784f569b99014ff81c3ebd790d4434b97507148c5c9bf5375337 MISC metadata.xml 664 SHA256 70c2b3ca29517c6cafffef5802fcd6a513517d320a118bf2205b0033ffa384ea SHA512 55e576a18ae7c71f3fa413b252a40945059d9f9308f4036739124bd241cc6c409816124c7e4fd30df965963d93907bce03ee117489fdb3443e62bf00dac9da25 WHIRLPOOL ce3c30df03e9026415bd72d5f3c132bb3273a597a6ca8e8928957baae1b4bc6d80ab8f7f0698d72cd8d5773a957ee2a929d3c2bdd4f5a6cd6ba88f9b9e0aa4c7 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.20 (GNU/Linux) - -iQIcBAEBCgAGBQJSKh9rAAoJELp701BxlEWfIsgQAJJ9dDLX/ctobuA9jL4OpmGc -HutcGH3JQS0/fy2hrk2xPnX09+NB5uZfIpnPkCGun+XrKWNvWm55SRSGqZd+JImv -INkZEi1FP4E3REUHTYKgMkCQLGSPJCiTHo7c0fX0r1a0pHONCpKh0J7qojI4OtJQ -6INxQ5kTll7C264BHOicx2qMk5wsae35LioAE3IWg66sqTEHiB+VNTBNnaeZJLnf -Er7GHfMDEG+Y8Wrr3+j0axnun51RDgXX3j5bLMVuZ2RYph15/PF2oJmqdOmuBYbD -vynSbA+KA9+QXSO/BwUoNuuN3OEqrwoM4BBsSDVLkCAmLAW5Ut2bON04UpiI6MbQ -xPbQiyvaRoQwSc97/6daEcszUfIb/k0hY1Ko0q1ijDUky8cjxq9crTF6S0nGcKUz -mJsQGjTq9rZvToVQqw6xUCIMBkVZq+avkxymLa3F+yttfpwFSVhHR1DUYBpZyMoa -g0I9Z5NjkVj20DK42prwOtcJibismqo4gLhokPzmwm88lHaKMjQCA5AKFX59s39b -Lza1STZexjEoW7CVlJ3BsyzPqO8KTCD/9RU+RA1WXyxYbNGEQUSN5iRNbJeumjzM -4I/gd65yamBCOe81cHPDl63rAM5MHRZYhfIpnsqLV03DCrniGk80uPeIX0USe5fR -cRjrb1YRQU1+kInDwzFn -=JVMH ------END PGP SIGNATURE----- diff --git a/net-nds/openldap/files/openldap-2.3.43-fix-hang.patch b/net-nds/openldap/files/openldap-2.3.43-fix-hang.patch new file mode 100644 index 000000000000..7e1f4457bd94 --- /dev/null +++ b/net-nds/openldap/files/openldap-2.3.43-fix-hang.patch @@ -0,0 +1,19 @@ +commit a3f40e5601c0c522f2bda418374fb415bdcbd75c +Author: Quanah Gibson-Mount <quanah@openldap.org> +Date: Thu Mar 24 02:25:49 2011 +0000 + + sl_busy is used as a boolean so just set it, don't increment it + +diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c +index 2a7a48e..df6d096 100644 +--- a/servers/slapd/daemon.c ++++ b/servers/slapd/daemon.c +@@ -2098,7 +2098,7 @@ slap_listener_activate( + Debug( LDAP_DEBUG_TRACE, "slap_listener_activate(%d): %s\n", + sl->sl_sd, sl->sl_busy ? "busy" : "", 0 ); + +- sl->sl_busy++; ++ sl->sl_busy = 1; + + rc = ldap_pvt_thread_pool_submit( &connection_pool, + slap_listener_thread, (void *) sl ); diff --git a/net-nds/openldap/openldap-2.3.43-r4.ebuild b/net-nds/openldap/openldap-2.3.43-r4.ebuild new file mode 100644 index 000000000000..1a0ba389e703 --- /dev/null +++ b/net-nds/openldap/openldap-2.3.43-r4.ebuild @@ -0,0 +1,546 @@ +# 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.3.43-r4.ebuild,v 1.1 2013/09/13 02:30:45 patrick Exp $ + +EAPI="2" + +WANT_AUTOCONF="latest" +WANT_AUTOMAKE="latest" +AT_M4DIR="./build" +inherit autotools db-use eutils flag-o-matic multilib ssl-cert toolchain-funcs versionator user + +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 ~x86 ~sparc-fbsd ~x86-fbsd" +IUSE="berkdb crypt debug gdbm ipv6 kerberos minimal odbc overlays perl samba sasl slp smbkrb5passwd ssl tcpd selinux" + +# note that the 'samba' USE flag pulling in OpenSSL is NOT an error. OpenLDAP +# uses OpenSSL for LanMan/NTLM hashing (which is used in some enviroments, like +# mine at work)! +# Robin H. Johnson <robbat2@gentoo.org> March 8, 2004 + +RDEPEND="sys-libs/ncurses + tcpd? ( sys-apps/tcp-wrappers ) + ssl? ( dev-libs/openssl ) + sasl? ( dev-libs/cyrus-sasl ) + !minimal? ( + odbc? ( dev-db/unixODBC ) + slp? ( net-libs/openslp ) + perl? ( dev-lang/perl[-build] ) + samba? ( dev-libs/openssl ) + kerberos? ( virtual/krb5 ) + berkdb? ( + || ( sys-libs/db:4.5 + sys-libs/db:4.4 + sys-libs/db:4.3 + >=sys-libs/db-4.2.52_p2-r1:4.2 + ) + ) + !berkdb? ( + gdbm? ( sys-libs/gdbm ) + !gdbm? ( + || ( sys-libs/db:4.5 + sys-libs/db:4.4 + sys-libs/db:4.3 + >=sys-libs/db-4.2.52_p2-r1:4.2 + ) + ) + ) + smbkrb5passwd? ( + dev-libs/openssl + app-crypt/heimdal + ) + ) + selinux? ( sec-policy/selinux-ldap )" +DEPEND="${RDEPEND}" + +# for tracking versions +OPENLDAP_VERSIONTAG=".version-tag" +OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data" + +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 '^(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 +} + +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 + +} + +pkg_setup() { + if has_version "<=dev-lang/perl-5.8.8_rc1" && built_with_use dev-lang/perl minimal ; then + die "You must have a complete (USE='-minimal') Perl install to use the perl backend!" + fi + + if use samba && ! use ssl ; then + eerror "LAN manager passwords need ssl flag set" + die "Please set ssl useflag" + fi + + 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_prepare() { + # According to MDK, the link order needs to be changed so that + # on systems w/ MD5 passwords the system crypt library is used + # (the net result is that "passwd" can be used to change ldap passwords w/ + # proper pam support) + sed -i -e 's/$(SECURITY_LIBS) $(LDIF_LIBS) $(LUTIL_LIBS)/$(LUTIL_LIBS) $(SECURITY_LIBS) $(LDIF_LIBS)/' \ + "${S}"/servers/slapd/Makefile.in + + # supersedes old fix for bug #31202 + EPATCH_OPTS="-p1 -d ${S}" epatch "${FILESDIR}"/${PN}-2.2.14-perlthreadsfix.patch + + # 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_OPTS="-p0 -d ${S}" + + # ximian connector 1.4.7 ntlm patch + epatch "${FILESDIR}"/${PN}-2.2.6-ntlm.patch + + # bug #132263 + epatch "${FILESDIR}"/${PN}-2.3.21-ppolicy.patch + + # bug #189817 + epatch "${FILESDIR}"/${PN}-2.3.37-libldap_r.patch + + # fix up stuff for newer autoconf that simulates autoconf-2.13, but doesn't + # do it perfectly. + cd "${S}"/build + ln -s shtool install + ln -s shtool install.sh + 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" + + # bug #116045 + # patch contrib modules + if ! use minimal ; then + cd "${S}"/contrib + epatch "${FILESDIR}"/${PN}-2.3.24-contrib-smbk5pwd.patch + fi + # Fix gcc-4.4 compat, bug 264761 + epatch "${FILESDIR}/openldap-2.3.XY-gcc44.patch" + + # Backport random-hang fix from 2.4 + # http://www.openldap.org/lists/openldap-technical/201208/msg00120.html + EPATCH_OPTS="" + cd "${S}" + epatch "${FILESDIR}/openldap-2.3.43-fix-hang.patch" +} + +src_configure() { + local myconf + + #Fix for glibc-2.8 and ucred. Bug 228457. + append-flags -D_GNU_SOURCE + + # HDB is only available with BerkDB + myconf_berkdb='--enable-bdb --enable-ldbm-api=berkeley --enable-hdb=mod' + myconf_gdbm='--disable-bdb --enable-ldbm-api=gdbm --disable-hdb' + + use debug && myconf="${myconf} --enable-debug" # there is no disable-debug + + # enable slapd/slurpd servers if not doing a minimal build + if ! use minimal ; then + myconf="${myconf} --enable-slapd --enable-slurpd" + # base backend stuff + myconf="${myconf} --enable-ldbm" + if use berkdb ; then + einfo "Using Berkeley DB for local backend" + myconf="${myconf} ${myconf_berkdb}" + # We need to include the slotted db.h dir for FreeBSD + append-cppflags -I$(db_includedir 4.5 4.4 4.3 4.2 ) + elif use gdbm ; then + einfo "Using GDBM for local backend" + myconf="${myconf} ${myconf_gdbm}" + else + ewarn "Neither gdbm or berkdb USE flags present, falling back to" + ewarn "Berkeley DB for local backend" + myconf="${myconf} ${myconf_berkdb}" + # We need to include the slotted db.h dir for FreeBSD + append-cppflags -I$(db_includedir 4.5 4.4 4.3 4.2 ) + fi + # extra backend stuff + myconf="${myconf} --enable-passwd=mod --enable-phonetic=mod" + myconf="${myconf} --enable-dnssrv=mod --enable-ldap" + myconf="${myconf} --enable-meta=mod --enable-monitor=mod" + myconf="${myconf} --enable-null=mod --enable-shell=mod" + myconf="${myconf} --enable-relay=mod" + myconf="${myconf} $(use_enable perl perl mod)" + myconf="${myconf} $(use_enable odbc sql mod)" + # slapd options + myconf="${myconf} $(use_enable crypt) $(use_enable slp)" + myconf="${myconf} --enable-rewrite --enable-rlookups" + myconf="${myconf} --enable-aci --enable-modules" + myconf="${myconf} --enable-cleartext --enable-slapi" + myconf="${myconf} $(use_enable samba lmpasswd)" + # slapd overlay options + myconf="${myconf} --enable-dyngroup --enable-proxycache" + use overlays && myconf="${myconf} --enable-overlays=mod" + myconf="${myconf} --enable-syncprov" + else + myconf="${myconf} --disable-slapd --disable-slurpd" + myconf="${myconf} --disable-bdb --disable-ldbm" + myconf="${myconf} --disable-hdb --disable-monitor" + myconf="${myconf} --disable-slurpd --disable-overlays" + myconf="${myconf} --disable-relay" + fi + + # basic functionality stuff + myconf="${myconf} --enable-syslog --enable-dynamic" + myconf="${myconf} --enable-local --enable-proctitle" + + myconf="${myconf} $(use_enable ipv6)" + myconf="${myconf} $(use_with sasl cyrus-sasl) $(use_enable sasl spasswd)" + myconf="${myconf} $(use_enable tcpd wrappers) $(use_with ssl tls)" + + if [ $(get_libdir) != "lib" ] ; then + append-ldflags -L/usr/$(get_libdir) + fi + + STRIP=/bin/true \ + econf \ + --enable-static \ + --enable-shared \ + --libexecdir=/usr/$(get_libdir)/openldap \ + ${myconf} || die "configure failed" +} + +src_compile() { + emake depend || die "make depend failed" + emake || die "make failed" + + # openldap/contrib + tc-export CC + if ! use minimal ; then + # dsaschema + einfo "Building contributed dsaschema" + cd "${S}"/contrib/slapd-modules/dsaschema + ${CC} -shared -I../../../include ${CFLAGS} -fPIC \ + -Wall -o libdsaschema-plugin.so dsaschema.c || \ + die "failed to compile dsaschema module" + # kerberos passwd + if use kerberos ; then + einfo "Building contributed pw-kerberos" + cd "${S}"/contrib/slapd-modules/passwd/ && \ + ${CC} -shared -I../../../include ${CFLAGS} -fPIC \ + $(krb5-config --cflags) \ + -DHAVE_KRB5 -o pw-kerberos.so kerberos.c || \ + die "failed to compile kerberos password module" + fi + # netscape mta-md5 password + einfo "Building contributed pw-netscape" + cd "${S}"/contrib/slapd-modules/passwd/ && \ + ${CC} -shared -I../../../include ${CFLAGS} -fPIC \ + -o pw-netscape.so netscape.c || \ + die "failed to compile netscape password module" + # smbk5pwd overlay + # Note: this modules builds, but may not work with + # Gentoo's MIT-Kerberos. It was designed for Heimdal + # Kerberos. + if use smbkrb5passwd ; then + einfo "Building contributed smbk5pwd" + local mydef + local mykrb5inc + mydef="-DDO_SAMBA -DDO_KRB5" + mykrb5inc="$(krb5-config --cflags)" + cd "${S}"/contrib/slapd-modules/smbk5pwd && \ + libexecdir="/usr/$(get_libdir)/openldap" \ + DEFS="${mydef}" KRB5_INC="${mykrb5inc}" emake || \ + die "failed to compile smbk5pwd module" + fi + # addrdnvalues + einfo "Building contributed addrdnvalues" + cd "${S}"/contrib/slapi-plugins/addrdnvalues/ && \ + ${CC} -shared -I../../../include ${CFLAGS} -fPIC \ + -o libaddrdnvalues-plugin.so addrdnvalues.c || \ + die "failed to compile addrdnvalues plugin" + fi +} + +src_test() { + einfo "Doing tests" + 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/ + + # make state directories + local dirlist="data" + if ! use minimal; then + dirlist="${dirlist} slurp ldbm" + fi + for x in ${dirlist}; do + keepdir /var/lib/openldap-${x} + fowners ldap:ldap /var/lib/openldap-${x} + fperms 0700 /var/lib/openldap-${x} + done + + 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}" + + # manually remove /var/tmp references in .la + # because it is packaged with an ancient libtool + #for x in "${D}"/usr/$(get_libdir)/lib*.la; do + # sed -i -e "s:-L${S}[/]*libraries::" ${x} + #done + + # 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.con* + 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 + newinitd "${FILESDIR}"/slurpd-initd slurpd + newconfd "${FILESDIR}"/slapd-confd slapd + + if [ $(get_libdir) != lib ]; then + sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${D}"etc/init.d/{slapd,slurpd} + fi + + # install contributed modules + docinto / + if [ -e "${S}"/contrib/slapd-modules/dsaschema/libdsaschema-plugin.so ]; + then + cd "${S}"/contrib/slapd-modules/dsaschema/ + newdoc README README.contrib.dsaschema + exeinto /usr/$(get_libdir)/openldap/openldap + doexe libdsaschema-plugin.so || \ + die "failed to install dsaschema module" + fi + if [ -e "${S}"/contrib/slapd-modules/passwd/pw-kerberos.so ]; then + cd "${S}"/contrib/slapd-modules/passwd/ + newdoc README README.contrib.passwd + exeinto /usr/$(get_libdir)/openldap/openldap + doexe pw-kerberos.so || \ + die "failed to install kerberos passwd module" + fi + if [ -e "${S}"/contrib/slapd-modules/passwd/pw-netscape.so ]; then + cd "${S}"/contrib/slapd-modules/passwd/ + newdoc README README.contrib.passwd + exeinto /usr/$(get_libdir)/openldap/openldap + doexe "${S}"/contrib/slapd-modules/passwd/pw-netscape.so || \ + die "failed to install Netscape MTA-MD5 passwd module" + fi + if [ -e "${S}"/contrib/slapd-modules/smbk5pwd/.libs/smbk5pwd.so ]; then + cd "${S}"/contrib/slapd-modules/smbk5pwd + newdoc README README.contrib.smbk5pwd + libexecdir="/usr/$(get_libdir)/openldap" \ + emake DESTDIR="${D}" install-mod || \ + die "failed to install smbk5pwd overlay module" + fi + if [ -e "${S}"/contrib/slapd-tools/statslog ]; then + cd "${S}"/contrib/slapd-tools + exeinto /usr/bin + newexe statslog ldapstatslog || \ + die "failed to install ldapstatslog script" + fi + if [ -e "${S}"/contrib/slapi-plugins/addrdnvalues/libaddrdnvalues-plugin.so ]; + then + cd "${S}"/contrib/slapi-plugins/addrdnvalues + newdoc README README.contrib.addrdnvalues + exeinto /usr/$(get_libdir)/openldap/openldap + doexe libaddrdnvalues-plugin.so || \ + die "failed to install addrdnvalues plugin" + fi + fi +} + +pkg_preinst() { + # keep old libs if any + LIBSUFFIXES=".so.2.0.130 -2.2.so.7" + for LIBSUFFIX in ${LIBSUFFIXES} ; do + for each in libldap libldap_r liblber ; do + preserve_old_lib "usr/$(get_libdir)/${each}${LIBSUFFIX}" + done + done +} + +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. + # Additionally, it overwrites + 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,slurp} + fi + + # Reference inclusion bug #77330 + echo + elog + 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 + + # note to bug #110412 + echo + elog + elog "An example file for tuning BDB backends with openldap is" + elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/" + elog + + LIBSUFFIXES=".so.2.0.130 -2.2.so.7" + for LIBSUFFIX in ${LIBSUFFIXES} ; do + for each in liblber libldap libldap_r ; do + preserve_old_lib_notify "usr/$(get_libdir)/${each}${LIBSUFFIX}" + done + done +} |