summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Erculiani <lxnay@gentoo.org>2010-07-07 14:31:36 +0000
committerFabio Erculiani <lxnay@gentoo.org>2010-07-07 14:31:36 +0000
commitbd1e357c75d696657893dee1822d51d04449ca48 (patch)
tree08cf00212f0df608bb131e1d9ce1396e3a33c2cc /net-nds
parentx86 stable wrt bug #305031 (diff)
downloadgentoo-2-bd1e357c75d696657893dee1822d51d04449ca48.tar.gz
gentoo-2-bd1e357c75d696657893dee1822d51d04449ca48.tar.bz2
gentoo-2-bd1e357c75d696657893dee1822d51d04449ca48.zip
new ebuild, 389 Directory Server server package, thanks to Andreis_Vinogradovs ( slepnoga ) <spamslepnoga@inbox.ru> for the base ebuild, closing #309553
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'net-nds')
-rw-r--r--net-nds/389-ds-base/389-ds-base-1.2.6_rc3.ebuild190
-rw-r--r--net-nds/389-ds-base/ChangeLog15
-rw-r--r--net-nds/389-ds-base/files/1.2.6/selinux_gentoo.patch11
-rw-r--r--net-nds/389-ds-base/files/1.2.6/selinux_makefile.patch10
-rw-r--r--net-nds/389-ds-base/files/389-ds-snmp.initd45
-rw-r--r--net-nds/389-ds-base/files/389-ds.initd74
-rw-r--r--net-nds/389-ds-base/files/restart-dirsrv29
-rw-r--r--net-nds/389-ds-base/files/start-dirsrv13
-rw-r--r--net-nds/389-ds-base/metadata.xml27
9 files changed, 414 insertions, 0 deletions
diff --git a/net-nds/389-ds-base/389-ds-base-1.2.6_rc3.ebuild b/net-nds/389-ds-base/389-ds-base-1.2.6_rc3.ebuild
new file mode 100644
index 000000000000..49a55e294691
--- /dev/null
+++ b/net-nds/389-ds-base/389-ds-base-1.2.6_rc3.ebuild
@@ -0,0 +1,190 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-nds/389-ds-base/389-ds-base-1.2.6_rc3.ebuild,v 1.1 2010/07/07 14:31:36 lxnay Exp $
+
+EAPI=2
+
+WANT_AUTOMAKE="1.9"
+MY_P=${P/_alpha/.a}
+MY_P=${MY_P/_rc/.rc}
+inherit eutils multilib flag-o-matic autotools
+
+DESCRIPTION="389 Directory Server (core librares and daemons )"
+HOMEPAGE="http://port389.org/"
+SRC_URI="http://directory.fedoraproject.org/sources/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2-with-exceptions"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="autobind auto-dn-suffix debug doc +pam-passthru +dna +ldapi +bitwise +presence kerberos selinux"
+
+ALL_DEPEND="dev-libs/nss[utils]
+ dev-libs/nspr
+ dev-libs/svrcore
+ dev-libs/mozldap
+ >=dev-libs/cyrus-sasl-2.1.19
+ >=dev-libs/icu-3.4
+ >=sys-libs/db-4.5
+ >=net-analyzer/net-snmp-5.1.2
+ dev-libs/openssl
+ sys-apps/tcp-wrappers
+ sys-libs/pam
+ sys-libs/zlib
+ dev-perl/perl-mozldap
+ dev-libs/libpcre:3
+ kerberos? ( net-nds/openldap
+ >=app-crypt/mit-krb5-1.7-r100[ldap] )
+ selinux? ( >=sys-apps/policycoreutils-1.30.30
+ sec-policy/selinux-base-policy )"
+
+DEPEND="${ALL_DEPEND}
+ dev-util/pkgconfig
+ sys-devel/libtool:1.5
+ doc? ( app-doc/doxygen )
+ selinux? ( sys-devel/m4 >=sys-apps/checkpolicy-1.30.12 )
+ sys-apps/sed"
+RDEPEND="${ALL_DEPEND}
+ virtual/perl-Time-Local
+ virtual/perl-MIME-Base64"
+
+S="${WORKDIR}/${MY_P}"
+
+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
+
+ sed -i -e 's/nobody/dirsrv/g' configure.ac || die "sed failed on configure.ac"
+ use selinux && epatch "${FILESDIR}/1.2.6"/*selinux*.patch
+ eautoreconf
+
+ # enable nsslapd-allow-unauthenticated-binds by default
+ sed -i '/^nsslapd-allow-unauthenticated-binds/ s/off/on/' "${S}"/ldap/ldif/template-dse.ldif.in || \
+ die "cannot tweak default setting: nsslapd-allow-unauthenticated-binds"
+
+}
+
+src_configure() {
+ local myconf=""
+
+ use auto-dn-suffix && myconf="${myconf} --enable-auto-dn-suffix"
+ use selinux && myconf="${myconf} --with-selinux"
+
+ 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) \
+ --enable-maintainer-mode \
+ --enable-autobind \
+ --with-fhs \
+ $myconf || die "econf failed"
+}
+
+src_compile() {
+ append-lfs-flags
+
+ # Use -j1 otherwise libacl-plugin.so could fail to install properly
+ emake -j1 || die "compile failed"
+ if use selinux; then
+ emake -f selinux/Makefile || die " build selinux policy failed"
+ fi
+}
+
+src_install () {
+ # Use -j1 otherwise libacl-plugin.so could fail to install properly
+ emake -j1 DESTDIR="${D}" install || die "emake install failed"
+
+ if use selinux;then
+ emake -f selinux/Makefile DESTDIR="${D}" install || die "Install selinux policy failed"
+ fi
+
+ # install not installed header
+ insinto /usr/include/dirsrv
+ doins ldap/servers/slapd/slapi-plugin.h
+
+ # for build free-ipa require winsync-plugin
+ doins ldap/servers/plugins/replication/winsync-plugin.h
+
+ # make sure perl scripts have a proper shebang
+ cd "${D}"/usr/share/dirsrv/script-templates/
+
+ for i in $(find ./ -iname '*.pl') ;do
+ sed -i -e 's/#{{PERL-EXEC}}/#\!\/usr\/bin\/perl/' $i || die
+ done
+
+ # remove redhat style init script
+ rm -rf "${D}"/etc/rc.d || die
+ rm -rf "${D}"/etc/default || die
+
+ # and install gentoo style init script
+ newinitd "${FILESDIR}"/389-ds.initd 389-ds
+ newinitd "${FILESDIR}"/389-ds-snmp.initd 389-ds-snmp
+
+ # install Gentoo-specific start/stop scripts
+ rm -f "${D}"/usr/sbin/{re,}start-dirsrv || die "cannot remove 389 start/stop executables"
+ exeinto /usr/sbin
+ doexe "${FILESDIR}"/{re,}start-dirsrv
+
+ # cope with libraries being in /usr/lib/dirsrv
+ dodir /etc/env.d
+ echo "LDPATH=/usr/$(get_libdir)/dirsrv" > "${D}"/etc/env.d/08dirsrv
+
+ # create the directory where our log file and database
+ diropts -m 0750 -o dirsrv -g dirsrv
+ keepdir /var/lib/dirsrv
+ dodir /var/lock/dirsrv
+
+ # snmp agent, required directory
+ keepdir /var/agentx
+ dodir /var/agentx
+
+ if use doc; then
+ cd "${S}"
+ doxygen slapi.doxy || die "cannot run doxygen"
+ dohtml -r docs/html
+ fi
+}
+
+pkg_postinst() {
+ if use selinux; then
+ if has "loadpolicy" $FEATURES; then
+ einfo "Inserting the following modules into the module store"
+ cd /usr/share/selinux/targeted # struct policy not supported
+ semodule -s dirsrv -i dirsrv.pp
+ else
+ elog
+ elog "Policy has not been loaded. It is strongly suggested"
+ elog "that the policy be loaded before continuing!!"
+ elog
+ elog "Automatic policy loading can be enabled by adding"
+ elog "\"loadpolicy\" to the FEATURES in make.conf."
+ elog
+ ebeep 4
+ fi
+ fi
+
+ elog
+ 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
+ elog "To start 389 Directory Server (LDAP service) at boot:"
+ elog
+ elog " rc-update add 389-ds default"
+ elog
+}
diff --git a/net-nds/389-ds-base/ChangeLog b/net-nds/389-ds-base/ChangeLog
new file mode 100644
index 000000000000..287137210699
--- /dev/null
+++ b/net-nds/389-ds-base/ChangeLog
@@ -0,0 +1,15 @@
+# ChangeLog for net-nds/389-ds-base
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-nds/389-ds-base/ChangeLog,v 1.1 2010/07/07 14:31:36 lxnay Exp $
+
+*389-ds-base-1.2.6_rc3 (07 Jul 2010)
+
+ 07 Jul 2010; Fabio Erculiani <lxnay@gentoo.org>
+ +files/1.2.6/selinux_gentoo.patch, +files/1.2.6/selinux_makefile.patch,
+ +files/389-ds.initd, +files/389-ds-snmp.initd,
+ +389-ds-base-1.2.6_rc3.ebuild, +files/restart-dirsrv, +files/start-dirsrv,
+ +metadata.xml:
+ new ebuild, 389 Directory Server server package, thanks to
+ Andreis_Vinogradovs ( slepnoga ) <spamslepnoga@inbox.ru> for the base
+ ebuild, closing #309553
+
diff --git a/net-nds/389-ds-base/files/1.2.6/selinux_gentoo.patch b/net-nds/389-ds-base/files/1.2.6/selinux_gentoo.patch
new file mode 100644
index 000000000000..4f6036fce1c9
--- /dev/null
+++ b/net-nds/389-ds-base/files/1.2.6/selinux_gentoo.patch
@@ -0,0 +1,11 @@
+--- m4.orig/selinux.m4 2010-03-09 04:02:20.562880260 +0200
++++ m4/selinux.m4 2010-03-09 04:03:16.558882069 +0200
+@@ -27,7 +27,7 @@
+ with_selinux=yes
+ AC_MSG_RESULT(yes)
+ AC_SUBST(with_selinux)
+- if test ! -f "/usr/share/selinux/devel/Makefile"; then
++ if test ! -f "/usr/share/selinux/targeted/include/Makefile"; then
+ AC_MSG_ERROR([SELinux development tools (selinux-policy) not found])
+ fi
+ ],
diff --git a/net-nds/389-ds-base/files/1.2.6/selinux_makefile.patch b/net-nds/389-ds-base/files/1.2.6/selinux_makefile.patch
new file mode 100644
index 000000000000..3ad7bda991fd
--- /dev/null
+++ b/net-nds/389-ds-base/files/1.2.6/selinux_makefile.patch
@@ -0,0 +1,10 @@
+--- selinux.orig/Makefile 2010-03-09 04:55:28.915799132 +0200
++++ selinux/Makefile 2010-03-09 04:57:09.214733326 +0200
+@@ -1,6 +1,5 @@
+-POLICY_MAKEFILE = /usr/share/selinux/devel/Makefile
+ POLICY_DIR = $(DESTDIR)/usr/share/selinux/targeted
+-
++POLICY_MAKEFILE = /usr/share/selinux/targeted/include/Makefile
+ all:
+ if [ ! -e $(POLICY_MAKEFILE) ]; then echo "You need to install the SELinux policy development tools (selinux-policy)" && exit 1; fi
+
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..15ce834af358
--- /dev/null
+++ b/net-nds/389-ds-base/files/389-ds-snmp.initd
@@ -0,0 +1,45 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-nds/389-ds-base/files/389-ds-snmp.initd,v 1.1 2010/07/07 14:31:36 lxnay Exp $
+
+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 b/net-nds/389-ds-base/files/389-ds.initd
new file mode 100644
index 000000000000..6cb417ee4127
--- /dev/null
+++ b/net-nds/389-ds-base/files/389-ds.initd
@@ -0,0 +1,74 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-nds/389-ds-base/files/389-ds.initd,v 1.1 2010/07/07 14:31:36 lxnay Exp $
+
+DIRSRV_EXEC="/usr/sbin/ns-slapd"
+PID_DIRECTORY="/var/run/dirsrv"
+DIRSRV_CONF_DIR="/etc/dirsrv"
+DS_INSTANCES=${DIRSRV_CONF_DIR}/slapd-*
+F389DS_INSTANCES=""
+
+depend() {
+ need net
+ 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})
+ 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 ${?}
+ if [ "${sts}" != "0" ]; then
+ return 1
+ fi
+ done
+}
+
+
+
+stop() {
+ checkconfig || return 1
+
+ for instance in ${DS_INSTANCES}; do
+ instance=$(basename ${instance})
+ 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 [ -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/files/restart-dirsrv b/net-nds/389-ds-base/files/restart-dirsrv
new file mode 100644
index 000000000000..b4d57467b29e
--- /dev/null
+++ b/net-nds/389-ds-base/files/restart-dirsrv
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# Script that restarts the ns-slapd server.
+# Exit status can be:
+# 0: Server restarted successfully
+# 1: Server could not be started
+# 2: Server started successfully (was not running)
+# 3: Server could not be stopped
+
+sleep_time=8
+running=$(/etc/init.d/389-ds status &> /dev/null)
+
+rc-config stop 389-ds
+if [ "${?}" = "1" ]; then
+ sleep ${sleep_time}
+ exit 3
+fi
+rc-config start 389-ds
+if [ "${?}" = "1" ]; then
+ sleep ${sleep_time}
+ exit 1
+fi
+if [ "${running}" = "0" ]; then
+ sleep ${sleep_time}
+ exit 0
+else
+ sleep ${sleep_time}
+ exit 2
+fi
diff --git a/net-nds/389-ds-base/files/start-dirsrv b/net-nds/389-ds-base/files/start-dirsrv
new file mode 100644
index 000000000000..7db799a2d3ce
--- /dev/null
+++ b/net-nds/389-ds-base/files/start-dirsrv
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Script that starts the ns-slapd server.
+# Exit status can be:
+# 0: Server started successfully
+# 1: Server could not be started
+# 2: Server already running
+
+rc-config stop 389-ds
+rc=$(rc-config start 389-ds)
+# give the daemon a chance to start
+sleep 8
+exit ${rc}
diff --git a/net-nds/389-ds-base/metadata.xml b/net-nds/389-ds-base/metadata.xml
new file mode 100644
index 000000000000..2f0221cb3709
--- /dev/null
+++ b/net-nds/389-ds-base/metadata.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+<maintainer>
+ <email>lxnay@gentoo.org</email>
+ <description>The enterprise-class Open Source LDAP server for Linux</description>
+</maintainer>
+ <longdescription>The enterprise-class Open Source LDAP server for Linux</longdescription>
+ <use>
+ <flag name='pam-passthru'>Enable pam-passthru plugin - for simple and fast system services used in ldap</flag>
+
+ <flag name='dna'>Enable dna (distributed numeric assignment ) plugin - to
+ automatically assign unique uid numbers to new user entries as they are created.</flag>
+
+ <flag name='presence'>Enable presence plugin - non-stabdart syntax
+ validation</flag>
+
+ <flag name='bitwise'>Enable bitwise plugin - supported data in raw/bitwise
+ format</flag>
+ <flag name='autobind'>Enable auto bind over unix domain socket (LDAPI)
+ support</flag>
+ <flag name='auto-dn-suffix'>Enable auto bind with auto dn suffix over unix
+ domain socket (LDAPI) support</flag>
+ <flag name='ldapi'>Enable LDAP over unix domain socket (LDAPI) support</flag>
+</use>
+</pkgmetadata>