From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- net-nds/389-ds-base/389-ds-base-1.3.4.14.ebuild | 138 +++++++ net-nds/389-ds-base/389-ds-base-1.3.5.17.ebuild | 124 +++++++ net-nds/389-ds-base/389-ds-base-9999.ebuild | 132 +++++++ net-nds/389-ds-base/Manifest | 11 + .../389-ds-base-1.3.4-no-instance-script.patch | 396 +++++++++++++++++++++ net-nds/389-ds-base/files/389-ds-snmp.initd | 44 +++ net-nds/389-ds-base/files/389-ds.initd-r1 | 90 +++++ net-nds/389-ds-base/metadata.xml | 32 ++ 8 files changed, 967 insertions(+) create mode 100644 net-nds/389-ds-base/389-ds-base-1.3.4.14.ebuild create mode 100644 net-nds/389-ds-base/389-ds-base-1.3.5.17.ebuild create mode 100644 net-nds/389-ds-base/389-ds-base-9999.ebuild create mode 100644 net-nds/389-ds-base/Manifest create mode 100644 net-nds/389-ds-base/files/389-ds-base-1.3.4-no-instance-script.patch create mode 100644 net-nds/389-ds-base/files/389-ds-snmp.initd create mode 100644 net-nds/389-ds-base/files/389-ds.initd-r1 create mode 100644 net-nds/389-ds-base/metadata.xml (limited to 'net-nds/389-ds-base') diff --git a/net-nds/389-ds-base/389-ds-base-1.3.4.14.ebuild b/net-nds/389-ds-base/389-ds-base-1.3.4.14.ebuild new file mode 100644 index 000000000000..affe994770bc --- /dev/null +++ b/net-nds/389-ds-base/389-ds-base-1.3.4.14.ebuild @@ -0,0 +1,138 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +WANT_AUTOMAKE="1.9" + +inherit user eutils multilib flag-o-matic autotools + +DESCRIPTION="389 Directory Server (core librares and daemons )" +HOMEPAGE="http://port389.org/" +SRC_URI="http://www.port389.org/sources/${P}.tar.bz2" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="autobind auto-dn-suffix debug doc +pam-passthru +dna +ldapi +bitwise +presence kerberos selinux" + +# Pinned to db:4.8 as it is the current stable, can change to a later db version < 6 when they stabilize. +# The --with-db-inc line in econf will need to be updated as well when changing db version. +COMMON_DEPEND=" + sys-libs/db:4.8 + >=dev-libs/cyrus-sasl-2.1.19 + >=net-analyzer/net-snmp-5.1.2 + >=dev-libs/icu-3.4:= + dev-libs/nss[utils] + dev-libs/nspr + dev-libs/svrcore + dev-libs/openssl:0= + dev-libs/libpcre:3 + >=dev-perl/perl-mozldap-1.5.3 + dev-perl/NetAddr-IP + net-nds/openldap + sys-libs/pam + sys-libs/zlib + kerberos? ( >=app-crypt/mit-krb5-1.7-r100[openldap] )" + +DEPEND="${COMMON_DEPEND} + virtual/pkgconfig + doc? ( app-doc/doxygen )" + +RDEPEND="${COMMON_DEPEND} + selinux? ( sec-policy/selinux-dirsrv ) + virtual/perl-Time-Local + virtual/perl-MIME-Base64" + +pkg_setup() { + enewgroup dirsrv + enewuser dirsrv -1 -1 -1 dirsrv +} + +src_prepare() { + #0001-Ticket-47840-add-configure-option-to-disable-instanc.patch + epatch "${FILESDIR}/389-ds-base-1.3.4-no-instance-script.patch" + + # as per 389 documentation, when 64bit, export USE_64 + use amd64 && export USE_64=1 + + # This will be changed in 1.3.5.X + sed -i -e 's/nobody/dirsrv/g' configure.ac || die "sed failed on configure.ac" + eautoreconf + + append-lfs-flags +} + +src_configure() { + # for 1.3.5.X, will add --enable-gcc-security. + # auto-dn-suffix currently throws warning in configure script, + # see https://fedorahosted.org/389/ticket/48710 + econf \ + $(use_enable debug) \ + $(use_enable pam-passthru) \ + $(use_enable ldapi) \ + $(use_enable autobind) \ + $(use_enable dna) \ + $(use_enable bitwise) \ + $(use_enable presence) \ + $(use_with kerberos) \ + $(use_enable auto-dn-suffix) \ + --enable-maintainer-mode \ + --with-fhs \ + --with-openldap \ + --sbindir=/usr/sbin \ + --bindir=/usr/bin \ + --with-db-inc=/usr/include/db4.8 + +} + +src_compile() { + default + if use doc; then + doxygen slapi.doxy || die "cannot run doxygen" + fi +} + +src_install () { + emake DESTDIR="${D}" install + + # remove redhat style init script + rm -rf "${D}"/etc/rc.d || die + # Needs a config option to remove this. + rm -rf "${D}"/etc/default || die + + # and 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 + + # cope with libraries being in /usr/lib/dirsrv + dodir /etc/env.d + echo "LDPATH=/usr/$(get_libdir)/dirsrv" > "${D}"/etc/env.d/08dirsrv + + if use doc; then + cd "${S}" || die + docinto html/ + dodoc -r docs/html/. + fi +} + +pkg_postinst() { + 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 + elog "If you are upgrading from previous 1.2.6 release candidates" + elog "please see:" + elog "http://directory.fedoraproject.org/wiki/Subtree_Rename#warning:_upgrade_from_389_v1.2.6_.28a.3F.2C_rc1_.7E_rc6.29_to_v1.2.6_rc6_or_newer" + echo +} diff --git a/net-nds/389-ds-base/389-ds-base-1.3.5.17.ebuild b/net-nds/389-ds-base/389-ds-base-1.3.5.17.ebuild new file mode 100644 index 000000000000..6fddd0315a5b --- /dev/null +++ b/net-nds/389-ds-base/389-ds-base-1.3.5.17.ebuild @@ -0,0 +1,124 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +WANT_AUTOMAKE="1.13" + +inherit user eutils multilib flag-o-matic autotools + +DESCRIPTION="389 Directory Server (core librares and daemons )" +HOMEPAGE="http://www.port389.org/" +SRC_URI="http://www.port389.org/sources/${P}.tar.bz2" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="autobind auto-dn-suffix debug doc +pam-passthru +dna +ldapi +bitwise presence kerberos selinux" + +# Pinned to db:4.8 as it is the current stable, can change to a later db version < 6 when they stabilize. +# The --with-db-inc line in econf will need to be updated as well when changing db version. +COMMON_DEPEND=" + sys-libs/db:4.8 + >=dev-libs/cyrus-sasl-2.1.19 + >=net-analyzer/net-snmp-5.1.2 + >=dev-libs/icu-3.4:= + >=dev-libs/nss-3.22[utils] + dev-libs/nspr + >=dev-libs/svrcore-4.1.2 + dev-libs/openssl:0= + dev-libs/libpcre:3 + >=dev-perl/perl-mozldap-1.5.3 + dev-perl/NetAddr-IP + net-nds/openldap + sys-libs/pam + sys-libs/zlib + kerberos? ( >=app-crypt/mit-krb5-1.7-r100[openldap] )" + +DEPEND="${COMMON_DEPEND} + virtual/pkgconfig + doc? ( app-doc/doxygen )" + +RDEPEND="${COMMON_DEPEND} + selinux? ( sec-policy/selinux-dirsrv ) + virtual/perl-Time-Local + virtual/perl-MIME-Base64" + +pkg_setup() { + enewgroup dirsrv + enewuser dirsrv -1 -1 -1 dirsrv +} + +src_prepare() { + # as per 389 documentation, when 64bit, export USE_64 + use amd64 && export USE_64=1 + + eautoreconf + + append-lfs-flags +} + +src_configure() { + econf \ + $(use_enable debug) \ + $(use_enable pam-passthru) \ + $(use_enable ldapi) \ + $(use_enable autobind) \ + $(use_enable dna) \ + $(use_enable bitwise) \ + $(use_enable presence) \ + $(use_with kerberos) \ + $(use_enable auto-dn-suffix) \ + --with-initddir=no \ + --enable-maintainer-mode \ + --with-fhs \ + --with-openldap \ + --sbindir=/usr/sbin \ + --bindir=/usr/bin \ + --with-db-inc=/usr/include/db4.8 + +} + +src_compile() { + default + if use doc; then + doxygen slapi.doxy || die "cannot run doxygen" + fi +} + +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 + + # cope with libraries being in /usr/lib/dirsrv + dodir /etc/env.d + echo "LDPATH=/usr/$(get_libdir)/dirsrv" > "${D}"/etc/env.d/08dirsrv + + if use doc; then + cd "${S}" || die + docinto html/ + dodoc -r docs/html/. + fi +} + +pkg_postinst() { + 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-9999.ebuild b/net-nds/389-ds-base/389-ds-base-9999.ebuild new file mode 100644 index 000000000000..2379554aaebe --- /dev/null +++ b/net-nds/389-ds-base/389-ds-base-9999.ebuild @@ -0,0 +1,132 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +WANT_AUTOMAKE="1.13" + +inherit user eutils multilib flag-o-matic autotools git-r3 + +DESCRIPTION="389 Directory Server (core librares and daemons )" +HOMEPAGE="http://port389.org/" +SRC_URI="" +EGIT_REPO_URI="https://pagure.io/389-ds-base.git" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="" +IUSE="autobind auto-dn-suffix debug doc +pam-passthru +dna +ldapi +bitwise kerberos selinux test" + +# Pinned to db:4.8 as it is the current stable, can change to a later db version < 6 when they stabilize. +# The --with-db-inc line in econf will need to be updated as well when changing db version. +COMMON_DEPEND=" + sys-libs/db:4.8 + >=dev-libs/cyrus-sasl-2.1.19 + >=net-analyzer/net-snmp-5.1.2 + >=dev-libs/icu-3.4:= + dev-libs/nss[utils] + dev-libs/nspr + >=dev-libs/svrcore-4.1.2 + dev-libs/openssl:0= + dev-libs/libpcre:3 + >=dev-perl/perl-mozldap-1.5.3 + dev-perl/NetAddr-IP + net-nds/openldap + sys-libs/pam + sys-libs/zlib + dev-libs/libevent + dev-util/cmocka + kerberos? ( >=app-crypt/mit-krb5-1.7-r100[openldap] )" + +DEPEND="${COMMON_DEPEND} + virtual/pkgconfig + doc? ( app-doc/doxygen )" + +RDEPEND="${COMMON_DEPEND} + selinux? ( sec-policy/selinux-dirsrv ) + virtual/perl-Time-Local + virtual/perl-MIME-Base64" + +pkg_setup() { + enewgroup dirsrv + enewuser dirsrv -1 -1 -1 dirsrv +} + +src_prepare() { + # as per 389 documentation, when 64bit, export USE_64 + use amd64 && export USE_64=1 + + eautoreconf + + append-lfs-flags +} + +src_configure() { + econf \ + $(use_enable debug) \ + $(use_enable pam-passthru) \ + $(use_enable ldapi) \ + $(use_enable autobind) \ + $(use_enable dna) \ + $(use_enable bitwise) \ + $(use_with kerberos) \ + $(use_enable auto-dn-suffix) \ + $(use_enable test cmocka) \ + --with-initddir=no \ + --enable-maintainer-mode \ + --with-fhs \ + --with-openldap \ + --sbindir=/usr/sbin \ + --bindir=/usr/bin \ + --with-db-inc=/usr/include/db4.8 + +} + +src_compile() { + default + if use doc; then + doxygen docs/slapi.doxy || die "cannot run doxygen" + fi +} + +src_test () { + # -j1 is a temporary workaround for bug #605432 + emake -j1 check +} + +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 + + # cope with libraries being in /usr/lib/dirsrv + dodir /etc/env.d + echo "LDPATH=/usr/$(get_libdir)/dirsrv" > "${D}"/etc/env.d/08dirsrv + + if use doc; then + cd "${S}" || die + docinto html/ + dodoc -r docs/html/. + fi +} + +pkg_postinst() { + 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 new file mode 100644 index 000000000000..b1a88df8f35b --- /dev/null +++ b/net-nds/389-ds-base/Manifest @@ -0,0 +1,11 @@ +AUX 389-ds-base-1.3.4-no-instance-script.patch 17750 SHA256 696ab70daa41af1eb6d979b39a0166445edc5f1cdf0755ce8e1459e54b38967e SHA512 649245bbd56cd5445470f102500eb5ea5aeb99a395cc6a49fc0f6331c2a77005aef3e01a49344f04bb018b6679ddd43e77f542a88e4bec46b30da4e6d7fa312a WHIRLPOOL a7cc074891fd6b98630aa3ab1bbed2e722cf3472dd73877b38616e5861f07b1784dc98055f1f686e5af48e21bd96776f0e202945dd4d5426a6d59f5fc010bd22 +AUX 389-ds-snmp.initd 960 SHA256 201a8e8ff30195927cb0c3819ac811034f20c811c0ad572e6be0c178954e7b16 SHA512 bb76a068aa5422664c3fc87d5c28124b26d6dbc88cd88856826ae905a4149a6a1d03ec562dcace1cebc6caaa0ca3c6e9346c1af5703d89e1da600df8ca4a4ba8 WHIRLPOOL 1b312091e6591040237eba7c0709b41ea3450360e46c02089173ed62f202e02344a88a6660c39225406987ff60b71fd90b7cf0c46fbaf5a9be589defd85db8bd +AUX 389-ds.initd-r1 2366 SHA256 51c91af63c089b4b742867554841019201c4e458450ce18125c2035e51f6e11f SHA512 530316eccf25196453a51398b810dc6ca14a9bf6f8e4487cfd42d00df190653a197b1effae357c6d9e5d00cd51e8e7d47092d0ecddf2d71d6fa100b58d19b6d7 WHIRLPOOL 453f9ed6ce784d5818acad0433b3afca649d1e321c42730a0ef365b2dfefbef8ec859c22c6fa84073e0acc1dbe92ed66a6106841b0a4ffbd006f5e393a27f94c +DIST 389-ds-base-1.3.4.14.tar.bz2 3433905 SHA256 4408e61c52dc56d8e0ffee530dde70c2af00aa86b385cc40b389ef8bcce55aaa SHA512 1043b3e3437d1d24d1eec54c5c5ca39692151d05b8eb035224db78e68a1f4011bd2e0916f54609387903e2bbe9345f954be5c0a578f90a107958f74604908d6c WHIRLPOOL f2bf87c450c870ad1b886000f49f5d1b6def760c9b1634cffe4871da755932d43cb9253bebe12092032359097a7786e9d29fc64d4326fb3a079a79163a2ccc01 +DIST 389-ds-base-1.3.5.17.tar.bz2 3587553 SHA256 522420b6decc162ed5d57ca913753b48e4bd7137fa0eb1bbc3e21e45923b1819 SHA512 5b96b19cea7dc80c64eaade31127d04c228f7e4dc1999ec19b341cf080ee4570757c84e8dae151c2cb3bcebe1398d50238d74ca362ce07fceafcb66fba590833 WHIRLPOOL 87728a559a7d71fd025af4ec8cb25bc10384acf1b515184f33f76ddc7cd0eb29562c4c3dbb70652f44f42734578acb1f7fc2deadc0947f4fe8f57a24bcbff39c +EBUILD 389-ds-base-1.3.4.14.ebuild 3649 SHA256 5bdc3a41e576c51363346993bf060305c9f9933baaf3e2c5d567ed1c6e09a0d5 SHA512 d881ac6bd193424708ac00fa7dbad40bec8c27857af89e857a43f102576015199fd4da480719d19a29baa8df3971a9620f1ebcc8454a1d0221ff990af97b42b4 WHIRLPOOL 18f22bf6a56ee2ed4c2f3c7f76f208f136ba821edaa9dcf7c60711526530bc174a31da902c6cd54209146f9dcf8b200f5911b8dfa49270daf7efb7d70964ae47 +EBUILD 389-ds-base-1.3.5.17.ebuild 2957 SHA256 728a91a63f86cf281e2baa02f9a83ac9eec1bc0c713d937ac7c9341159b38dce SHA512 f9dce9c354af006f613df1db6316c67c1ac2d3d8bd6835f28bdee440e8bf40bfdb1611c810c0d4e040a6aec5e82fe26d43e979dc5f8ddd68e80fcfb2f47710b7 WHIRLPOOL 7acd3598ee1b2412d3dd32248741e601d7be8b85ff4f292a0a77238fb055f41ee8c511aa05b87f20924d3c13de31942181044e5f32c3de0645406dce3286b581 +EBUILD 389-ds-base-9999.ebuild 3072 SHA256 cc2e401f3007465797ecd0cd953fc6b92de6c1565ce10f8133d3e4f97dd69d44 SHA512 4b21aef6336e3adf5a8bf6324c84066483311447ef92bc564b128958940233aec8fc15f7f2e30d485e92418e8311359b8df3b51438aaf0b9b588738c1306222f WHIRLPOOL e35c4c1bd5a6783f931493cc4070893d0d5ee736f549cb68ea141464092c0b11b193c3335f7ad9639ff53556c5d1ce46450eaa04706e270eb2948a1eb58f2f07 +MISC ChangeLog 8369 SHA256 202e35ddc1f756cd7c1cc579d0d90c0c7662d2771e9e6cec0377e8b4b28c6552 SHA512 16e628a85ee4786b3f404760f52e0106736bb7fff78fd494fe47e46f4249a557f01ace3fc715164ccbe11b9ed004434d7f1cf0a48125b69dc45713d238ec4f47 WHIRLPOOL f05a03d60740cfa8f4e07f8eb11cd92ea9178764f0087a2ad733c85132e588cb8ee483ee81462ea7a94808d3a0c8cfd6f432e3006aca0e8e0584b0115c7aa0b9 +MISC ChangeLog-2015 5873 SHA256 6d19b6275315bd4ec653fb780b8f4042a6f03ae616b54fe5036052080e38fb2e SHA512 44838bf74cab477bed20306ebc5b676bcf3be78885b9b1ce2752dd93ec92274949dd2a0f095d6823dd033094f3caf3342aa4dde908a4fae55ab36a7dee1e505b WHIRLPOOL 313ca7b73de31ad9a2be8782e6a6d9337f0f52cac6d16930460710477a9c6b529654f48623b8981fd3b3d07dc6bf9e6b038066960cf0999b596ea17d513c47c3 +MISC metadata.xml 1366 SHA256 42968f035557d5bb89e6e5e1cf041a696b472eb8e495ee25e54364b6e1e1cfd7 SHA512 02834f37e40d6aac18027e2589b27b0b6649cbafd7f13f0775eaed8ffeb8e8bc1facbc1693e31c12b9f6e302e05b69617ac697edb047bcaf3942d2de72df2013 WHIRLPOOL 8aaf442b711cae3e43a9a9fb08e551a49ec570ce3ebde3996f51fa130e23f747029f2fcc5bf0437c4e589c67ae2c2aadc89668c913195cfce0657771d8a47f21 diff --git a/net-nds/389-ds-base/files/389-ds-base-1.3.4-no-instance-script.patch b/net-nds/389-ds-base/files/389-ds-base-1.3.4-no-instance-script.patch new file mode 100644 index 000000000000..8af7ad2be452 --- /dev/null +++ b/net-nds/389-ds-base/files/389-ds-base-1.3.4-no-instance-script.patch @@ -0,0 +1,396 @@ +From 7b75e7a4c60637a86acf6c757f207550294279ef Mon Sep 17 00:00:00 2001 +From: William Brown +Date: Wed, 28 Oct 2015 14:25:26 +1000 +Subject: [PATCH] Ticket 47840 - add configure option to disable instance + specific scripts https://fedorahosted.org/389/ticket/47840 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Bug Description: Now that ​https://fedorahosted.org/389/ticket/528 is +fixed, the next step is to allow building the server with the instance specific +scripts disabled. + +Fix Description: Instead of defining a configure option, we provide a new +option in setup-ds.pl, slapd.InstScriptsEnabled, which defaults to false. All +new installs of 389 will NOT install with a inst_dir nor the scripts that are in +that directory. + +Additionally, this change fixes setup-ds.pl to correctly use the sbindir scripts +to start/stop the server instance during installation. + +Finally, we add support for setup-ds.pl so that in --update if the inst_dir +exists, scripts will be updated, but if it does not exist, no action is taken. + +In time, we will alter --update to *remove* the scripts within inst_dir during +the update (We have no way of knowing if a customer has put custom scripts in +inst_dir) + +Example: +/opt/dirsrv/sbin/setup-ds.pl slapd.InstScriptsEnabled=false + +Author: wibrown + +Review by: nhosoi (Thanks!) +--- + ldap/admin/src/scripts/DSCreate.pm.in | 204 +++++++++++++++++++-------------- + ldap/admin/src/scripts/DSUpdate.pm.in | 12 +- + ldap/admin/src/scripts/setup-ds.res.in | 1 + + 3 files changed, 124 insertions(+), 93 deletions(-) + +diff --git a/ldap/admin/src/scripts/DSCreate.pm.in b/ldap/admin/src/scripts/DSCreate.pm.in +index 3ce5a73..6425be4 100644 +--- a/ldap/admin/src/scripts/DSCreate.pm.in ++++ b/ldap/admin/src/scripts/DSCreate.pm.in +@@ -130,6 +130,15 @@ sub sanityCheckParams { + return @errs; + } + ++ # We need to make sure this value is lowercase ++ $inf->{slapd}->{InstScriptsEnabled} = lc $inf->{slapd}->{InstScriptsEnabled}; ++ ++ if ("true" ne $inf->{slapd}->{InstScriptsEnabled} && "false" ne $inf->{slapd}->{InstScriptsEnabled}) { ++ debug(1, "InstScriptsEnabled is not a valid boolean"); ++ return ('error_invalid_boolean', $inf->{slapd}->{InstScriptsEnabled}); ++ } ++ ++ + return (); + } + +@@ -204,13 +213,17 @@ sub makeDSDirs { + my $mode = getMode($inf, 7); + my @errs; + ++ my @dsdirs = qw(config_dir schema_dir log_dir lock_dir run_dir tmp_dir cert_dir db_dir ldif_dir bak_dir); ++ if ($inf->{slapd}->{InstScriptsEnabled} eq "true") { ++ @dsdirs = qw(inst_dir config_dir schema_dir log_dir lock_dir run_dir tmp_dir cert_dir db_dir ldif_dir bak_dir); ++ } ++ + # These paths are owned by the SuiteSpotGroup + # This allows the admin server to run as a different, + # more privileged user than the directory server, but + # still allows the admin server to manage directory + # server files/dirs without being root +- for my $kw (qw(inst_dir config_dir schema_dir log_dir lock_dir run_dir tmp_dir +- cert_dir db_dir ldif_dir bak_dir)) { ++ for my $kw (@dsdirs) { + my $dir = $inf->{slapd}->{$kw}; + @errs = makePaths($dir, $mode, $inf->{General}->{SuiteSpotUserID}, + $inf->{General}->{SuiteSpotGroup}); +@@ -262,56 +275,66 @@ sub createInstanceScripts { + my $myperl = "!$perlexec"; + my $mydevnull = (-f "/dev/null" ? " /dev/null " : " NUL "); + +- # determine initconfig_dir +- my $initconfig_dir = $inf->{slapd}->{initconfig_dir} || get_initconfigdir($inf->{General}->{prefix}); +- +- my %maptable = ( +- "DS-ROOT" => $inf->{General}->{prefix}, +- "SEP" => "/", # works on all platforms +- "SERVER-NAME" => $inf->{General}->{FullMachineName}, +- "SERVER-PORT" => $inf->{slapd}->{ServerPort}, +- "PERL-EXEC" => $myperl, +- "DEV-NULL" => $mydevnull, +- "ROOT-DN" => $inf->{slapd}->{RootDN}, +- "LDIF-DIR" => $inf->{slapd}->{ldif_dir}, +- "SERV-ID" => $inf->{slapd}->{ServerIdentifier}, +- "BAK-DIR" => $inf->{slapd}->{bak_dir}, +- "SERVER-DIR" => $inf->{General}->{ServerRoot}, +- "CONFIG-DIR" => $inf->{slapd}->{config_dir}, +- "INITCONFIG-DIR" => $initconfig_dir, +- "INST-DIR" => $inf->{slapd}->{inst_dir}, +- "RUN-DIR" => $inf->{slapd}->{run_dir}, +- "PRODUCT-NAME" => "slapd", +- "SERVERBIN-DIR" => $inf->{slapd}->{sbindir}, +- "DB-DIR" => $inf->{slapd}->{db_dir} +- ); +- +- my $dir = "$inf->{General}->{prefix}@taskdir@"; +- for my $file (glob("$dir/template-*")) { +- my $basename = $file; +- $basename =~ s/^.*template-//; +- my $destfile = "$inf->{slapd}->{inst_dir}/$basename"; +- +- next if ($skip and -f $destfile); # in skip mode, skip files that already exist +- +- if (!open(SRC, "< $file")) { +- return ("error_opening_scripttmpl", $file, $!); +- } +- if (!open(DEST, "> $destfile")) { +- return ("error_opening_scripttmpl", $destfile, $!); +- } +- my $contents; # slurp entire file into memory +- read SRC, $contents, int(-s $file); +- close(SRC); +- while (my ($key, $val) = each %maptable) { +- $contents =~ s/\{\{$key\}\}/$val/g; +- } +- print DEST $contents; +- close(DEST); +- my @errs = changeOwnerMode($inf, 5, $destfile); +- if (@errs) { +- return @errs; ++ # If we have InstScriptsEnabled, we likely have setup.inf or the argument. ++ # However, during an upgrade, we need to know if we should upgrade the template files or not. ++ # For now, the easiest way is to check to if the directory exists, and if is does, we assume we want to upgrade / create the updated scripts. ++ if ($inf->{slapd}->{InstScriptsEnabled} eq "true" || -d $inf->{slapd}->{inst_dir} ) { ++ debug(1, "Creating or updating instance directory scripts\n"); ++ # determine initconfig_dir ++ my $initconfig_dir = $inf->{slapd}->{initconfig_dir} || get_initconfigdir($inf->{General}->{prefix}); ++ ++ my %maptable = ( ++ "DS-ROOT" => $inf->{General}->{prefix}, ++ "SEP" => "/", # works on all platforms ++ "SERVER-NAME" => $inf->{General}->{FullMachineName}, ++ "SERVER-PORT" => $inf->{slapd}->{ServerPort}, ++ "PERL-EXEC" => $myperl, ++ "DEV-NULL" => $mydevnull, ++ "ROOT-DN" => $inf->{slapd}->{RootDN}, ++ "LDIF-DIR" => $inf->{slapd}->{ldif_dir}, ++ "SERV-ID" => $inf->{slapd}->{ServerIdentifier}, ++ "BAK-DIR" => $inf->{slapd}->{bak_dir}, ++ "SERVER-DIR" => $inf->{General}->{ServerRoot}, ++ "CONFIG-DIR" => $inf->{slapd}->{config_dir}, ++ "INITCONFIG-DIR" => $initconfig_dir, ++ "INST-DIR" => $inf->{slapd}->{inst_dir}, ++ "RUN-DIR" => $inf->{slapd}->{run_dir}, ++ "PRODUCT-NAME" => "slapd", ++ "SERVERBIN-DIR" => $inf->{slapd}->{sbindir}, ++ "DB-DIR" => $inf->{slapd}->{db_dir} ++ ); ++ ++ ++ my $dir = "$inf->{General}->{prefix}@taskdir@"; ++ for my $file (glob("$dir/template-*")) { ++ my $basename = $file; ++ $basename =~ s/^.*template-//; ++ my $destfile = "$inf->{slapd}->{inst_dir}/$basename"; ++ debug(1, "$destfile\n"); ++ ++ next if ($skip and -f $destfile); # in skip mode, skip files that already exist ++ ++ if (!open(SRC, "< $file")) { ++ return ("error_opening_scripttmpl", $file, $!); ++ } ++ if (!open(DEST, "> $destfile")) { ++ return ("error_opening_scripttmpl", $destfile, $!); ++ } ++ my $contents; # slurp entire file into memory ++ read SRC, $contents, int(-s $file); ++ close(SRC); ++ while (my ($key, $val) = each %maptable) { ++ $contents =~ s/\{\{$key\}\}/$val/g; ++ } ++ print DEST $contents; ++ close(DEST); ++ my @errs = changeOwnerMode($inf, 5, $destfile); ++ if (@errs) { ++ return @errs; ++ } + } ++ } else { ++ debug(1, "No instance directory scripts will be updated or created\n"); + } + + return (); +@@ -639,7 +662,7 @@ sub initDatabase { + return (); + } + +- my $cmd = "$inf->{slapd}->{inst_dir}/ldif2db -n $inf->{slapd}->{ds_bename} -i \'$ldiffile\'"; ++ my $cmd = "$inf->{slapd}->{sbindir}/ldif2db -Z $inf->{slapd}->{ServerIdentifier} -n $inf->{slapd}->{ds_bename} -i \'$ldiffile\'"; + $? = 0; # clear error condition + my $output = `$cmd 2>&1`; + my $result = $?; +@@ -662,7 +685,7 @@ sub startServer { + my @errs; + # get error log + my $errLog = "$inf->{slapd}->{log_dir}/errors"; +- my $startcmd = "$inf->{slapd}->{inst_dir}/start-slapd"; ++ my $startcmd = "$inf->{slapd}->{sbindir}/start-dirsrv $inf->{slapd}->{ServerIdentifier}"; + if ("@systemdsystemunitdir@" and (getLogin() eq 'root')) { + $startcmd = "/bin/systemctl start @package_name@\@$inf->{slapd}->{ServerIdentifier}.service"; + } +@@ -875,6 +898,10 @@ sub setDefaults { + "@datadir@", + $inf->{General}->{prefix}); + ++ if (!defined($inf->{slapd}->{InstScriptsEnabled})) { ++ $inf->{slapd}->{InstScriptsEnabled} = "false"; ++ } ++ + if (!defined($inf->{slapd}->{inst_dir})) { + $inf->{slapd}->{inst_dir} = "$inf->{General}->{ServerRoot}/slapd-$servid"; + } +@@ -975,9 +1002,12 @@ sub updateSelinuxPolicy { + system("restorecon -R $localstatedir/lib/@PACKAGE_NAME@"); + } + ++ my @inst_dirs = qw(config_dir schema_dir log_dir lock_dir run_dir tmp_dir cert_dir db_dir ldif_dir bak_dir); ++ if ($inf->{slapd}->{InstScriptsEnabled} eq "true") { ++ @inst_dirs = qw(inst_dir config_dir schema_dir log_dir lock_dir run_dir tmp_dir cert_dir db_dir ldif_dir bak_dir); ++ } + # run restorecon on all instance directories we created +- for my $kw (qw(inst_dir config_dir schema_dir log_dir lock_dir run_dir tmp_dir +- cert_dir db_dir ldif_dir bak_dir)) { ++ for my $kw (@inst_dirs) { + my $dir = $inf->{slapd}->{$kw}; + system("restorecon -R $dir"); + } +@@ -1231,14 +1261,14 @@ sub createDSInstance { + } + + sub stopServer { +- my $instancedir = shift; +- my $prog = $instancedir . "/stop-slapd"; ++ my $instance = shift; ++ my $prog = "@sbindir@/stop-dirsrv"; + if (-x $prog) { + $? = 0; + # run the stop command +- my $output = `$prog 2>&1`; ++ my $output = `$prog $instance 2>&1`; + my $status = $?; +- debug(3, "stopping server $instancedir returns status $status: output $output\n"); ++ debug(3, "stopping server $instance returns status $status: output $output\n"); + if ($status) { + debug(1,"Warning: Could not stop directory server: status $status: output $output\n"); + # if the server is not running, that's ok +@@ -1254,7 +1284,7 @@ sub stopServer { + return; + } + +- debug(1, "Successfully stopped server $instancedir\n"); ++ debug(1, "Successfully stopped server $instance\n"); + return 1; + } + +@@ -1331,23 +1361,16 @@ sub removeDSInstance { + $conn->close(); + + # stop the server +- my $instdir = ""; +- if ($entry) { +- foreach my $path ( @{$entry->{"nsslapd-instancedir"}} ) +- { +- if (!stopServer($path)) { +- if ($force) { +- debug(1, "Warning: Could not stop directory server - Error: $! - forcing continue\n"); +- } elsif ($! == ENOENT) { # stop script not found or server not running +- debug(1, "Warning: Could not stop directory server: already removed or not running\n"); +- push @errs, [ 'error_stopping_server', $path, $! ]; +- } else { # real error +- debug(1, "Error: Could not stop directory server - aborting - use -f flag to force removal\n"); +- push @errs, [ 'error_stopping_server', $path, $! ]; +- return @errs; +- } +- } +- $instdir = $path; ++ if (!stopServer($inst)) { ++ if ($force) { ++ debug(1, "Warning: Could not stop directory server - Error: $! - forcing continue\n"); ++ } elsif ($! == ENOENT) { # stop script not found or server not running ++ debug(1, "Warning: Could not stop directory server: already removed or not running\n"); ++ push @errs, [ 'error_stopping_server', $inst, $! ]; ++ } else { # real error ++ debug(1, "Error: Could not stop directory server - aborting - use -f flag to force removal\n"); ++ push @errs, [ 'error_stopping_server', $inst, $! ]; ++ return @errs; + } + } + +@@ -1363,18 +1386,25 @@ sub removeDSInstance { + push @errs, remove_tree($entry, "nsslapd-errorlog", $instname, 1); + } + +- # instance dir +- if ( -d $instdir && $instdir =~ /$instname/ ) +- { +- # clean up pid files (if any) +- remove_pidfile("STARTPIDFILE", $inst, $instdir, $instname, $rundir, $product_name); +- remove_pidfile("PIDFILE", $inst, $instdir, $instname, $rundir, $product_name); + +- my $rc = rmtree($instdir); +- if ( 0 == $rc ) ++ # instance dir ++ my $instdir = ""; ++ if ($entry) { ++ foreach my $instdir ( @{$entry->{"nsslapd-instancedir"}} ) + { +- push @errs, [ 'error_removing_path', $instdir, $! ]; +- debug(1, "Warning: $instdir was not removed. Error: $!\n"); ++ if ( -d $instdir && $instdir =~ /$instname/ ) ++ { ++ # clean up pid files (if any) ++ remove_pidfile("STARTPIDFILE", $inst, $instdir, $instname, $rundir, $product_name); ++ remove_pidfile("PIDFILE", $inst, $instdir, $instname, $rundir, $product_name); ++ ++ my $rc = rmtree($instdir); ++ if ( 0 == $rc ) ++ { ++ push @errs, [ 'error_removing_path', $instdir, $! ]; ++ debug(1, "Warning: $instdir was not removed. Error: $!\n"); ++ } ++ } + } + } + # Finally, config dir +diff --git a/ldap/admin/src/scripts/DSUpdate.pm.in b/ldap/admin/src/scripts/DSUpdate.pm.in +index be1e67c..e84a9a9 100644 +--- a/ldap/admin/src/scripts/DSUpdate.pm.in ++++ b/ldap/admin/src/scripts/DSUpdate.pm.in +@@ -226,10 +226,10 @@ sub updateDS { + for my $upd (@updates) { + my @localerrs; + if ($upd->{$PRE_STAGE}) { +- debug(1, "Running stage $PRE_STAGE update ", $upd->{path}, "\n"); ++ debug(1, "Running updateDS stage $PRE_STAGE update ", $upd->{path}, "\n"); + @localerrs = &{$upd->{$PRE_STAGE}}($inf, $setup->{configdir}); + } elsif ($upd->{file}) { +- debug(1, "Running stage $PRE_STAGE update ", $upd->{path}, "\n"); ++ debug(1, "Running updateDS stage $PRE_STAGE update ", $upd->{path}, "\n"); + @localerrs = processUpdate($upd, $inf, $setup->{configdir}, $PRE_STAGE); + } + if (@localerrs) { +@@ -276,10 +276,10 @@ sub updateDS { + for my $upd (@updates) { + my @localerrs; + if ($upd->{$POST_STAGE}) { +- debug(1, "Running stage $POST_STAGE update ", $upd->{path}, "\n"); ++ debug(1, "Running updateDS stage $POST_STAGE update ", $upd->{path}, "\n"); + @localerrs = &{$upd->{$POST_STAGE}}($inf, $setup->{configdir}); + } elsif ($upd->{file}) { +- debug(1, "Running stage $POST_STAGE update ", $upd->{path}, "\n"); ++ debug(1, "Running updateDS stage $POST_STAGE update ", $upd->{path}, "\n"); + @localerrs = processUpdate($upd, $inf, $setup->{configdir}, $POST_STAGE); + } + if (@localerrs) { +@@ -385,10 +385,10 @@ sub updateDSInstance { + for my $upd (@{$updates}) { + my @localerrs; + if ($upd->{$stage}) { +- debug(1, "Running stage $stage update ", $upd->{path}, "\n"); ++ debug(1, "Running updateDSInstance stage $stage update ", $upd->{path}, "\n"); + @localerrs = &{$upd->{$stage}}($inf, $inst, $dseldif, $conn); + } elsif ($upd->{file}) { +- debug(1, "Running stage $stage update ", $upd->{path}, "\n"); ++ debug(1, "Running updateDSInstance stage $stage update ", $upd->{path}, "\n"); + @localerrs = processUpdate($upd, $inf, $configdir, $stage, + $inst, $dseldif, $conn); + } +diff --git a/ldap/admin/src/scripts/setup-ds.res.in b/ldap/admin/src/scripts/setup-ds.res.in +index 7134e25..fa37567 100644 +--- a/ldap/admin/src/scripts/setup-ds.res.in ++++ b/ldap/admin/src/scripts/setup-ds.res.in +@@ -116,6 +116,7 @@ error_creating_file = Could not create file '%s'. Error: %s\n + error_copying_file = Could not copy file '%s' to '%s'. Error: %s\n + error_enabling_feature = Could not enable the directory server feature '%s'. Error: %s\n + error_importing_ldif = Could not import LDIF file '%s'. Error: %s. Output: %s\n ++error_invalid_boolean = Could not convert value '%s' to boolean. Valid values are true or false.\n + error_starting_server = Could not start the directory server using command '%s'. The last line from the error log was '%s'. Error: %s\n + error_stopping_server = Could not stop the directory server '%s'. Error: %s\n + error_missing_userid = The SuiteSpotUserID is missing. This must be set to valid user\n +-- +2.4.3 + diff --git a/net-nds/389-ds-base/files/389-ds-snmp.initd b/net-nds/389-ds-base/files/389-ds-snmp.initd new file mode 100644 index 000000000000..94df1580d76b --- /dev/null +++ b/net-nds/389-ds-base/files/389-ds-snmp.initd @@ -0,0 +1,44 @@ +#!/sbin/openrc-run +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +PIDFILE="/var/run/ldap-agent.pid" +CONFIGFILE="/etc/dirsrv/config/ldap-agent.conf" + +# instance support in progress + +depend() { + need net + use logger snmpd +} + +start() { + ebegin "Starting 389 Directory Server ldap-snmp agent" + start-stop-daemon --start --quiet -b \ + --pidfile ${PIDFILE} --exec /usr/sbin/ldap-agent -- ${CONFIGFILE} + eend ${?} + if [ "${?}" != "0" ]; then + local entries=/etc/dirsrv/slapd-* + if [ -n "${entries}" ]; then + ewarn "Please make sure that ${CONFIGFILE} contains at least" + ewarn "one of the following entries:" + for entry in ${entries}; do + entry=$(basename ${entry}) + ewarn "server ${entry}" + done + fi + fi +} + +stop() { + ebegin "Stopping 389 Directory Server ldap-snmp agent" + start-stop-daemon --stop --quiet --pidfile ${PIDFILE} + eend ${?} + +} + +restart() { + svc_stop + sleep 2 + svc_start +} diff --git a/net-nds/389-ds-base/files/389-ds.initd-r1 b/net-nds/389-ds-base/files/389-ds.initd-r1 new file mode 100644 index 000000000000..bc9e6e1bb3a7 --- /dev/null +++ b/net-nds/389-ds-base/files/389-ds.initd-r1 @@ -0,0 +1,90 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +DIRSRV_EXEC="/usr/sbin/ns-slapd" +PID_DIRECTORY="/var/run/dirsrv" +LOCK_DIRECTORY="/var/lock/dirsrv" +DIRSRV_CONF_DIR="/etc/dirsrv" +DS_INSTANCES=${DIRSRV_CONF_DIR}/slapd-* +F389DS_INSTANCES="" + +depend() { + need net logger + use dns + provide dirsvr ldap +} + +checkconfig() { + if [ -z "${DS_INSTANCES}" ]; then + eerror "389 Directory Server has not been configured." + eend 1 + return 1 + fi +} + +start() { + checkconfig || return 1 + + for instance in ${DS_INSTANCES}; do + instance=$(basename ${instance}) + # skip .removed instances, bug #338133 + if [ "${instance%%.removed}" != "${instance}" ]; then + continue + fi + # Create the required directories in case they got nuked + mkdir -p ${PID_DIRECTORY} + mkdir -p ${LOCK_DIRECTORY}/${instance} + # This will probably break one day, we should be pulling out the suitespotuser from dse.ldif + chown dirsrv: ${PID_DIRECTORY} + chown dirsrv: ${LOCK_DIRECTORY}/${instance} + ebegin "Starting 389 Directory Server: instance ${instance}" + start-stop-daemon --start --quiet -m \ + --pidfile ${PID_DIRECTORY}/${instance}.startpid \ + --exec ${DIRSRV_EXEC} -- -D ${DIRSRV_CONF_DIR}/${instance} \ + -i ${PID_DIRECTORY}/${instance}.pid \ + -w ${PID_DIRECTORY}/${instance}.startpid + sts=${?} + eend ${sts} + if [ "${sts}" != "0" ]; then + return 1 + fi + done +} + + + +stop() { + checkconfig || return 1 + + for instance in ${DS_INSTANCES}; do + instance=$(basename ${instance}) + if [ "${instance%%.removed}" != "${instance}" ]; then + continue + fi + ebegin "Stopping 389 Directory Server: instance ${instance}" + start-stop-daemon --stop --quiet \ + --pidfile ${PID_DIRECTORY}/${instance}.pid \ + --exec ${DIRSRV_EXEC} + eend ${?} + done +} + +status() { + for instance in ${DS_INSTANCES}; do + instance=$(basename ${instance}) + if [ "${instance%%.removed}" != "${instance}" ]; then + continue + fi + if [ -e ${PID_DIRECTORY}/${instance}.pid ]; then + pid=$(cat ${PID_DIRECTORY}/${instance}.pid) + if [ $(echo "$pid" | grep -c $pid) -ge 1 ]; then + einfo "389 Directory Server: instance ${instance} (pid $pid) running." + else + ewarn "389 Directory Server: instance ${instance} (pid $pid) NOT running." + fi + else + eerror "389 Directory Server: instance ${instance} is NOT running." + fi + done +} diff --git a/net-nds/389-ds-base/metadata.xml b/net-nds/389-ds-base/metadata.xml new file mode 100644 index 000000000000..fc1547d4a917 --- /dev/null +++ b/net-nds/389-ds-base/metadata.xml @@ -0,0 +1,32 @@ + + + + + wibrown@redhat.com + William Brown + Part of the 389-ds core team + + + wes@sol1.com.au + Wes + + + proxy-maint@gentoo.org + Proxy Maintainers + +The enterprise-class Open Source LDAP server for Linux + + Enable pam-passthru plugin - for simple and fast system services used in ldap + Enable dna (distributed numeric assignment ) plugin - to + automatically assign unique uid numbers to new user entries as they are created. + Enable presence plugin - non-standard syntax + validation + Enable bitwise plugin - supported data in raw/bitwise + format + Enable auto bind over unix domain socket (LDAPI) + support + Enable auto bind with auto dn suffix over unix + domain socket (LDAPI) support + Enable LDAP over unix domain socket (LDAPI) support + + -- cgit v1.2.3