summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2013-12-06 22:43:42 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2013-12-06 22:43:42 +0000
commitcb4bb1a220443c35e306e71224b316c66fc05c06 (patch)
tree61707f99055e56b5e1693fdb9b5248f614b672e6
parentRemove old (diff)
downloadhistorical-cb4bb1a220443c35e306e71224b316c66fc05c06.tar.gz
historical-cb4bb1a220443c35e306e71224b316c66fc05c06.tar.bz2
historical-cb4bb1a220443c35e306e71224b316c66fc05c06.zip
Bug #485166: dev-lang/perl no longer has USE=build, so update the dep; clean up many older unstablized older versions.
Package-Manager: portage-2.2.7/cvs/Linux x86_64
-rw-r--r--net-nds/openldap/ChangeLog14
-rw-r--r--net-nds/openldap/Manifest28
-rw-r--r--net-nds/openldap/openldap-2.3.43-r1.ebuild540
-rw-r--r--net-nds/openldap/openldap-2.4.21.ebuild613
-rw-r--r--net-nds/openldap/openldap-2.4.25-r1.ebuild621
-rw-r--r--net-nds/openldap/openldap-2.4.25.ebuild613
-rw-r--r--net-nds/openldap/openldap-2.4.28.ebuild621
-rw-r--r--net-nds/openldap/openldap-2.4.31-r1.ebuild672
-rw-r--r--net-nds/openldap/openldap-2.4.31.ebuild669
-rw-r--r--net-nds/openldap/openldap-2.4.32.ebuild672
-rw-r--r--net-nds/openldap/openldap-2.4.33-r1.ebuild666
-rw-r--r--net-nds/openldap/openldap-2.4.33-r2.ebuild669
-rw-r--r--net-nds/openldap/openldap-2.4.33.ebuild672
13 files changed, 14 insertions, 7056 deletions
diff --git a/net-nds/openldap/ChangeLog b/net-nds/openldap/ChangeLog
index 676005d63e74..9b220a54f83e 100644
--- a/net-nds/openldap/ChangeLog
+++ b/net-nds/openldap/ChangeLog
@@ -1,6 +1,18 @@
# 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.449 2013/11/09 15:52:54 pacho Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-nds/openldap/ChangeLog,v 1.450 2013/12/06 22:43:36 robbat2 Exp $
+
+ 06 Dec 2013; Robin H. Johnson <robbat2@gentoo.org> -openldap-2.3.43-r1.ebuild,
+ -openldap-2.4.21.ebuild, -openldap-2.4.25-r1.ebuild, -openldap-2.4.25.ebuild,
+ -openldap-2.4.28.ebuild, -openldap-2.4.31-r1.ebuild, -openldap-2.4.31.ebuild,
+ -openldap-2.4.32.ebuild, -openldap-2.4.33-r1.ebuild,
+ -openldap-2.4.33-r2.ebuild, -openldap-2.4.33.ebuild,
+ openldap-2.3.43-r3.ebuild, openldap-2.3.43-r4.ebuild,
+ openldap-2.4.19-r1.ebuild, openldap-2.4.23.ebuild, openldap-2.4.24.ebuild,
+ openldap-2.4.28-r1.ebuild, openldap-2.4.30.ebuild, openldap-2.4.35-r1.ebuild,
+ openldap-2.4.35.ebuild:
+ Bug #485166: dev-lang/perl no longer has USE=build, so update the dep; clean
+ up many older unstablized older versions.
09 Nov 2013; Pacho Ramos <pacho@gentoo.org> openldap-2.4.35-r1.ebuild:
x86 stable, bug #486302
diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest
index f197df291a9f..13a4f36e4017 100644
--- a/net-nds/openldap/Manifest
+++ b/net-nds/openldap/Manifest
@@ -1,6 +1,3 @@
------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
@@ -36,44 +33,21 @@ AUX slapd.tmpfilesd 94 SHA256 29e53a0022d0079ed6b8f952fe8c4fd4a4c1dad83f1c5aa2c4
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
-DIST openldap-2.4.21.tgz 5477877 SHA256 22eca357137c135b5561e2fa0e3336b280702acf2e5c4f40bc7aed1d1e8e9324 SHA512 09bf3a4e4e44523898f3ab1005ff345d7b91d31212c7f4307640a5e4d39d9861f11e86ac8314f9a3239b5e164549143496a6031d8501633632455f006a93acfe WHIRLPOOL b831897219b4d1adcf1ff416d8c3f7c68012daf668ee389f553b792df17fcdcc2334bd8f703d3850fd0381efbc954d78ed465ae5df07e43ad08b9c77edc8159e
DIST openldap-2.4.23.tgz 5182440 SHA256 5a5ede91d5e8ab3c7f637620aa29a3b96eb34318a8b26c8eef2d2c789fc055e3 SHA512 cca9c32ab319cbe6fb851c0244a25d9e372f34f780a939b75cfe35fb77995918669b7d4e815bb7a7941a844f5b55b886caccc769180bfe87b20d66e4441008e2 WHIRLPOOL ba72e3857e0309b6db92626d600a13241ee110acf5cfd47e733b22582ac5118dc502eb3e60eec0026216671736281c110603b7527a1f8e21a311ed0052f13df3
DIST openldap-2.4.24.tgz 5240643 SHA256 fdcecb64082a0d8e124f13b31fccf4765901e29decaf4224b28d4cff90a14614 SHA512 d889d5e5ec079a73a946719915b1b5f540676b735a628c764ec04e5f2b6786d35ead8de331e583b3e9c8b00f26023861ce5c32c935872ab7c0b66fe66b0aa09a WHIRLPOOL 58e279e5bc44f200a38b0993b340647d4c23834f72f9f736c2e454d3cdb9d7a96b64ccfc9a432ba16478ef6f9ed9d4627528376cb4dd844d9697dc637f163012
-DIST openldap-2.4.25.tgz 5250595 SHA256 615acc9970ae2f612bae7e8012d63f3194ef02a2a638bc1fd9ca7f31d85c1075 SHA512 11f71280430f024283dc9a5c0b217e14b0629f968989b54183b13c41ff06012eb2cdfd66047077d091b82fbc3651f7944c710e3b1b3d96da9bcc3602e21c1235 WHIRLPOOL 15516fcf5185d63128b6580c667c95280b1e9d9ef869c1870b39d3c80434dbdb7b4fbfe728d2b8e49e9f6c7481120dac760944ab577954847959f2e7cefca3a2
DIST openldap-2.4.28.tgz 5436340 SHA256 332ab5b13dbc0f85b1112d7a6f3485069108bfbd4d2603c8b548adbfa9bbc371 SHA512 585f01cac1facf4e703b975d8132fe3cc4c5687d315f5825c5456971cdafae5f08f006c440764898789c1c87619428ac9629de0a499b83c3f63b7e4ccd46f1fe WHIRLPOOL 2c1b22b479a2f89e34f27831d5db8dae89a647c5368c862d9e9fbdc45840a5f352ec2be54d6acfc536dfb050d9941202efa627cd39972392e416397c281209c7
DIST openldap-2.4.30.tgz 5440261 SHA256 fc013e528616f8578d9f221409c48af9b8937a62005e0bec88f6f1c4c8ff3d81 SHA512 89f032b069dc54cfe0c3149b85c5fedaf89b6b706c368da22852fed51c2574cb703823db1f4c52a9422d5274d4e70497f270fd558985675ab274d6025678c6f3 WHIRLPOOL 86009c7c269f9a0db93ba72e0aec04c15a5f89f39601468a2064fa814815d50a86e8a812979e060361a4f342ec5f21077d0ac5cc837d0c6b3e7af6dd926bc296
-DIST openldap-2.4.31.tgz 5444236 SHA256 bde845840df4794b869a6efd6a6b1086f80989038e4844b2e4d7d6b57b39c5b6 SHA512 c0f58928a339bedf68de4f95ca0e4d82b187d54ffa15834ebd69d8a90722f699cc495fb4f624450bc51b9e1bcb2b96c429b84dd80ba1930ecdd24c1cd77cc24b WHIRLPOOL 51b897ab6d7b2a50232d3ce59c928e9e12e372d61c888e5d1826ad14f313a48cb8cb47ec4156383ceb7a8ef20d0feaf60658a9c84f255e09f9510dbe0b34640b
-DIST openldap-2.4.32.tgz 5450134 SHA256 9ee413c6a816cb41f71826759b78001d04e747ede9dde302d6ba94ab16f0b82e SHA512 85b6d32fb08c6f4230bfea3f7cb9de0723f4894eae1266384ffea289710e3f3c49b1b0c1802dde41f4a64292c5e68d1d7dd6812f6027e23609b950259b4c93e7 WHIRLPOOL dc99d68ad45f6881fbcad1efc4a74f11cec47517de52f7e7d407f9b85ea6d6f3df844d9bc95360a338ea4d22886508e1e1aba0a61c182a0e594f6cbcc8440e24
-DIST openldap-2.4.33.tgz 5463850 SHA256 81e9eca20f17a69a5d15ebc4c66a323106da4f4f80a32105bc7cdea333aca14c SHA512 382253c0dc1f7937748cb5931d60db90e16dc06201c3e0eebbf0f7fb8b7f1d3634c6036804977e9a5a6e264cc0888abcc66d507310a5c3451d2dc7a758213e84 WHIRLPOOL 4ca58af83c2ec1e2ef9de61963858254b882269a4c97ea1edec31cd6a07f944bec6db79c4ad6997f5c9e8792a6d1dfebd49af9d20ac5538a7f4f92a63c59f518
DIST openldap-2.4.35.tgz 5486240 SHA256 16100374c147df0d82a5c52ca60da5eca1a5ea8b5a187467d40a78e3691e9eeb SHA512 b39232b4bab7ecb0ae14961adaa555590ca24ecbaeb3d94ea251e2de3bf7425ce364a2a488f9745fae17f106cdf198c852c73b5f2b910d329c598db435d6b31d WHIRLPOOL dccdbb7e858da3a5a6bec31956e13acac3ec604c4d40b88ff64ea9741feb32e70e7a9113f0e147996728214f494f8a858a55cbf6ceb1d5a8c6cc27e4aed44629
DIST rfc2307bis.schema-20100722 9718 SHA256 c61c72e04b45d1e774de1e4084fb2a596210307fc94fe6532b257cdae283b86b SHA512 f71ec7f5ebf826524ef263c2d7e1fc17b7238bd82c3118bfdae2eddbb00e9777ea918c644f0416e818cf60f44807555a0ca48c20cc8738fcbf1675cff7292f17 WHIRLPOOL 77dd13ebbb87f44298cda6f48940662d288a7bf6fbcde3ad88656eee00b470fee11d8ecbd5a6008d3ca3263c48447b30310393881922a258d81722a56e05deb7
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 18282 SHA256 2eb3c15f58c23ab44dc91945fa2b991ff538cbb3f606f5d32c30ea0cbb5a9a95 SHA512 7e87a3d5842953a948f8023684df1198a78874ba3b207831b3464242c853db41ad290de0043d41db80c3b626199191212eeea2ab6b64663e213e8135dfa11ba6 WHIRLPOOL 946eb623a67036c379cd8a037a7feddfa4e655929323f3eb7f2bb6d4d6855f5104833660e25769009d4b59cf85c68e0a24ea604f1124ee5f14aa2b3f9a22739c
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
EBUILD openldap-2.4.24.ebuild 20064 SHA256 daca138ae52d74aa0ebc436641b16c0b2671e723978c4ac7f4c06b9f5547f9ef SHA512 b86d348180db22a6799bc38469bd3bc8a789bcf060bb3460d708a36126614d92fae4a6f237bc2b3109cc5005af944d8ea720548b7c83aade24d5e6df7d83d826 WHIRLPOOL e40d1118d9331079751893c5951fc967cb55b22989438b7316da49d33da4835afa30a88994852bdaad9e5c56c64c88100e9a6c67d07b4e0d87331046cde92a3d
-EBUILD openldap-2.4.25-r1.ebuild 20770 SHA256 b4b7a206a055637ddc1f120628562210b313aa4b84b5a7830c5126504d1fa8d0 SHA512 c080432969585505a47fef626f667861a5982e5b07b3756b64e50b6288505447a31306cc2de35cbc67103f8fe6be84b2842be06cf6bef4a9cd65d937e1a59a02 WHIRLPOOL 4291fbb2cbcc0bc4a000c599f087c0e9fa24772d38bcf0b29c96a9568f906ef50560ca74b39e4c2d82a200daa12a891724a6bd5c778506d28df52ed4c54f41df
-EBUILD openldap-2.4.25.ebuild 20075 SHA256 1299f0734472ebe648048d4c0d547c1889e64424613bdf2ba9c63a46d9019eb8 SHA512 96de00e52176ecfb636712633c810ef0b0f1c977a63b72cec899f55f39342322839e343f6369db26e7056c64c760c12a25ce7e57f3a369a353f6246c415e3345 WHIRLPOOL d8031a97956fedbda389292a76304b1ec6d88531a783503d33f9002a0c5ef3c0edd104146dabf3147f03b369ad2f018effb8f84a065611fd29dece85d9926aaf
EBUILD openldap-2.4.28-r1.ebuild 21968 SHA256 a031cf75d2579f29547cf86452a013195f8d629bb76efc8146e84a18d60a9fe5 SHA512 7210f3cf73f682467b10e4de625da1e1ff1edf63b904e4c67cdf4d98f2bfc5464645b147902559c6f493e95eeafbb3dd7bde9814f193f9a28585d1a99c29c239 WHIRLPOOL 9f2501aff9c1396ad44161cb0d02750aa73cb4928f0750ae4c0785178dd90de236df8b46a513a667d37639cb06dbe2ea509587461ff13edc1fe966fea0adffef
-EBUILD openldap-2.4.28.ebuild 20766 SHA256 6e2d2d16bd63dea76afae241763af38f998a10339ba75140a28844db69ebc1a6 SHA512 5ec7bd5991140595f0f7afc05c7b0cbcda132d2a0913c4b5f4350c0e3610879264f4f160a23af431052ba795f20cc1d1118a7affff358839b75aa9bd7706d344 WHIRLPOOL d99e131df95989e3afa5433998fda380b5843f3d40e954d3f97470abff427634cf06d7ae771fb8948dcf7eae2e13d9f7ec9a46ae28face629e1d3ef465fbfc8d
EBUILD openldap-2.4.30.ebuild 21984 SHA256 90202c1b99d88b977ce01f2cea3e5ef8aec73a773a30b2dfe479b6f5341c5985 SHA512 368bbd4d254636700705ff45d4bdb5dbc7e40ca53a8fd8918e1a7b45dc1ea3cb6550d60e3d115486d5b5e407ce3e9a38aacb5610dbfb54d1cc25a5af4dbedfae WHIRLPOOL b0a44a1d5067a37a672ea8d1a345a80002c71ce5f43c312da9b60f8addbf527f774eba5b1cdee8baa1bc2df9239e8786a35cb029100a715d3404934cb0962b53
-EBUILD openldap-2.4.31-r1.ebuild 22312 SHA256 9795321cd892d2f7372f17dc26fb1dafe7b59b5cd7574933d5dc9f3d0a9a9dcc SHA512 326c6eb28e75cb78744110f90aacf0df8073b18c9d887adac0f8154398f0bdac9300c9cb7fe860e6b3d1f8f27e1a4bdeb4e1994ec26d97fab7201c3992d69441 WHIRLPOOL dfc3bb1c48eff1ecda936043e7be85dfc69527297f69d215f8566c2110a52bdf65aec137e466afbcb039f25aea56474927c2ba2fc12ee14ce78a452f909a5ec1
-EBUILD openldap-2.4.31.ebuild 22254 SHA256 cf4893975f5e6b7f83ce63e1e82d566374dc8f305712047b2f81ffdddd08f0a4 SHA512 1b62c1c107a5ca3256be4a67fe2a4bc3b959963a39a7faef4a8b2a2ce65d8244238c11ee059e7aea5b4cb9d359f2dc70bca843d408f439a412b1bbc6cb1b546b WHIRLPOOL 6248efa93a28f320f094f0f7e017cc24c83eb6adb667749294363bbe94005e2a7ed4e8859b5bc1a915e8b937f90d402dbbbed41be90b9804f857224ac02d940a
-EBUILD openldap-2.4.32.ebuild 22317 SHA256 fe078797113bf34a6a626a26c82007bb6dd4b4f3271e6cb2f9dc104840bdccab SHA512 fe6e95794aed15c22f899db10e69ab5910d69b0e7452f036f2ed7a5ba6e9bcb266bf0d81cdf6cd2cad23855a9e0b0c2c5b8f8cb30dc9b38d283363f808f65f5d WHIRLPOOL 8c0db904e0ac099258f074255bda9849ccb5936dd3b725e511d362ce23803ee8e1bb6815a89088b7d084bd6f0f5413a1404db587fff6ee1ba25613f90af72261
-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 22445 SHA256 425c0a3b6266a509209979699294606722838861af0af2f565bdbd622c2bb58e SHA512 33a20909e43f8fd8cb65b4095bd365d87506adc69f1e8649681e5b7209df8356ac0d78f023400af41a5ab7bc4b4c398e3bdffc5b22c8648b42139e9f551972b8 WHIRLPOOL fda3edeb8c7f9dc453f3c1d24152da241e4655e65e96b76da074264c0eb047a67fede9cab55cb09869f0993d5d6ba84132195d9ea8511af9b90a506fe838c1fc
EBUILD openldap-2.4.35.ebuild 22173 SHA256 8279211f8c3d28164cebf2edf8632820082759e004085c9d993d901237ba2fc4 SHA512 bc30c9303acbecafa727e998e76c513452f0562a9747e00c0d57ae0628fea1627eb684e2474add641e23855d9e8755d4cf50f2925d9d9979dcb5d87045abd7af WHIRLPOOL 20ec8d63012cc19a1c34f217b962f43e8192ce9c54ea08d22e8cc09ce5f980be6b7d78cde07a3edd88bf9188550ad938f2f59e9fc866a7748b3dd5181d3aea0e
-MISC ChangeLog 78635 SHA256 87b01674cb05e48973202dc6fe02f720ac833193f77e32a542dbbc99fbeafab7 SHA512 918e8f7d114d9ba9f8b738a223819692f1b917a580d388d3306e070079b73a581d1d6f90473e93cfead1450c3120e0730029a46c828121b4eeab464dbac763aa WHIRLPOOL 6c1e317695726095f9934175dccebfbb681ae8a99094a5ac6049ed19107c514b640948e728d95179f105fddbbf66f0964000fcd8fde4bccd6408ddedbae999cb
+MISC ChangeLog 79351 SHA256 afee19153b51aa269a26e640e43e29b37b33f1fd09b437bb4fd28f797279d9be SHA512 e238696b3c757dc16201721765b15a65638e807fe7c3e54f9ee56e53fd1107f01156fee3812c26bb9156e9ad45c4301dd7f113935b4d83d5790028196bb0840f WHIRLPOOL 7d12ee71d092590bd2fdb9034445fd79a65de000b115c839beb4d744582a1fe025cee314e1cfb67b880d63c8ceee9933b299492567c282b44e0fadfa9dc7de14
MISC metadata.xml 664 SHA256 70c2b3ca29517c6cafffef5802fcd6a513517d320a118bf2205b0033ffa384ea SHA512 55e576a18ae7c71f3fa413b252a40945059d9f9308f4036739124bd241cc6c409816124c7e4fd30df965963d93907bce03ee117489fdb3443e62bf00dac9da25 WHIRLPOOL ce3c30df03e9026415bd72d5f3c132bb3273a597a6ca8e8928957baae1b4bc6d80ab8f7f0698d72cd8d5773a957ee2a929d3c2bdd4f5a6cd6ba88f9b9e0aa4c7
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.22 (GNU/Linux)
-
-iEYEAREIAAYFAlJ+WlcACgkQCaWpQKGI+9SGeACdHM1EM6KnXeuUgSniD1G8NL0R
-lTUAn3QMSYoZVeXuG5aseHnOOGnjp1vU
-=+0jn
------END PGP SIGNATURE-----
diff --git a/net-nds/openldap/openldap-2.3.43-r1.ebuild b/net-nds/openldap/openldap-2.3.43-r1.ebuild
deleted file mode 100644
index 2d732c2040bb..000000000000
--- a/net-nds/openldap/openldap-2.3.43-r1.ebuild
+++ /dev/null
@@ -1,540 +0,0 @@
-# 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-r1.ebuild,v 1.13 2013/03/03 09:02:31 vapier 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 ~sparc-fbsd x86 ~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"
-}
-
-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
-}
diff --git a/net-nds/openldap/openldap-2.4.21.ebuild b/net-nds/openldap/openldap-2.4.21.ebuild
deleted file mode 100644
index 4aceb77054ca..000000000000
--- a/net-nds/openldap/openldap-2.4.21.ebuild
+++ /dev/null
@@ -1,613 +0,0 @@
-# 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.21.ebuild,v 1.11 2013/03/03 09:02:31 vapier Exp $
-
-EAPI="2"
-WANT_AUTOMAKE=1.9
-inherit db-use eutils flag-o-matic multilib ssl-cert versionator toolchain-funcs autotools 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"
-
-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}"
-
-# openssl is needed to generate lanman-passwords required by samba
-RDEPEND="sys-libs/ncurses
- sys-devel/libtool
- icu? ( dev-libs/icu )
- tcpd? ( sys-apps/tcp-wrappers )
- ssl? ( !gnutls? ( dev-libs/openssl )
- gnutls? ( <net-libs/gnutls-3 ) )
- sasl? ( dev-libs/cyrus-sasl )
- !minimal? (
- 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}"
-
-# 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 "${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
- 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
- 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=${ROOT}/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
- 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() {
- # 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.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.19
- epatch "${FILESDIR}"/${PN}-2.4.19-contrib-smbk5pwd.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
-
- 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 /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
-
- 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/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
-
- tc-export CC AR CXX
- STRIP=/bin/true \
- econf \
- --libexecdir=/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}" || 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" \
- KRB5_INC="$(krb5-config --cflags)" \
- CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap" \
- || die "emake smbk5pwd 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 /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 /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}" 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-initd2 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 cxx ; then
- einfo "Install the ldapc++ library"
- cd "${S}/contrib/ldapc++"
- emake DESTDIR="${D}" libexecdir="/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="/usr/$(get_libdir)/openldap" install || die "emake install smbk5pwd failed"
- newdoc README smbk5pwd-README
- fi
-
- einfo "Installing contrib modules"
- cd "${S}/contrib/slapd-modules"
- for l in */*.la; do
- "${lt}" --mode=install cp ${l} \
- "${D}"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
- fi
-}
-
-pkg_preinst() {
- # keep old libs if any
- preserve_old_lib usr/$(get_libdir)/{libldap,libldap_r,liblber}-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 "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-
- preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3.so.0
-}
diff --git a/net-nds/openldap/openldap-2.4.25-r1.ebuild b/net-nds/openldap/openldap-2.4.25-r1.ebuild
deleted file mode 100644
index b14b4bb95858..000000000000
--- a/net-nds/openldap/openldap-2.4.25-r1.ebuild
+++ /dev/null
@@ -1,621 +0,0 @@
-# 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.25-r1.ebuild,v 1.11 2013/03/03 09:02:31 vapier Exp $
-
-EAPI="3"
-WANT_AUTOMAKE=1.9
-inherit db-use eutils flag-o-matic multilib ssl-cert versionator toolchain-funcs autotools 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-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}"
-
-# openssl is needed to generate lanman-passwords required by samba
-RDEPEND="sys-libs/ncurses
- sys-devel/libtool
- icu? ( dev-libs/icu )
- tcpd? ( sys-apps/tcp-wrappers )
- ssl? ( !gnutls? ( dev-libs/openssl )
- gnutls? ( <net-libs/gnutls-3 ) )
- sasl? ( dev-libs/cyrus-sasl )
- !minimal? (
- 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}"
-
-# 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
- 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
- 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() {
- # 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.19
- epatch "${FILESDIR}"/${PN}-2.4.19-contrib-smbk5pwd.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
-
- 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
-
- 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
-
- 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}" || 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" \
- KRB5_INC="$(krb5-config --cflags)" \
- CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
- || die "emake smbk5pwd 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}" 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
- 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}"
-
- # change slapd.pid location in configuration file
- keepdir /var/run/openldap
- use prefix || fowners ldap:ldap /var/run/openldap
- fperms 0755 /var/run/openldap
-
- if ! use minimal; then
- # 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
- newinitd "${FILESDIR}"/slapd-initd2 slapd
- newconfd "${FILESDIR}"/slapd-confd slapd
- if [ $(get_libdir) != lib ]; then
- sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${ED}"etc/init.d/slapd
- fi
-
- 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
-
- 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
- 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,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 "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)
-}
diff --git a/net-nds/openldap/openldap-2.4.25.ebuild b/net-nds/openldap/openldap-2.4.25.ebuild
deleted file mode 100644
index 3c2cbe882996..000000000000
--- a/net-nds/openldap/openldap-2.4.25.ebuild
+++ /dev/null
@@ -1,613 +0,0 @@
-# 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.25.ebuild,v 1.11 2013/03/03 09:02:31 vapier Exp $
-
-EAPI="2"
-WANT_AUTOMAKE=1.9
-inherit db-use eutils flag-o-matic multilib ssl-cert versionator toolchain-funcs autotools 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"
-
-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}"
-
-# openssl is needed to generate lanman-passwords required by samba
-RDEPEND="sys-libs/ncurses
- sys-devel/libtool
- icu? ( dev-libs/icu )
- tcpd? ( sys-apps/tcp-wrappers )
- ssl? ( !gnutls? ( dev-libs/openssl )
- gnutls? ( <net-libs/gnutls-3 ) )
- sasl? ( dev-libs/cyrus-sasl )
- !minimal? (
- 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}"
-
-# 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 "${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
- 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
- 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=${ROOT}/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
- 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() {
- # 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.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.19
- epatch "${FILESDIR}"/${PN}-2.4.19-contrib-smbk5pwd.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
-
- 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 /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
-
- 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/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
-
- tc-export CC AR CXX
- STRIP=/bin/true \
- econf \
- --libexecdir=/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}" || 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" \
- KRB5_INC="$(krb5-config --cflags)" \
- CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap" \
- || die "emake smbk5pwd 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 /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 /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}" 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-initd2 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 cxx ; then
- einfo "Install the ldapc++ library"
- cd "${S}/contrib/ldapc++"
- emake DESTDIR="${D}" libexecdir="/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="/usr/$(get_libdir)/openldap" install || die "emake install smbk5pwd failed"
- newdoc README smbk5pwd-README
- fi
-
- einfo "Installing contrib modules"
- cd "${S}/contrib/slapd-modules"
- for l in */*.la; do
- "${lt}" --mode=install cp ${l} \
- "${D}"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
- fi
-}
-
-pkg_preinst() {
- # keep old libs if any
- preserve_old_lib usr/$(get_libdir)/{libldap,libldap_r,liblber}-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 "DB_CONFIG.fast.example in /usr/share/doc/${PF}/"
-
- preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3.so.0
-}
diff --git a/net-nds/openldap/openldap-2.4.28.ebuild b/net-nds/openldap/openldap-2.4.28.ebuild
deleted file mode 100644
index 85de0eb8aa6d..000000000000
--- a/net-nds/openldap/openldap-2.4.28.ebuild
+++ /dev/null
@@ -1,621 +0,0 @@
-# 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.28.ebuild,v 1.9 2013/03/03 09:02:31 vapier Exp $
-
-EAPI="3"
-WANT_AUTOMAKE=1.9
-inherit db-use eutils flag-o-matic multilib ssl-cert versionator toolchain-funcs autotools 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-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}"
-
-# openssl is needed to generate lanman-passwords required by samba
-RDEPEND="sys-libs/ncurses
- sys-devel/libtool
- icu? ( dev-libs/icu )
- tcpd? ( sys-apps/tcp-wrappers )
- ssl? ( !gnutls? ( dev-libs/openssl )
- gnutls? ( <net-libs/gnutls-3 ) )
- sasl? ( dev-libs/cyrus-sasl )
- !minimal? (
- 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}"
-
-# 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
- 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
- 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() {
- # 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.28-contrib-smbk5pwd.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
-
- 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
-
- 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
-
- 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}" || 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" \
- KRB5_INC="$(krb5-config --cflags)" \
- CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" \
- || die "emake smbk5pwd 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}" 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
- 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}"
-
- # change slapd.pid location in configuration file
- keepdir /var/run/openldap
- use prefix || fowners ldap:ldap /var/run/openldap
- fperms 0755 /var/run/openldap
-
- if ! use minimal; then
- # 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
- newinitd "${FILESDIR}"/slapd-initd2 slapd
- newconfd "${FILESDIR}"/slapd-confd slapd
- if [ $(get_libdir) != lib ]; then
- sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${ED}"etc/init.d/slapd
- fi
-
- 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
-
- 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
- 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,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 "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)
-}
diff --git a/net-nds/openldap/openldap-2.4.31-r1.ebuild b/net-nds/openldap/openldap-2.4.31-r1.ebuild
deleted file mode 100644
index 13e29816bfbd..000000000000
--- a/net-nds/openldap/openldap-2.4.31-r1.ebuild
+++ /dev/null
@@ -1,672 +0,0 @@
-# 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.31-r1.ebuild,v 1.4 2013/03/03 09:02:31 vapier Exp $
-
-EAPI="4"
-
-inherit db-use eutils flag-o-matic multilib ssl-cert versionator toolchain-funcs autotools user
-
-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="sys-libs/ncurses
- sys-devel/libtool
- icu? ( dev-libs/icu )
- tcpd? ( sys-apps/tcp-wrappers )
- ssl? ( !gnutls? ( dev-libs/openssl )
- gnutls? ( <net-libs/gnutls-3 dev-libs/libgcrypt ) )
- sasl? ( dev-libs/cyrus-sasl )
- !minimal? (
- 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.28-contrib-smbk5pwd.patch
- # bug #408077 - samba4
- epatch "${FILESDIR}"/${PN}-2.4.30-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}"/${P}-gcc47.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
-
- # 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}"
-
- # change slapd.pid location in configuration file
- keepdir /var/run/openldap
- use prefix || fowners ldap:ldap /var/run/openldap
- fperms 0755 /var/run/openldap
-
- if ! use minimal; then
- # 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
- newinitd "${FILESDIR}"/slapd-initd-2.4.28-r1 slapd
- newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
- if [ $(get_libdir) != lib ]; then
- sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${ED}"etc/init.d/slapd
- 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)
-}
diff --git a/net-nds/openldap/openldap-2.4.31.ebuild b/net-nds/openldap/openldap-2.4.31.ebuild
deleted file mode 100644
index 3e041cbd8170..000000000000
--- a/net-nds/openldap/openldap-2.4.31.ebuild
+++ /dev/null
@@ -1,669 +0,0 @@
-# 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.31.ebuild,v 1.4 2013/03/03 09:02:31 vapier Exp $
-
-EAPI="4"
-
-inherit db-use eutils flag-o-matic multilib ssl-cert versionator toolchain-funcs autotools user
-
-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="sys-libs/ncurses
- sys-devel/libtool
- icu? ( dev-libs/icu )
- tcpd? ( sys-apps/tcp-wrappers )
- ssl? ( !gnutls? ( dev-libs/openssl )
- gnutls? ( <net-libs/gnutls-3 dev-libs/libgcrypt ) )
- sasl? ( dev-libs/cyrus-sasl )
- !minimal? (
- 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.28-contrib-smbk5pwd.patch
- # bug #408077 - samba4
- epatch "${FILESDIR}"/${PN}-2.4.30-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
-
- 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
-
- # 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}"
-
- # change slapd.pid location in configuration file
- keepdir /var/run/openldap
- use prefix || fowners ldap:ldap /var/run/openldap
- fperms 0755 /var/run/openldap
-
- if ! use minimal; then
- # 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
- newinitd "${FILESDIR}"/slapd-initd-2.4.28-r1 slapd
- newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
- if [ $(get_libdir) != lib ]; then
- sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${ED}"etc/init.d/slapd
- 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)
-}
diff --git a/net-nds/openldap/openldap-2.4.32.ebuild b/net-nds/openldap/openldap-2.4.32.ebuild
deleted file mode 100644
index 36ddbf909d23..000000000000
--- a/net-nds/openldap/openldap-2.4.32.ebuild
+++ /dev/null
@@ -1,672 +0,0 @@
-# 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.32.ebuild,v 1.3 2013/03/03 09:02:31 vapier Exp $
-
-EAPI="4"
-
-inherit db-use eutils flag-o-matic multilib ssl-cert versionator toolchain-funcs autotools user
-
-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="sys-libs/ncurses
- sys-devel/libtool
- icu? ( dev-libs/icu )
- tcpd? ( sys-apps/tcp-wrappers )
- ssl? ( !gnutls? ( dev-libs/openssl )
- gnutls? ( <net-libs/gnutls-3 dev-libs/libgcrypt ) )
- sasl? ( dev-libs/cyrus-sasl )
- !minimal? (
- 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.28-contrib-smbk5pwd.patch
- # bug #408077 - samba4
- epatch "${FILESDIR}"/${PN}-2.4.30-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
-
- 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
-
- # 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}"
-
- # change slapd.pid location in configuration file
- keepdir /var/run/openldap
- use prefix || fowners ldap:ldap /var/run/openldap
- fperms 0755 /var/run/openldap
-
- if ! use minimal; then
- # 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
- newinitd "${FILESDIR}"/slapd-initd-2.4.28-r1 slapd
- newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
- if [ $(get_libdir) != lib ]; then
- sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${ED}"etc/init.d/slapd
- 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)
-}
diff --git a/net-nds/openldap/openldap-2.4.33-r1.ebuild b/net-nds/openldap/openldap-2.4.33-r1.ebuild
deleted file mode 100644
index 8190e35834a1..000000000000
--- a/net-nds/openldap/openldap-2.4.33-r1.ebuild
+++ /dev/null
@@ -1,666 +0,0 @@
-# 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.33-r1.ebuild,v 1.3 2013/03/03 09:02:31 vapier Exp $
-
-EAPI="4"
-
-inherit db-use eutils flag-o-matic multilib ssl-cert versionator toolchain-funcs autotools user
-
-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-3 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.28-contrib-smbk5pwd.patch
- # bug #408077 - samba4
- epatch "${FILESDIR}"/${PN}-2.4.30-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
-
- 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
- newinitd "${FILESDIR}"/slapd-initd-2.4.28-r1 slapd
- newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
- if [ $(get_libdir) != lib ]; then
- sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${ED}"etc/init.d/slapd
- 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)
-}
diff --git a/net-nds/openldap/openldap-2.4.33-r2.ebuild b/net-nds/openldap/openldap-2.4.33-r2.ebuild
deleted file mode 100644
index 7b284797dd3e..000000000000
--- a/net-nds/openldap/openldap-2.4.33-r2.ebuild
+++ /dev/null
@@ -1,669 +0,0 @@
-# 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.33-r2.ebuild,v 1.1 2013/04/16 03:58:26 robbat2 Exp $
-
-EAPI="4"
-
-inherit db-use eutils flag-o-matic multilib ssl-cert versionator toolchain-funcs autotools
-
-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.28-contrib-smbk5pwd.patch
- # bug #408077 - samba4
- epatch "${FILESDIR}"/${PN}-2.4.30-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
- newinitd "${FILESDIR}"/slapd-initd-2.4.28-r1 slapd
- newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
- if [ $(get_libdir) != lib ]; then
- sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${ED}"etc/init.d/slapd
- 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)
-}
diff --git a/net-nds/openldap/openldap-2.4.33.ebuild b/net-nds/openldap/openldap-2.4.33.ebuild
deleted file mode 100644
index a7f5771aa36e..000000000000
--- a/net-nds/openldap/openldap-2.4.33.ebuild
+++ /dev/null
@@ -1,672 +0,0 @@
-# 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.33.ebuild,v 1.3 2013/03/03 09:02:31 vapier Exp $
-
-EAPI="4"
-
-inherit db-use eutils flag-o-matic multilib ssl-cert versionator toolchain-funcs autotools user
-
-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="sys-libs/ncurses
- sys-devel/libtool
- icu? ( dev-libs/icu )
- tcpd? ( sys-apps/tcp-wrappers )
- ssl? ( !gnutls? ( dev-libs/openssl )
- gnutls? ( <net-libs/gnutls-3 dev-libs/libgcrypt ) )
- sasl? ( dev-libs/cyrus-sasl )
- !minimal? (
- 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.28-contrib-smbk5pwd.patch
- # bug #408077 - samba4
- epatch "${FILESDIR}"/${PN}-2.4.30-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
-
- 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
-
- # 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}"
-
- # change slapd.pid location in configuration file
- keepdir /var/run/openldap
- use prefix || fowners ldap:ldap /var/run/openldap
- fperms 0755 /var/run/openldap
-
- if ! use minimal; then
- # 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
- newinitd "${FILESDIR}"/slapd-initd-2.4.28-r1 slapd
- newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd
- if [ $(get_libdir) != lib ]; then
- sed -e "s,/usr/lib/,/usr/$(get_libdir)/," -i "${ED}"etc/init.d/slapd
- 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)
-}