From cc4618c9ba3d974948ebf340b542d8cb01db2f55 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 16 Sep 2021 22:05:01 +0100 Subject: gentoo resync : 16.09.2021 --- net-nds/389-ds-base/389-ds-base-1.4.4.16-r1.ebuild | 300 +++++++ net-nds/389-ds-base/389-ds-base-1.4.4.16.ebuild | 300 ------- net-nds/389-ds-base/Manifest | 4 +- net-nds/389-ds-base/metadata.xml | 2 +- net-nds/Manifest.gz | Bin 2562 -> 2561 bytes net-nds/adtool/Manifest | 2 +- net-nds/adtool/metadata.xml | 2 +- net-nds/gssproxy/Manifest | 2 +- net-nds/gssproxy/metadata.xml | 2 +- net-nds/jxplorer/Manifest | 2 +- net-nds/jxplorer/metadata.xml | 2 +- net-nds/ldapvi/Manifest | 2 +- net-nds/ldapvi/metadata.xml | 2 +- net-nds/led/Manifest | 2 +- net-nds/led/metadata.xml | 2 +- net-nds/metadata.xml | 2 +- net-nds/nsscache/Manifest | 2 +- net-nds/nsscache/metadata.xml | 2 +- net-nds/openldap/Manifest | 10 +- net-nds/openldap/metadata.xml | 2 +- net-nds/openldap/openldap-2.4.57-r1.ebuild | 908 --------------------- net-nds/openldap/openldap-2.4.57-r2.ebuild | 908 +++++++++++++++++++++ net-nds/openldap/openldap-2.4.58-r1.ebuild | 908 --------------------- net-nds/openldap/openldap-2.4.58-r2.ebuild | 908 +++++++++++++++++++++ net-nds/openldap/openldap-2.4.59-r1.ebuild | 908 --------------------- net-nds/openldap/openldap-2.4.59-r2.ebuild | 908 +++++++++++++++++++++ net-nds/openldap/openldap-2.5.4-r1.ebuild | 840 +++++++++++++++++++ net-nds/openldap/openldap-2.5.4.ebuild | 840 ------------------- net-nds/phpldapadmin/Manifest | 2 +- net-nds/phpldapadmin/metadata.xml | 2 +- net-nds/rpcbind/Manifest | 2 +- net-nds/rpcbind/metadata.xml | 2 +- net-nds/shelldap/Manifest | 2 +- net-nds/shelldap/metadata.xml | 2 +- net-nds/smbldap-tools/Manifest | 2 +- net-nds/smbldap-tools/metadata.xml | 2 +- net-nds/tac_plus/Manifest | 2 +- net-nds/tac_plus/metadata.xml | 2 +- net-nds/yp-tools/Manifest | 2 +- net-nds/yp-tools/metadata.xml | 2 +- 40 files changed, 3898 insertions(+), 3898 deletions(-) create mode 100644 net-nds/389-ds-base/389-ds-base-1.4.4.16-r1.ebuild delete mode 100644 net-nds/389-ds-base/389-ds-base-1.4.4.16.ebuild delete mode 100644 net-nds/openldap/openldap-2.4.57-r1.ebuild create mode 100644 net-nds/openldap/openldap-2.4.57-r2.ebuild delete mode 100644 net-nds/openldap/openldap-2.4.58-r1.ebuild create mode 100644 net-nds/openldap/openldap-2.4.58-r2.ebuild delete mode 100644 net-nds/openldap/openldap-2.4.59-r1.ebuild create mode 100644 net-nds/openldap/openldap-2.4.59-r2.ebuild create mode 100644 net-nds/openldap/openldap-2.5.4-r1.ebuild delete mode 100644 net-nds/openldap/openldap-2.5.4.ebuild (limited to 'net-nds') diff --git a/net-nds/389-ds-base/389-ds-base-1.4.4.16-r1.ebuild b/net-nds/389-ds-base/389-ds-base-1.4.4.16-r1.ebuild new file mode 100644 index 000000000000..e3ef7ffdf4bf --- /dev/null +++ b/net-nds/389-ds-base/389-ds-base-1.4.4.16-r1.ebuild @@ -0,0 +1,300 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +CRATES=" +ahash-0.7.2 +ansi_term-0.11.0 +atty-0.2.14 +autocfg-1.0.1 +base64-0.13.0 +bitflags-1.2.1 +byteorder-1.4.3 +cbindgen-0.9.1 +cc-1.0.67 +cfg-if-1.0.0 +clap-2.33.3 +concread-0.2.9 +crossbeam-0.8.0 +crossbeam-channel-0.5.1 +crossbeam-deque-0.8.0 +crossbeam-epoch-0.9.3 +crossbeam-queue-0.3.1 +crossbeam-utils-0.8.3 +fernet-0.1.4 +foreign-types-0.3.2 +foreign-types-shared-0.1.1 +getrandom-0.2.2 +hermit-abi-0.1.18 +instant-0.1.9 +itoa-0.4.7 +jobserver-0.1.21 +lazy_static-1.4.0 +libc-0.2.93 +lock_api-0.4.3 +log-0.4.14 +memoffset-0.6.3 +once_cell-1.7.2 +openssl-0.10.33 +openssl-sys-0.9.61 +parking_lot-0.11.1 +parking_lot_core-0.8.3 +paste-0.1.18 +paste-impl-0.1.18 +pkg-config-0.3.19 +ppv-lite86-0.2.10 +proc-macro-hack-0.5.19 +proc-macro2-1.0.26 +quote-1.0.9 +rand-0.8.3 +rand_chacha-0.3.0 +rand_core-0.6.2 +rand_hc-0.3.0 +redox_syscall-0.2.6 +remove_dir_all-0.5.3 +ryu-1.0.5 +scopeguard-1.1.0 +serde-1.0.125 +serde_derive-1.0.125 +serde_json-1.0.64 +smallvec-1.6.1 +strsim-0.8.0 +syn-1.0.69 +synstructure-0.12.4 +tempfile-3.2.0 +textwrap-0.11.0 +toml-0.5.8 +unicode-width-0.1.8 +unicode-xid-0.2.1 +uuid-0.8.2 +vcpkg-0.2.11 +vec_map-0.8.2 +version_check-0.9.3 +wasi-0.10.2+wasi-snapshot-preview1 +winapi-0.3.9 +winapi-i686-pc-windows-gnu-0.4.0 +winapi-x86_64-pc-windows-gnu-0.4.0 +zeroize-1.2.0 +zeroize_derive-1.0.1 +" + +PYTHON_COMPAT=( python3_{8,9} ) + +DISTUTILS_SINGLE_IMPL=1 +DISTUTILS_USE_SETUPTOOLS=rdepend + +inherit multilib flag-o-matic autotools distutils-r1 systemd tmpfiles db-use cargo + +DESCRIPTION="389 Directory Server (core libraries and daemons)" +HOMEPAGE="https://directory.fedoraproject.org/" +SRC_URI="https://github.com/389ds/${PN}/archive/refs/tags/${P}.tar.gz + $(cargo_crate_uris ${CRATES})" +LICENSE="GPL-3+ Apache-2.0 BSD MIT MPL-2.0" +SLOT="$(ver_cut 1-2)/0" +KEYWORDS="~amd64" +IUSE_PLUGINS="+accountpolicy +bitwise +dna +pam-passthru" +IUSE="${IUSE_PLUGINS} +autobind auto-dn-suffix debug doc +ldapi selinux systemd" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +# lib389 tests (which is most of the suite) can't find their own modules. +RESTRICT="test" + +# always list newer first +# Do not add any AGPL-3 BDB here! +# See bug 525110, comment 15. +BERKDB_SLOTS=( 5.3 4.8 ) + +DEPEND=" + >=app-crypt/mit-krb5-1.7-r100[openldap] + >=dev-libs/cyrus-sasl-2.1.19[kerberos] + >=dev-libs/icu-60.2:= + dev-libs/nspr + >=dev-libs/nss-3.22[utils] + dev-libs/libevent:= + dev-libs/libpcre:3 + dev-libs/openssl:0= + >=net-analyzer/net-snmp-5.1.2:= + net-nds/openldap[sasl] + || ( + $(for slot in ${BERKDB_SLOTS[@]} ; do printf '%s\n' "sys-libs/db:${slot}" ; done) + ) + sys-libs/cracklib + sys-fs/e2fsprogs + sys-libs/zlib + pam-passthru? ( sys-libs/pam ) + selinux? ( + $(python_gen_cond_dep ' + sys-libs/libselinux[python,${PYTHON_USEDEP}] + ') + ) + systemd? ( >=sys-apps/systemd-244 ) + virtual/libcrypt:= + " + +BDEPEND=">=sys-devel/autoconf-2.69-r5 + virtual/pkgconfig + ${PYTHON_DEPS} + $(python_gen_cond_dep ' + dev-python/argparse-manpage[${PYTHON_USEDEP}] + ') + doc? ( app-doc/doxygen ) + test? ( dev-util/cmocka ) +" + +# perl dependencies are for logconv.pl +RDEPEND="${DEPEND} + !dev-libs/svrcore + !net-nds/389-ds-base:0 + acct-user/dirsrv + acct-group/dirsrv + ${PYTHON_DEPS} + $(python_gen_cond_dep ' + dev-python/pyasn1[${PYTHON_USEDEP}] + dev-python/pyasn1-modules[${PYTHON_USEDEP}] + dev-python/argcomplete[${PYTHON_USEDEP}] + dev-python/python-dateutil[${PYTHON_USEDEP}] + dev-python/python-ldap[sasl,${PYTHON_USEDEP}] + dev-python/distro[${PYTHON_USEDEP}] + ') + virtual/perl-Archive-Tar + virtual/perl-DB_File + virtual/perl-IO + virtual/perl-Getopt-Long + virtual/perl-IO-Compress + virtual/perl-MIME-Base64 + virtual/perl-Scalar-List-Utils + virtual/perl-Time-Local + virtual/logger + selinux? ( sec-policy/selinux-dirsrv ) +" + +S="${WORKDIR}/${PN}-${P}" + +PATCHES=( + "${FILESDIR}/${P}-crypt-import.patch" + "${FILESDIR}/${PN}-db-gentoo.patch" +) + +distutils_enable_tests pytest + +src_prepare() { + # this is for upstream GitHub issue 4292 + if use !systemd; then + sed -i \ + -e 's|WITH_SYSTEMD = 1|WITH_SYSTEMD = 0|' \ + Makefile.am || die + fi + + # GH issue 4092 + sed -i \ + -e 's|@localstatedir@/run|/run|' \ + ldap/admin/src/defaults.inf.in || die + + default + + eautoreconf +} + +src_configure() { + local myeconfargs=( + $(use_enable accountpolicy acctpolicy) + $(use_enable bitwise) + $(use_enable dna) + $(use_enable pam-passthru) + $(use_enable autobind) + $(use_enable auto-dn-suffix) + $(use_enable debug) + $(use_enable ldapi) + $(use_with selinux) + $(use_with systemd) + $(use_with systemd systemdgroupname "dirsrv.target") + $(use_with systemd tmpfiles-d "/usr/lib/tmpfiles.d") + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" + $(use_with !systemd initddir "/etc/init.d") + $(use_enable test cmocka) + --enable-rust + --enable-rust-offline + --with-pythonexec="${PYTHON}" + --with-fhs + --with-openldap + --with-db-inc="$(db_includedir)" + --disable-cockpit + ) + + econf "${myeconfargs[@]}" + + rm "${S}"/.cargo/config || die +} + +src_compile() { + export CARGO_HOME="${ECARGO_HOME}" + + default + + if use doc; then + doxygen "${S}"/docs/slapi.doxy || die + fi + + cd "${S}"/src/lib389 || die + distutils-r1_src_compile + + # argparse-manpage dynamic man pages have hardcoded man v1 in header + sed -i \ + "1s/\"1\"/\"8\"/" \ + "${S}"/src/lib389/man/{openldap_to_ds,ds{conf,ctl,idm,create}}.8 || die +} + +src_test () { + emake check + cd "${S}"/src/lib389 || die + distutils-r1_src_test +} + +src_install() { + # -j1 is a temporary workaround for bug #605432 + emake -j1 DESTDIR="${D}" install + + # Install gentoo style init script + # Get these merged upstream + newinitd "${FILESDIR}"/389-ds.initd-r1 389-ds + newinitd "${FILESDIR}"/389-ds-snmp.initd 389-ds-snmp + + dotmpfiles "${FILESDIR}"/389-ds-base.conf + + # cope with libraries being in /usr/lib/dirsrv + dodir /etc/env.d + echo "LDPATH=/usr/$(get_libdir)/dirsrv" > "${ED}"/etc/env.d/08dirsrv || die + + if use doc; then + cd "${S}" || die + docinto html/ + dodoc -r html/. + fi + + cd "${S}"/src/lib389 || die + distutils-r1_src_install + python_fix_shebang "${ED}" + + find "${ED}" -type f \( -name "*.a" -o -name "*.la" \) -delete || die +} + +pkg_postinst() { + tmpfiles_process 389-ds-base.conf + + echo + elog "If you are planning to use 389-ds-snmp (ldap-agent)," + elog "make sure to properly configure: /etc/dirsrv/config/ldap-agent.conf" + elog "adding proper 'server' entries, and adding the lines below to" + elog " => /etc/snmp/snmpd.conf" + elog + elog "master agentx" + elog "agentXSocket /var/agentx/master" + elog + elog "To start 389 Directory Server (LDAP service) at boot:" + elog + elog " rc-update add 389-ds default" + elog + echo +} diff --git a/net-nds/389-ds-base/389-ds-base-1.4.4.16.ebuild b/net-nds/389-ds-base/389-ds-base-1.4.4.16.ebuild deleted file mode 100644 index a4f075f0ebf9..000000000000 --- a/net-nds/389-ds-base/389-ds-base-1.4.4.16.ebuild +++ /dev/null @@ -1,300 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -CRATES=" -ahash-0.7.2 -ansi_term-0.11.0 -atty-0.2.14 -autocfg-1.0.1 -base64-0.13.0 -bitflags-1.2.1 -byteorder-1.4.3 -cbindgen-0.9.1 -cc-1.0.67 -cfg-if-1.0.0 -clap-2.33.3 -concread-0.2.9 -crossbeam-0.8.0 -crossbeam-channel-0.5.1 -crossbeam-deque-0.8.0 -crossbeam-epoch-0.9.3 -crossbeam-queue-0.3.1 -crossbeam-utils-0.8.3 -fernet-0.1.4 -foreign-types-0.3.2 -foreign-types-shared-0.1.1 -getrandom-0.2.2 -hermit-abi-0.1.18 -instant-0.1.9 -itoa-0.4.7 -jobserver-0.1.21 -lazy_static-1.4.0 -libc-0.2.93 -lock_api-0.4.3 -log-0.4.14 -memoffset-0.6.3 -once_cell-1.7.2 -openssl-0.10.33 -openssl-sys-0.9.61 -parking_lot-0.11.1 -parking_lot_core-0.8.3 -paste-0.1.18 -paste-impl-0.1.18 -pkg-config-0.3.19 -ppv-lite86-0.2.10 -proc-macro-hack-0.5.19 -proc-macro2-1.0.26 -quote-1.0.9 -rand-0.8.3 -rand_chacha-0.3.0 -rand_core-0.6.2 -rand_hc-0.3.0 -redox_syscall-0.2.6 -remove_dir_all-0.5.3 -ryu-1.0.5 -scopeguard-1.1.0 -serde-1.0.125 -serde_derive-1.0.125 -serde_json-1.0.64 -smallvec-1.6.1 -strsim-0.8.0 -syn-1.0.69 -synstructure-0.12.4 -tempfile-3.2.0 -textwrap-0.11.0 -toml-0.5.8 -unicode-width-0.1.8 -unicode-xid-0.2.1 -uuid-0.8.2 -vcpkg-0.2.11 -vec_map-0.8.2 -version_check-0.9.3 -wasi-0.10.2+wasi-snapshot-preview1 -winapi-0.3.9 -winapi-i686-pc-windows-gnu-0.4.0 -winapi-x86_64-pc-windows-gnu-0.4.0 -zeroize-1.2.0 -zeroize_derive-1.0.1 -" - -PYTHON_COMPAT=( python3_{8,9} ) - -DISTUTILS_SINGLE_IMPL=1 -DISTUTILS_USE_SETUPTOOLS=rdepend - -inherit multilib flag-o-matic autotools distutils-r1 systemd tmpfiles db-use cargo - -DESCRIPTION="389 Directory Server (core libraries and daemons)" -HOMEPAGE="https://directory.fedoraproject.org/" -SRC_URI="https://github.com/389ds/${PN}/archive/refs/tags/${P}.tar.gz - $(cargo_crate_uris ${CRATES})" -LICENSE="GPL-3+ Apache-2.0 BSD MIT MPL-2.0" -SLOT="$(ver_cut 1-2)/0" -KEYWORDS="~amd64" -IUSE_PLUGINS="+accountpolicy +bitwise +dna +pam-passthru" -IUSE="${IUSE_PLUGINS} +autobind auto-dn-suffix debug doc +ldapi selinux systemd" - -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - -# lib389 tests (which is most of the suite) can't find their own modules. -RESTRICT="test" - -# always list newer first -# Do not add any AGPL-3 BDB here! -# See bug 525110, comment 15. -BERKDB_SLOTS=( 5.3 4.8 ) - -DEPEND=" - >=app-crypt/mit-krb5-1.7-r100[openldap] - >=dev-libs/cyrus-sasl-2.1.19[kerberos] - >=dev-libs/icu-60.2:= - dev-libs/nspr - >=dev-libs/nss-3.22[utils] - dev-libs/libevent:= - dev-libs/libpcre:3 - dev-libs/openssl:0= - >=net-analyzer/net-snmp-5.1.2:= - net-nds/openldap[sasl] - || ( - $(for slot in ${BERKDB_SLOTS[@]} ; do printf '%s\n' "sys-libs/db:${slot}" ; done) - ) - sys-libs/cracklib - sys-libs/e2fsprogs-libs - sys-libs/zlib - pam-passthru? ( sys-libs/pam ) - selinux? ( - $(python_gen_cond_dep ' - sys-libs/libselinux[python,${PYTHON_USEDEP}] - ') - ) - systemd? ( >=sys-apps/systemd-244 ) - virtual/libcrypt:= - " - -BDEPEND=">=sys-devel/autoconf-2.69-r5 - virtual/pkgconfig - ${PYTHON_DEPS} - $(python_gen_cond_dep ' - dev-python/argparse-manpage[${PYTHON_USEDEP}] - ') - doc? ( app-doc/doxygen ) - test? ( dev-util/cmocka ) -" - -# perl dependencies are for logconv.pl -RDEPEND="${DEPEND} - !dev-libs/svrcore - !net-nds/389-ds-base:0 - acct-user/dirsrv - acct-group/dirsrv - ${PYTHON_DEPS} - $(python_gen_cond_dep ' - dev-python/pyasn1[${PYTHON_USEDEP}] - dev-python/pyasn1-modules[${PYTHON_USEDEP}] - dev-python/argcomplete[${PYTHON_USEDEP}] - dev-python/python-dateutil[${PYTHON_USEDEP}] - dev-python/python-ldap[sasl,${PYTHON_USEDEP}] - dev-python/distro[${PYTHON_USEDEP}] - ') - virtual/perl-Archive-Tar - virtual/perl-DB_File - virtual/perl-IO - virtual/perl-Getopt-Long - virtual/perl-IO-Compress - virtual/perl-MIME-Base64 - virtual/perl-Scalar-List-Utils - virtual/perl-Time-Local - virtual/logger - selinux? ( sec-policy/selinux-dirsrv ) -" - -S="${WORKDIR}/${PN}-${P}" - -PATCHES=( - "${FILESDIR}/${P}-crypt-import.patch" - "${FILESDIR}/${PN}-db-gentoo.patch" -) - -distutils_enable_tests pytest - -src_prepare() { - # this is for upstream GitHub issue 4292 - if use !systemd; then - sed -i \ - -e 's|WITH_SYSTEMD = 1|WITH_SYSTEMD = 0|' \ - Makefile.am || die - fi - - # GH issue 4092 - sed -i \ - -e 's|@localstatedir@/run|/run|' \ - ldap/admin/src/defaults.inf.in || die - - default - - eautoreconf -} - -src_configure() { - local myeconfargs=( - $(use_enable accountpolicy acctpolicy) - $(use_enable bitwise) - $(use_enable dna) - $(use_enable pam-passthru) - $(use_enable autobind) - $(use_enable auto-dn-suffix) - $(use_enable debug) - $(use_enable ldapi) - $(use_with selinux) - $(use_with systemd) - $(use_with systemd systemdgroupname "dirsrv.target") - $(use_with systemd tmpfiles-d "/usr/lib/tmpfiles.d") - --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" - $(use_with !systemd initddir "/etc/init.d") - $(use_enable test cmocka) - --enable-rust - --enable-rust-offline - --with-pythonexec="${PYTHON}" - --with-fhs - --with-openldap - --with-db-inc="$(db_includedir)" - --disable-cockpit - ) - - econf "${myeconfargs[@]}" - - rm "${S}"/.cargo/config || die -} - -src_compile() { - export CARGO_HOME="${ECARGO_HOME}" - - default - - if use doc; then - doxygen "${S}"/docs/slapi.doxy || die - fi - - cd "${S}"/src/lib389 || die - distutils-r1_src_compile - - # argparse-manpage dynamic man pages have hardcoded man v1 in header - sed -i \ - "1s/\"1\"/\"8\"/" \ - "${S}"/src/lib389/man/{openldap_to_ds,ds{conf,ctl,idm,create}}.8 || die -} - -src_test () { - emake check - cd "${S}"/src/lib389 || die - distutils-r1_src_test -} - -src_install() { - # -j1 is a temporary workaround for bug #605432 - emake -j1 DESTDIR="${D}" install - - # Install gentoo style init script - # Get these merged upstream - newinitd "${FILESDIR}"/389-ds.initd-r1 389-ds - newinitd "${FILESDIR}"/389-ds-snmp.initd 389-ds-snmp - - dotmpfiles "${FILESDIR}"/389-ds-base.conf - - # cope with libraries being in /usr/lib/dirsrv - dodir /etc/env.d - echo "LDPATH=/usr/$(get_libdir)/dirsrv" > "${ED}"/etc/env.d/08dirsrv || die - - if use doc; then - cd "${S}" || die - docinto html/ - dodoc -r html/. - fi - - cd "${S}"/src/lib389 || die - distutils-r1_src_install - python_fix_shebang "${ED}" - - find "${ED}" -type f \( -name "*.a" -o -name "*.la" \) -delete || die -} - -pkg_postinst() { - tmpfiles_process 389-ds-base.conf - - echo - elog "If you are planning to use 389-ds-snmp (ldap-agent)," - elog "make sure to properly configure: /etc/dirsrv/config/ldap-agent.conf" - elog "adding proper 'server' entries, and adding the lines below to" - elog " => /etc/snmp/snmpd.conf" - elog - elog "master agentx" - elog "agentXSocket /var/agentx/master" - elog - elog "To start 389 Directory Server (LDAP service) at boot:" - elog - elog " rc-update add 389-ds default" - elog - echo -} diff --git a/net-nds/389-ds-base/Manifest b/net-nds/389-ds-base/Manifest index 0211e6d51641..adadfd47f7c9 100644 --- a/net-nds/389-ds-base/Manifest +++ b/net-nds/389-ds-base/Manifest @@ -77,5 +77,5 @@ DIST winapi-i686-pc-windows-gnu-0.4.0.crate 2918815 BLAKE2B 4d357e4d30f955297217 DIST winapi-x86_64-pc-windows-gnu-0.4.0.crate 2947998 BLAKE2B 2ad1ea8b5fa07d544e910ccba043ae925269b76b26c9da356305b34b86741dd8b9aff0b9ffe3d562db4fcd7d7c46a11ce9e3168b782b1d89ae6881742b7ede82 SHA512 4a654af6a5d649dc87e00497245096b35a2894ae66f155cb62389902c3b93ddcc5cf7d0d8b9dd97b291d2d80bc686af2298e80abef6ac69883f4a54e79712513 DIST zeroize-1.2.0.crate 15450 BLAKE2B 1f3c2688cf84d8bc22f777cc06673c29c9306b2c246bec67404729dac01570dd550c4ebe1f9cbd04c3d6a2711bf7106c45a34d01bb0ab7b73d3a15a65bf66eb7 SHA512 9bc0242824908909669e473029990a582efb884ce8f37d153d3a92083f64afe7b3bb26821dff8f39af74ea7935024d9414d458cf61c2e6291ca3611e896ae390 DIST zeroize_derive-1.0.1.crate 8047 BLAKE2B c43d99d7f80d104ec43708742d2c13080a3b96d0b8ffac099f86c82bce33d263313a42ebec42ed5dbeaeac397d1717e6cf089980dd7934b1efc7228b737a5f21 SHA512 cbb7fe8d9ecb38c0f6fd11e491afa289cc9d8719f2460f4569816d7d55ec17fc88aa9a167aafb83809e2122481e016039b055e3bc4edfdeaf009fc0d65212dc7 -EBUILD 389-ds-base-1.4.4.16.ebuild 6590 BLAKE2B c8c0d6c236cb27731a90223c90e1f5c8ee8deb9feda08bfb80b283ebf23d47b7250132095d99fcc04c43fed8fba9f2a22ae2b48278849fc89f5548a6ada1d67d SHA512 336b325dd9e5712b563bcd5eb9f88de91f3f4d403be56889bbace434435cfa6a9dad101f0271abddbf664d52c64a0c82dbbca9315e7cc6b5f213835851c249e9 -MISC metadata.xml 1459 BLAKE2B 6da8c449be55f7c70e560a5d5ec6fb1fbcf3823586ef3beaa4bd5c5b4d3cdd71f2383ffd08744b051419bbc8492faac5ef1b94e5a88d546bd36b3cc7e94d9292 SHA512 b9c6773813d4c4b221622457bc9cfc284232c7d572445c2cd9531476528863e354f3c4483f61d2d81564aabea60d1594f5b5cae6c279f0c51af1370f5c623b2d +EBUILD 389-ds-base-1.4.4.16-r1.ebuild 6583 BLAKE2B 4f73a5ed48192f5b0449b71eea70b4b9c65e828a04a731066369aee0a802db5b26d94fa2b54a7818342ce671c0dad725e0d22e13fcaabf266920486085e40860 SHA512 b6628b6e28f6b6998d59336e2b1e845ee2cf8d3fdef60b877aef12ee8fbd60bdb949a5f72603dd10c17e49faf51f99ef440b7164e9e8b2f5daec286749ab1887 +MISC metadata.xml 1460 BLAKE2B c3c5e271a36f665015758b047f9e533dc0c593c2b8a241ed560afb3d54e2798ad08c98586dadafdcc5dc44b249db95f510022ace1a71167004d8dd721f2ec513 SHA512 6397b47a23a4bdb197b9298b08e7f9c3cf86c2ec4102170e49619b4e636d55837b4e28782cfda0790d9d2824903fd6169fe125052bf4efde2df1f3968c06476e diff --git a/net-nds/389-ds-base/metadata.xml b/net-nds/389-ds-base/metadata.xml index 2963a9951817..783f5bd0fbcd 100644 --- a/net-nds/389-ds-base/metadata.xml +++ b/net-nds/389-ds-base/metadata.xml @@ -1,5 +1,5 @@ - + Dessa@gmake.de diff --git a/net-nds/Manifest.gz b/net-nds/Manifest.gz index 1ec56ec2883a..21e275b42946 100644 Binary files a/net-nds/Manifest.gz and b/net-nds/Manifest.gz differ diff --git a/net-nds/adtool/Manifest b/net-nds/adtool/Manifest index 6b5b61dfb630..fb55b6973099 100644 --- a/net-nds/adtool/Manifest +++ b/net-nds/adtool/Manifest @@ -3,4 +3,4 @@ AUX adtool-1.3.3-bfr-overflow.patch 587 BLAKE2B ea6322d2dcc26575676ba26f048db275 AUX adtool-1.3.3-fno-common.patch 528 BLAKE2B eca0e12bb41b9d52e634fee7670caa8c9b4f2b7b51ab5b1631d827b36a0cd5f705d44b1c044a71aaedd75de7564f5a7d90869d06252cf1dc01a44b652dcdcf2a SHA512 26f1b8fcba21b925c496090d90e4fe13f8f5d584ac24d40e218d1ba0e9b16a2c0cf088bbae6e43706a5737c0537c7b50bf32605747c2a411f8ac52003693756a DIST adtool-1.3.3.tar.gz 334767 BLAKE2B 401f10df2708a2e2b7384354192337145739d4a8df2f0366171d0989836c9795263dba9d95d597d3e129b72bfcd53df2532c55a62d126e773bcf79cac909df52 SHA512 800a9fd19481b2c986991c27674e24b40bd6f4d58d7cbcf94532acb88f6c36de1f18d4165d6a2dcffd7d5baeac86aaf6f0ff1ef1b46d93ffc28b826b3d857251 EBUILD adtool-1.3.3-r1.ebuild 580 BLAKE2B c017a841de408e0c2bd596b9a1e02d0a067e41b0e6ab099be7e446219808f37d85ff45b4f10499cd3bb26f17fe95c267f83e8a3a2edc1e07a015f0d2946702fe SHA512 9000ed0995ff8d505d65cfb4d3c9bed2161ad84eeb9c5bdf6c65b67999ca3e392208cd5710a6479f552a68537cfa8cd78f6de0319f426f6e2157779072c59068 -MISC metadata.xml 316 BLAKE2B dab8286c90e963fa534872bbd0a14ead0cb628292468a6c049e901307527a3b7bb41cc9d7da91fb66a23169ccc34d70905c8c22535d4ff5706a135615f246c50 SHA512 f4998caf1492df78f9bc82c7fcf2661046f8d61dfc70bbaa36652accfe367b3af13ff10922841beb6e6dbd69018ae3be82a4f3346e77ed4070ff40d2137c07a6 +MISC metadata.xml 317 BLAKE2B 5aed0c4e8afe6ff6146e11ceb5666c3ae1016d6569cb539d536cbad8273915b99acdc9036c0f90e37154c1fb8c11b7dea942e20eceb53f14837e7ea9a876202b SHA512 36de6a092c0a74713e2ade79bb3abb3ec1990f6405f016125896a763ae20c157055e6319c23a1d6534e7b92449ff68be95045d42333c570912708ded0e279dc3 diff --git a/net-nds/adtool/metadata.xml b/net-nds/adtool/metadata.xml index 61c9370d8e01..e96b8c5f5f14 100644 --- a/net-nds/adtool/metadata.xml +++ b/net-nds/adtool/metadata.xml @@ -1,5 +1,5 @@ - + diff --git a/net-nds/gssproxy/Manifest b/net-nds/gssproxy/Manifest index 08ca0fa74a8a..ec2ebf28a188 100644 --- a/net-nds/gssproxy/Manifest +++ b/net-nds/gssproxy/Manifest @@ -1,4 +1,4 @@ AUX gssproxy 276 BLAKE2B f529b72cc589910a8c7c5f76428359e6bbca612e3ce78f1a02213655183942d1c362a3c48d7d60ceb408d4ae0a8dd75f12ebaa30d7cff59d1f0ea2537c2b1dcc SHA512 883a9a82e9f7e92aee212f9cdc8a5c5eb5204d03a928a48d5826ef4de273907a8d4f1bbf2e9351d19f88fb35cd499ea1103d7aaa0e97ed23fc2e5a0b35be0fee DIST gssproxy-0.8.4.tar.gz 567579 BLAKE2B 55519d2d439e168df0346cfa2655e01bc90191e17ea7d8c72c5f29c22ed6adca39e5adb4fd900f6dc756147b2fbee23212bfc097c38ab927e6c9679b0186fa2c SHA512 ab81c40d6c7b1908751feb107d8da66603b7681fb67aa7a1f30194a81d542ca89e6c2f34425e9356b9c55eb3691bfa240ba41441c01498af45e862a133cd088a EBUILD gssproxy-0.8.4.ebuild 2807 BLAKE2B 018f555f13754fd0673e2597ad55ff019e7d5d7d177ebc3b889d4c1debc4477ca3ba1e852e411064477a55711138b9d3cf0418b18c294b63750a78d62ca52d46 SHA512 8318e5c635a5e5177277f6614e30149fadde1044bdabb4f0eb95ad7cefaa0fed01a9ca071a34fffca025bad56b341db30160cb9b2ce9e8da38cfbccbc86f55c8 -MISC metadata.xml 220 BLAKE2B 8ead86e7c2e2a8ecb0068c4ebcf5322f3ccce91c48fb2bc0b62bc6400609f57b3d5c37f92351f748da0e603129fe3e7be8dfcdb6294e003bf33e3ac0ca30eb48 SHA512 c262561324e85dc1fe18ceede654af3ae9f494b36233a807944dbbc7ac9764c93654d1faf958ef4c98c1fb370c71f5073443294289f43ddee0c76e606a703d32 +MISC metadata.xml 221 BLAKE2B 12ca7879e624ddb2085fbcf6c64b392796ef63aa3542bb51f80594cb6f319c2e7cc52660108a94f81ce540a19b07607ac599e82a21c4b5a46ccbf983c5d38d3b SHA512 c67d921bc7074f20a036d795b10293f39a9a2d6d21ccbbeee776a6ceff36d0e89f15bb98f6761de93f290addbf1447fddd20de80cec60c0987913d47e976ef61 diff --git a/net-nds/gssproxy/metadata.xml b/net-nds/gssproxy/metadata.xml index aebca33be179..3f6127b56e7f 100644 --- a/net-nds/gssproxy/metadata.xml +++ b/net-nds/gssproxy/metadata.xml @@ -1,5 +1,5 @@ - + base-system@gentoo.org diff --git a/net-nds/jxplorer/Manifest b/net-nds/jxplorer/Manifest index 3bda8379a807..d4a95fca7a85 100644 --- a/net-nds/jxplorer/Manifest +++ b/net-nds/jxplorer/Manifest @@ -3,4 +3,4 @@ AUX build.xml 1871 BLAKE2B 0edb1b98c8b2f8b2de5996b1ce8ef8558d08fdff034d5187460a3 AUX jxplorer-3-pre 663 BLAKE2B d7311e13b367c74af7ebc005c15ef14af80057c995f2d30dd684a49c09c10e165d5c18721f7c266ff4066a904f0ad34e3570e250ebebe2b8486fe54cd7d26875 SHA512 11acb8c28a063825678ec3fe7bafc1cd1d0f99c96d49e62500d06b0584967017efb050c561826ce8b6db8a73da66ea1742f4a361fddc4e17abddad5174106f9f DIST jxplorer-3.3.1.2-project.zip 4625538 BLAKE2B b1bfb552dd4524f4d0fde4ff15617bf3e50629c0f879f05ee87c9f301afa9a5a4c544c8bb85d5b9639fe809f030752f9e96c321a4e6d20fda7aa55097363bdeb SHA512 6c95de48b2abd41a4926de3bd9bd203e266676028e12d1f1c93d8ef6f10b233eefcb122c8c075d6758b43c85e30fdc4b01d55811e5fcbdcd64d353c6f0fef94a EBUILD jxplorer-3.3.1.2-r1.ebuild 1796 BLAKE2B 43eef49d886421732e96f4d67e3829a78c906a95b709d5904e1ee73f6096640b82bd6741191976092f61b12f9027a11feac105e31f3ce14669677d1778ccb571 SHA512 c245a500df028f66c2b10b7fdb7a9f4dffb19775279a172a3003696d0121d46f1d9f34162ffbb1069ff9940a1ccc28aa00f0676f2f62a6ec157a94b6fedd83ba -MISC metadata.xml 314 BLAKE2B f90c3010c15a26ffb04114d4049aadedb720df7d6bf04801603d6fb4f63331d6a5f7b135d4d926e0cbc8504849c1677b04b9d61e0fe67ee97ec41d5e30375b88 SHA512 28b10ef2e247491aac4d9868d8c42ccef74abdc9806820b84a29d479e8f53218e1aab497c3f450c289cacf40ea8fbd193a508203ffc915ad2fb7582258bc7d96 +MISC metadata.xml 315 BLAKE2B 3a0a5eabbb965a2db04fb5017cbaeab09b12f0d5e39cc20700a3fa179b08988af8132dd7b6957b68cff84e1d2ef79fe328076fc333aedd01961519c31dbd3465 SHA512 788c959697912642f7c5481eced1e7f2bfab8a183d27e000641c860981868f01b68ea6f54de21fc5ee8229fa0bcdd25165c3cf160c271fb20aebd3334b3358cf diff --git a/net-nds/jxplorer/metadata.xml b/net-nds/jxplorer/metadata.xml index 47977bec6070..f7c8e043e944 100644 --- a/net-nds/jxplorer/metadata.xml +++ b/net-nds/jxplorer/metadata.xml @@ -1,5 +1,5 @@ - + java@gentoo.org diff --git a/net-nds/ldapvi/Manifest b/net-nds/ldapvi/Manifest index e8a9ebe527f1..017927f8af21 100644 --- a/net-nds/ldapvi/Manifest +++ b/net-nds/ldapvi/Manifest @@ -1,3 +1,3 @@ DIST ldapvi-1.7_p20101214.tar.bz2 1490491 BLAKE2B 21bb7b6113e89ce848e7a8efcec063dbfe9c32331c1125456a96dc6edc4e09d17245307a041a7d7804fac20bcce5b38677d719fb53d993fb874134bbd4d4df19 SHA512 2d2a744a36364793f406f37ecf6e546914d697457dec37b81544f4979f4c692756b2a1c3ea6fcbaba5e3238b2bf758ab3e0bd9a9a0794c4da734d65286bd5925 EBUILD ldapvi-1.7_p20101214-r2.ebuild 1013 BLAKE2B bfbd8833cc620faa9cb4322d7159ee88fedbc60b0a7850285162f9a789e1a0f9024df8f6c87285bd9aa4c508a07388bca9616b27fc84a983c3c3ab1851fb45c0 SHA512 2ff77b829383aac452db4661ca62baea52a92105135a04f28894fb71beb6df3519c62dc28eca8333a57f482c896c3c4ce923f402a29c6ecd378b5bacb02951ad -MISC metadata.xml 256 BLAKE2B e359587434ae69bc9db48bc0dbc2071c4b5c487ad9f65dea534f5a9ef38585191088f8cdf58d2803f50bd97b871d3d68d16b011cce3af71bf5953eb1b5a72e56 SHA512 3ac9c3945f86b6121a94e460be21c5ce62dd0de5ff42efa05e74d04b9baf7fd72e2479c8b8b7e7c913d773d6262ab63cf095d6ef32507d871dab24bc2dac3360 +MISC metadata.xml 257 BLAKE2B 2b8c0475fd2f982c8f0d1675eb7daf656b0671906551ad0c5dd151b70bf9e43194a39a08c5e6e28e07e933fd7627ba5cc5d43595b13924b60bb3515329e5e79c SHA512 c14a70df1639d58bc0aae865ee21874afbcc9b57a24c4a0612a04f58936a92e83c88d3a698bac8680c70da7a52e54fa0ee2a607063c23f57d85893c4e05b393b diff --git a/net-nds/ldapvi/metadata.xml b/net-nds/ldapvi/metadata.xml index 88c46f5af765..29dcd68733cb 100644 --- a/net-nds/ldapvi/metadata.xml +++ b/net-nds/ldapvi/metadata.xml @@ -1,5 +1,5 @@ - + diff --git a/net-nds/led/Manifest b/net-nds/led/Manifest index eeef070535aa..56e6d565949a 100644 --- a/net-nds/led/Manifest +++ b/net-nds/led/Manifest @@ -1,3 +1,3 @@ DIST led-1.111.tar.gz 30636 BLAKE2B 54169c602b7b1feeff4fac4999d8c25ec56107234ddb62f9c6bcac2faed0c4f3bdba27ff666b2385d14bff8bdd01521ef3a981e77148af422ef73893bd985dc9 SHA512 e5078cbed72e406846f50be13fa2e475549b5e0f22eee8da19fca1bb097bc155ee38d289f3f1f89e47d4efae6d9d67eda8bec8a2dd9b90f52020dcd6ea2945e5 EBUILD led-1.111.ebuild 699 BLAKE2B ff79bc72d764fccf43b7496a2138774c56855092177cb8873c3d6ef4ce4878f2e3726847a1914e19f5afc76c5a480d1fda000f139c66065697063cad71cb080f SHA512 f05f695789593009615085a06a9da05d97640c4bc64937d6bc63ba4f729bd66d4ab94126c327c7cc48385a66a8c9edb92c25bfedc4677eb2d3e0b1c4544efd9b -MISC metadata.xml 333 BLAKE2B b5752f015f532d37755c1ccde2ac987db326f0e0962505825d7885e3a11670ee08db0280f5e7372999b0c99b89d2a68581c6b78045fb9c0a24bc0d55be6d4cab SHA512 455aeeda0952f143bd2ec87c4c7d47096a0d95e9587994d1fc9a89aaba738f814384006b4c6c1dda3ef37800cf32f9e658a1037b3f269a3590f461c77ec43ccf +MISC metadata.xml 334 BLAKE2B ca9375958e19604a4a362785cadbf3cfe9ac944babfed9cb28138cd2480ad18e3a08a8c4b91d2c42bf7a8386607c623ca17c4a67d673f9a4d9507d457c638830 SHA512 563ba9aa159f828535d6c35f9a510ec8f154bffc9d6521f5c4d0da2d4234886c3d80a433c9625ad92b9f13aedcba971799fedf9f1cf7fb483aa7b69d2899bc2b diff --git a/net-nds/led/metadata.xml b/net-nds/led/metadata.xml index 0582001aca48..f8d9fcb68a42 100644 --- a/net-nds/led/metadata.xml +++ b/net-nds/led/metadata.xml @@ -1,5 +1,5 @@ - + robbat2@gentoo.org diff --git a/net-nds/metadata.xml b/net-nds/metadata.xml index 4b2da444b63a..7d6af5ba3871 100644 --- a/net-nds/metadata.xml +++ b/net-nds/metadata.xml @@ -1,5 +1,5 @@ - + The net-nds category contains NDS (NetWare Directory Services) software. diff --git a/net-nds/nsscache/Manifest b/net-nds/nsscache/Manifest index 3f73b29f09c3..7b8d76658409 100644 --- a/net-nds/nsscache/Manifest +++ b/net-nds/nsscache/Manifest @@ -1,4 +1,4 @@ DIST nsscache-0.30-r3-gentoo-authorized-keys-command.py 11974 BLAKE2B 4272bab8d85ef0f39c8b26fd035009d3c77dd629fd7853e0072232393d329af1885ce44c4877d7718a37154661d9c85bb1f5276463875f9dfbbd023106d9d15a SHA512 b660a6ae19e6e42efbb07d0a368704706b0a0bd1bf0b2c84855f0d1c00d4cda80872432f5a25384d0c27e99bf60072beb12975bcfa0201b52fa040d0e6bc2da2 DIST nsscache-0.39.tar.gz 127896 BLAKE2B 8383ca53ee5cf2f84e4485722d35598b624005bb32073696a23daa1061c0b057d26333cdee9c97cedcb99daa8c61362719d80b01b216c163a327cd4edeabeefd SHA512 f93cec949302f21bc5989ab3192302a32349ee4ae98e2f05f169cca8a16a821f39857cb0fff52c7b54552828684b4723d22e44f97525a01577ab89bd159e0376 EBUILD nsscache-0.39.ebuild 1551 BLAKE2B e887301bcc5d0c5a2ed4a3cb8394634377754b562bcc9d00f611724f63f3c2f2a4c37b517c72b961d5a87694b0618f432cc963af12269d7c9e45fada4f18b7de SHA512 dc98faed7dc9f0b4e591eaac4b13b3ba8c452574b5fc82d41115a2cadb464e1dd07e0e682969118459a7f216d6f26aa488912be461ce4058dbff0ea9660b9038 -MISC metadata.xml 455 BLAKE2B 1e71e0d24defac1beb64e865e0d30327414874bd0017fed5059e530f3dc08c8f11d20b6234bd16486bd6192c52e417e2c85262d1479e6da07e6cff7027ac7e28 SHA512 04e60c7b2db069aecaa3d69cb2760143ccf30a34f5ac304d63962de65bc4db3fbcadd8be27c8a7b949a115ca0e879f3136773a6e63f4573faa817efc1821f075 +MISC metadata.xml 456 BLAKE2B ee505573318df447fed8e9a7aeb0a0df522ec19ae87ad652fe81b1434671e0d60adef32d065f885a8d53ee6d93ffe17a556b804ecb2ada878445af754ce391aa SHA512 265423e266552a7a66dd5eb5615febb9984abb2e87f565df8aac64400672e5bae45d8a42b3e7727bea1509c2c87b003136917dfa6e0281785f4e8fd88f3d9ad9 diff --git a/net-nds/nsscache/metadata.xml b/net-nds/nsscache/metadata.xml index 49a9b9a18f2b..d3fb44707ce8 100644 --- a/net-nds/nsscache/metadata.xml +++ b/net-nds/nsscache/metadata.xml @@ -1,5 +1,5 @@ - + robbat2@gentoo.org diff --git a/net-nds/openldap/Manifest b/net-nds/openldap/Manifest index 91394b1c719c..2c5cd76798bf 100644 --- a/net-nds/openldap/Manifest +++ b/net-nds/openldap/Manifest @@ -25,8 +25,8 @@ DIST openldap-2.4.58.tgz 5885225 BLAKE2B effb618dba03497796a497cd7f53ec52e389133 DIST openldap-2.4.59.tgz 5886272 BLAKE2B a2a8bed1d2af97fd41d651668152fd4740871bc5a8abf4b50390839228af82ac103346b3500ae0f8dd31b708acabb30435b90cd48dfafe510e648df5150d96b8 SHA512 233459ab446da6e107a7fc4ecd5668d6b08c11a11359ee76449550393e8f586a29b59d7ae09a050a1fca4fcf388ea61438ef60831b3ae802d92c048365ae3968 DIST openldap-2.5.4.tgz 6415235 BLAKE2B 16e466d01dc7642786bb88a101854513f1239f1e817fd05145e89deb54bc1b911a5dc5f42b132747f14bdd2a3355e7c398b8b14937e7093361f4a96bfb7e9197 SHA512 00b57c9179acf3b1bde738e91604f3b09b5f5309106362bb947154d131868f233713eaa75c9af9771bfad731902d67406e8fb429851bad227fc48054cace16a8 DIST rfc2307bis.schema-20140524 12262 BLAKE2B 98031f49e9bde1e4821e637af3382364d8344ed7017649686a088070d96a632dffa6c661552352656b1b159c0fd962965580069a64c7f3d5bb6a3ed75f60fd99 SHA512 83b89a1deeefc8566b97e7e865b9b6d04541099cbdf719e24538a7d27d61b6209e87ab9003a9f140bd9afd018ec569e71721e3a24090e1902c8b6659d2ba103e -EBUILD openldap-2.4.57-r1.ebuild 29110 BLAKE2B 206d1449037f69b81c4d47bc368919dcf1a796ef2e331df597acca641d4ff77cb7da7908c44f09b440d979bb17926e9a51af126f5d6941853a57ba88777e46e7 SHA512 42bf7ad43519b02c440430a919f7760c9f7d99ef715085fdae46aed3c36b54355e52a62a9b849207934703aa625151e54e0260e09cb52c900179de7d494adf70 -EBUILD openldap-2.4.58-r1.ebuild 29118 BLAKE2B 28397dfb743e0344575ff563b26537d1b6e330e609300863a018adcb4edb3b70c2c2bd8d689c4b986b85af3be95e25db93c9a14e53154d50acd5ffb46e6893ac SHA512 250e19bc91392627e7fc6e5b35fe6d104f06b318a7094b2506a04e438d6f2c2b201f6ca3d90d69f56338a2babe5d3c1c3d82e5eea29429f7ad06dae2fa472b5f -EBUILD openldap-2.4.59-r1.ebuild 29118 BLAKE2B 28397dfb743e0344575ff563b26537d1b6e330e609300863a018adcb4edb3b70c2c2bd8d689c4b986b85af3be95e25db93c9a14e53154d50acd5ffb46e6893ac SHA512 250e19bc91392627e7fc6e5b35fe6d104f06b318a7094b2506a04e438d6f2c2b201f6ca3d90d69f56338a2babe5d3c1c3d82e5eea29429f7ad06dae2fa472b5f -EBUILD openldap-2.5.4.ebuild 27229 BLAKE2B 83a96f855953a9cb56291949bfc0eaa4da21ab0cc784e34ca3866f5d00cc55f1fb3ac54252708b2eaf94fb78c4459646095dcb5509b6a5e0a0fc9a28c08522f7 SHA512 890bb982c7937e7e0fa4912ff304c8fb7b56ffc8db43b7290cfb90e8bac225cd0e913400756a6f08d8ba9d936cab6a2db35ddf34b1872b7b81c2132448bcc209 -MISC metadata.xml 1030 BLAKE2B b940261c1e1fac05fceffc80673100d3102e53b532b8936b2e51bbf5a6bdf2ff5cfe633c53b494856d973a86c8d0f2b5acf8f2c26d2c62d16f1313fb8dab798a SHA512 c031e0cbe8d8f6d5fcdd8d4c4e036e5087068c35ae44264b5e244c0d6dee429836f493d75f6bb2cb422d14ccd0a7934b13748cf83517791e61c51fd6d924deb3 +EBUILD openldap-2.4.57-r2.ebuild 29103 BLAKE2B 176097aa953f53efffa29785125bdeddd2922836a7b1ce9fd36d537c6065833463f6800e0e52a6293c27d74b98c91189b6a3a4c0d195b39d33268383f82e639f SHA512 6828adbfaa6d4d9ec6f16322a965195422c2c0d018d2673dd3bc23b26314ce0a43ab7787f51f22d503298a533c7260a0a782e5091e1dbe716c13cee81be01574 +EBUILD openldap-2.4.58-r2.ebuild 29111 BLAKE2B 4f842320fa48255cc5284a0b3707b2b0381a1334fd9720657c867869954f3af7efe6a085fe608ca29f50d81c1aacc4378f70a2ce2d3c3329921d948c2e747881 SHA512 ebaa4d6f3858d4ae055af9b30f927f3d265f6c58397edd4ee9decfe5fdb130a9410a05047ad37eb48edfcf90029f9705bfc3cda550da2fc7912015394d9593d6 +EBUILD openldap-2.4.59-r2.ebuild 29111 BLAKE2B 4f842320fa48255cc5284a0b3707b2b0381a1334fd9720657c867869954f3af7efe6a085fe608ca29f50d81c1aacc4378f70a2ce2d3c3329921d948c2e747881 SHA512 ebaa4d6f3858d4ae055af9b30f927f3d265f6c58397edd4ee9decfe5fdb130a9410a05047ad37eb48edfcf90029f9705bfc3cda550da2fc7912015394d9593d6 +EBUILD openldap-2.5.4-r1.ebuild 27222 BLAKE2B b1ef40472c11ba9be316e56c3422530cf996d258df72d540b6bb13b9831e6261a2820a52d75defc2751ec401eca48af0004e6c4978800219e51e8d5cd4a3e361 SHA512 ab682204181ba86498cfa5b40cb33cabaeb086a779aea34fea04903b6758a2dbeab07fa9149a71d75d28317fb3f6473b4ea3396a2493e3fa3ed66ab80aa0de85 +MISC metadata.xml 1031 BLAKE2B 1e98f23b8035c52190d99b0b009ce4fa65d1e64902a3af2472f5866028f02ae3e599eb05ed2a45393118368786d64b8d30b77044c2a4019da4e7866c626a99aa SHA512 0feee9e685a5f4a2dd61ca9f0845de8c65e83ba08a67a3a90e8c97e0bf4ccf72b969b0328fa84ba9ec34fafd8bd97a448e9a3f3d2a2b3238e6dd7a2b38932293 diff --git a/net-nds/openldap/metadata.xml b/net-nds/openldap/metadata.xml index 38186cd8f1b6..901d31c63ed9 100644 --- a/net-nds/openldap/metadata.xml +++ b/net-nds/openldap/metadata.xml @@ -1,5 +1,5 @@ - + zlogene@gentoo.org diff --git a/net-nds/openldap/openldap-2.4.57-r1.ebuild b/net-nds/openldap/openldap-2.4.57-r1.ebuild deleted file mode 100644 index 47420777739a..000000000000 --- a/net-nds/openldap/openldap-2.4.57-r1.ebuild +++ /dev/null @@ -1,908 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles - -BIS_PN=rfc2307bis.schema -BIS_PV=20140524 -BIS_P="${BIS_PN}-${BIS_PV}" - -DESCRIPTION="LDAP suite of application and development tools" -HOMEPAGE="https://www.OpenLDAP.org/" - -# upstream mirrors are mostly not working, using canonical URI -SRC_URI=" - https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz - http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz - http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz - http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz - mirror://gentoo/${BIS_P}" - -LICENSE="OPENLDAP GPL-2" -SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris" - -IUSE_DAEMON="crypt samba tcpd experimental minimal" -IUSE_BACKEND="+berkdb" -IUSE_OVERLAY="overlays perl" -IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test" -IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2" -IUSE_CONTRIB="${IUSE_CONTRIB} cxx" -IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}" - -RESTRICT="!test? ( test )" -REQUIRED_USE="cxx? ( sasl ) - pbkdf2? ( ssl ) - test? ( berkdb ) - ?? ( test minimal )" - -# always list newer first -# Do not add any AGPL-3 BDB here! -# See bug 525110, comment 15. -# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build. -BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}" -BDB_PKGS='' -for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done - -# openssl is needed to generate lanman-passwords required by samba -COMMON_DEPEND=" - ssl? ( - !gnutls? ( - >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] - ) - gnutls? ( - >=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}] - >=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}] - ) - ) - sasl? ( dev-libs/cyrus-sasl:= ) - !minimal? ( - dev-libs/libltdl - sys-libs/e2fsprogs-libs - >=dev-db/lmdb-0.9.18:= - crypt? ( virtual/libcrypt:= ) - tcpd? ( sys-apps/tcp-wrappers ) - odbc? ( !iodbc? ( dev-db/unixODBC ) - iodbc? ( dev-db/libiodbc ) ) - perl? ( dev-lang/perl:=[-build(-)] ) - samba? ( - dev-libs/openssl:0= - ) - berkdb? ( - dash - "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch - - # bug #420959 - "${FILESDIR}"/${PN}-2.4.31-gcc47.patch - - # unbundle lmdb - "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch - - # fix some compiler warnings - "${FILESDIR}"/${PN}-2.4.47-warnings.patch -) - -openldap_filecount() { - local dir="$1" - find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l -} - -openldap_find_versiontags() { - # scan for all datadirs - local 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_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}$(sed "s:\/::" <<< ${each})" - 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=$(ver_cut 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" ]] && [[ -f "${SLAPD_PATH}" ]]; then - OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \ - | awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')" - if use berkdb; then - # find which one would be used - for bdb_slot in ${BDB_SLOTS} ; do - NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")" - [[ -n "${NEWVER}" ]] && break - done - fi - local fail=0 - if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then - : - # Nothing wrong here. - elif [[ -z "${OLDVER}" ]] && [[ -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}" ]] && [[ -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() { - local d l i - 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/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[minimal]' ; then - einfo "Skipping scan for previous datadirs as requested by minimal useflag" - else - openldap_find_versiontags - fi -} - -src_prepare() { - # ensure correct SLAPI path by default - sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \ - -i include/ldap_defaults.h || die - - default - rm -r libraries/liblmdb || die - - pushd build &>/dev/null || die "pushd 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" - popd &>/dev/null || die - - # wrong assumption that /bin/sh is /bin/bash - sed \ - -e 's|/bin/sh|/bin/bash|g' \ - -i tests/scripts/* || die "sed failed" - - # Required for autoconf-2.70 #765043 - sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.in || die - AT_NOEAUTOMAKE=yes eautoreconf -} - -build_contrib_module() { - # - pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1" - einfo "Compiling contrib-module: $3" - # Make sure it's uppercase - local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -D${define_name}=SLAPD_MOD_DYNAMIC \ - -I"${BUILD_DIR}"/include \ - -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" - popd &>/dev/null || die -} - -src_configure() { - # Bug 408001 - use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync - - # connectionless ldap per bug #342439 - append-cppflags -DLDAP_CONNECTIONLESS - - multilib-minimal_src_configure -} - -multilib_src_configure() { - local myconf=() - - use debug && myconf+=( $(use_enable debug) ) - - # ICU exists only in the configure, nowhere in the codebase, bug #510858 - export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no - - if ! use minimal && multilib_is_native_abi; then - local CPPFLAGS=${CPPFLAGS} - - # re-enable serverside overlay chains per bug #296567 - # see ldap docs chaper 12.3.1 for details - myconf+=( --enable-ldap ) - - # backends - myconf+=( --enable-slapd ) - if use berkdb ; then - einfo "Using Berkeley DB for local backend" - myconf+=( --enable-bdb --enable-hdb ) - DBINCLUDE=$(db_includedir ${BDB_SLOTS}) - einfo "Using ${DBINCLUDE} for sys-libs/db version" - # We need to include the slotted db.h dir for FreeBSD - append-cppflags -I${DBINCLUDE} - else - myconf+=( --disable-bdb --disable-hdb ) - fi - for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do - myconf+=( --enable-${backend}=mod ) - done - - myconf+=( $(use_enable perl perl mod) ) - - 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+=( --with-odbc=${odbc_lib} ) - fi - - # slapd options - myconf+=( - $(use_enable crypt) - --disable-slp - $(use_enable samba lmpasswd) - $(use_enable syslog) - ) - if use experimental ; then - myconf+=( - --enable-dynacl - --enable-aci=mod - ) - fi - for option in aci cleartext modules rewrite rlookups slapi; do - myconf+=( --enable-${option} ) - done - - # slapd overlay options - # Compile-in the syncprov, the others as module - myconf+=( --enable-syncprov=yes ) - use overlays && myconf+=( --enable-overlays=mod ) - - else - myconf+=( - --disable-backends - --disable-slapd - --disable-bdb - --disable-hdb - --disable-mdb - --disable-overlays - --disable-syslog - ) - fi - - # basic functionality stuff - myconf+=( - $(use_enable ipv6) - $(multilib_native_use_with sasl cyrus-sasl) - $(multilib_native_use_enable sasl spasswd) - $(use_enable tcpd wrappers) - ) - - # Some cross-compiling tests don't pan out well. - tc-is-cross-compiler && myconf+=( - --with-yielding-select=yes - ) - - local ssl_lib="no" - if use ssl || ( ! use minimal && use samba ) ; then - ssl_lib="openssl" - use gnutls && ssl_lib="gnutls" - fi - - myconf+=( --with-tls=${ssl_lib} ) - - for basicflag in dynamic local proctitle shared; do - myconf+=( --enable-${basicflag} ) - done - - tc-export AR CC CXX - CONFIG_SHELL="/bin/sh" \ - ECONF_SOURCE="${S}" \ - STRIP=/bin/true \ - econf \ - --libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \ - $(use_enable static-libs static) \ - "${myconf[@]}" - emake depend -} - -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. - local myconf_ldapcpp=( - --with-ldap-includes="${S}"/include - ) - - mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die - pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" - - local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS} - append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \ - -L"${BUILD_DIR}"/libraries/libldap/.libs - append-cppflags -I"${BUILD_DIR}"/include - ECONF_SOURCE=${S}/contrib/ldapc++ \ - econf "${myconf_ldapcpp[@]}" \ - CC="${CC}" \ - CXX="${CXX}" - popd &>/dev/null || die -} - -multilib_src_compile() { - tc-export AR CC CXX - emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh - local lt="${BUILD_DIR}/libtool" - export echo="echo" - - if ! use minimal && multilib_is_native_abi ; then - if use cxx ; then - einfo "Building contrib library: ldapc++" - src_configure_cxx - pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" - emake CC="${CC}" CXX="${CXX}" - popd &>/dev/null || die - fi - - if use smbkrb5passwd ; then - einfo "Building contrib-module: smbk5pwd" - pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd" - - MY_DEFS="-DDO_SHADOW" - if use samba ; then - MY_DEFS="${MY_DEFS} -DDO_SAMBA" - MY_KRB5_INC="" - fi - if use kerberos ; then - MY_DEFS="${MY_DEFS} -DDO_KRB5" - MY_KRB5_INC="$(krb5-config --cflags)" - fi - - emake \ - DEFS="${MY_DEFS}" \ - KRB5_INC="${MY_KRB5_INC}" \ - LDAP_BUILD="${BUILD_DIR}" \ - CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" - popd &>/dev/null || die - fi - - if use overlays ; then - einfo "Building contrib-module: samba4" - pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4" - - emake \ - LDAP_BUILD="${BUILD_DIR}" \ - CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap" - popd &>/dev/null || die - fi - - if use kerberos ; then - if use kinit ; then - build_contrib_module "kinit" "kinit.c" "kinit" - fi - pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" - einfo "Compiling contrib-module: pw-kerberos" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -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" - popd &>/dev/null || die - fi - - if use pbkdf2; then - pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2" - einfo "Compiling contrib-module: pw-pbkdf2" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -I../../../../include \ - ${CFLAGS} \ - -o pbkdf2.lo \ - -c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed" - einfo "Linking contrib-module: pw-pbkdf2" - "${lt}" --mode=link --tag=CC \ - "${CC}" -module \ - ${CFLAGS} \ - ${LDFLAGS} \ - -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ - -o pw-pbkdf2.la \ - pbkdf2.lo || die "linking pw-pbkdf2 failed" - popd &>/dev/null || die - fi - - if use sha2 ; then - pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2" - einfo "Compiling contrib-module: pw-sha2" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -I../../../../include \ - ${CFLAGS} \ - -o sha2.lo \ - -c sha2.c || die "compiling pw-sha2 failed" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -I../../../../include \ - ${CFLAGS} \ - -o slapd-sha2.lo \ - -c slapd-sha2.c || die "compiling pw-sha2 failed" - einfo "Linking contrib-module: pw-sha2" - "${lt}" --mode=link --tag=CC \ - "${CC}" -module \ - ${CFLAGS} \ - ${LDFLAGS} \ - -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ - -o pw-sha2.la \ - sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed" - popd &>/dev/null || die - fi - - # We could build pw-radius if GNURadius would install radlib.h - pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" - einfo "Compiling contrib-module: pw-netscape" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -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 "acl" "posixgroup.c" "posixGroup" # example code only - #build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos - 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 "cloak" "cloak.c" "cloak" - # build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand - build_contrib_module "denyop" "denyop.c" "denyop-overlay" - build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin" - build_contrib_module "dupent" "dupent.c" "dupent" - build_contrib_module "lastbind" "lastbind.c" "lastbind" - # lastmod may not play well with other overlays - build_contrib_module "lastmod" "lastmod.c" "lastmod" - build_contrib_module "noopsrch" "noopsrch.c" "noopsrch" - #build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576 - #build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER - build_contrib_module "trace" "trace.c" "trace" - popd &>/dev/null || die - # build slapi-plugins - pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues" - einfo "Building contrib-module: addrdnvalues plugin" - "${CC}" -shared \ - -I"${BUILD_DIR}"/include \ - -I../../../include \ - ${CFLAGS} \ - -fPIC \ - ${LDFLAGS} \ - -o libaddrdnvalues-plugin.so \ - addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed" - popd &>/dev/null || die - fi -} - -multilib_src_test() { - if multilib_is_native_abi; then - cd tests || die - emake tests - fi -} - -multilib_src_install() { - local lt="${BUILD_DIR}/libtool" - emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install - - if ! use minimal && multilib_is_native_abi; 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.4.40-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 - einfo "Adding $(basename ${x})" - sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die - 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 || die - eend - - # install our own init scripts and systemd unit files - einfo "Install init scripts" - sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die - doinitd "${T}"/slapd - newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd - - einfo "Install systemd service" - sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die - systemd_dounit "${T}"/slapd.service - systemd_install_serviced "${FILESDIR}"/slapd.service.conf - newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf - - # If built without SLP, we don't need to be before avahi - sed -i \ - -e '/before/{s/avahi-daemon//g}' \ - "${ED}"/etc/init.d/slapd \ - || die - - if use cxx ; then - einfo "Install the ldapc++ library" - cd "${BUILD_DIR}/contrib/ldapc++" || die - emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install - cd "${S}"/contrib/ldapc++ || die - newdoc README ldapc++-README - fi - - if use smbkrb5passwd ; then - einfo "Install the smbk5pwd module" - cd "${S}/contrib/slapd-modules/smbk5pwd" || die - emake DESTDIR="${D}" \ - LDAP_BUILD="${BUILD_DIR}" \ - libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install - newdoc README smbk5pwd-README - fi - - if use overlays ; then - einfo "Install the samba4 module" - cd "${S}/contrib/slapd-modules/samba4" || die - emake DESTDIR="${D}" \ - LDAP_BUILD="${BUILD_DIR}" \ - libexecdir="/usr/$(get_libdir)/openldap" install - newdoc README samba4-README - fi - - einfo "Installing contrib modules" - cd "${S}/contrib/slapd-modules" || die - for l in */*.la */*/*.la; do - [[ -e ${l} ]] || continue - "${lt}" --mode=install cp ${l} \ - "${ED}"/usr/$(get_libdir)/openldap/openldap || \ - die "installing ${l} failed" - done - - dodoc "${FILESDIR}"/DB_CONFIG.fast.example - docinto contrib - doman */*.5 - #newdoc acl/README* - newdoc addpartial/README addpartial-README - newdoc allop/README allop-README - newdoc allowed/README allowed-README - newdoc autogroup/README autogroup-README - newdoc dsaschema/README dsaschema-README - newdoc passwd/README passwd-README - cd "${S}/contrib/slapi-plugins" || die - 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} - - docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample* - docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample* - docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm - - dosbin "${S}"/contrib/slapd-tools/statslog - newdoc "${S}"/contrib/slapd-tools/README README.statslog - fi - - if ! use static-libs ; then - find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die - fi -} - -multilib_src_install_all() { - dodoc ANNOUNCEMENT CHANGES COPYRIGHT README - docinto rfc ; dodoc doc/rfc/*.txt -} - -pkg_preinst() { - # keep old libs if any - preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0) - # bug 440470, only display the getting started help there was no openldap before, - # or we are going to a non-minimal build - ! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]' - OPENLDAP_PRINT_MESSAGES=$((! $?)) -} - -pkg_postinst() { - if ! use minimal ; then - tmpfiles_process slapd.conf - - # 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 allow' 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 - if [[ -d "${EROOT}"/var/run/openldap ]]; then - use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; } - chmod 0755 "${EROOT}"/var/run/openldap || die - fi - use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default} - chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die - use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data - fi - - if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then - elog "Getting started using OpenLDAP? There is some documentation available:" - elog "Gentoo Guide to OpenLDAP Authentication" - elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)" - elog "---" - elog "An example file for tuning BDB backends with openldap is" - elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/" - fi - - 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.57-r2.ebuild b/net-nds/openldap/openldap-2.4.57-r2.ebuild new file mode 100644 index 000000000000..0687cd44fefb --- /dev/null +++ b/net-nds/openldap/openldap-2.4.57-r2.ebuild @@ -0,0 +1,908 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles + +BIS_PN=rfc2307bis.schema +BIS_PV=20140524 +BIS_P="${BIS_PN}-${BIS_PV}" + +DESCRIPTION="LDAP suite of application and development tools" +HOMEPAGE="https://www.OpenLDAP.org/" + +# upstream mirrors are mostly not working, using canonical URI +SRC_URI=" + https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz + http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz + http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz + http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz + mirror://gentoo/${BIS_P}" + +LICENSE="OPENLDAP GPL-2" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris" + +IUSE_DAEMON="crypt samba tcpd experimental minimal" +IUSE_BACKEND="+berkdb" +IUSE_OVERLAY="overlays perl" +IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test" +IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2" +IUSE_CONTRIB="${IUSE_CONTRIB} cxx" +IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}" + +RESTRICT="!test? ( test )" +REQUIRED_USE="cxx? ( sasl ) + pbkdf2? ( ssl ) + test? ( berkdb ) + ?? ( test minimal )" + +# always list newer first +# Do not add any AGPL-3 BDB here! +# See bug 525110, comment 15. +# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build. +BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}" +BDB_PKGS='' +for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done + +# openssl is needed to generate lanman-passwords required by samba +COMMON_DEPEND=" + ssl? ( + !gnutls? ( + >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] + ) + gnutls? ( + >=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}] + >=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}] + ) + ) + sasl? ( dev-libs/cyrus-sasl:= ) + !minimal? ( + dev-libs/libltdl + sys-fs/e2fsprogs + >=dev-db/lmdb-0.9.18:= + crypt? ( virtual/libcrypt:= ) + tcpd? ( sys-apps/tcp-wrappers ) + odbc? ( !iodbc? ( dev-db/unixODBC ) + iodbc? ( dev-db/libiodbc ) ) + perl? ( dev-lang/perl:=[-build(-)] ) + samba? ( + dev-libs/openssl:0= + ) + berkdb? ( + dash + "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch + + # bug #420959 + "${FILESDIR}"/${PN}-2.4.31-gcc47.patch + + # unbundle lmdb + "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch + + # fix some compiler warnings + "${FILESDIR}"/${PN}-2.4.47-warnings.patch +) + +openldap_filecount() { + local dir="$1" + find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l +} + +openldap_find_versiontags() { + # scan for all datadirs + local 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_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}$(sed "s:\/::" <<< ${each})" + 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=$(ver_cut 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" ]] && [[ -f "${SLAPD_PATH}" ]]; then + OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \ + | awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')" + if use berkdb; then + # find which one would be used + for bdb_slot in ${BDB_SLOTS} ; do + NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")" + [[ -n "${NEWVER}" ]] && break + done + fi + local fail=0 + if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then + : + # Nothing wrong here. + elif [[ -z "${OLDVER}" ]] && [[ -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}" ]] && [[ -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() { + local d l i + 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/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[minimal]' ; then + einfo "Skipping scan for previous datadirs as requested by minimal useflag" + else + openldap_find_versiontags + fi +} + +src_prepare() { + # ensure correct SLAPI path by default + sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \ + -i include/ldap_defaults.h || die + + default + rm -r libraries/liblmdb || die + + pushd build &>/dev/null || die "pushd 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" + popd &>/dev/null || die + + # wrong assumption that /bin/sh is /bin/bash + sed \ + -e 's|/bin/sh|/bin/bash|g' \ + -i tests/scripts/* || die "sed failed" + + # Required for autoconf-2.70 #765043 + sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.in || die + AT_NOEAUTOMAKE=yes eautoreconf +} + +build_contrib_module() { + # + pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1" + einfo "Compiling contrib-module: $3" + # Make sure it's uppercase + local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -D${define_name}=SLAPD_MOD_DYNAMIC \ + -I"${BUILD_DIR}"/include \ + -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" + popd &>/dev/null || die +} + +src_configure() { + # Bug 408001 + use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync + + # connectionless ldap per bug #342439 + append-cppflags -DLDAP_CONNECTIONLESS + + multilib-minimal_src_configure +} + +multilib_src_configure() { + local myconf=() + + use debug && myconf+=( $(use_enable debug) ) + + # ICU exists only in the configure, nowhere in the codebase, bug #510858 + export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no + + if ! use minimal && multilib_is_native_abi; then + local CPPFLAGS=${CPPFLAGS} + + # re-enable serverside overlay chains per bug #296567 + # see ldap docs chaper 12.3.1 for details + myconf+=( --enable-ldap ) + + # backends + myconf+=( --enable-slapd ) + if use berkdb ; then + einfo "Using Berkeley DB for local backend" + myconf+=( --enable-bdb --enable-hdb ) + DBINCLUDE=$(db_includedir ${BDB_SLOTS}) + einfo "Using ${DBINCLUDE} for sys-libs/db version" + # We need to include the slotted db.h dir for FreeBSD + append-cppflags -I${DBINCLUDE} + else + myconf+=( --disable-bdb --disable-hdb ) + fi + for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do + myconf+=( --enable-${backend}=mod ) + done + + myconf+=( $(use_enable perl perl mod) ) + + 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+=( --with-odbc=${odbc_lib} ) + fi + + # slapd options + myconf+=( + $(use_enable crypt) + --disable-slp + $(use_enable samba lmpasswd) + $(use_enable syslog) + ) + if use experimental ; then + myconf+=( + --enable-dynacl + --enable-aci=mod + ) + fi + for option in aci cleartext modules rewrite rlookups slapi; do + myconf+=( --enable-${option} ) + done + + # slapd overlay options + # Compile-in the syncprov, the others as module + myconf+=( --enable-syncprov=yes ) + use overlays && myconf+=( --enable-overlays=mod ) + + else + myconf+=( + --disable-backends + --disable-slapd + --disable-bdb + --disable-hdb + --disable-mdb + --disable-overlays + --disable-syslog + ) + fi + + # basic functionality stuff + myconf+=( + $(use_enable ipv6) + $(multilib_native_use_with sasl cyrus-sasl) + $(multilib_native_use_enable sasl spasswd) + $(use_enable tcpd wrappers) + ) + + # Some cross-compiling tests don't pan out well. + tc-is-cross-compiler && myconf+=( + --with-yielding-select=yes + ) + + local ssl_lib="no" + if use ssl || ( ! use minimal && use samba ) ; then + ssl_lib="openssl" + use gnutls && ssl_lib="gnutls" + fi + + myconf+=( --with-tls=${ssl_lib} ) + + for basicflag in dynamic local proctitle shared; do + myconf+=( --enable-${basicflag} ) + done + + tc-export AR CC CXX + CONFIG_SHELL="/bin/sh" \ + ECONF_SOURCE="${S}" \ + STRIP=/bin/true \ + econf \ + --libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \ + $(use_enable static-libs static) \ + "${myconf[@]}" + emake depend +} + +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. + local myconf_ldapcpp=( + --with-ldap-includes="${S}"/include + ) + + mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die + pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" + + local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS} + append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \ + -L"${BUILD_DIR}"/libraries/libldap/.libs + append-cppflags -I"${BUILD_DIR}"/include + ECONF_SOURCE=${S}/contrib/ldapc++ \ + econf "${myconf_ldapcpp[@]}" \ + CC="${CC}" \ + CXX="${CXX}" + popd &>/dev/null || die +} + +multilib_src_compile() { + tc-export AR CC CXX + emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh + local lt="${BUILD_DIR}/libtool" + export echo="echo" + + if ! use minimal && multilib_is_native_abi ; then + if use cxx ; then + einfo "Building contrib library: ldapc++" + src_configure_cxx + pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" + emake CC="${CC}" CXX="${CXX}" + popd &>/dev/null || die + fi + + if use smbkrb5passwd ; then + einfo "Building contrib-module: smbk5pwd" + pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd" + + MY_DEFS="-DDO_SHADOW" + if use samba ; then + MY_DEFS="${MY_DEFS} -DDO_SAMBA" + MY_KRB5_INC="" + fi + if use kerberos ; then + MY_DEFS="${MY_DEFS} -DDO_KRB5" + MY_KRB5_INC="$(krb5-config --cflags)" + fi + + emake \ + DEFS="${MY_DEFS}" \ + KRB5_INC="${MY_KRB5_INC}" \ + LDAP_BUILD="${BUILD_DIR}" \ + CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" + popd &>/dev/null || die + fi + + if use overlays ; then + einfo "Building contrib-module: samba4" + pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4" + + emake \ + LDAP_BUILD="${BUILD_DIR}" \ + CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap" + popd &>/dev/null || die + fi + + if use kerberos ; then + if use kinit ; then + build_contrib_module "kinit" "kinit.c" "kinit" + fi + pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" + einfo "Compiling contrib-module: pw-kerberos" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -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" + popd &>/dev/null || die + fi + + if use pbkdf2; then + pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2" + einfo "Compiling contrib-module: pw-pbkdf2" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -I../../../../include \ + ${CFLAGS} \ + -o pbkdf2.lo \ + -c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed" + einfo "Linking contrib-module: pw-pbkdf2" + "${lt}" --mode=link --tag=CC \ + "${CC}" -module \ + ${CFLAGS} \ + ${LDFLAGS} \ + -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ + -o pw-pbkdf2.la \ + pbkdf2.lo || die "linking pw-pbkdf2 failed" + popd &>/dev/null || die + fi + + if use sha2 ; then + pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2" + einfo "Compiling contrib-module: pw-sha2" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -I../../../../include \ + ${CFLAGS} \ + -o sha2.lo \ + -c sha2.c || die "compiling pw-sha2 failed" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -I../../../../include \ + ${CFLAGS} \ + -o slapd-sha2.lo \ + -c slapd-sha2.c || die "compiling pw-sha2 failed" + einfo "Linking contrib-module: pw-sha2" + "${lt}" --mode=link --tag=CC \ + "${CC}" -module \ + ${CFLAGS} \ + ${LDFLAGS} \ + -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ + -o pw-sha2.la \ + sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed" + popd &>/dev/null || die + fi + + # We could build pw-radius if GNURadius would install radlib.h + pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" + einfo "Compiling contrib-module: pw-netscape" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -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 "acl" "posixgroup.c" "posixGroup" # example code only + #build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos + 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 "cloak" "cloak.c" "cloak" + # build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand + build_contrib_module "denyop" "denyop.c" "denyop-overlay" + build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin" + build_contrib_module "dupent" "dupent.c" "dupent" + build_contrib_module "lastbind" "lastbind.c" "lastbind" + # lastmod may not play well with other overlays + build_contrib_module "lastmod" "lastmod.c" "lastmod" + build_contrib_module "noopsrch" "noopsrch.c" "noopsrch" + #build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576 + #build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER + build_contrib_module "trace" "trace.c" "trace" + popd &>/dev/null || die + # build slapi-plugins + pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues" + einfo "Building contrib-module: addrdnvalues plugin" + "${CC}" -shared \ + -I"${BUILD_DIR}"/include \ + -I../../../include \ + ${CFLAGS} \ + -fPIC \ + ${LDFLAGS} \ + -o libaddrdnvalues-plugin.so \ + addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed" + popd &>/dev/null || die + fi +} + +multilib_src_test() { + if multilib_is_native_abi; then + cd tests || die + emake tests + fi +} + +multilib_src_install() { + local lt="${BUILD_DIR}/libtool" + emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install + + if ! use minimal && multilib_is_native_abi; 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.4.40-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 + einfo "Adding $(basename ${x})" + sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die + 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 || die + eend + + # install our own init scripts and systemd unit files + einfo "Install init scripts" + sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die + doinitd "${T}"/slapd + newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd + + einfo "Install systemd service" + sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die + systemd_dounit "${T}"/slapd.service + systemd_install_serviced "${FILESDIR}"/slapd.service.conf + newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf + + # If built without SLP, we don't need to be before avahi + sed -i \ + -e '/before/{s/avahi-daemon//g}' \ + "${ED}"/etc/init.d/slapd \ + || die + + if use cxx ; then + einfo "Install the ldapc++ library" + cd "${BUILD_DIR}/contrib/ldapc++" || die + emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install + cd "${S}"/contrib/ldapc++ || die + newdoc README ldapc++-README + fi + + if use smbkrb5passwd ; then + einfo "Install the smbk5pwd module" + cd "${S}/contrib/slapd-modules/smbk5pwd" || die + emake DESTDIR="${D}" \ + LDAP_BUILD="${BUILD_DIR}" \ + libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install + newdoc README smbk5pwd-README + fi + + if use overlays ; then + einfo "Install the samba4 module" + cd "${S}/contrib/slapd-modules/samba4" || die + emake DESTDIR="${D}" \ + LDAP_BUILD="${BUILD_DIR}" \ + libexecdir="/usr/$(get_libdir)/openldap" install + newdoc README samba4-README + fi + + einfo "Installing contrib modules" + cd "${S}/contrib/slapd-modules" || die + for l in */*.la */*/*.la; do + [[ -e ${l} ]] || continue + "${lt}" --mode=install cp ${l} \ + "${ED}"/usr/$(get_libdir)/openldap/openldap || \ + die "installing ${l} failed" + done + + dodoc "${FILESDIR}"/DB_CONFIG.fast.example + docinto contrib + doman */*.5 + #newdoc acl/README* + newdoc addpartial/README addpartial-README + newdoc allop/README allop-README + newdoc allowed/README allowed-README + newdoc autogroup/README autogroup-README + newdoc dsaschema/README dsaschema-README + newdoc passwd/README passwd-README + cd "${S}/contrib/slapi-plugins" || die + 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} + + docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample* + docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample* + docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm + + dosbin "${S}"/contrib/slapd-tools/statslog + newdoc "${S}"/contrib/slapd-tools/README README.statslog + fi + + if ! use static-libs ; then + find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die + fi +} + +multilib_src_install_all() { + dodoc ANNOUNCEMENT CHANGES COPYRIGHT README + docinto rfc ; dodoc doc/rfc/*.txt +} + +pkg_preinst() { + # keep old libs if any + preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0) + # bug 440470, only display the getting started help there was no openldap before, + # or we are going to a non-minimal build + ! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]' + OPENLDAP_PRINT_MESSAGES=$((! $?)) +} + +pkg_postinst() { + if ! use minimal ; then + tmpfiles_process slapd.conf + + # 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 allow' 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 + if [[ -d "${EROOT}"/var/run/openldap ]]; then + use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; } + chmod 0755 "${EROOT}"/var/run/openldap || die + fi + use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default} + chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die + use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data + fi + + if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then + elog "Getting started using OpenLDAP? There is some documentation available:" + elog "Gentoo Guide to OpenLDAP Authentication" + elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)" + elog "---" + elog "An example file for tuning BDB backends with openldap is" + elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/" + fi + + 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.58-r1.ebuild b/net-nds/openldap/openldap-2.4.58-r1.ebuild deleted file mode 100644 index 679dc8b2ae51..000000000000 --- a/net-nds/openldap/openldap-2.4.58-r1.ebuild +++ /dev/null @@ -1,908 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles - -BIS_PN=rfc2307bis.schema -BIS_PV=20140524 -BIS_P="${BIS_PN}-${BIS_PV}" - -DESCRIPTION="LDAP suite of application and development tools" -HOMEPAGE="https://www.OpenLDAP.org/" - -# upstream mirrors are mostly not working, using canonical URI -SRC_URI=" - https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz - http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz - http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz - http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz - mirror://gentoo/${BIS_P}" - -LICENSE="OPENLDAP GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris" - -IUSE_DAEMON="crypt samba tcpd experimental minimal" -IUSE_BACKEND="+berkdb" -IUSE_OVERLAY="overlays perl" -IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test" -IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2" -IUSE_CONTRIB="${IUSE_CONTRIB} cxx" -IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}" - -RESTRICT="!test? ( test )" -REQUIRED_USE="cxx? ( sasl ) - pbkdf2? ( ssl ) - test? ( berkdb ) - ?? ( test minimal )" - -# always list newer first -# Do not add any AGPL-3 BDB here! -# See bug 525110, comment 15. -# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build. -BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}" -BDB_PKGS='' -for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done - -# openssl is needed to generate lanman-passwords required by samba -COMMON_DEPEND=" - ssl? ( - !gnutls? ( - >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] - ) - gnutls? ( - >=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}] - >=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}] - ) - ) - sasl? ( dev-libs/cyrus-sasl:= ) - !minimal? ( - dev-libs/libltdl - sys-libs/e2fsprogs-libs - >=dev-db/lmdb-0.9.18:= - crypt? ( virtual/libcrypt:= ) - tcpd? ( sys-apps/tcp-wrappers ) - odbc? ( !iodbc? ( dev-db/unixODBC ) - iodbc? ( dev-db/libiodbc ) ) - perl? ( dev-lang/perl:=[-build(-)] ) - samba? ( - dev-libs/openssl:0= - ) - berkdb? ( - dash - "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch - - # bug #420959 - "${FILESDIR}"/${PN}-2.4.31-gcc47.patch - - # unbundle lmdb - "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch - - # fix some compiler warnings - "${FILESDIR}"/${PN}-2.4.47-warnings.patch -) - -openldap_filecount() { - local dir="$1" - find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l -} - -openldap_find_versiontags() { - # scan for all datadirs - local 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_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}$(sed "s:\/::" <<< ${each})" - 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=$(ver_cut 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" ]] && [[ -f "${SLAPD_PATH}" ]]; then - OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \ - | awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')" - if use berkdb; then - # find which one would be used - for bdb_slot in ${BDB_SLOTS} ; do - NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")" - [[ -n "${NEWVER}" ]] && break - done - fi - local fail=0 - if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then - : - # Nothing wrong here. - elif [[ -z "${OLDVER}" ]] && [[ -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}" ]] && [[ -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() { - local d l i - 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/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[minimal]' ; then - einfo "Skipping scan for previous datadirs as requested by minimal useflag" - else - openldap_find_versiontags - fi -} - -src_prepare() { - # ensure correct SLAPI path by default - sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \ - -i include/ldap_defaults.h || die - - default - rm -r libraries/liblmdb || die - - pushd build &>/dev/null || die "pushd 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" - popd &>/dev/null || die - - # wrong assumption that /bin/sh is /bin/bash - sed \ - -e 's|/bin/sh|/bin/bash|g' \ - -i tests/scripts/* || die "sed failed" - - # Required for autoconf-2.70 #765043 - sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.in || die - AT_NOEAUTOMAKE=yes eautoreconf -} - -build_contrib_module() { - # - pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1" - einfo "Compiling contrib-module: $3" - # Make sure it's uppercase - local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -D${define_name}=SLAPD_MOD_DYNAMIC \ - -I"${BUILD_DIR}"/include \ - -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" - popd &>/dev/null || die -} - -src_configure() { - # Bug 408001 - use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync - - # connectionless ldap per bug #342439 - append-cppflags -DLDAP_CONNECTIONLESS - - multilib-minimal_src_configure -} - -multilib_src_configure() { - local myconf=() - - use debug && myconf+=( $(use_enable debug) ) - - # ICU exists only in the configure, nowhere in the codebase, bug #510858 - export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no - - if ! use minimal && multilib_is_native_abi; then - local CPPFLAGS=${CPPFLAGS} - - # re-enable serverside overlay chains per bug #296567 - # see ldap docs chaper 12.3.1 for details - myconf+=( --enable-ldap ) - - # backends - myconf+=( --enable-slapd ) - if use berkdb ; then - einfo "Using Berkeley DB for local backend" - myconf+=( --enable-bdb --enable-hdb ) - DBINCLUDE=$(db_includedir ${BDB_SLOTS}) - einfo "Using ${DBINCLUDE} for sys-libs/db version" - # We need to include the slotted db.h dir for FreeBSD - append-cppflags -I${DBINCLUDE} - else - myconf+=( --disable-bdb --disable-hdb ) - fi - for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do - myconf+=( --enable-${backend}=mod ) - done - - myconf+=( $(use_enable perl perl mod) ) - - 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+=( --with-odbc=${odbc_lib} ) - fi - - # slapd options - myconf+=( - $(use_enable crypt) - --disable-slp - $(use_enable samba lmpasswd) - $(use_enable syslog) - ) - if use experimental ; then - myconf+=( - --enable-dynacl - --enable-aci=mod - ) - fi - for option in aci cleartext modules rewrite rlookups slapi; do - myconf+=( --enable-${option} ) - done - - # slapd overlay options - # Compile-in the syncprov, the others as module - myconf+=( --enable-syncprov=yes ) - use overlays && myconf+=( --enable-overlays=mod ) - - else - myconf+=( - --disable-backends - --disable-slapd - --disable-bdb - --disable-hdb - --disable-mdb - --disable-overlays - --disable-syslog - ) - fi - - # basic functionality stuff - myconf+=( - $(use_enable ipv6) - $(multilib_native_use_with sasl cyrus-sasl) - $(multilib_native_use_enable sasl spasswd) - $(use_enable tcpd wrappers) - ) - - # Some cross-compiling tests don't pan out well. - tc-is-cross-compiler && myconf+=( - --with-yielding-select=yes - ) - - local ssl_lib="no" - if use ssl || ( ! use minimal && use samba ) ; then - ssl_lib="openssl" - use gnutls && ssl_lib="gnutls" - fi - - myconf+=( --with-tls=${ssl_lib} ) - - for basicflag in dynamic local proctitle shared; do - myconf+=( --enable-${basicflag} ) - done - - tc-export AR CC CXX - CONFIG_SHELL="/bin/sh" \ - ECONF_SOURCE="${S}" \ - STRIP=/bin/true \ - econf \ - --libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \ - $(use_enable static-libs static) \ - "${myconf[@]}" - emake depend -} - -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. - local myconf_ldapcpp=( - --with-ldap-includes="${S}"/include - ) - - mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die - pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" - - local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS} - append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \ - -L"${BUILD_DIR}"/libraries/libldap/.libs - append-cppflags -I"${BUILD_DIR}"/include - ECONF_SOURCE=${S}/contrib/ldapc++ \ - econf "${myconf_ldapcpp[@]}" \ - CC="${CC}" \ - CXX="${CXX}" - popd &>/dev/null || die -} - -multilib_src_compile() { - tc-export AR CC CXX - emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh - local lt="${BUILD_DIR}/libtool" - export echo="echo" - - if ! use minimal && multilib_is_native_abi ; then - if use cxx ; then - einfo "Building contrib library: ldapc++" - src_configure_cxx - pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" - emake CC="${CC}" CXX="${CXX}" - popd &>/dev/null || die - fi - - if use smbkrb5passwd ; then - einfo "Building contrib-module: smbk5pwd" - pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd" - - MY_DEFS="-DDO_SHADOW" - if use samba ; then - MY_DEFS="${MY_DEFS} -DDO_SAMBA" - MY_KRB5_INC="" - fi - if use kerberos ; then - MY_DEFS="${MY_DEFS} -DDO_KRB5" - MY_KRB5_INC="$(krb5-config --cflags)" - fi - - emake \ - DEFS="${MY_DEFS}" \ - KRB5_INC="${MY_KRB5_INC}" \ - LDAP_BUILD="${BUILD_DIR}" \ - CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" - popd &>/dev/null || die - fi - - if use overlays ; then - einfo "Building contrib-module: samba4" - pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4" - - emake \ - LDAP_BUILD="${BUILD_DIR}" \ - CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap" - popd &>/dev/null || die - fi - - if use kerberos ; then - if use kinit ; then - build_contrib_module "kinit" "kinit.c" "kinit" - fi - pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" - einfo "Compiling contrib-module: pw-kerberos" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -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" - popd &>/dev/null || die - fi - - if use pbkdf2; then - pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2" - einfo "Compiling contrib-module: pw-pbkdf2" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -I../../../../include \ - ${CFLAGS} \ - -o pbkdf2.lo \ - -c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed" - einfo "Linking contrib-module: pw-pbkdf2" - "${lt}" --mode=link --tag=CC \ - "${CC}" -module \ - ${CFLAGS} \ - ${LDFLAGS} \ - -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ - -o pw-pbkdf2.la \ - pbkdf2.lo || die "linking pw-pbkdf2 failed" - popd &>/dev/null || die - fi - - if use sha2 ; then - pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2" - einfo "Compiling contrib-module: pw-sha2" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -I../../../../include \ - ${CFLAGS} \ - -o sha2.lo \ - -c sha2.c || die "compiling pw-sha2 failed" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -I../../../../include \ - ${CFLAGS} \ - -o slapd-sha2.lo \ - -c slapd-sha2.c || die "compiling pw-sha2 failed" - einfo "Linking contrib-module: pw-sha2" - "${lt}" --mode=link --tag=CC \ - "${CC}" -module \ - ${CFLAGS} \ - ${LDFLAGS} \ - -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ - -o pw-sha2.la \ - sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed" - popd &>/dev/null || die - fi - - # We could build pw-radius if GNURadius would install radlib.h - pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" - einfo "Compiling contrib-module: pw-netscape" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -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 "acl" "posixgroup.c" "posixGroup" # example code only - #build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos - 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 "cloak" "cloak.c" "cloak" - # build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand - build_contrib_module "denyop" "denyop.c" "denyop-overlay" - build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin" - build_contrib_module "dupent" "dupent.c" "dupent" - build_contrib_module "lastbind" "lastbind.c" "lastbind" - # lastmod may not play well with other overlays - build_contrib_module "lastmod" "lastmod.c" "lastmod" - build_contrib_module "noopsrch" "noopsrch.c" "noopsrch" - #build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576 - #build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER - build_contrib_module "trace" "trace.c" "trace" - popd &>/dev/null || die - # build slapi-plugins - pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues" - einfo "Building contrib-module: addrdnvalues plugin" - "${CC}" -shared \ - -I"${BUILD_DIR}"/include \ - -I../../../include \ - ${CFLAGS} \ - -fPIC \ - ${LDFLAGS} \ - -o libaddrdnvalues-plugin.so \ - addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed" - popd &>/dev/null || die - fi -} - -multilib_src_test() { - if multilib_is_native_abi; then - cd tests || die - emake tests - fi -} - -multilib_src_install() { - local lt="${BUILD_DIR}/libtool" - emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install - - if ! use minimal && multilib_is_native_abi; 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.4.40-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 - einfo "Adding $(basename ${x})" - sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die - 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 || die - eend - - # install our own init scripts and systemd unit files - einfo "Install init scripts" - sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die - doinitd "${T}"/slapd - newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd - - einfo "Install systemd service" - sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die - systemd_dounit "${T}"/slapd.service - systemd_install_serviced "${FILESDIR}"/slapd.service.conf - newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf - - # If built without SLP, we don't need to be before avahi - sed -i \ - -e '/before/{s/avahi-daemon//g}' \ - "${ED}"/etc/init.d/slapd \ - || die - - if use cxx ; then - einfo "Install the ldapc++ library" - cd "${BUILD_DIR}/contrib/ldapc++" || die - emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install - cd "${S}"/contrib/ldapc++ || die - newdoc README ldapc++-README - fi - - if use smbkrb5passwd ; then - einfo "Install the smbk5pwd module" - cd "${S}/contrib/slapd-modules/smbk5pwd" || die - emake DESTDIR="${D}" \ - LDAP_BUILD="${BUILD_DIR}" \ - libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install - newdoc README smbk5pwd-README - fi - - if use overlays ; then - einfo "Install the samba4 module" - cd "${S}/contrib/slapd-modules/samba4" || die - emake DESTDIR="${D}" \ - LDAP_BUILD="${BUILD_DIR}" \ - libexecdir="/usr/$(get_libdir)/openldap" install - newdoc README samba4-README - fi - - einfo "Installing contrib modules" - cd "${S}/contrib/slapd-modules" || die - for l in */*.la */*/*.la; do - [[ -e ${l} ]] || continue - "${lt}" --mode=install cp ${l} \ - "${ED}"/usr/$(get_libdir)/openldap/openldap || \ - die "installing ${l} failed" - done - - dodoc "${FILESDIR}"/DB_CONFIG.fast.example - docinto contrib - doman */*.5 - #newdoc acl/README* - newdoc addpartial/README addpartial-README - newdoc allop/README allop-README - newdoc allowed/README allowed-README - newdoc autogroup/README autogroup-README - newdoc dsaschema/README dsaschema-README - newdoc passwd/README passwd-README - cd "${S}/contrib/slapi-plugins" || die - 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} - - docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample* - docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample* - docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm - - dosbin "${S}"/contrib/slapd-tools/statslog - newdoc "${S}"/contrib/slapd-tools/README README.statslog - fi - - if ! use static-libs ; then - find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die - fi -} - -multilib_src_install_all() { - dodoc ANNOUNCEMENT CHANGES COPYRIGHT README - docinto rfc ; dodoc doc/rfc/*.txt -} - -pkg_preinst() { - # keep old libs if any - preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0) - # bug 440470, only display the getting started help there was no openldap before, - # or we are going to a non-minimal build - ! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]' - OPENLDAP_PRINT_MESSAGES=$((! $?)) -} - -pkg_postinst() { - if ! use minimal ; then - tmpfiles_process slapd.conf - - # 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 allow' 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 - if [[ -d "${EROOT}"/var/run/openldap ]]; then - use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; } - chmod 0755 "${EROOT}"/var/run/openldap || die - fi - use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default} - chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die - use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data - fi - - if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then - elog "Getting started using OpenLDAP? There is some documentation available:" - elog "Gentoo Guide to OpenLDAP Authentication" - elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)" - elog "---" - elog "An example file for tuning BDB backends with openldap is" - elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/" - fi - - 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.58-r2.ebuild b/net-nds/openldap/openldap-2.4.58-r2.ebuild new file mode 100644 index 000000000000..440319751d1e --- /dev/null +++ b/net-nds/openldap/openldap-2.4.58-r2.ebuild @@ -0,0 +1,908 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles + +BIS_PN=rfc2307bis.schema +BIS_PV=20140524 +BIS_P="${BIS_PN}-${BIS_PV}" + +DESCRIPTION="LDAP suite of application and development tools" +HOMEPAGE="https://www.OpenLDAP.org/" + +# upstream mirrors are mostly not working, using canonical URI +SRC_URI=" + https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz + http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz + http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz + http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz + mirror://gentoo/${BIS_P}" + +LICENSE="OPENLDAP GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris" + +IUSE_DAEMON="crypt samba tcpd experimental minimal" +IUSE_BACKEND="+berkdb" +IUSE_OVERLAY="overlays perl" +IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test" +IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2" +IUSE_CONTRIB="${IUSE_CONTRIB} cxx" +IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}" + +RESTRICT="!test? ( test )" +REQUIRED_USE="cxx? ( sasl ) + pbkdf2? ( ssl ) + test? ( berkdb ) + ?? ( test minimal )" + +# always list newer first +# Do not add any AGPL-3 BDB here! +# See bug 525110, comment 15. +# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build. +BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}" +BDB_PKGS='' +for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done + +# openssl is needed to generate lanman-passwords required by samba +COMMON_DEPEND=" + ssl? ( + !gnutls? ( + >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] + ) + gnutls? ( + >=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}] + >=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}] + ) + ) + sasl? ( dev-libs/cyrus-sasl:= ) + !minimal? ( + dev-libs/libltdl + sys-fs/e2fsprogs + >=dev-db/lmdb-0.9.18:= + crypt? ( virtual/libcrypt:= ) + tcpd? ( sys-apps/tcp-wrappers ) + odbc? ( !iodbc? ( dev-db/unixODBC ) + iodbc? ( dev-db/libiodbc ) ) + perl? ( dev-lang/perl:=[-build(-)] ) + samba? ( + dev-libs/openssl:0= + ) + berkdb? ( + dash + "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch + + # bug #420959 + "${FILESDIR}"/${PN}-2.4.31-gcc47.patch + + # unbundle lmdb + "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch + + # fix some compiler warnings + "${FILESDIR}"/${PN}-2.4.47-warnings.patch +) + +openldap_filecount() { + local dir="$1" + find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l +} + +openldap_find_versiontags() { + # scan for all datadirs + local 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_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}$(sed "s:\/::" <<< ${each})" + 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=$(ver_cut 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" ]] && [[ -f "${SLAPD_PATH}" ]]; then + OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \ + | awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')" + if use berkdb; then + # find which one would be used + for bdb_slot in ${BDB_SLOTS} ; do + NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")" + [[ -n "${NEWVER}" ]] && break + done + fi + local fail=0 + if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then + : + # Nothing wrong here. + elif [[ -z "${OLDVER}" ]] && [[ -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}" ]] && [[ -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() { + local d l i + 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/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[minimal]' ; then + einfo "Skipping scan for previous datadirs as requested by minimal useflag" + else + openldap_find_versiontags + fi +} + +src_prepare() { + # ensure correct SLAPI path by default + sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \ + -i include/ldap_defaults.h || die + + default + rm -r libraries/liblmdb || die + + pushd build &>/dev/null || die "pushd 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" + popd &>/dev/null || die + + # wrong assumption that /bin/sh is /bin/bash + sed \ + -e 's|/bin/sh|/bin/bash|g' \ + -i tests/scripts/* || die "sed failed" + + # Required for autoconf-2.70 #765043 + sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.in || die + AT_NOEAUTOMAKE=yes eautoreconf +} + +build_contrib_module() { + # + pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1" + einfo "Compiling contrib-module: $3" + # Make sure it's uppercase + local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -D${define_name}=SLAPD_MOD_DYNAMIC \ + -I"${BUILD_DIR}"/include \ + -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" + popd &>/dev/null || die +} + +src_configure() { + # Bug 408001 + use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync + + # connectionless ldap per bug #342439 + append-cppflags -DLDAP_CONNECTIONLESS + + multilib-minimal_src_configure +} + +multilib_src_configure() { + local myconf=() + + use debug && myconf+=( $(use_enable debug) ) + + # ICU exists only in the configure, nowhere in the codebase, bug #510858 + export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no + + if ! use minimal && multilib_is_native_abi; then + local CPPFLAGS=${CPPFLAGS} + + # re-enable serverside overlay chains per bug #296567 + # see ldap docs chaper 12.3.1 for details + myconf+=( --enable-ldap ) + + # backends + myconf+=( --enable-slapd ) + if use berkdb ; then + einfo "Using Berkeley DB for local backend" + myconf+=( --enable-bdb --enable-hdb ) + DBINCLUDE=$(db_includedir ${BDB_SLOTS}) + einfo "Using ${DBINCLUDE} for sys-libs/db version" + # We need to include the slotted db.h dir for FreeBSD + append-cppflags -I${DBINCLUDE} + else + myconf+=( --disable-bdb --disable-hdb ) + fi + for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do + myconf+=( --enable-${backend}=mod ) + done + + myconf+=( $(use_enable perl perl mod) ) + + 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+=( --with-odbc=${odbc_lib} ) + fi + + # slapd options + myconf+=( + $(use_enable crypt) + --disable-slp + $(use_enable samba lmpasswd) + $(use_enable syslog) + ) + if use experimental ; then + myconf+=( + --enable-dynacl + --enable-aci=mod + ) + fi + for option in aci cleartext modules rewrite rlookups slapi; do + myconf+=( --enable-${option} ) + done + + # slapd overlay options + # Compile-in the syncprov, the others as module + myconf+=( --enable-syncprov=yes ) + use overlays && myconf+=( --enable-overlays=mod ) + + else + myconf+=( + --disable-backends + --disable-slapd + --disable-bdb + --disable-hdb + --disable-mdb + --disable-overlays + --disable-syslog + ) + fi + + # basic functionality stuff + myconf+=( + $(use_enable ipv6) + $(multilib_native_use_with sasl cyrus-sasl) + $(multilib_native_use_enable sasl spasswd) + $(use_enable tcpd wrappers) + ) + + # Some cross-compiling tests don't pan out well. + tc-is-cross-compiler && myconf+=( + --with-yielding-select=yes + ) + + local ssl_lib="no" + if use ssl || ( ! use minimal && use samba ) ; then + ssl_lib="openssl" + use gnutls && ssl_lib="gnutls" + fi + + myconf+=( --with-tls=${ssl_lib} ) + + for basicflag in dynamic local proctitle shared; do + myconf+=( --enable-${basicflag} ) + done + + tc-export AR CC CXX + CONFIG_SHELL="/bin/sh" \ + ECONF_SOURCE="${S}" \ + STRIP=/bin/true \ + econf \ + --libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \ + $(use_enable static-libs static) \ + "${myconf[@]}" + emake depend +} + +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. + local myconf_ldapcpp=( + --with-ldap-includes="${S}"/include + ) + + mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die + pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" + + local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS} + append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \ + -L"${BUILD_DIR}"/libraries/libldap/.libs + append-cppflags -I"${BUILD_DIR}"/include + ECONF_SOURCE=${S}/contrib/ldapc++ \ + econf "${myconf_ldapcpp[@]}" \ + CC="${CC}" \ + CXX="${CXX}" + popd &>/dev/null || die +} + +multilib_src_compile() { + tc-export AR CC CXX + emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh + local lt="${BUILD_DIR}/libtool" + export echo="echo" + + if ! use minimal && multilib_is_native_abi ; then + if use cxx ; then + einfo "Building contrib library: ldapc++" + src_configure_cxx + pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" + emake CC="${CC}" CXX="${CXX}" + popd &>/dev/null || die + fi + + if use smbkrb5passwd ; then + einfo "Building contrib-module: smbk5pwd" + pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd" + + MY_DEFS="-DDO_SHADOW" + if use samba ; then + MY_DEFS="${MY_DEFS} -DDO_SAMBA" + MY_KRB5_INC="" + fi + if use kerberos ; then + MY_DEFS="${MY_DEFS} -DDO_KRB5" + MY_KRB5_INC="$(krb5-config --cflags)" + fi + + emake \ + DEFS="${MY_DEFS}" \ + KRB5_INC="${MY_KRB5_INC}" \ + LDAP_BUILD="${BUILD_DIR}" \ + CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" + popd &>/dev/null || die + fi + + if use overlays ; then + einfo "Building contrib-module: samba4" + pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4" + + emake \ + LDAP_BUILD="${BUILD_DIR}" \ + CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap" + popd &>/dev/null || die + fi + + if use kerberos ; then + if use kinit ; then + build_contrib_module "kinit" "kinit.c" "kinit" + fi + pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" + einfo "Compiling contrib-module: pw-kerberos" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -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" + popd &>/dev/null || die + fi + + if use pbkdf2; then + pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2" + einfo "Compiling contrib-module: pw-pbkdf2" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -I../../../../include \ + ${CFLAGS} \ + -o pbkdf2.lo \ + -c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed" + einfo "Linking contrib-module: pw-pbkdf2" + "${lt}" --mode=link --tag=CC \ + "${CC}" -module \ + ${CFLAGS} \ + ${LDFLAGS} \ + -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ + -o pw-pbkdf2.la \ + pbkdf2.lo || die "linking pw-pbkdf2 failed" + popd &>/dev/null || die + fi + + if use sha2 ; then + pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2" + einfo "Compiling contrib-module: pw-sha2" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -I../../../../include \ + ${CFLAGS} \ + -o sha2.lo \ + -c sha2.c || die "compiling pw-sha2 failed" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -I../../../../include \ + ${CFLAGS} \ + -o slapd-sha2.lo \ + -c slapd-sha2.c || die "compiling pw-sha2 failed" + einfo "Linking contrib-module: pw-sha2" + "${lt}" --mode=link --tag=CC \ + "${CC}" -module \ + ${CFLAGS} \ + ${LDFLAGS} \ + -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ + -o pw-sha2.la \ + sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed" + popd &>/dev/null || die + fi + + # We could build pw-radius if GNURadius would install radlib.h + pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" + einfo "Compiling contrib-module: pw-netscape" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -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 "acl" "posixgroup.c" "posixGroup" # example code only + #build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos + 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 "cloak" "cloak.c" "cloak" + # build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand + build_contrib_module "denyop" "denyop.c" "denyop-overlay" + build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin" + build_contrib_module "dupent" "dupent.c" "dupent" + build_contrib_module "lastbind" "lastbind.c" "lastbind" + # lastmod may not play well with other overlays + build_contrib_module "lastmod" "lastmod.c" "lastmod" + build_contrib_module "noopsrch" "noopsrch.c" "noopsrch" + #build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576 + #build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER + build_contrib_module "trace" "trace.c" "trace" + popd &>/dev/null || die + # build slapi-plugins + pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues" + einfo "Building contrib-module: addrdnvalues plugin" + "${CC}" -shared \ + -I"${BUILD_DIR}"/include \ + -I../../../include \ + ${CFLAGS} \ + -fPIC \ + ${LDFLAGS} \ + -o libaddrdnvalues-plugin.so \ + addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed" + popd &>/dev/null || die + fi +} + +multilib_src_test() { + if multilib_is_native_abi; then + cd tests || die + emake tests + fi +} + +multilib_src_install() { + local lt="${BUILD_DIR}/libtool" + emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install + + if ! use minimal && multilib_is_native_abi; 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.4.40-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 + einfo "Adding $(basename ${x})" + sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die + 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 || die + eend + + # install our own init scripts and systemd unit files + einfo "Install init scripts" + sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die + doinitd "${T}"/slapd + newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd + + einfo "Install systemd service" + sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die + systemd_dounit "${T}"/slapd.service + systemd_install_serviced "${FILESDIR}"/slapd.service.conf + newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf + + # If built without SLP, we don't need to be before avahi + sed -i \ + -e '/before/{s/avahi-daemon//g}' \ + "${ED}"/etc/init.d/slapd \ + || die + + if use cxx ; then + einfo "Install the ldapc++ library" + cd "${BUILD_DIR}/contrib/ldapc++" || die + emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install + cd "${S}"/contrib/ldapc++ || die + newdoc README ldapc++-README + fi + + if use smbkrb5passwd ; then + einfo "Install the smbk5pwd module" + cd "${S}/contrib/slapd-modules/smbk5pwd" || die + emake DESTDIR="${D}" \ + LDAP_BUILD="${BUILD_DIR}" \ + libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install + newdoc README smbk5pwd-README + fi + + if use overlays ; then + einfo "Install the samba4 module" + cd "${S}/contrib/slapd-modules/samba4" || die + emake DESTDIR="${D}" \ + LDAP_BUILD="${BUILD_DIR}" \ + libexecdir="/usr/$(get_libdir)/openldap" install + newdoc README samba4-README + fi + + einfo "Installing contrib modules" + cd "${S}/contrib/slapd-modules" || die + for l in */*.la */*/*.la; do + [[ -e ${l} ]] || continue + "${lt}" --mode=install cp ${l} \ + "${ED}"/usr/$(get_libdir)/openldap/openldap || \ + die "installing ${l} failed" + done + + dodoc "${FILESDIR}"/DB_CONFIG.fast.example + docinto contrib + doman */*.5 + #newdoc acl/README* + newdoc addpartial/README addpartial-README + newdoc allop/README allop-README + newdoc allowed/README allowed-README + newdoc autogroup/README autogroup-README + newdoc dsaschema/README dsaschema-README + newdoc passwd/README passwd-README + cd "${S}/contrib/slapi-plugins" || die + 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} + + docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample* + docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample* + docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm + + dosbin "${S}"/contrib/slapd-tools/statslog + newdoc "${S}"/contrib/slapd-tools/README README.statslog + fi + + if ! use static-libs ; then + find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die + fi +} + +multilib_src_install_all() { + dodoc ANNOUNCEMENT CHANGES COPYRIGHT README + docinto rfc ; dodoc doc/rfc/*.txt +} + +pkg_preinst() { + # keep old libs if any + preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0) + # bug 440470, only display the getting started help there was no openldap before, + # or we are going to a non-minimal build + ! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]' + OPENLDAP_PRINT_MESSAGES=$((! $?)) +} + +pkg_postinst() { + if ! use minimal ; then + tmpfiles_process slapd.conf + + # 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 allow' 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 + if [[ -d "${EROOT}"/var/run/openldap ]]; then + use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; } + chmod 0755 "${EROOT}"/var/run/openldap || die + fi + use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default} + chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die + use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data + fi + + if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then + elog "Getting started using OpenLDAP? There is some documentation available:" + elog "Gentoo Guide to OpenLDAP Authentication" + elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)" + elog "---" + elog "An example file for tuning BDB backends with openldap is" + elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/" + fi + + 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.59-r1.ebuild b/net-nds/openldap/openldap-2.4.59-r1.ebuild deleted file mode 100644 index 679dc8b2ae51..000000000000 --- a/net-nds/openldap/openldap-2.4.59-r1.ebuild +++ /dev/null @@ -1,908 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles - -BIS_PN=rfc2307bis.schema -BIS_PV=20140524 -BIS_P="${BIS_PN}-${BIS_PV}" - -DESCRIPTION="LDAP suite of application and development tools" -HOMEPAGE="https://www.OpenLDAP.org/" - -# upstream mirrors are mostly not working, using canonical URI -SRC_URI=" - https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz - http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz - http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz - http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz - mirror://gentoo/${BIS_P}" - -LICENSE="OPENLDAP GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris" - -IUSE_DAEMON="crypt samba tcpd experimental minimal" -IUSE_BACKEND="+berkdb" -IUSE_OVERLAY="overlays perl" -IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test" -IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2" -IUSE_CONTRIB="${IUSE_CONTRIB} cxx" -IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}" - -RESTRICT="!test? ( test )" -REQUIRED_USE="cxx? ( sasl ) - pbkdf2? ( ssl ) - test? ( berkdb ) - ?? ( test minimal )" - -# always list newer first -# Do not add any AGPL-3 BDB here! -# See bug 525110, comment 15. -# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build. -BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}" -BDB_PKGS='' -for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done - -# openssl is needed to generate lanman-passwords required by samba -COMMON_DEPEND=" - ssl? ( - !gnutls? ( - >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] - ) - gnutls? ( - >=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}] - >=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}] - ) - ) - sasl? ( dev-libs/cyrus-sasl:= ) - !minimal? ( - dev-libs/libltdl - sys-libs/e2fsprogs-libs - >=dev-db/lmdb-0.9.18:= - crypt? ( virtual/libcrypt:= ) - tcpd? ( sys-apps/tcp-wrappers ) - odbc? ( !iodbc? ( dev-db/unixODBC ) - iodbc? ( dev-db/libiodbc ) ) - perl? ( dev-lang/perl:=[-build(-)] ) - samba? ( - dev-libs/openssl:0= - ) - berkdb? ( - dash - "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch - - # bug #420959 - "${FILESDIR}"/${PN}-2.4.31-gcc47.patch - - # unbundle lmdb - "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch - - # fix some compiler warnings - "${FILESDIR}"/${PN}-2.4.47-warnings.patch -) - -openldap_filecount() { - local dir="$1" - find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l -} - -openldap_find_versiontags() { - # scan for all datadirs - local 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_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}$(sed "s:\/::" <<< ${each})" - 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=$(ver_cut 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" ]] && [[ -f "${SLAPD_PATH}" ]]; then - OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \ - | awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')" - if use berkdb; then - # find which one would be used - for bdb_slot in ${BDB_SLOTS} ; do - NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")" - [[ -n "${NEWVER}" ]] && break - done - fi - local fail=0 - if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then - : - # Nothing wrong here. - elif [[ -z "${OLDVER}" ]] && [[ -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}" ]] && [[ -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() { - local d l i - 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/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[minimal]' ; then - einfo "Skipping scan for previous datadirs as requested by minimal useflag" - else - openldap_find_versiontags - fi -} - -src_prepare() { - # ensure correct SLAPI path by default - sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \ - -i include/ldap_defaults.h || die - - default - rm -r libraries/liblmdb || die - - pushd build &>/dev/null || die "pushd 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" - popd &>/dev/null || die - - # wrong assumption that /bin/sh is /bin/bash - sed \ - -e 's|/bin/sh|/bin/bash|g' \ - -i tests/scripts/* || die "sed failed" - - # Required for autoconf-2.70 #765043 - sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.in || die - AT_NOEAUTOMAKE=yes eautoreconf -} - -build_contrib_module() { - # - pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1" - einfo "Compiling contrib-module: $3" - # Make sure it's uppercase - local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -D${define_name}=SLAPD_MOD_DYNAMIC \ - -I"${BUILD_DIR}"/include \ - -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" - popd &>/dev/null || die -} - -src_configure() { - # Bug 408001 - use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync - - # connectionless ldap per bug #342439 - append-cppflags -DLDAP_CONNECTIONLESS - - multilib-minimal_src_configure -} - -multilib_src_configure() { - local myconf=() - - use debug && myconf+=( $(use_enable debug) ) - - # ICU exists only in the configure, nowhere in the codebase, bug #510858 - export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no - - if ! use minimal && multilib_is_native_abi; then - local CPPFLAGS=${CPPFLAGS} - - # re-enable serverside overlay chains per bug #296567 - # see ldap docs chaper 12.3.1 for details - myconf+=( --enable-ldap ) - - # backends - myconf+=( --enable-slapd ) - if use berkdb ; then - einfo "Using Berkeley DB for local backend" - myconf+=( --enable-bdb --enable-hdb ) - DBINCLUDE=$(db_includedir ${BDB_SLOTS}) - einfo "Using ${DBINCLUDE} for sys-libs/db version" - # We need to include the slotted db.h dir for FreeBSD - append-cppflags -I${DBINCLUDE} - else - myconf+=( --disable-bdb --disable-hdb ) - fi - for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do - myconf+=( --enable-${backend}=mod ) - done - - myconf+=( $(use_enable perl perl mod) ) - - 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+=( --with-odbc=${odbc_lib} ) - fi - - # slapd options - myconf+=( - $(use_enable crypt) - --disable-slp - $(use_enable samba lmpasswd) - $(use_enable syslog) - ) - if use experimental ; then - myconf+=( - --enable-dynacl - --enable-aci=mod - ) - fi - for option in aci cleartext modules rewrite rlookups slapi; do - myconf+=( --enable-${option} ) - done - - # slapd overlay options - # Compile-in the syncprov, the others as module - myconf+=( --enable-syncprov=yes ) - use overlays && myconf+=( --enable-overlays=mod ) - - else - myconf+=( - --disable-backends - --disable-slapd - --disable-bdb - --disable-hdb - --disable-mdb - --disable-overlays - --disable-syslog - ) - fi - - # basic functionality stuff - myconf+=( - $(use_enable ipv6) - $(multilib_native_use_with sasl cyrus-sasl) - $(multilib_native_use_enable sasl spasswd) - $(use_enable tcpd wrappers) - ) - - # Some cross-compiling tests don't pan out well. - tc-is-cross-compiler && myconf+=( - --with-yielding-select=yes - ) - - local ssl_lib="no" - if use ssl || ( ! use minimal && use samba ) ; then - ssl_lib="openssl" - use gnutls && ssl_lib="gnutls" - fi - - myconf+=( --with-tls=${ssl_lib} ) - - for basicflag in dynamic local proctitle shared; do - myconf+=( --enable-${basicflag} ) - done - - tc-export AR CC CXX - CONFIG_SHELL="/bin/sh" \ - ECONF_SOURCE="${S}" \ - STRIP=/bin/true \ - econf \ - --libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \ - $(use_enable static-libs static) \ - "${myconf[@]}" - emake depend -} - -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. - local myconf_ldapcpp=( - --with-ldap-includes="${S}"/include - ) - - mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die - pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" - - local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS} - append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \ - -L"${BUILD_DIR}"/libraries/libldap/.libs - append-cppflags -I"${BUILD_DIR}"/include - ECONF_SOURCE=${S}/contrib/ldapc++ \ - econf "${myconf_ldapcpp[@]}" \ - CC="${CC}" \ - CXX="${CXX}" - popd &>/dev/null || die -} - -multilib_src_compile() { - tc-export AR CC CXX - emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh - local lt="${BUILD_DIR}/libtool" - export echo="echo" - - if ! use minimal && multilib_is_native_abi ; then - if use cxx ; then - einfo "Building contrib library: ldapc++" - src_configure_cxx - pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" - emake CC="${CC}" CXX="${CXX}" - popd &>/dev/null || die - fi - - if use smbkrb5passwd ; then - einfo "Building contrib-module: smbk5pwd" - pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd" - - MY_DEFS="-DDO_SHADOW" - if use samba ; then - MY_DEFS="${MY_DEFS} -DDO_SAMBA" - MY_KRB5_INC="" - fi - if use kerberos ; then - MY_DEFS="${MY_DEFS} -DDO_KRB5" - MY_KRB5_INC="$(krb5-config --cflags)" - fi - - emake \ - DEFS="${MY_DEFS}" \ - KRB5_INC="${MY_KRB5_INC}" \ - LDAP_BUILD="${BUILD_DIR}" \ - CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" - popd &>/dev/null || die - fi - - if use overlays ; then - einfo "Building contrib-module: samba4" - pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4" - - emake \ - LDAP_BUILD="${BUILD_DIR}" \ - CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap" - popd &>/dev/null || die - fi - - if use kerberos ; then - if use kinit ; then - build_contrib_module "kinit" "kinit.c" "kinit" - fi - pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" - einfo "Compiling contrib-module: pw-kerberos" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -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" - popd &>/dev/null || die - fi - - if use pbkdf2; then - pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2" - einfo "Compiling contrib-module: pw-pbkdf2" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -I../../../../include \ - ${CFLAGS} \ - -o pbkdf2.lo \ - -c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed" - einfo "Linking contrib-module: pw-pbkdf2" - "${lt}" --mode=link --tag=CC \ - "${CC}" -module \ - ${CFLAGS} \ - ${LDFLAGS} \ - -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ - -o pw-pbkdf2.la \ - pbkdf2.lo || die "linking pw-pbkdf2 failed" - popd &>/dev/null || die - fi - - if use sha2 ; then - pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2" - einfo "Compiling contrib-module: pw-sha2" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -I../../../../include \ - ${CFLAGS} \ - -o sha2.lo \ - -c sha2.c || die "compiling pw-sha2 failed" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -I../../../../include \ - ${CFLAGS} \ - -o slapd-sha2.lo \ - -c slapd-sha2.c || die "compiling pw-sha2 failed" - einfo "Linking contrib-module: pw-sha2" - "${lt}" --mode=link --tag=CC \ - "${CC}" -module \ - ${CFLAGS} \ - ${LDFLAGS} \ - -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ - -o pw-sha2.la \ - sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed" - popd &>/dev/null || die - fi - - # We could build pw-radius if GNURadius would install radlib.h - pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" - einfo "Compiling contrib-module: pw-netscape" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -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 "acl" "posixgroup.c" "posixGroup" # example code only - #build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos - 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 "cloak" "cloak.c" "cloak" - # build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand - build_contrib_module "denyop" "denyop.c" "denyop-overlay" - build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin" - build_contrib_module "dupent" "dupent.c" "dupent" - build_contrib_module "lastbind" "lastbind.c" "lastbind" - # lastmod may not play well with other overlays - build_contrib_module "lastmod" "lastmod.c" "lastmod" - build_contrib_module "noopsrch" "noopsrch.c" "noopsrch" - #build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576 - #build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER - build_contrib_module "trace" "trace.c" "trace" - popd &>/dev/null || die - # build slapi-plugins - pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues" - einfo "Building contrib-module: addrdnvalues plugin" - "${CC}" -shared \ - -I"${BUILD_DIR}"/include \ - -I../../../include \ - ${CFLAGS} \ - -fPIC \ - ${LDFLAGS} \ - -o libaddrdnvalues-plugin.so \ - addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed" - popd &>/dev/null || die - fi -} - -multilib_src_test() { - if multilib_is_native_abi; then - cd tests || die - emake tests - fi -} - -multilib_src_install() { - local lt="${BUILD_DIR}/libtool" - emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install - - if ! use minimal && multilib_is_native_abi; 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.4.40-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 - einfo "Adding $(basename ${x})" - sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die - 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 || die - eend - - # install our own init scripts and systemd unit files - einfo "Install init scripts" - sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die - doinitd "${T}"/slapd - newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd - - einfo "Install systemd service" - sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die - systemd_dounit "${T}"/slapd.service - systemd_install_serviced "${FILESDIR}"/slapd.service.conf - newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf - - # If built without SLP, we don't need to be before avahi - sed -i \ - -e '/before/{s/avahi-daemon//g}' \ - "${ED}"/etc/init.d/slapd \ - || die - - if use cxx ; then - einfo "Install the ldapc++ library" - cd "${BUILD_DIR}/contrib/ldapc++" || die - emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install - cd "${S}"/contrib/ldapc++ || die - newdoc README ldapc++-README - fi - - if use smbkrb5passwd ; then - einfo "Install the smbk5pwd module" - cd "${S}/contrib/slapd-modules/smbk5pwd" || die - emake DESTDIR="${D}" \ - LDAP_BUILD="${BUILD_DIR}" \ - libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install - newdoc README smbk5pwd-README - fi - - if use overlays ; then - einfo "Install the samba4 module" - cd "${S}/contrib/slapd-modules/samba4" || die - emake DESTDIR="${D}" \ - LDAP_BUILD="${BUILD_DIR}" \ - libexecdir="/usr/$(get_libdir)/openldap" install - newdoc README samba4-README - fi - - einfo "Installing contrib modules" - cd "${S}/contrib/slapd-modules" || die - for l in */*.la */*/*.la; do - [[ -e ${l} ]] || continue - "${lt}" --mode=install cp ${l} \ - "${ED}"/usr/$(get_libdir)/openldap/openldap || \ - die "installing ${l} failed" - done - - dodoc "${FILESDIR}"/DB_CONFIG.fast.example - docinto contrib - doman */*.5 - #newdoc acl/README* - newdoc addpartial/README addpartial-README - newdoc allop/README allop-README - newdoc allowed/README allowed-README - newdoc autogroup/README autogroup-README - newdoc dsaschema/README dsaschema-README - newdoc passwd/README passwd-README - cd "${S}/contrib/slapi-plugins" || die - 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} - - docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample* - docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample* - docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm - - dosbin "${S}"/contrib/slapd-tools/statslog - newdoc "${S}"/contrib/slapd-tools/README README.statslog - fi - - if ! use static-libs ; then - find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die - fi -} - -multilib_src_install_all() { - dodoc ANNOUNCEMENT CHANGES COPYRIGHT README - docinto rfc ; dodoc doc/rfc/*.txt -} - -pkg_preinst() { - # keep old libs if any - preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0) - # bug 440470, only display the getting started help there was no openldap before, - # or we are going to a non-minimal build - ! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]' - OPENLDAP_PRINT_MESSAGES=$((! $?)) -} - -pkg_postinst() { - if ! use minimal ; then - tmpfiles_process slapd.conf - - # 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 allow' 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 - if [[ -d "${EROOT}"/var/run/openldap ]]; then - use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; } - chmod 0755 "${EROOT}"/var/run/openldap || die - fi - use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default} - chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die - use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data - fi - - if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then - elog "Getting started using OpenLDAP? There is some documentation available:" - elog "Gentoo Guide to OpenLDAP Authentication" - elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)" - elog "---" - elog "An example file for tuning BDB backends with openldap is" - elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/" - fi - - 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.59-r2.ebuild b/net-nds/openldap/openldap-2.4.59-r2.ebuild new file mode 100644 index 000000000000..440319751d1e --- /dev/null +++ b/net-nds/openldap/openldap-2.4.59-r2.ebuild @@ -0,0 +1,908 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles + +BIS_PN=rfc2307bis.schema +BIS_PV=20140524 +BIS_P="${BIS_PN}-${BIS_PV}" + +DESCRIPTION="LDAP suite of application and development tools" +HOMEPAGE="https://www.OpenLDAP.org/" + +# upstream mirrors are mostly not working, using canonical URI +SRC_URI=" + https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz + http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz + http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz + http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz + mirror://gentoo/${BIS_P}" + +LICENSE="OPENLDAP GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris" + +IUSE_DAEMON="crypt samba tcpd experimental minimal" +IUSE_BACKEND="+berkdb" +IUSE_OVERLAY="overlays perl" +IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test" +IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2" +IUSE_CONTRIB="${IUSE_CONTRIB} cxx" +IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}" + +RESTRICT="!test? ( test )" +REQUIRED_USE="cxx? ( sasl ) + pbkdf2? ( ssl ) + test? ( berkdb ) + ?? ( test minimal )" + +# always list newer first +# Do not add any AGPL-3 BDB here! +# See bug 525110, comment 15. +# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build. +BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}" +BDB_PKGS='' +for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done + +# openssl is needed to generate lanman-passwords required by samba +COMMON_DEPEND=" + ssl? ( + !gnutls? ( + >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] + ) + gnutls? ( + >=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}] + >=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}] + ) + ) + sasl? ( dev-libs/cyrus-sasl:= ) + !minimal? ( + dev-libs/libltdl + sys-fs/e2fsprogs + >=dev-db/lmdb-0.9.18:= + crypt? ( virtual/libcrypt:= ) + tcpd? ( sys-apps/tcp-wrappers ) + odbc? ( !iodbc? ( dev-db/unixODBC ) + iodbc? ( dev-db/libiodbc ) ) + perl? ( dev-lang/perl:=[-build(-)] ) + samba? ( + dev-libs/openssl:0= + ) + berkdb? ( + dash + "${FILESDIR}"/${PN}-2.4.28-fix-dash.patch + + # bug #420959 + "${FILESDIR}"/${PN}-2.4.31-gcc47.patch + + # unbundle lmdb + "${FILESDIR}"/${PN}-2.4.42-mdb-unbundle.patch + + # fix some compiler warnings + "${FILESDIR}"/${PN}-2.4.47-warnings.patch +) + +openldap_filecount() { + local dir="$1" + find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l +} + +openldap_find_versiontags() { + # scan for all datadirs + local 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_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}$(sed "s:\/::" <<< ${each})" + 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=$(ver_cut 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" ]] && [[ -f "${SLAPD_PATH}" ]]; then + OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \ + | awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')" + if use berkdb; then + # find which one would be used + for bdb_slot in ${BDB_SLOTS} ; do + NEWVER="$(db_findver "=sys-libs/db-${bdb_slot}*")" + [[ -n "${NEWVER}" ]] && break + done + fi + local fail=0 + if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then + : + # Nothing wrong here. + elif [[ -z "${OLDVER}" ]] && [[ -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}" ]] && [[ -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() { + local d l i + 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/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[minimal]' ; then + einfo "Skipping scan for previous datadirs as requested by minimal useflag" + else + openldap_find_versiontags + fi +} + +src_prepare() { + # ensure correct SLAPI path by default + sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \ + -i include/ldap_defaults.h || die + + default + rm -r libraries/liblmdb || die + + pushd build &>/dev/null || die "pushd 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" + popd &>/dev/null || die + + # wrong assumption that /bin/sh is /bin/bash + sed \ + -e 's|/bin/sh|/bin/bash|g' \ + -i tests/scripts/* || die "sed failed" + + # Required for autoconf-2.70 #765043 + sed 's@^AM_INIT_AUTOMAKE.*@AC_PROG_MAKE_SET@' -i configure.in || die + AT_NOEAUTOMAKE=yes eautoreconf +} + +build_contrib_module() { + # + pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1" + einfo "Compiling contrib-module: $3" + # Make sure it's uppercase + local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -D${define_name}=SLAPD_MOD_DYNAMIC \ + -I"${BUILD_DIR}"/include \ + -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" + popd &>/dev/null || die +} + +src_configure() { + # Bug 408001 + use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync + + # connectionless ldap per bug #342439 + append-cppflags -DLDAP_CONNECTIONLESS + + multilib-minimal_src_configure +} + +multilib_src_configure() { + local myconf=() + + use debug && myconf+=( $(use_enable debug) ) + + # ICU exists only in the configure, nowhere in the codebase, bug #510858 + export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no + + if ! use minimal && multilib_is_native_abi; then + local CPPFLAGS=${CPPFLAGS} + + # re-enable serverside overlay chains per bug #296567 + # see ldap docs chaper 12.3.1 for details + myconf+=( --enable-ldap ) + + # backends + myconf+=( --enable-slapd ) + if use berkdb ; then + einfo "Using Berkeley DB for local backend" + myconf+=( --enable-bdb --enable-hdb ) + DBINCLUDE=$(db_includedir ${BDB_SLOTS}) + einfo "Using ${DBINCLUDE} for sys-libs/db version" + # We need to include the slotted db.h dir for FreeBSD + append-cppflags -I${DBINCLUDE} + else + myconf+=( --disable-bdb --disable-hdb ) + fi + for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do + myconf+=( --enable-${backend}=mod ) + done + + myconf+=( $(use_enable perl perl mod) ) + + 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+=( --with-odbc=${odbc_lib} ) + fi + + # slapd options + myconf+=( + $(use_enable crypt) + --disable-slp + $(use_enable samba lmpasswd) + $(use_enable syslog) + ) + if use experimental ; then + myconf+=( + --enable-dynacl + --enable-aci=mod + ) + fi + for option in aci cleartext modules rewrite rlookups slapi; do + myconf+=( --enable-${option} ) + done + + # slapd overlay options + # Compile-in the syncprov, the others as module + myconf+=( --enable-syncprov=yes ) + use overlays && myconf+=( --enable-overlays=mod ) + + else + myconf+=( + --disable-backends + --disable-slapd + --disable-bdb + --disable-hdb + --disable-mdb + --disable-overlays + --disable-syslog + ) + fi + + # basic functionality stuff + myconf+=( + $(use_enable ipv6) + $(multilib_native_use_with sasl cyrus-sasl) + $(multilib_native_use_enable sasl spasswd) + $(use_enable tcpd wrappers) + ) + + # Some cross-compiling tests don't pan out well. + tc-is-cross-compiler && myconf+=( + --with-yielding-select=yes + ) + + local ssl_lib="no" + if use ssl || ( ! use minimal && use samba ) ; then + ssl_lib="openssl" + use gnutls && ssl_lib="gnutls" + fi + + myconf+=( --with-tls=${ssl_lib} ) + + for basicflag in dynamic local proctitle shared; do + myconf+=( --enable-${basicflag} ) + done + + tc-export AR CC CXX + CONFIG_SHELL="/bin/sh" \ + ECONF_SOURCE="${S}" \ + STRIP=/bin/true \ + econf \ + --libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \ + $(use_enable static-libs static) \ + "${myconf[@]}" + emake depend +} + +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. + local myconf_ldapcpp=( + --with-ldap-includes="${S}"/include + ) + + mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die + pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" + + local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS} + append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \ + -L"${BUILD_DIR}"/libraries/libldap/.libs + append-cppflags -I"${BUILD_DIR}"/include + ECONF_SOURCE=${S}/contrib/ldapc++ \ + econf "${myconf_ldapcpp[@]}" \ + CC="${CC}" \ + CXX="${CXX}" + popd &>/dev/null || die +} + +multilib_src_compile() { + tc-export AR CC CXX + emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh + local lt="${BUILD_DIR}/libtool" + export echo="echo" + + if ! use minimal && multilib_is_native_abi ; then + if use cxx ; then + einfo "Building contrib library: ldapc++" + src_configure_cxx + pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" + emake CC="${CC}" CXX="${CXX}" + popd &>/dev/null || die + fi + + if use smbkrb5passwd ; then + einfo "Building contrib-module: smbk5pwd" + pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd" + + MY_DEFS="-DDO_SHADOW" + if use samba ; then + MY_DEFS="${MY_DEFS} -DDO_SAMBA" + MY_KRB5_INC="" + fi + if use kerberos ; then + MY_DEFS="${MY_DEFS} -DDO_KRB5" + MY_KRB5_INC="$(krb5-config --cflags)" + fi + + emake \ + DEFS="${MY_DEFS}" \ + KRB5_INC="${MY_KRB5_INC}" \ + LDAP_BUILD="${BUILD_DIR}" \ + CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" + popd &>/dev/null || die + fi + + if use overlays ; then + einfo "Building contrib-module: samba4" + pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4" + + emake \ + LDAP_BUILD="${BUILD_DIR}" \ + CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap" + popd &>/dev/null || die + fi + + if use kerberos ; then + if use kinit ; then + build_contrib_module "kinit" "kinit.c" "kinit" + fi + pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" + einfo "Compiling contrib-module: pw-kerberos" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -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" + popd &>/dev/null || die + fi + + if use pbkdf2; then + pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2" + einfo "Compiling contrib-module: pw-pbkdf2" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -I../../../../include \ + ${CFLAGS} \ + -o pbkdf2.lo \ + -c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed" + einfo "Linking contrib-module: pw-pbkdf2" + "${lt}" --mode=link --tag=CC \ + "${CC}" -module \ + ${CFLAGS} \ + ${LDFLAGS} \ + -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ + -o pw-pbkdf2.la \ + pbkdf2.lo || die "linking pw-pbkdf2 failed" + popd &>/dev/null || die + fi + + if use sha2 ; then + pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2" + einfo "Compiling contrib-module: pw-sha2" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -I../../../../include \ + ${CFLAGS} \ + -o sha2.lo \ + -c sha2.c || die "compiling pw-sha2 failed" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -I../../../../include \ + ${CFLAGS} \ + -o slapd-sha2.lo \ + -c slapd-sha2.c || die "compiling pw-sha2 failed" + einfo "Linking contrib-module: pw-sha2" + "${lt}" --mode=link --tag=CC \ + "${CC}" -module \ + ${CFLAGS} \ + ${LDFLAGS} \ + -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ + -o pw-sha2.la \ + sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed" + popd &>/dev/null || die + fi + + # We could build pw-radius if GNURadius would install radlib.h + pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" + einfo "Compiling contrib-module: pw-netscape" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -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 "acl" "posixgroup.c" "posixGroup" # example code only + #build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos + 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 "cloak" "cloak.c" "cloak" + # build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand + build_contrib_module "denyop" "denyop.c" "denyop-overlay" + build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin" + build_contrib_module "dupent" "dupent.c" "dupent" + build_contrib_module "lastbind" "lastbind.c" "lastbind" + # lastmod may not play well with other overlays + build_contrib_module "lastmod" "lastmod.c" "lastmod" + build_contrib_module "noopsrch" "noopsrch.c" "noopsrch" + #build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576 + #build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER + build_contrib_module "trace" "trace.c" "trace" + popd &>/dev/null || die + # build slapi-plugins + pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues" + einfo "Building contrib-module: addrdnvalues plugin" + "${CC}" -shared \ + -I"${BUILD_DIR}"/include \ + -I../../../include \ + ${CFLAGS} \ + -fPIC \ + ${LDFLAGS} \ + -o libaddrdnvalues-plugin.so \ + addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed" + popd &>/dev/null || die + fi +} + +multilib_src_test() { + if multilib_is_native_abi; then + cd tests || die + emake tests + fi +} + +multilib_src_install() { + local lt="${BUILD_DIR}/libtool" + emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install + + if ! use minimal && multilib_is_native_abi; 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.4.40-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 + einfo "Adding $(basename ${x})" + sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die + 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 || die + eend + + # install our own init scripts and systemd unit files + einfo "Install init scripts" + sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die + doinitd "${T}"/slapd + newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd + + einfo "Install systemd service" + sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die + systemd_dounit "${T}"/slapd.service + systemd_install_serviced "${FILESDIR}"/slapd.service.conf + newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf + + # If built without SLP, we don't need to be before avahi + sed -i \ + -e '/before/{s/avahi-daemon//g}' \ + "${ED}"/etc/init.d/slapd \ + || die + + if use cxx ; then + einfo "Install the ldapc++ library" + cd "${BUILD_DIR}/contrib/ldapc++" || die + emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install + cd "${S}"/contrib/ldapc++ || die + newdoc README ldapc++-README + fi + + if use smbkrb5passwd ; then + einfo "Install the smbk5pwd module" + cd "${S}/contrib/slapd-modules/smbk5pwd" || die + emake DESTDIR="${D}" \ + LDAP_BUILD="${BUILD_DIR}" \ + libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install + newdoc README smbk5pwd-README + fi + + if use overlays ; then + einfo "Install the samba4 module" + cd "${S}/contrib/slapd-modules/samba4" || die + emake DESTDIR="${D}" \ + LDAP_BUILD="${BUILD_DIR}" \ + libexecdir="/usr/$(get_libdir)/openldap" install + newdoc README samba4-README + fi + + einfo "Installing contrib modules" + cd "${S}/contrib/slapd-modules" || die + for l in */*.la */*/*.la; do + [[ -e ${l} ]] || continue + "${lt}" --mode=install cp ${l} \ + "${ED}"/usr/$(get_libdir)/openldap/openldap || \ + die "installing ${l} failed" + done + + dodoc "${FILESDIR}"/DB_CONFIG.fast.example + docinto contrib + doman */*.5 + #newdoc acl/README* + newdoc addpartial/README addpartial-README + newdoc allop/README allop-README + newdoc allowed/README allowed-README + newdoc autogroup/README autogroup-README + newdoc dsaschema/README dsaschema-README + newdoc passwd/README passwd-README + cd "${S}/contrib/slapi-plugins" || die + 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} + + docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample* + docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample* + docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm + + dosbin "${S}"/contrib/slapd-tools/statslog + newdoc "${S}"/contrib/slapd-tools/README README.statslog + fi + + if ! use static-libs ; then + find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die + fi +} + +multilib_src_install_all() { + dodoc ANNOUNCEMENT CHANGES COPYRIGHT README + docinto rfc ; dodoc doc/rfc/*.txt +} + +pkg_preinst() { + # keep old libs if any + preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0) + # bug 440470, only display the getting started help there was no openldap before, + # or we are going to a non-minimal build + ! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]' + OPENLDAP_PRINT_MESSAGES=$((! $?)) +} + +pkg_postinst() { + if ! use minimal ; then + tmpfiles_process slapd.conf + + # 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 allow' 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 + if [[ -d "${EROOT}"/var/run/openldap ]]; then + use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; } + chmod 0755 "${EROOT}"/var/run/openldap || die + fi + use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default} + chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die + use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data + fi + + if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then + elog "Getting started using OpenLDAP? There is some documentation available:" + elog "Gentoo Guide to OpenLDAP Authentication" + elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)" + elog "---" + elog "An example file for tuning BDB backends with openldap is" + elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/" + fi + + preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0) +} diff --git a/net-nds/openldap/openldap-2.5.4-r1.ebuild b/net-nds/openldap/openldap-2.5.4-r1.ebuild new file mode 100644 index 000000000000..72168dd71c9c --- /dev/null +++ b/net-nds/openldap/openldap-2.5.4-r1.ebuild @@ -0,0 +1,840 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles + +BIS_PN=rfc2307bis.schema +BIS_PV=20140524 +BIS_P="${BIS_PN}-${BIS_PV}" + +DESCRIPTION="LDAP suite of application and development tools" +HOMEPAGE="https://www.OpenLDAP.org/" + +# upstream mirrors are mostly not working, using canonical URI +SRC_URI=" + https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz + http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz + http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz + http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz + mirror://gentoo/${BIS_P}" + +LICENSE="OPENLDAP GPL-2" +SLOT="0" +KEYWORDS="" + +IUSE_DAEMON="crypt samba tcpd experimental minimal" +IUSE_OVERLAY="overlays perl" +IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test" +IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2" +IUSE_CONTRIB="${IUSE_CONTRIB} cxx" +IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}" + +RESTRICT="!test? ( test )" +REQUIRED_USE="cxx? ( sasl ) + pbkdf2? ( ssl ) + ?? ( test minimal )" + +# always list newer first +# Do not add any AGPL-3 BDB here! +# See bug 525110, comment 15. +# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build. +BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}" +BDB_PKGS='' +for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done + +# openssl is needed to generate lanman-passwords required by samba +COMMON_DEPEND=" + ssl? ( + !gnutls? ( + >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] + ) + gnutls? ( + >=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}] + >=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}] + ) + ) + sasl? ( dev-libs/cyrus-sasl:= ) + !minimal? ( + dev-libs/libltdl + sys-fs/e2fsprogs + >=dev-db/lmdb-0.9.18:= + crypt? ( virtual/libcrypt:= ) + tcpd? ( sys-apps/tcp-wrappers ) + odbc? ( !iodbc? ( dev-db/unixODBC ) + iodbc? ( dev-db/libiodbc ) ) + perl? ( dev-lang/perl:=[-build(-)] ) + samba? ( + dev-libs/openssl:0= + ) + smbkrb5passwd? ( + dev-libs/openssl:0= + kerberos? ( app-crypt/heimdal ) + ) + kerberos? ( + virtual/krb5 + kinit? ( !app-crypt/heimdal ) + ) + cxx? ( dev-libs/cyrus-sasl:= ) + ) +" +DEPEND="${COMMON_DEPEND} + sys-apps/groff +" +RDEPEND="${COMMON_DEPEND} + selinux? ( sec-policy/selinux-ldap ) +" + +# The user/group are only used for running daemons which are +# disabled in minimal builds, so elide the accounts too. +BDEPEND="!minimal? ( + acct-group/ldap + acct-user/ldap +) +" + +# for tracking versions +OPENLDAP_VERSIONTAG=".version-tag" +OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data" + +MULTILIB_WRAPPED_HEADERS=( + # USE=cxx + /usr/include/LDAPAsynConnection.h + /usr/include/LDAPAttrType.h + /usr/include/LDAPAttribute.h + /usr/include/LDAPAttributeList.h + /usr/include/LDAPConnection.h + /usr/include/LDAPConstraints.h + /usr/include/LDAPControl.h + /usr/include/LDAPControlSet.h + /usr/include/LDAPEntry.h + /usr/include/LDAPEntryList.h + /usr/include/LDAPException.h + /usr/include/LDAPExtResult.h + /usr/include/LDAPMessage.h + /usr/include/LDAPMessageQueue.h + /usr/include/LDAPModList.h + /usr/include/LDAPModification.h + /usr/include/LDAPObjClass.h + /usr/include/LDAPRebind.h + /usr/include/LDAPRebindAuth.h + /usr/include/LDAPReferenceList.h + /usr/include/LDAPResult.h + /usr/include/LDAPSaslBindResult.h + /usr/include/LDAPSchema.h + /usr/include/LDAPSearchReference.h + /usr/include/LDAPSearchResult.h + /usr/include/LDAPSearchResults.h + /usr/include/LDAPUrl.h + /usr/include/LDAPUrlList.h + /usr/include/LdifReader.h + /usr/include/LdifWriter.h + /usr/include/SaslInteraction.h + /usr/include/SaslInteractionHandler.h + /usr/include/StringList.h + /usr/include/TlsOptions.h +) + +openldap_filecount() { + local dir="$1" + find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l +} + +openldap_find_versiontags() { + # scan for all datadirs + local 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_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}$(sed "s:\/::" <<< ${each})" + 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=$(ver_cut 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" ]] && [[ -f "${SLAPD_PATH}" ]]; then + OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \ + | awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')" + local fail=0 + if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then + : + # Nothing wrong here. + elif [[ -z "${OLDVER}" ]] && [[ -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}" ]] && [[ -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() { + local d l i + 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/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[minimal]' ; then + einfo "Skipping scan for previous datadirs as requested by minimal useflag" + else + openldap_find_versiontags + fi +} + +src_prepare() { + # ensure correct SLAPI path by default + sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \ + -i include/ldap_defaults.h || die + + default + rm -r libraries/liblmdb || die + + pushd build &>/dev/null || die "pushd 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" + popd &>/dev/null || die + + AT_NOEAUTOMAKE=yes eautoreconf +} + +build_contrib_module() { + # + pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1" + einfo "Compiling contrib-module: $3" + # Make sure it's uppercase + local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -D${define_name}=SLAPD_MOD_DYNAMIC \ + -I"${BUILD_DIR}"/include \ + -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" + popd &>/dev/null || die +} + +src_configure() { + # Bug 408001 + use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync + + # connectionless ldap per bug #342439 + append-cppflags -DLDAP_CONNECTIONLESS + + multilib-minimal_src_configure +} + +multilib_src_configure() { + local myconf=() + + use debug && myconf+=( $(use_enable debug) ) + + # ICU exists only in the configure, nowhere in the codebase, bug #510858 + export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no + + if ! use minimal && multilib_is_native_abi; then + local CPPFLAGS=${CPPFLAGS} + + # re-enable serverside overlay chains per bug #296567 + # see ldap docs chaper 12.3.1 for details + myconf+=( --enable-ldap ) + + # backends + myconf+=( --enable-slapd ) + for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do + myconf+=( --enable-${backend}=mod ) + done + + myconf+=( $(use_enable perl perl mod) ) + + 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+=( --with-odbc=${odbc_lib} ) + fi + + # slapd options + myconf+=( + $(use_enable crypt) + --disable-slp + $(use_enable samba lmpasswd) + $(use_enable syslog) + ) + if use experimental ; then + myconf+=( + --enable-dynacl + --enable-aci=mod + ) + fi + for option in aci cleartext modules rewrite rlookups slapi; do + myconf+=( --enable-${option} ) + done + + # slapd overlay options + # Compile-in the syncprov, the others as module + myconf+=( --enable-syncprov=yes ) + use overlays && myconf+=( --enable-overlays=mod ) + + else + myconf+=( + --disable-backends + --disable-slapd + --disable-mdb + --disable-overlays + --disable-syslog + ) + fi + + # basic functionality stuff + myconf+=( + $(use_enable ipv6) + $(multilib_native_use_with sasl cyrus-sasl) + $(multilib_native_use_enable sasl spasswd) + $(use_enable tcpd wrappers) + ) + + # Some cross-compiling tests don't pan out well. + tc-is-cross-compiler && myconf+=( + --with-yielding-select=yes + ) + + local ssl_lib="no" + if use ssl || ( ! use minimal && use samba ) ; then + ssl_lib="openssl" + use gnutls && ssl_lib="gnutls" + fi + + myconf+=( --with-tls=${ssl_lib} ) + + for basicflag in dynamic local shared; do + myconf+=( --enable-${basicflag} ) + done + + tc-export AR CC CXX + CONFIG_SHELL="/bin/sh" \ + ECONF_SOURCE="${S}" \ + STRIP=/bin/true \ + econf \ + --libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \ + $(use_enable static-libs static) \ + "${myconf[@]}" + emake depend +} + +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. + local myconf_ldapcpp=( + --with-ldap-includes="${S}"/include + ) + + mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die + pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" + + local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS} + append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \ + -L"${BUILD_DIR}"/libraries/libldap/.libs + append-cppflags -I"${BUILD_DIR}"/include + ECONF_SOURCE=${S}/contrib/ldapc++ \ + econf "${myconf_ldapcpp[@]}" \ + CC="${CC}" \ + CXX="${CXX}" + popd &>/dev/null || die +} + +multilib_src_compile() { + tc-export AR CC CXX + emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh + local lt="${BUILD_DIR}/libtool" + export echo="echo" + + if ! use minimal && multilib_is_native_abi ; then + if use cxx ; then + einfo "Building contrib library: ldapc++" + src_configure_cxx + pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" + emake CC="${CC}" CXX="${CXX}" + popd &>/dev/null || die + fi + + if use smbkrb5passwd ; then + einfo "Building contrib-module: smbk5pwd" + pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd" + + MY_DEFS="-DDO_SHADOW" + if use samba ; then + MY_DEFS="${MY_DEFS} -DDO_SAMBA" + MY_KRB5_INC="" + fi + if use kerberos ; then + MY_DEFS="${MY_DEFS} -DDO_KRB5" + MY_KRB5_INC="$(krb5-config --cflags)" + fi + + emake \ + DEFS="${MY_DEFS}" \ + KRB5_INC="${MY_KRB5_INC}" \ + LDAP_BUILD="${BUILD_DIR}" \ + CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" + popd &>/dev/null || die + fi + + if use overlays ; then + einfo "Building contrib-module: samba4" + pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4" + + emake \ + LDAP_BUILD="${BUILD_DIR}" \ + CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap" + popd &>/dev/null || die + fi + + if use kerberos ; then + if use kinit ; then + build_contrib_module "kinit" "kinit.c" "kinit" + fi + pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" + einfo "Compiling contrib-module: pw-kerberos" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -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" + popd &>/dev/null || die + fi + + if use pbkdf2; then + pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2" + einfo "Compiling contrib-module: pw-pbkdf2" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -I../../../../include \ + ${CFLAGS} \ + -o pbkdf2.lo \ + -c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed" + einfo "Linking contrib-module: pw-pbkdf2" + "${lt}" --mode=link --tag=CC \ + "${CC}" -module \ + ${CFLAGS} \ + ${LDFLAGS} \ + -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ + -o pw-pbkdf2.la \ + pbkdf2.lo || die "linking pw-pbkdf2 failed" + popd &>/dev/null || die + fi + + if use sha2 ; then + pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2" + einfo "Compiling contrib-module: pw-sha2" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -I../../../../include \ + ${CFLAGS} \ + -o sha2.lo \ + -c sha2.c || die "compiling pw-sha2 failed" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -I../../../../include \ + ${CFLAGS} \ + -o slapd-sha2.lo \ + -c slapd-sha2.c || die "compiling pw-sha2 failed" + einfo "Linking contrib-module: pw-sha2" + "${lt}" --mode=link --tag=CC \ + "${CC}" -module \ + ${CFLAGS} \ + ${LDFLAGS} \ + -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ + -o pw-sha2.la \ + sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed" + popd &>/dev/null || die + fi + + # We could build pw-radius if GNURadius would install radlib.h + pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" + einfo "Compiling contrib-module: pw-netscape" + "${lt}" --mode=compile --tag=CC \ + "${CC}" \ + -I"${BUILD_DIR}"/include \ + -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 "acl" "posixgroup.c" "posixGroup" # example code only + #build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos + 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 "cloak" "cloak.c" "cloak" + # build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand + build_contrib_module "denyop" "denyop.c" "denyop-overlay" + build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin" + build_contrib_module "dupent" "dupent.c" "dupent" + build_contrib_module "lastbind" "lastbind.c" "lastbind" + # lastmod may not play well with other overlays + build_contrib_module "lastmod" "lastmod.c" "lastmod" + build_contrib_module "noopsrch" "noopsrch.c" "noopsrch" + #build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576 + #build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER + build_contrib_module "trace" "trace.c" "trace" + popd &>/dev/null || die + # build slapi-plugins + pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues" + einfo "Building contrib-module: addrdnvalues plugin" + "${CC}" -shared \ + -I"${BUILD_DIR}"/include \ + -I../../../include \ + ${CFLAGS} \ + -fPIC \ + ${LDFLAGS} \ + -o libaddrdnvalues-plugin.so \ + addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed" + popd &>/dev/null || die + fi +} + +multilib_src_test() { + if multilib_is_native_abi; then + cd tests || die + emake tests + fi +} + +multilib_src_install() { + local lt="${BUILD_DIR}/libtool" + emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install + + if ! use minimal && multilib_is_native_abi; 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.4.40-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 + einfo "Adding $(basename ${x})" + sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die + 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 || die + eend + + # install our own init scripts and systemd unit files + einfo "Install init scripts" + sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die + doinitd "${T}"/slapd + newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd + + einfo "Install systemd service" + sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die + systemd_dounit "${T}"/slapd.service + systemd_install_serviced "${FILESDIR}"/slapd.service.conf + newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf + + # If built without SLP, we don't need to be before avahi + sed -i \ + -e '/before/{s/avahi-daemon//g}' \ + "${ED}"/etc/init.d/slapd \ + || die + + if use cxx ; then + einfo "Install the ldapc++ library" + cd "${BUILD_DIR}/contrib/ldapc++" || die + emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install + cd "${S}"/contrib/ldapc++ || die + newdoc README ldapc++-README + fi + + if use smbkrb5passwd ; then + einfo "Install the smbk5pwd module" + cd "${S}/contrib/slapd-modules/smbk5pwd" || die + emake DESTDIR="${D}" \ + LDAP_BUILD="${BUILD_DIR}" \ + libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install + newdoc README smbk5pwd-README + fi + + if use overlays ; then + einfo "Install the samba4 module" + cd "${S}/contrib/slapd-modules/samba4" || die + emake DESTDIR="${D}" \ + LDAP_BUILD="${BUILD_DIR}" \ + libexecdir="/usr/$(get_libdir)/openldap" install + newdoc README samba4-README + fi + + einfo "Installing contrib modules" + cd "${S}/contrib/slapd-modules" || die + for l in */*.la */*/*.la; do + [[ -e ${l} ]] || continue + "${lt}" --mode=install cp ${l} \ + "${ED}"/usr/$(get_libdir)/openldap/openldap || \ + die "installing ${l} failed" + done + + dodoc "${FILESDIR}"/DB_CONFIG.fast.example + docinto contrib + doman */*.5 + #newdoc acl/README* + newdoc addpartial/README addpartial-README + newdoc allop/README allop-README + newdoc allowed/README allowed-README + newdoc autogroup/README autogroup-README + newdoc dsaschema/README dsaschema-README + newdoc passwd/README passwd-README + cd "${S}/contrib/slapi-plugins" || die + 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} + + docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample* + docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample* + docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm + + dosbin "${S}"/contrib/slapd-tools/statslog + newdoc "${S}"/contrib/slapd-tools/README README.statslog + fi + + if ! use static-libs ; then + find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die + fi +} + +multilib_src_install_all() { + dodoc ANNOUNCEMENT CHANGES COPYRIGHT README + docinto rfc ; dodoc doc/rfc/*.txt +} + +pkg_preinst() { + # keep old libs if any + preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0) + # bug 440470, only display the getting started help there was no openldap before, + # or we are going to a non-minimal build + ! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]' + OPENLDAP_PRINT_MESSAGES=$((! $?)) +} + +pkg_postinst() { + if ! use minimal ; then + tmpfiles_process slapd.conf + + # 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 allow' 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 + if [[ -d "${EROOT}"/var/run/openldap ]]; then + use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; } + chmod 0755 "${EROOT}"/var/run/openldap || die + fi + use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default} + chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die + use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data + fi + + if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then + elog "Getting started using OpenLDAP? There is some documentation available:" + elog "Gentoo Guide to OpenLDAP Authentication" + elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)" + elog "---" + elog "An example file for tuning BDB backends with openldap is" + elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/" + fi + + preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0) +} diff --git a/net-nds/openldap/openldap-2.5.4.ebuild b/net-nds/openldap/openldap-2.5.4.ebuild deleted file mode 100644 index 8c6dab1cf306..000000000000 --- a/net-nds/openldap/openldap-2.5.4.ebuild +++ /dev/null @@ -1,840 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit autotools db-use flag-o-matic multilib-minimal preserve-libs ssl-cert toolchain-funcs systemd tmpfiles - -BIS_PN=rfc2307bis.schema -BIS_PV=20140524 -BIS_P="${BIS_PN}-${BIS_PV}" - -DESCRIPTION="LDAP suite of application and development tools" -HOMEPAGE="https://www.OpenLDAP.org/" - -# upstream mirrors are mostly not working, using canonical URI -SRC_URI=" - https://openldap.org/software/download/OpenLDAP/openldap-release/${P}.tgz - http://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/${P}.tgz - http://repository.linagora.org/OpenLDAP/openldap-release/${P}.tgz - http://mirror.eu.oneandone.net/software/openldap/openldap-release/${P}.tgz - mirror://gentoo/${BIS_P}" - -LICENSE="OPENLDAP GPL-2" -SLOT="0" -KEYWORDS="" - -IUSE_DAEMON="crypt samba tcpd experimental minimal" -IUSE_OVERLAY="overlays perl" -IUSE_OPTIONAL="gnutls iodbc sasl ssl odbc debug ipv6 +syslog selinux static-libs test" -IUSE_CONTRIB="smbkrb5passwd kerberos kinit pbkdf2 sha2" -IUSE_CONTRIB="${IUSE_CONTRIB} cxx" -IUSE="${IUSE_DAEMON} ${IUSE_BACKEND} ${IUSE_OVERLAY} ${IUSE_OPTIONAL} ${IUSE_CONTRIB}" - -RESTRICT="!test? ( test )" -REQUIRED_USE="cxx? ( sasl ) - pbkdf2? ( ssl ) - ?? ( test minimal )" - -# always list newer first -# Do not add any AGPL-3 BDB here! -# See bug 525110, comment 15. -# Advanced usage: OPENLDAP_BDB_SLOTS in the environment can be used to force a slot during build. -BDB_SLOTS="${OPENLDAP_BDB_SLOTS:=5.3 5.1 4.8 4.7 4.6 4.5 4.4}" -BDB_PKGS='' -for _slot in $BDB_SLOTS; do BDB_PKGS="${BDB_PKGS} sys-libs/db:${_slot}" ; done - -# openssl is needed to generate lanman-passwords required by samba -COMMON_DEPEND=" - ssl? ( - !gnutls? ( - >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] - ) - gnutls? ( - >=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}] - >=dev-libs/libgcrypt-1.5.3:0=[${MULTILIB_USEDEP}] - ) - ) - sasl? ( dev-libs/cyrus-sasl:= ) - !minimal? ( - dev-libs/libltdl - sys-libs/e2fsprogs-libs - >=dev-db/lmdb-0.9.18:= - crypt? ( virtual/libcrypt:= ) - tcpd? ( sys-apps/tcp-wrappers ) - odbc? ( !iodbc? ( dev-db/unixODBC ) - iodbc? ( dev-db/libiodbc ) ) - perl? ( dev-lang/perl:=[-build(-)] ) - samba? ( - dev-libs/openssl:0= - ) - smbkrb5passwd? ( - dev-libs/openssl:0= - kerberos? ( app-crypt/heimdal ) - ) - kerberos? ( - virtual/krb5 - kinit? ( !app-crypt/heimdal ) - ) - cxx? ( dev-libs/cyrus-sasl:= ) - ) -" -DEPEND="${COMMON_DEPEND} - sys-apps/groff -" -RDEPEND="${COMMON_DEPEND} - selinux? ( sec-policy/selinux-ldap ) -" - -# The user/group are only used for running daemons which are -# disabled in minimal builds, so elide the accounts too. -BDEPEND="!minimal? ( - acct-group/ldap - acct-user/ldap -) -" - -# for tracking versions -OPENLDAP_VERSIONTAG=".version-tag" -OPENLDAP_DEFAULTDIR_VERSIONTAG="/var/lib/openldap-data" - -MULTILIB_WRAPPED_HEADERS=( - # USE=cxx - /usr/include/LDAPAsynConnection.h - /usr/include/LDAPAttrType.h - /usr/include/LDAPAttribute.h - /usr/include/LDAPAttributeList.h - /usr/include/LDAPConnection.h - /usr/include/LDAPConstraints.h - /usr/include/LDAPControl.h - /usr/include/LDAPControlSet.h - /usr/include/LDAPEntry.h - /usr/include/LDAPEntryList.h - /usr/include/LDAPException.h - /usr/include/LDAPExtResult.h - /usr/include/LDAPMessage.h - /usr/include/LDAPMessageQueue.h - /usr/include/LDAPModList.h - /usr/include/LDAPModification.h - /usr/include/LDAPObjClass.h - /usr/include/LDAPRebind.h - /usr/include/LDAPRebindAuth.h - /usr/include/LDAPReferenceList.h - /usr/include/LDAPResult.h - /usr/include/LDAPSaslBindResult.h - /usr/include/LDAPSchema.h - /usr/include/LDAPSearchReference.h - /usr/include/LDAPSearchResult.h - /usr/include/LDAPSearchResults.h - /usr/include/LDAPUrl.h - /usr/include/LDAPUrlList.h - /usr/include/LdifReader.h - /usr/include/LdifWriter.h - /usr/include/SaslInteraction.h - /usr/include/SaslInteractionHandler.h - /usr/include/StringList.h - /usr/include/TlsOptions.h -) - -openldap_filecount() { - local dir="$1" - find "${dir}" -type f ! -name '.*' ! -name 'DB_CONFIG*' | wc -l -} - -openldap_find_versiontags() { - # scan for all datadirs - local 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_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}$(sed "s:\/::" <<< ${each})" - 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=$(ver_cut 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" ]] && [[ -f "${SLAPD_PATH}" ]]; then - OLDVER="$(/usr/bin/ldd ${SLAPD_PATH} \ - | awk '/libdb-/{gsub("^libdb-","",$1);gsub(".so$","",$1);print $1}')" - local fail=0 - if [[ -z "${OLDVER}" ]] && [[ -z "${NEWVER}" ]]; then - : - # Nothing wrong here. - elif [[ -z "${OLDVER}" ]] && [[ -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}" ]] && [[ -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() { - local d l i - 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/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[minimal]' ; then - einfo "Skipping scan for previous datadirs as requested by minimal useflag" - else - openldap_find_versiontags - fi -} - -src_prepare() { - # ensure correct SLAPI path by default - sed -e 's,\(#define LDAPI_SOCK\).*,\1 "'"${EPREFIX}"'/var/run/openldap/slapd.sock",' \ - -i include/ldap_defaults.h || die - - default - rm -r libraries/liblmdb || die - - pushd build &>/dev/null || die "pushd 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" - popd &>/dev/null || die - - AT_NOEAUTOMAKE=yes eautoreconf -} - -build_contrib_module() { - # - pushd "${S}/contrib/slapd-modules/$1" &>/dev/null || die "pushd contrib/slapd-modules/$1" - einfo "Compiling contrib-module: $3" - # Make sure it's uppercase - local define_name="$(LC_ALL=C tr '[:lower:]' '[:upper:]' <<< "SLAPD_OVER_${1}")" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -D${define_name}=SLAPD_MOD_DYNAMIC \ - -I"${BUILD_DIR}"/include \ - -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" - popd &>/dev/null || die -} - -src_configure() { - # Bug 408001 - use elibc_FreeBSD && append-cppflags -DMDB_DSYNC=O_SYNC -DMDB_FDATASYNC=fsync - - # connectionless ldap per bug #342439 - append-cppflags -DLDAP_CONNECTIONLESS - - multilib-minimal_src_configure -} - -multilib_src_configure() { - local myconf=() - - use debug && myconf+=( $(use_enable debug) ) - - # ICU exists only in the configure, nowhere in the codebase, bug #510858 - export ac_cv_header_unicode_utypes_h=no ol_cv_lib_icu=no - - if ! use minimal && multilib_is_native_abi; then - local CPPFLAGS=${CPPFLAGS} - - # re-enable serverside overlay chains per bug #296567 - # see ldap docs chaper 12.3.1 for details - myconf+=( --enable-ldap ) - - # backends - myconf+=( --enable-slapd ) - for backend in dnssrv ldap mdb meta monitor null passwd relay shell sock; do - myconf+=( --enable-${backend}=mod ) - done - - myconf+=( $(use_enable perl perl mod) ) - - 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+=( --with-odbc=${odbc_lib} ) - fi - - # slapd options - myconf+=( - $(use_enable crypt) - --disable-slp - $(use_enable samba lmpasswd) - $(use_enable syslog) - ) - if use experimental ; then - myconf+=( - --enable-dynacl - --enable-aci=mod - ) - fi - for option in aci cleartext modules rewrite rlookups slapi; do - myconf+=( --enable-${option} ) - done - - # slapd overlay options - # Compile-in the syncprov, the others as module - myconf+=( --enable-syncprov=yes ) - use overlays && myconf+=( --enable-overlays=mod ) - - else - myconf+=( - --disable-backends - --disable-slapd - --disable-mdb - --disable-overlays - --disable-syslog - ) - fi - - # basic functionality stuff - myconf+=( - $(use_enable ipv6) - $(multilib_native_use_with sasl cyrus-sasl) - $(multilib_native_use_enable sasl spasswd) - $(use_enable tcpd wrappers) - ) - - # Some cross-compiling tests don't pan out well. - tc-is-cross-compiler && myconf+=( - --with-yielding-select=yes - ) - - local ssl_lib="no" - if use ssl || ( ! use minimal && use samba ) ; then - ssl_lib="openssl" - use gnutls && ssl_lib="gnutls" - fi - - myconf+=( --with-tls=${ssl_lib} ) - - for basicflag in dynamic local shared; do - myconf+=( --enable-${basicflag} ) - done - - tc-export AR CC CXX - CONFIG_SHELL="/bin/sh" \ - ECONF_SOURCE="${S}" \ - STRIP=/bin/true \ - econf \ - --libexecdir="${EPREFIX}"/usr/$(get_libdir)/openldap \ - $(use_enable static-libs static) \ - "${myconf[@]}" - emake depend -} - -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. - local myconf_ldapcpp=( - --with-ldap-includes="${S}"/include - ) - - mkdir -p "${BUILD_DIR}"/contrib/ldapc++ || die - pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" - - local LDFLAGS=${LDFLAGS} CPPFLAGS=${CPPFLAGS} - append-ldflags -L"${BUILD_DIR}"/libraries/liblber/.libs \ - -L"${BUILD_DIR}"/libraries/libldap/.libs - append-cppflags -I"${BUILD_DIR}"/include - ECONF_SOURCE=${S}/contrib/ldapc++ \ - econf "${myconf_ldapcpp[@]}" \ - CC="${CC}" \ - CXX="${CXX}" - popd &>/dev/null || die -} - -multilib_src_compile() { - tc-export AR CC CXX - emake CC="${CC}" AR="${AR}" SHELL="${EPREFIX}"/bin/sh - local lt="${BUILD_DIR}/libtool" - export echo="echo" - - if ! use minimal && multilib_is_native_abi ; then - if use cxx ; then - einfo "Building contrib library: ldapc++" - src_configure_cxx - pushd "${BUILD_DIR}/contrib/ldapc++" &>/dev/null || die "pushd contrib/ldapc++" - emake CC="${CC}" CXX="${CXX}" - popd &>/dev/null || die - fi - - if use smbkrb5passwd ; then - einfo "Building contrib-module: smbk5pwd" - pushd "${S}/contrib/slapd-modules/smbk5pwd" &>/dev/null || die "pushd contrib/slapd-modules/smbk5pwd" - - MY_DEFS="-DDO_SHADOW" - if use samba ; then - MY_DEFS="${MY_DEFS} -DDO_SAMBA" - MY_KRB5_INC="" - fi - if use kerberos ; then - MY_DEFS="${MY_DEFS} -DDO_KRB5" - MY_KRB5_INC="$(krb5-config --cflags)" - fi - - emake \ - DEFS="${MY_DEFS}" \ - KRB5_INC="${MY_KRB5_INC}" \ - LDAP_BUILD="${BUILD_DIR}" \ - CC="${CC}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" - popd &>/dev/null || die - fi - - if use overlays ; then - einfo "Building contrib-module: samba4" - pushd "${S}/contrib/slapd-modules/samba4" &>/dev/null || die "pushd contrib/slapd-modules/samba4" - - emake \ - LDAP_BUILD="${BUILD_DIR}" \ - CC="${CC}" libexecdir="/usr/$(get_libdir)/openldap" - popd &>/dev/null || die - fi - - if use kerberos ; then - if use kinit ; then - build_contrib_module "kinit" "kinit.c" "kinit" - fi - pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" - einfo "Compiling contrib-module: pw-kerberos" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -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" - popd &>/dev/null || die - fi - - if use pbkdf2; then - pushd "${S}/contrib/slapd-modules/passwd/pbkdf2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/pbkdf2" - einfo "Compiling contrib-module: pw-pbkdf2" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -I../../../../include \ - ${CFLAGS} \ - -o pbkdf2.lo \ - -c pw-pbkdf2.c || die "compiling pw-pbkdf2 failed" - einfo "Linking contrib-module: pw-pbkdf2" - "${lt}" --mode=link --tag=CC \ - "${CC}" -module \ - ${CFLAGS} \ - ${LDFLAGS} \ - -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ - -o pw-pbkdf2.la \ - pbkdf2.lo || die "linking pw-pbkdf2 failed" - popd &>/dev/null || die - fi - - if use sha2 ; then - pushd "${S}/contrib/slapd-modules/passwd/sha2" &>/dev/null || die "pushd contrib/slapd-modules/passwd/sha2" - einfo "Compiling contrib-module: pw-sha2" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -I../../../../include \ - ${CFLAGS} \ - -o sha2.lo \ - -c sha2.c || die "compiling pw-sha2 failed" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -I../../../../include \ - ${CFLAGS} \ - -o slapd-sha2.lo \ - -c slapd-sha2.c || die "compiling pw-sha2 failed" - einfo "Linking contrib-module: pw-sha2" - "${lt}" --mode=link --tag=CC \ - "${CC}" -module \ - ${CFLAGS} \ - ${LDFLAGS} \ - -rpath "${EPREFIX}"/usr/$(get_libdir)/openldap/openldap \ - -o pw-sha2.la \ - sha2.lo slapd-sha2.lo || die "linking pw-sha2 failed" - popd &>/dev/null || die - fi - - # We could build pw-radius if GNURadius would install radlib.h - pushd "${S}/contrib/slapd-modules/passwd" &>/dev/null || die "pushd contrib/slapd-modules/passwd" - einfo "Compiling contrib-module: pw-netscape" - "${lt}" --mode=compile --tag=CC \ - "${CC}" \ - -I"${BUILD_DIR}"/include \ - -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 "acl" "posixgroup.c" "posixGroup" # example code only - #build_contrib_module "acl" "gssacl.c" "gss" # example code only, also needs kerberos - 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 "cloak" "cloak.c" "cloak" - # build_contrib_module "comp_match" "comp_match.c" "comp_match" # really complex, adds new external deps, questionable demand - build_contrib_module "denyop" "denyop.c" "denyop-overlay" - build_contrib_module "dsaschema" "dsaschema.c" "dsaschema-plugin" - build_contrib_module "dupent" "dupent.c" "dupent" - build_contrib_module "lastbind" "lastbind.c" "lastbind" - # lastmod may not play well with other overlays - build_contrib_module "lastmod" "lastmod.c" "lastmod" - build_contrib_module "noopsrch" "noopsrch.c" "noopsrch" - #build_contrib_module "nops" "nops.c" "nops-overlay" https://bugs.gentoo.org/641576 - #build_contrib_module "nssov" "nssov.c" "nssov-overlay" RESO:LATER - build_contrib_module "trace" "trace.c" "trace" - popd &>/dev/null || die - # build slapi-plugins - pushd "${S}/contrib/slapi-plugins/addrdnvalues" &>/dev/null || die "pushd contrib/slapi-plugins/addrdnvalues" - einfo "Building contrib-module: addrdnvalues plugin" - "${CC}" -shared \ - -I"${BUILD_DIR}"/include \ - -I../../../include \ - ${CFLAGS} \ - -fPIC \ - ${LDFLAGS} \ - -o libaddrdnvalues-plugin.so \ - addrdnvalues.c || die "Building libaddrdnvalues-plugin.so failed" - popd &>/dev/null || die - fi -} - -multilib_src_test() { - if multilib_is_native_abi; then - cd tests || die - emake tests - fi -} - -multilib_src_install() { - local lt="${BUILD_DIR}/libtool" - emake DESTDIR="${D}" SHELL="${EPREFIX}"/bin/sh install - - if ! use minimal && multilib_is_native_abi; 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.4.40-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 - einfo "Adding $(basename ${x})" - sed -e "/###INSERTDYNAMICMODULESHERE###$/a# moduleload\t$(basename ${x})" -i "${configfile}" || die - 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 || die - eend - - # install our own init scripts and systemd unit files - einfo "Install init scripts" - sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd-initd-2.4.40-r2 > "${T}"/slapd || die - doinitd "${T}"/slapd - newconfd "${FILESDIR}"/slapd-confd-2.4.28-r1 slapd - - einfo "Install systemd service" - sed -e "s,/usr/lib/,/usr/$(get_libdir)/," "${FILESDIR}"/slapd.service > "${T}"/slapd.service || die - systemd_dounit "${T}"/slapd.service - systemd_install_serviced "${FILESDIR}"/slapd.service.conf - newtmpfiles "${FILESDIR}"/slapd.tmpfilesd slapd.conf - - # If built without SLP, we don't need to be before avahi - sed -i \ - -e '/before/{s/avahi-daemon//g}' \ - "${ED}"/etc/init.d/slapd \ - || die - - if use cxx ; then - einfo "Install the ldapc++ library" - cd "${BUILD_DIR}/contrib/ldapc++" || die - emake DESTDIR="${D}" libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install - cd "${S}"/contrib/ldapc++ || die - newdoc README ldapc++-README - fi - - if use smbkrb5passwd ; then - einfo "Install the smbk5pwd module" - cd "${S}/contrib/slapd-modules/smbk5pwd" || die - emake DESTDIR="${D}" \ - LDAP_BUILD="${BUILD_DIR}" \ - libexecdir="${EPREFIX}/usr/$(get_libdir)/openldap" install - newdoc README smbk5pwd-README - fi - - if use overlays ; then - einfo "Install the samba4 module" - cd "${S}/contrib/slapd-modules/samba4" || die - emake DESTDIR="${D}" \ - LDAP_BUILD="${BUILD_DIR}" \ - libexecdir="/usr/$(get_libdir)/openldap" install - newdoc README samba4-README - fi - - einfo "Installing contrib modules" - cd "${S}/contrib/slapd-modules" || die - for l in */*.la */*/*.la; do - [[ -e ${l} ]] || continue - "${lt}" --mode=install cp ${l} \ - "${ED}"/usr/$(get_libdir)/openldap/openldap || \ - die "installing ${l} failed" - done - - dodoc "${FILESDIR}"/DB_CONFIG.fast.example - docinto contrib - doman */*.5 - #newdoc acl/README* - newdoc addpartial/README addpartial-README - newdoc allop/README allop-README - newdoc allowed/README allowed-README - newdoc autogroup/README autogroup-README - newdoc dsaschema/README dsaschema-README - newdoc passwd/README passwd-README - cd "${S}/contrib/slapi-plugins" || die - 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} - - docinto back-sock ; dodoc "${S}"/servers/slapd/back-sock/searchexample* - docinto back-shell ; dodoc "${S}"/servers/slapd/back-shell/searchexample* - docinto back-perl ; dodoc "${S}"/servers/slapd/back-perl/SampleLDAP.pm - - dosbin "${S}"/contrib/slapd-tools/statslog - newdoc "${S}"/contrib/slapd-tools/README README.statslog - fi - - if ! use static-libs ; then - find "${ED}" \( -name '*.a' -o -name '*.la' \) -delete || die - fi -} - -multilib_src_install_all() { - dodoc ANNOUNCEMENT CHANGES COPYRIGHT README - docinto rfc ; dodoc doc/rfc/*.txt -} - -pkg_preinst() { - # keep old libs if any - preserve_old_lib /usr/$(get_libdir)/{liblber,libldap_r,liblber}-2.3$(get_libname 0) - # bug 440470, only display the getting started help there was no openldap before, - # or we are going to a non-minimal build - ! has_version net-nds/openldap || has_version 'net-nds/openldap[minimal]' - OPENLDAP_PRINT_MESSAGES=$((! $?)) -} - -pkg_postinst() { - if ! use minimal ; then - tmpfiles_process slapd.conf - - # 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 allow' 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 - if [[ -d "${EROOT}"/var/run/openldap ]]; then - use prefix || { chown ldap:ldap "${EROOT}"/var/run/openldap || die; } - chmod 0755 "${EROOT}"/var/run/openldap || die - fi - use prefix || chown root:ldap "${EROOT}"/etc/openldap/slapd.conf{,.default} - chmod 0640 "${EROOT}"/etc/openldap/slapd.conf{,.default} || die - use prefix || chown ldap:ldap "${EROOT}"/var/lib/openldap-data - fi - - if has_version 'net-nds/openldap[-minimal]' && ((${OPENLDAP_PRINT_MESSAGES})); then - elog "Getting started using OpenLDAP? There is some documentation available:" - elog "Gentoo Guide to OpenLDAP Authentication" - elog "(https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP)" - elog "---" - elog "An example file for tuning BDB backends with openldap is" - elog "DB_CONFIG.fast.example in /usr/share/doc/${PF}/" - fi - - preserve_old_lib_notify /usr/$(get_libdir)/{liblber,libldap,libldap_r}-2.3$(get_libname 0) -} diff --git a/net-nds/phpldapadmin/Manifest b/net-nds/phpldapadmin/Manifest index a4fda3a588fc..e37a3682dcbd 100644 --- a/net-nds/phpldapadmin/Manifest +++ b/net-nds/phpldapadmin/Manifest @@ -2,4 +2,4 @@ AUX phpldapadmin-1.2.1.1-fix-magic-quotes.patch 829 BLAKE2B 833f2d7b8934b9547ce2 AUX postinstall2-en.txt 131 BLAKE2B 7ace4170aa9f57f1eb89319f11cee249be8bbec50dad798c0be22616d31a01a3cfeb6057485c8656318c0330c3d9b4ffb1d343978742618edfc6bbf9789807e8 SHA512 f465adc204ef40675848e39e37bab3f2eb5054549e3b787953793ece683df84a52373d23383601b3c53c6b98bf8f1de83c6d83be117be9c00da7058763709d6b DIST phpldapadmin-1.2.5.tar.gz 1117335 BLAKE2B 00d82434dbdadf1f90f5f356ad644d7cfa078cc0696d7cf64e36bc49baf2a5f29bd62fbcd265d9771e713bdd19d4e5708e77e1229199b6712874f982f9b067b0 SHA512 53cf5a8fb3ae3e5fc3c2ab6d23fb9cf731f1d39e122db6531e87461610f13e4bc1c9e8d4fcf7abd2ee5697022a068a9e23d8e039ba79a12929faeb6265920701 EBUILD phpldapadmin-1.2.5.ebuild 1199 BLAKE2B 58ce16b374b868e16f1ef89629c9475f13f47b9908d1d9ca95f1ef2ddd4bdf1d4bc6641e9708d6607a3059c6483bc6209ac9d946ae03a348f857d953cf311189 SHA512 e2013af12d6e74d8c00f1cb8fe7a7650ce51edf9e92a7d25e94d027316227e6d34e1488a4d526ddfeded961884888740ee518b6b4d11283d3e92ca22cd716ef0 -MISC metadata.xml 473 BLAKE2B 16721c0c1cc7f6df377ec95461c909a1c4cade32fe787f0079c8eeec8c82725059177ae4342bd2e70b3f6a14744fe20df8c43860ac831eb10fc7eaf469db532e SHA512 bd04821f96880f2fca76986ae6f7383739acb8787be8d1944251ba3850c80f220153d2eac3de5614d96eb0faeb92b0b5194f73c3bd2b555af29955bee8730aad +MISC metadata.xml 474 BLAKE2B fa81bc3cae9543e95148378c6a6a853b02479d8588276986da3434297db39aa538d64a135c95b59f6b8f2f74d68496eb90c6b5ab9a74f41cf68b65eeecd7a169 SHA512 adcdea4aa21664719940769ccc90a32c79b13941792d699bc6c30fc4ecf840dd4b273b69ccea13353a1c2d65dcec2bd0270a5cd7c99b6508ede9293bbefe0241 diff --git a/net-nds/phpldapadmin/metadata.xml b/net-nds/phpldapadmin/metadata.xml index d95c18142232..102a94f8876a 100644 --- a/net-nds/phpldapadmin/metadata.xml +++ b/net-nds/phpldapadmin/metadata.xml @@ -1,5 +1,5 @@ - + jmbsvicetto@gentoo.org diff --git a/net-nds/rpcbind/Manifest b/net-nds/rpcbind/Manifest index 631fc1bbf794..9e0c7333dcd9 100644 --- a/net-nds/rpcbind/Manifest +++ b/net-nds/rpcbind/Manifest @@ -3,4 +3,4 @@ AUX rpcbind.initd 414 BLAKE2B 38636c24567ab930a5222711112bb197f7bdf2289773adda1e DIST rpcbind-1.2.6.tar.bz2 124590 BLAKE2B bb0e9f81e4747f8a732c9e25af561e79f2b6cd1c1955db586833871901b6da73f4b7ef32149a81b75daa81359b9c0554726670460b28857042dd66a2f861cac2 SHA512 fb89c61be4c533fe2e6057749d97079a2d1c9fac0d35d6be1a159a0edbf86092b3fc121f19fa920e75aac5ecdd3f59f5978e6401d5cad16cd438c977736206a7 EBUILD rpcbind-1.2.6.ebuild 1487 BLAKE2B 7440892bec73c28266202335922472b29a6d826426e4ab454c4f93d3a7f1a7ce7faec76627e8383a06f2fae3de8c22b034d81c1ecb54afa91009bb6761a2dc8c SHA512 b31561523f59350cf14b45f9b44c85d5ce55e4acf62892501c354339df4770a0286d656ecafa0926e24548e850d2e59dc022d19449865b7826aafe6cd09bd9b1 EBUILD rpcbind-9999.ebuild 1495 BLAKE2B dd6f81064866d04bef23c668e589b612ab7d9a7f01c3bfc24e3a23c210ceef37496df7061d369f5b71d236116690b9378f5f4b84a7144034058cfd6a4fb72263 SHA512 edeaa4c058963be5384c65bfdf1d22db71c206a2f28cc86d88c078e3bddda507594360edb76c36dfbb2085fb69a0bb1e10030e12f40021c911964c8b5833844b -MISC metadata.xml 459 BLAKE2B d3625a12679bb29b5402e397618cb007079ca84ada8ef79ced347338a6dacb4473a58fcdf7350e16f8623442f601563acaa247f5f605df1d289876cb3fc4dde1 SHA512 1aa9e72521a4c4c22c78e5a5e9f32c89d66b50079b9e42dc4cb4a043561d6a48e9e76ab52c2803609479161bfd7b21c18689d5088594762c4e09fa1fa58dd3b1 +MISC metadata.xml 460 BLAKE2B 2e7352e45c26bd8e6a7bf73c0fa09bb13cacb818d761b24ff5f7a6a745a3c8cf9cebd9b4d1157f26e7089242736fa6c65bdfab55368973154a17bccf286ec0c1 SHA512 4d68eacefeffe672e6945661b33dae822ff9a8318e6fb3aa0e67cb7176f8f2e1ddf055a4089306659ce8a6adc28551f079b5791e39cb88b88948aba3c03fda39 diff --git a/net-nds/rpcbind/metadata.xml b/net-nds/rpcbind/metadata.xml index 8b85a22052b2..7c87940b9c70 100644 --- a/net-nds/rpcbind/metadata.xml +++ b/net-nds/rpcbind/metadata.xml @@ -1,5 +1,5 @@ - + base-system@gentoo.org diff --git a/net-nds/shelldap/Manifest b/net-nds/shelldap/Manifest index 8f3dea3c0986..ce4e9cc43699 100644 --- a/net-nds/shelldap/Manifest +++ b/net-nds/shelldap/Manifest @@ -1,3 +1,3 @@ DIST shelldap-1.5.1.tar.gz 22817 BLAKE2B 8ec41edf8c7d024f5eaed286284445cc9d41fbdf93ae34229d32392dd6f4862b8b3e66b5735679a9019d505753994f3d1d8f0d6cefec9b55708ef982d757b009 SHA512 64e5f58aa2d930ff869abb0c88ba36a5aac1272f118af8d17a0db847d6ce4bdd9fe3b8fb6b2e9d08f89bec57a102adf170f2c9f6b98b5f3fe5c30ac3636a060a EBUILD shelldap-1.5.1.ebuild 994 BLAKE2B 2ebf30720de7685576dc3b33f20dafbe557246cc010150b52eb17b1398cc07f0e85a01af36a2ceb86ee1790d9f0e702ac2f0a10c35de8ce70cd9c46460a01f0a SHA512 7b3dd02ad44264e6893bc1c1d4f33ca51fdc24c895c9f550962a8e7d223c5977dbe084bd3142917fe13bf05dd3e746b48730277b695f83d2aa3422b15acde45f -MISC metadata.xml 858 BLAKE2B 84805f4e0648b39f02f836241ba4292aa0b20763e1cbf835c3109f11aa562cf2beb9922cf04bb03ac03e4e08f10ffe121334b1844f4683c5629e89eaca82a041 SHA512 9c2067a5e37081c1b54ed9c921c7bdbdc6ae12006deca6009bd9d40c5f556509ad82bae28794bf188bcd65e85160ac09bff8042625a481ae0e6f3a14d4bdaeaa +MISC metadata.xml 859 BLAKE2B 3d4605648405e93c70b5a62c9af748b5b0268a376973ee85275673b6a4a34b6e9bcb313bfa87dd052b9258c3b70b9bb03f94b6fe98de3757514fe4dc76805fa6 SHA512 b7b11dd7bda1dac91943e6d9e6123de3d5ea8cdf05fdca49c88a922eebd1a2a4d6a2fadfbb536d19b53441b59c3d202d6fcc158aa0137607d8754dafdd2d1f50 diff --git a/net-nds/shelldap/metadata.xml b/net-nds/shelldap/metadata.xml index 09297f5a9c6f..5f1a0cc1c96c 100644 --- a/net-nds/shelldap/metadata.xml +++ b/net-nds/shelldap/metadata.xml @@ -1,5 +1,5 @@ - + azamat.hackimov@gmail.com diff --git a/net-nds/smbldap-tools/Manifest b/net-nds/smbldap-tools/Manifest index d3f4422b5f09..c09d60c55732 100644 --- a/net-nds/smbldap-tools/Manifest +++ b/net-nds/smbldap-tools/Manifest @@ -1,4 +1,4 @@ AUX smbldap-tools-0.9.10-smbldap-config-pod.patch 974 BLAKE2B b8ab4c2a910dfa8794b2f7366da54f7398822c9e65a2e18bc2ec157140d16fabb12a757f1529ba5a2e71c4b4b41902ad3bdd5789fff18eeda1df3fac3f525c03 SHA512 c4801c4b411c95c9c6495809b045c9c1bc641f8fc4b3797f34b44d9bec67428bb0ab86a07414c935f1b882fb27091e0a6286f1559dd9554a9451ada75f804eba DIST smbldap-tools-0.9.10.tar.gz 336840 BLAKE2B 8df7cf34d1fedb54ece3f5c018b7bf03a1b0f0ca8813980eaa21d338113fe30535d7627c0d61b8d30c331e20ebb81449ae4a0ddcdfd4a93cb028f2c376a2ce76 SHA512 e1aef98d91ec722427b27f3aed25d8ef4cd4a6c845f98935e2f99075dea93275fc0335760d517398be8ca7898084bfee457ada0a718b66226e6ce3f38fdf2b2e EBUILD smbldap-tools-0.9.10-r1.ebuild 1556 BLAKE2B d4eea2d2d2b620d7e1fa37c7b7bcb094b477caa6468cf50f0aa53ac1b6f183107d20e51dc422d5cf5e12e46778bd5875e62c009009ade8fabe3257f8935b5756 SHA512 f30462ec769277a84a23733ee83be91312b5ac3be99f032d556484f743d9fc1b0ec072a61ef09b70c9fb10d089907c6ba97426ab6dab9c4b10292c9824e1a23b -MISC metadata.xml 238 BLAKE2B d8df54241ec3e8c56cd49149dcf4a8eef0eefcd7eacce01bb0f1d5dcdc492b45d25f9388caf582e979dc9eb283ba88b8ab5ee28812072280566b797180eb649e SHA512 f8a66c9ca8ad8a98b25a6f0280652c9262ae5c23cc9cf813bd304722b80e404585689a9b618de7f3d57be64ec28e83d9aa8b84036dcdb2a91117f454b1ef7e93 +MISC metadata.xml 239 BLAKE2B 7127a2a67e79dc98a78fcaca706fd348389c7f08465112215855afe5978d2932ecbee93944efb1df528fbb6d09e884b277cb1d55a8b3926487b6ca07f9330b8a SHA512 4ea42efe4d083d013b85796ca25a132678bcefe6e3687fd6dd371814fd307118fbc8da8c15ce7f4d956e5f824cd0202f49d3469406c88008e84ff9f4d360f424 diff --git a/net-nds/smbldap-tools/metadata.xml b/net-nds/smbldap-tools/metadata.xml index 6a21123323aa..09a9748a01cd 100644 --- a/net-nds/smbldap-tools/metadata.xml +++ b/net-nds/smbldap-tools/metadata.xml @@ -1,5 +1,5 @@ - + samba@gentoo.org diff --git a/net-nds/tac_plus/Manifest b/net-nds/tac_plus/Manifest index b3e124422d52..03fbb5b00f4c 100644 --- a/net-nds/tac_plus/Manifest +++ b/net-nds/tac_plus/Manifest @@ -12,4 +12,4 @@ DIST tacacs+-F4.0.4.27a.tar.gz 504395 BLAKE2B 8cd58d451c28e16d3804e9dcf5a82ae5ec EBUILD tac_plus-4.0.4.19-r5.ebuild 1335 BLAKE2B 0ed7044750cdfe7c0806cbe805092393bdde34bd54f0323408a1ac5f16c4ae26a5400befbfbf447d7d2e10ad77c2ec602680bed6a3e4aba7906c50c5ad1f841d SHA512 206f052c0aaace001ec9120cf53aae366d8c982d404c1dd9780b9cff7e31c507fc712e97f20d2d1f7d20cde638afb29f53be6d75e88d906098cf45018ac2869b EBUILD tac_plus-4.0.4.27a-r2.ebuild 1434 BLAKE2B c8e60d045e95bd6938872e24a1a7992815a92560e58186ef314b70c818b4a4cb8b32c583aec9a1c0582b82ea9c0826bfcbd8c1a43ee775563ee34446b46db602 SHA512 e10cb51c2ed054b4b3c92efc1a75bd151ae0b33cc95bdb5bf8bcd8eba84801225a5c57459923f975904a805f7a236ec55f149e5ab35c984af1a14223b4046964 EBUILD tac_plus-4.0.4.27a-r3.ebuild 1509 BLAKE2B aa31aefcb97419daf855d5cc0e1115440cf5ebe9a46f01e807e1abd277039fe89504d7a1e348bd62515028046819de21569ab08a4f81369fa6f5602c5cff7320 SHA512 40339e3fcae5c91124c8d4fb7d4e5d010a10a8583024e98a414ed656d1e01195d283037c34fc39271902cab0ae9dbd604af67fd74823f0b580263a21aa0863ac -MISC metadata.xml 346 BLAKE2B af6ab8c1a15ae2a4cc33278ad0ae51ec94f990f7037a71d90cbf78fab0d66e0cdc0291af09ae0c16d23525a24609ed994e1808c24255d0b819821b31bf876650 SHA512 82dc7debafb808d8af76dff04d781f90724159fd33f655243125d354e629099c583a7d9e9478bf370543dc7ca4fb0c42392aedd661088dd1f8a44a65219491cc +MISC metadata.xml 347 BLAKE2B f3a5e8ac1da978c0bb203b48b4461c149b80ba8761444d327d309daf3556d250118dd0f349441f4fbfe6c6820a5f6f164e7ad22cbc6c915a8de0dd1bf112b296 SHA512 65614032fac0718ee5e56c8f167b0a4164bddefb6a1277822af82dd85d22ec9ce507136e31367983b5dfee7a967e54befb3b135c08ca496be67c9b241b536011 diff --git a/net-nds/tac_plus/metadata.xml b/net-nds/tac_plus/metadata.xml index e485335c3fa0..75c49978ae22 100644 --- a/net-nds/tac_plus/metadata.xml +++ b/net-nds/tac_plus/metadata.xml @@ -1,5 +1,5 @@ - + diff --git a/net-nds/yp-tools/Manifest b/net-nds/yp-tools/Manifest index 5a065f9fc2cf..29dcc5a54659 100644 --- a/net-nds/yp-tools/Manifest +++ b/net-nds/yp-tools/Manifest @@ -2,4 +2,4 @@ AUX domainname.service 165 BLAKE2B b36bb4877585f69503c319743a2e78f62f419852f2354 AUX domainname.service.conf 89 BLAKE2B 22b81d78eb5df449658413dd2b23ceab02376fca3c061e328a3db36f88b3840296db961748679c8df9719dfb6cf3f4fd100ad6ed79916585aa79edbcf27c7577 SHA512 529f85f41e8204cc3dda72eb3c94c81443b8aa9f5af1ce4cab4510cbc42da79a4554d223893f0a968afb4476898b8a74ea061f8e9f40518b3066584ea9c7ad6c DIST yp-tools-4.2.3.tar.gz 195247 BLAKE2B 5e068f6856876dbf55c25030730195222fd331a06b8d57aa8a797a42c90538289a61ea8de1a2fee2d173e3444f76f82d111fc1120c287f90b7dbad1a2be23313 SHA512 2fcdaaeb8af4c3f62aa571a488c04561356681fc18b919ef728cfc1941578870cce74b136959f49e4ab04f988a79252163c1abe30b357788cb0b5faca7b5d147 EBUILD yp-tools-4.2.3-r1.ebuild 962 BLAKE2B 3e5c94c7a12934e4700716209540dd250b7db84808ee8f70e929cd1585af8faefd9b2ffd61e95cb9ec9455d4f8103102b7897923a52424bf2fecd9f5a42c347f SHA512 7eb9606b1832a856bb125c6f065445ece2b6b6b9451b10e21c4eea4aec86f1d0ff284729007880bdeda0beefe6c9c44a02273ce3477fa44cbd40716afb2bb2bb -MISC metadata.xml 167 BLAKE2B e4dadf27fd344484f2bccb5b904909c89aac568c32e5b3c44bdf139eacefd4b4fae74419f503d2b7da0dccc1b68ba05d777d11292c0f89270d1ac5c9c703e8ca SHA512 7c8decb24ee3a850e38186cf3c7f8933a28017426806870ad6ef9ceb2533be147a2681fc789b535a81cb528af8c29d90d3006e4f250aee23bd7dea4561294e33 +MISC metadata.xml 168 BLAKE2B 2e0e000b4c3b6ca04c12903fdbe278415c05a822623c52e9aa95cbbf3d50bcb1246b7edbda7d2f6b559af8950c6374e6e0a69b76319964cfe686bf50b0604a57 SHA512 4dcf45d1809e8390a2d8155c8ebfe0dd610203e392aeab0ccd8a10f42cc8532a4925eff32b35e7a6c35598a4efd288229034ec0732299dbd8cfa0acff705fed3 diff --git a/net-nds/yp-tools/metadata.xml b/net-nds/yp-tools/metadata.xml index 7a38bb900964..115e9d64a669 100644 --- a/net-nds/yp-tools/metadata.xml +++ b/net-nds/yp-tools/metadata.xml @@ -1,5 +1,5 @@ - + -- cgit v1.2.3