summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-nds/389-admin
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-nds/389-admin')
-rw-r--r--net-nds/389-admin/389-admin-1.1.31.ebuild171
-rw-r--r--net-nds/389-admin/Manifest1
-rw-r--r--net-nds/389-admin/files/1.1.11_rc1/0001-gentoo-apache-names.patch18
-rw-r--r--net-nds/389-admin/files/1.1.11_rc1/0003-find-mod_nss.m4.patch11
-rw-r--r--net-nds/389-admin/files/1.1.11_rc1/0004-rpath-fix.configure.ac.patch19
-rw-r--r--net-nds/389-admin/files/1.1.11_rc1/0010-gentoo_selinux_makefile.patch11
-rw-r--r--net-nds/389-admin/files/1.1.11_rc1/48_mod_admserv.conf3
-rw-r--r--net-nds/389-admin/files/1.1.11_rc1/48_mod_restartd.conf5
-rw-r--r--net-nds/389-admin/files/389-admin-cfgstuff-1.patch56
-rw-r--r--net-nds/389-admin/files/389-admin.confd73
-rw-r--r--net-nds/389-admin/files/389-admin.initd162
-rw-r--r--net-nds/389-admin/files/restart-ds-admin7
-rw-r--r--net-nds/389-admin/files/start-ds-admin7
-rw-r--r--net-nds/389-admin/files/stop-ds-admin7
-rw-r--r--net-nds/389-admin/metadata.xml12
15 files changed, 563 insertions, 0 deletions
diff --git a/net-nds/389-admin/389-admin-1.1.31.ebuild b/net-nds/389-admin/389-admin-1.1.31.ebuild
new file mode 100644
index 000000000000..4716caecd553
--- /dev/null
+++ b/net-nds/389-admin/389-admin-1.1.31.ebuild
@@ -0,0 +1,171 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+WANT_AUTOMAKE="1.9"
+
+MY_PV=${PV/_rc/.rc}
+MY_PV=${MY_PV/_a/.a}
+
+inherit eutils multilib autotools depend.apache
+
+DESCRIPTION="389 Directory Server (admin)"
+HOMEPAGE="http://port389.org/"
+SRC_URI="http://directory.fedoraproject.org/sources/${PN}-${MY_PV}.tar.bz2"
+
+LICENSE="GPL-2 Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug ipv6 selinux"
+
+# TODO snmp agent init script
+
+COMMON_DEPEND=">=app-admin/389-admin-console-1.1.0
+ >=app-admin/389-ds-console-1.1.0
+ app-misc/mime-types
+ dev-libs/389-adminutil
+ dev-libs/cyrus-sasl
+ dev-libs/icu:=
+ dev-libs/nss[utils]
+ || ( <=dev-libs/nspr-4.8.3-r3[ipv6?] >=dev-libs/nspr-4.8.4 )
+ dev-libs/svrcore
+ net-analyzer/net-snmp[ipv6?]
+ net-nds/openldap
+ selinux? (
+ sys-apps/checkpolicy
+ sys-apps/policycoreutils
+ )
+ >=sys-libs/db-4.2.52
+ sys-libs/pam
+ sys-apps/tcp-wrappers[ipv6?]
+ www-apache/mod_nss
+ www-servers/apache:2[apache2_modules_actions,apache2_modules_alias,apache2_modules_auth_basic,apache2_modules_authz_default,apache2_modules_cgi,apache2_modules_mime_magic,apache2_modules_rewrite,apache2_modules_setenvif,suexec,threads]"
+RDEPEND="
+ ${COMMON_DEPEND}
+ www-client/lynx
+ selinux? ( sec-policy/selinux-base-policy )
+"
+DEPEND="sys-apps/sed ${COMMON_DEPEND}"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+need_apache2
+
+src_prepare() {
+ # as per 389 documentation, when 64bit, export USE_64
+ use amd64 && export USE_64=1
+
+ epatch "${FILESDIR}/1.1.11_rc1/0001-gentoo-apache-names.patch"
+ epatch "${FILESDIR}/1.1.11_rc1/0003-find-mod_nss.m4.patch"
+ epatch "${FILESDIR}/1.1.11_rc1/0004-rpath-fix.configure.ac.patch"
+ # Configuration fixes
+ epatch "${FILESDIR}/${PN}-cfgstuff-1.patch"
+
+ sed -e "s!SUBDIRS!# SUBDIRS!g" -i Makefile.am || die "sed failed"
+ # Setup default user/group, in this case it's dirsrv
+ sed -e "s!nobody!dirsrv!g" -i configure.ac || die "sed failed"
+
+ eautoreconf
+}
+
+src_configure() {
+ # stub autoconf triplet :(
+ local myconf=""
+ use debug && myconf="--enable-debug"
+ use selinux && myconf="${myconf} --with-selinux"
+
+ econf \
+ --enable-threading \
+ --disable-rpath \
+ --with-adminutil=/usr \
+ --with-apr-config \
+ --with-apxs=${APXS} \
+ --with-fhs \
+ --with-httpd=${APACHE_BIN} \
+ --with-openldap \
+ ${myconf} || die "econf failed"
+}
+
+src_install () {
+
+ emake DESTDIR="${D}" install || die "emake failed"
+ keepdir /var/log/dirsrv/admin-serv
+
+ # remove redhat style init script.
+ rm -rf "${D}"/etc/rc.d
+ rm -rf "${D}"/etc/default
+
+ # install gentoo style init script.
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+
+ # remove redhat style wrapper scripts
+ # and install gentoo scripts.
+ rm -rf "${D}"/usr/sbin/*-ds-admin
+ dosbin "${FILESDIR}"/*-ds-admin || die "cannot install gentoo start/stop scripts"
+
+ # In this version build systems for modules is delete :(
+ # manually install modules, not using apache-modules eclass
+ # because use bindled library
+
+ # install mod_admserv
+ exeinto "${APACHE_MODULESDIR}"
+ doexe "${S}/.libs"/mod_admserv.so || die "internal ebuild error: mod_admserv not found"
+
+ insinto "${APACHE_MODULES_CONFDIR}"
+ newins "${FILESDIR}/1.1.11_rc1"/48_mod_admserv.conf 48_mod_admserv \
+ || die "internal ebuild error: 48_mod_admserv.conf not found"
+
+ # install mod_restard
+ exeinto "${APACHE_MODULESDIR}"
+ doexe "${S}/.libs"/mod_restartd.so || die "internal ebuild error: mod_restartd not found"
+
+ insinto "${APACHE_MODULES_CONFDIR}"
+ newins "${FILESDIR}/1.1.11_rc1"/48_mod_restartd.conf 48_mod_restartd \
+ || die "internal ebuild error: 48_mod_restard.conf not found"
+
+ if use selinux; then
+ local POLICY_TYPES="targeted"
+ cd "${S}"/selinux || die
+ cp /usr/share/selinux/${POLICY_TYPES}/include/Makefile . || die
+ make || die "selinux policy compile failed"
+ insinto /usr/share/selinux/${POLICY_TYPES}
+ doins -r "${S}/selinux/"*.pp
+ fi
+
+}
+
+pkg_postinst() {
+
+ # show setup information
+ elog "Once you configured www-servers/apache as written above,"
+ elog "you need to run (as root): /usr/sbin/setup-ds-admin.pl"
+ elog
+
+ # show security and sysctl info
+ elog "It is recommended to setup net.ipv4.tcp_keep_alive_time"
+ elog "in /etc/sysctl.conf (or via sysctl -w && sysctl -p) to a reasonable"
+ elog "value (in milliseconds) to avoid temporary server congestions"
+ elog "from lost client connections"
+ elog
+
+ # /etc/security/limits.conf settings
+ elog "It is also recommended to fine tune the maximum open files"
+ elog "settings inside /etc/security/limits.conf:"
+ elog "* soft nofile 2048"
+ elog "* hard nofile 4096"
+ elog
+
+ elog "To start 389 Directory Server Administration Interface at boot"
+ elog "please add 389-admin service to the default runlevel:"
+ elog
+ elog " rc-update add 389-admin default"
+ elog
+
+ elog "for 389 Directory Server Admin interface to work, you need"
+ elog "to setup a FQDN hostname and use it while running /usr/sbin/setup-ds-admin.pl"
+ elog
+
+}
diff --git a/net-nds/389-admin/Manifest b/net-nds/389-admin/Manifest
new file mode 100644
index 000000000000..195a76174c60
--- /dev/null
+++ b/net-nds/389-admin/Manifest
@@ -0,0 +1 @@
+DIST 389-admin-1.1.31.tar.bz2 647098 SHA256 79c8c0133f72be4915fec8a4f2490bc21480de5fae77070f2ce13b1d9f28872f SHA512 631cd286a817a9e862adc610464d1c1f7a7af8dbade4cc2d8535330f81591d65df4773b6dbce0256470002165640fe73b49c20ee5093f71e5121d2cfa15ca9c4 WHIRLPOOL bff158c3d2201d8723faf340e21e3fdbeaaa62bbefac033b1f5ac981bd17a2e83f0507908b3919af1911b519442da75a96164b73d4df6953227973feaaab047e
diff --git a/net-nds/389-admin/files/1.1.11_rc1/0001-gentoo-apache-names.patch b/net-nds/389-admin/files/1.1.11_rc1/0001-gentoo-apache-names.patch
new file mode 100644
index 000000000000..9f145d959894
--- /dev/null
+++ b/net-nds/389-admin/files/1.1.11_rc1/0001-gentoo-apache-names.patch
@@ -0,0 +1,18 @@
+diff -ur m4.orig/httpd.m4 m4/httpd.m4
+--- m4.orig/httpd.m4 2009-10-25 14:10:24.398721002 +0200
++++ m4/httpd.m4 2009-10-25 14:12:54.463219758 +0200
+@@ -58,12 +58,12 @@
+ *) APACHE22= ;;
+ esac
+
+-httpdconf=${httpd_root}/${httpd_conf_rel}
++httpdconf=/etc/apache2/httpd.conf
+
+ mimemagic=`grep MIMEMagicFile $httpdconf|grep -v \^# | awk '{print $2}'`
+ if test ! -f "$mimemagic" ; then
+ # assume relative to root
+- mimemagic=${httpd_root}/${mimemagic}
++ mimemagic=/etc/apache2/magic
+ fi
+
+ # check for mime.types file
diff --git a/net-nds/389-admin/files/1.1.11_rc1/0003-find-mod_nss.m4.patch b/net-nds/389-admin/files/1.1.11_rc1/0003-find-mod_nss.m4.patch
new file mode 100644
index 000000000000..5a15e1dbf606
--- /dev/null
+++ b/net-nds/389-admin/files/1.1.11_rc1/0003-find-mod_nss.m4.patch
@@ -0,0 +1,11 @@
+--- m4/mod_nss.m4.orig 2010-01-14 23:05:29.000000000 +0200
++++ m4/mod_nss.m4 2010-01-24 20:58:47.086937825 +0200
+@@ -52,7 +52,7 @@
+
+ # else, parse httpd.conf or httpconfdir/nss.conf
+ if test -z "$modnssbindir" ; then
+- nsspcache=`grep NSSPassPhraseHelper $httpdconf|awk '{print $2}'`
++ nsspcache=`grep -R NSSPassPhraseHelper /etc/apache2/* |awk '{print $2}'`
+ if test -z "$nsspcache" ; then
+ nsspcache=`grep NSSPassPhraseHelper $httpd_root/conf.d/* | awk '{print $2}'`
+ fi
diff --git a/net-nds/389-admin/files/1.1.11_rc1/0004-rpath-fix.configure.ac.patch b/net-nds/389-admin/files/1.1.11_rc1/0004-rpath-fix.configure.ac.patch
new file mode 100644
index 000000000000..d74c345363f1
--- /dev/null
+++ b/net-nds/389-admin/files/1.1.11_rc1/0004-rpath-fix.configure.ac.patch
@@ -0,0 +1,19 @@
+--- configure.ac.orig 2010-01-25 01:34:58.296824267 +0200
++++ configure.ac 2010-01-25 01:36:16.101825667 +0200
+@@ -433,13 +433,10 @@
+
+ if test "$enable_rpath" != "yes" ; then
+ AC_MSG_NOTICE([Fixing libtool to remove automatic rpath to $libdir . . .])
+- cp -p libtool libtool.orig
+- cp -p libtool libtool.tmp
++ cp -p ./libtool libtool.orig
++ cp -p ./libtool libtool.tmp
+ sed -e '/^runpath_var/ d' \
+- -e '/^hardcode_libdir_flag_spec/ d' \
+- libtool > libtool.tmp
+- cp -p libtool.tmp libtool
+- rm -f libtool.tmp
++ -e '/^hardcode_libdir_flag_spec/ d' -i ./libtool
+ fi
+
+ AC_CONFIG_FILES([Makefile])
diff --git a/net-nds/389-admin/files/1.1.11_rc1/0010-gentoo_selinux_makefile.patch b/net-nds/389-admin/files/1.1.11_rc1/0010-gentoo_selinux_makefile.patch
new file mode 100644
index 000000000000..f7856efce231
--- /dev/null
+++ b/net-nds/389-admin/files/1.1.11_rc1/0010-gentoo_selinux_makefile.patch
@@ -0,0 +1,11 @@
+--- m4.orig/selinux.m4 2010-03-11 23:18:19.697503404 +0200
++++ m4/selinux.m4 2010-03-11 23:19:04.653503112 +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-admin/files/1.1.11_rc1/48_mod_admserv.conf b/net-nds/389-admin/files/1.1.11_rc1/48_mod_admserv.conf
new file mode 100644
index 000000000000..4a3f296f48e5
--- /dev/null
+++ b/net-nds/389-admin/files/1.1.11_rc1/48_mod_admserv.conf
@@ -0,0 +1,3 @@
+<IfDefine ADMSERV>
+ LoadModule mod_admserv modules/mod_admserv.so
+</IfDefine ADMSERV>
diff --git a/net-nds/389-admin/files/1.1.11_rc1/48_mod_restartd.conf b/net-nds/389-admin/files/1.1.11_rc1/48_mod_restartd.conf
new file mode 100644
index 000000000000..1d0d2f37825d
--- /dev/null
+++ b/net-nds/389-admin/files/1.1.11_rc1/48_mod_restartd.conf
@@ -0,0 +1,5 @@
+<IfDefine RESTARTD>
+ <IfModule !mod_restartd.c>
+ LoadModule restartd_module modules/mod_restartd.so
+ </IfModule>
+</IfDefine>
diff --git a/net-nds/389-admin/files/389-admin-cfgstuff-1.patch b/net-nds/389-admin/files/389-admin-cfgstuff-1.patch
new file mode 100644
index 000000000000..783f4772f7f1
--- /dev/null
+++ b/net-nds/389-admin/files/389-admin-cfgstuff-1.patch
@@ -0,0 +1,56 @@
+--- 389-admin-1.1.11.rc1.orig/admserv/cfgstuff/httpd-2.2.conf.in
++++ 389-admin-1.1.11.rc1/admserv/cfgstuff/httpd-2.2.conf.in
+@@ -143,7 +143,7 @@ LoadModule file_cache_module @moddir@/mo
+ LoadModule mem_cache_module @moddir@/mod_mem_cache.so
+ LoadModule cgi_module @moddir@/mod_cgi.so
+ LoadModule restartd_module @admmoddir@/mod_restartd.so
+-LoadModule nss_module @nssmoddir@/libmodnss.so
++LoadModule nss_module @moddir@/mod_nss.so
+ LoadModule admserv_module @admmoddir@/mod_admserv.so
+
+ ### Section 2: 'Main' server configuration
+@@ -389,15 +389,7 @@ ServerSignature On
+ # Alias.
+ #
+
+-<IfModule mod_cgid.c>
+-#
+-# Additional to mod_cgid.c settings, mod_cgid has Scriptsock <path>
+-# for setting UNIX socket for communicating with cgid.
+-#
+-Scriptsock @piddir@/admin-serv.cgisock
+-</IfModule>
+-
+-# and this one is for mod_restartd because mod_cgid will consume the other one
++# Setup mod_admserv socket handle
+ Scriptsock @piddir@/admin-serv.cgisock
+
+ #
+--- 389-admin-1.1.11.rc1.orig/admserv/cfgstuff/httpd.conf.in
++++ 389-admin-1.1.11.rc1/admserv/cfgstuff/httpd.conf.in
+@@ -142,7 +142,7 @@ LoadModule file_cache_module @moddir@/mo
+ LoadModule mem_cache_module @moddir@/mod_mem_cache.so
+ LoadModule cgi_module @moddir@/mod_cgi.so
+ LoadModule restartd_module @admmoddir@/mod_restartd.so
+-LoadModule nss_module @nssmoddir@/libmodnss.so
++LoadModule nss_module @moddir@/mod_nss.so
+ LoadModule admserv_module @admmoddir@/mod_admserv.so
+
+ ### Section 2: 'Main' server configuration
+@@ -388,15 +388,7 @@ ServerSignature On
+ # Alias.
+ #
+
+-<IfModule mod_cgid.c>
+-#
+-# Additional to mod_cgid.c settings, mod_cgid has Scriptsock <path>
+-# for setting UNIX socket for communicating with cgid.
+-#
+-Scriptsock @piddir@/admin-serv.cgisock
+-</IfModule>
+-
+-# and this one is for mod_restartd because mod_cgid will consume the other one
++# Setup mod_admserv socket handle
+ Scriptsock @piddir@/admin-serv.cgisock
+
+ #
diff --git a/net-nds/389-admin/files/389-admin.confd b/net-nds/389-admin/files/389-admin.confd
new file mode 100644
index 000000000000..8f134a4a2e76
--- /dev/null
+++ b/net-nds/389-admin/files/389-admin.confd
@@ -0,0 +1,73 @@
+# /etc/conf.d/389-admin: config file for /etc/init.d/389-admin
+
+# When you install a module it is easy to activate or deactivate the modules
+# and other features of apache using the APACHE2_OPTS line. Every module should
+# install a configuration in /etc/dirsrv/admin-serv. In that file will have an
+# <IfDefine NNN> directive where NNN is the option to enable that module.
+#
+# Here are the options available in the default configuration:
+#
+# AUTH_DIGEST Enables mod_auth_digest
+# AUTHNZ_LDAP Enables authentication through mod_ldap (available if USE=ldap)
+# CACHE Enables mod_cache
+# DAV Enables mod_dav
+# ERRORDOCS Enables default error documents for many languages.
+# INFO Enables mod_info, a useful module for debugging
+# LANGUAGE Enables content-negotiation based on language and charset.
+# LDAP Enables mod_ldap (available if USE=ldap)
+# MANUAL Enables /manual/ to be the apache manual (available if USE=docs)
+# MEM_CACHE Enables default configuration mod_mem_cache
+# PROXY Enables mod_proxy
+# SSL Enables SSL (available if USE=ssl)
+# SUEXEC Enables running CGI scripts (in USERDIR) through suexec.
+# USERDIR Enables /~username mapping to /home/username/public_html
+#
+#
+# The following two options provide the default virtual host for the HTTP and
+# HTTPS protocol. YOU NEED TO ENABLE AT LEAST ONE OF THEM, otherwise apache
+# will not listen for incomming connections on the approriate port.
+#
+# DEFAULT_VHOST Enables name-based virtual hosts, with the default
+# virtual host being in /var/www/localhost/htdocs
+# SSL_DEFAULT_VHOST Enables default vhost for SSL (you should enable this
+# when you enable SSL)
+#
+APACHE2_OPTS="-D DEFAULT_VHOST -D LANGUAGE -D INFO -D SUEXEC"
+
+# Extended options for advanced uses of Apache ONLY
+# You don't need to edit these unless you are doing crazy Apache stuff
+# As not having them set correctly, or feeding in an incorrect configuration
+# via them will result in Apache failing to start
+# YOU HAVE BEEN WARNED.
+
+# PID file
+#PIDFILE=/var/run/dirsrv/admin-serv.pid
+
+# timeout for startup/shutdown checks
+#TIMEOUT=10
+
+# ServerRoot setting
+#SERVERROOT=/usr/lib/apache2
+
+# Configuration file location
+# - If this does NOT start with a '/', then it is treated relative to
+# $SERVERROOT by Apache
+#CONFIGFILE=/etc/dirsrv/admin-serv/httpd.conf
+
+# Location to log startup errors to
+# They are normally dumped to your terminal.
+#STARTUPERRORLOG="/var/log/dirsrv/admin-serv/startuperror.log"
+
+# A command that outputs a formatted text version of the HTML at the URL
+# of the command line. Designed for lynx, however other programs may work.
+#LYNX="lynx -dump"
+
+# The URL to your server's mod_status status page.
+# Required for status and fullstatus
+#STATUSURL="http://localhost/server-status"
+
+# Method to use when reloading the server
+# Valid options are 'restart' and 'graceful'
+# See http://httpd.apache.org/docs/2.2/stopping.html for information on
+# what they do and how they differ.
+#RELOAD_TYPE="graceful"
diff --git a/net-nds/389-admin/files/389-admin.initd b/net-nds/389-admin/files/389-admin.initd
new file mode 100644
index 000000000000..9da3c50116b0
--- /dev/null
+++ b/net-nds/389-admin/files/389-admin.initd
@@ -0,0 +1,162 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+opts="configdump configtest fullstatus graceful gracefulstop modules reload"
+
+depend() {
+ need net 389-ds
+ use mysql dns logger netmount postgresql
+ after sshd
+}
+
+configtest() {
+ ebegin "Checking Apache Configuration of 389 Directory Server Admin"
+ checkconfig
+ eend ${?}
+}
+
+checkconfd() {
+ PIDFILE="${PIDFILE:-/var/run/dirsrv/admin-serv.pid}"
+ TIMEOUT=${TIMEOUT:-10}
+
+ SERVERROOT="${SERVERROOT:-/usr/lib/apache2}"
+ if [ ! -d ${SERVERROOT} ]; then
+ eerror "SERVERROOT does not exist: ${SERVERROOT}"
+ return 1
+ fi
+
+ CONFIGFILE="${CONFIGFILE:-/etc/dirsrv/admin-serv/httpd.conf}"
+ [ "${CONFIGFILE#/}" = "${CONFIGFILE}" ] && CONFIGFILE="${SERVERROOT}/${CONFIGFILE}"
+ if [ ! -r "${CONFIGFILE}" ]; then
+ eerror "Unable to read configuration file: ${CONFIGFILE}"
+ return 1
+ fi
+
+ APACHE2_OPTS="${APACHE2_OPTS} -d ${SERVERROOT}"
+ APACHE2_OPTS="${APACHE2_OPTS} -f ${CONFIGFILE}"
+ [ -n "${STARTUPERRORLOG}" ] && APACHE2_OPTS="${APACHE2_OPTS} -E ${STARTUPERRORLOG}"
+
+ APACHE2="/usr/sbin/apache2"
+}
+
+checkconfig() {
+ checkconfd || return 1
+
+ ${APACHE2} ${APACHE2_OPTS} -t 1>/dev/null 2>&1
+ ret=${?}
+ if [ $ret -ne 0 ]; then
+ eerror "389 Directory Server Admin (Apache2) has detected a syntax error in your configuration files:"
+ ${APACHE2} ${APACHE2_OPTS} -t
+ fi
+
+ return $ret
+}
+
+start() {
+ checkconfig || return 1
+
+ [ -f /var/log/dirsrv/admin-serv/ssl_scache ] && rm /var/log/dirsrv/admin-serv/ssl_scache
+
+ ebegin "Starting 389 Directory Server Admin (apache2)"
+ ${APACHE2} ${APACHE2_OPTS} -k start
+ [ "${?}" != "0" ] && eend "${?}" && return 1
+
+ let i=0
+ while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do
+ sleep 1 && let i++
+ done
+
+ test $i -le ${TIMEOUT}
+ eend ${?}
+}
+
+stop() {
+ checkconfd || return 1
+
+ ebegin "Stopping 389 Directory Server Admin (apache2)"
+ ${APACHE2} ${APACHE2_OPTS} -k stop
+
+ let i=0
+ while pidof "${APACHE2}" >/dev/null && [ $i -lt ${TIMEOUT} ]; do
+ sleep 1 && let i++
+ done
+
+ test $i -le ${TIMEOUT}
+ eend ${?}
+}
+
+reload() {
+ RELOAD_TYPE="${RELOAD_TYPE:-graceful}"
+
+ checkconfig || return 1
+ service_started "${SVCNAME}" || return
+
+ if [ "${RELOAD_TYPE}" = "restart" ]; then
+ ebegin "Restarting 389 Directory Server Admin (apache2)"
+ ${APACHE2} ${APACHE2_OPTS} -k restart
+ eend ${?}
+ elif [ "${RELOAD_TYPE}" = "graceful" ]; then
+ ebegin "Gracefully restarting 389 Directory Server Admin (apache2)"
+ ${APACHE2} ${APACHE2_OPTS} -k graceful
+ eend ${?}
+ else
+ eerror "${RELOAD_TYPE} is not a valid RELOAD_TYPE. Please edit /etc/conf.d/dirsrv-admin"
+ fi
+}
+
+graceful() {
+ checkconfig || return 1
+ service_started "${SVCNAME}" || return
+ ebegin "Gracefully restarting 389 Directory Server Admin (apache2)"
+ ${APACHE2} ${APACHE2_OPTS} -k graceful
+ eend ${?}
+}
+
+gracefulstop() {
+ checkconfig || return 1
+
+ # zap!
+ if service_started "${SVCNAME}"; then
+ mark_service_stopped "${SVCNAME}"
+ fi
+
+ ebegin "Gracefully stopping 389 Directory Server Admin (apache2)"
+ ${APACHE2} ${APACHE2_OPTS} -k graceful-stop
+ eend ${?}
+}
+
+modules() {
+ checkconfig || return 1
+
+ ${APACHE2} ${APACHE2_OPTS} -M 2>&1
+}
+
+fullstatus() {
+ LYNX="${LYNX:-lynx -dump}"
+ STATUSURL="${STATUSURL:-http://localhost/server-status}"
+
+ if ! service_started "${SVCNAME}"; then
+ eerror "${SVCNAME} not started"
+ elif ! type -p ${LYNX} 2>&1 >/dev/null; then
+ eerror "lynx not found! you need to emerge www-client/lynx"
+ else
+ ${LYNX} ${STATUSURL}
+ fi
+}
+
+configdump() {
+ LYNX="${LYNX:-lynx -dump}"
+ INFOURL="${INFOURL:-http://localhost/server-info}"
+
+ checkconfd || return 1
+
+ if ! service_started "${SVCNAME}"; then
+ eerror "${SVCNAME} not started"
+ else
+ echo "${APACHE2} started with '${APACHE2_OPTS}'"
+ for i in config server list; do
+ ${LYNX} "${INFOURL}/?${i}" | sed '/Apache Server Information/d;/^[[:space:]]\+[_]\+$/Q'
+ done
+ fi
+}
diff --git a/net-nds/389-admin/files/restart-ds-admin b/net-nds/389-admin/files/restart-ds-admin
new file mode 100644
index 000000000000..1f0cb71769d2
--- /dev/null
+++ b/net-nds/389-admin/files/restart-ds-admin
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# Copyright (c) 2007-2009, Mario Fetka <mario-fetka@gmx.at>
+#
+# Licensed under the GNU General Public License, v2
+
+rc-config restart 389-admin
diff --git a/net-nds/389-admin/files/start-ds-admin b/net-nds/389-admin/files/start-ds-admin
new file mode 100644
index 000000000000..1131e1d41880
--- /dev/null
+++ b/net-nds/389-admin/files/start-ds-admin
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# Copyright (c) 2007-2009, Mario Fetka <mario-fetka@gmx.at>
+#
+# Licensed under the GNU General Public License, v2
+
+rc-config start 389-admin
diff --git a/net-nds/389-admin/files/stop-ds-admin b/net-nds/389-admin/files/stop-ds-admin
new file mode 100644
index 000000000000..31f841f5e932
--- /dev/null
+++ b/net-nds/389-admin/files/stop-ds-admin
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# Copyright (c) 2007-2009, Mario Fetka <mario-fetka@gmx.at>
+#
+# Licensed under the GNU General Public License, v2
+
+rc-config stop 389-admin
diff --git a/net-nds/389-admin/metadata.xml b/net-nds/389-admin/metadata.xml
new file mode 100644
index 000000000000..2379d9d2267d
--- /dev/null
+++ b/net-nds/389-admin/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+</maintainer>
+<longdescription>
+389 Administration Server is an HTTP agent that provides management features
+for 389 Directory Server. It provides some management web apps that can
+be used through a web browser. It provides the authentication, access control,
+and CGI utilities used by the console.</longdescription>
+</pkgmetadata>