From 1131abbc35a1468e2f957d6a3916472fe08b236a Mon Sep 17 00:00:00 2001 From: Micha Glave Date: Thu, 26 Sep 2013 16:17:38 +0200 Subject: [PATCH] Introducing ApacheDS ebuild --- net-nds/apacheds/Manifest | 4 ++ net-nds/apacheds/apacheds-2.0.0_rc15.ebuild | 55 ++++++++++++++++ net-nds/apacheds/files/apacheds.conf | 25 ++++++++ net-nds/apacheds/files/apacheds.init | 71 +++++++++++++++++++++ 4 files changed, 155 insertions(+) create mode 100644 net-nds/apacheds/Manifest create mode 100644 net-nds/apacheds/apacheds-2.0.0_rc15.ebuild create mode 100644 net-nds/apacheds/files/apacheds.conf create mode 100644 net-nds/apacheds/files/apacheds.init diff --git a/net-nds/apacheds/Manifest b/net-nds/apacheds/Manifest new file mode 100644 index 0000000..7087a67 --- /dev/null +++ b/net-nds/apacheds/Manifest @@ -0,0 +1,4 @@ +AUX apacheds.conf 743 SHA256 d302e492d1c876185241512b75883ac4debbad7a22519d308909065dc149d5b1 SHA512 85d01ef0c5be92d1c3cd9c2d551d00f3717dcac1d58e040caeb8b173f033ab18cb30d084cb9f4215e015b11de7496c09788c99b2e2ba3ee4c2c072bcd381b57f WHIRLPOOL 9c0697483ba9d1ae0f1b1b1efaa832ccafce017aab400cbb53d5da7987b5699828c4ea80a7626a310e049b0ee6e408af75a8b382de7b49b8f1ea6ef98f547ebb +AUX apacheds.init 3141 SHA256 cec6d82bd9a17e8e7f7505e57c5c18f9571d1ec8df4c9a2ccb73e323387a4ada SHA512 58be8ce85e956f6658e5086bd983ce1a75cc0952d3ad16dbc33e78957503f7945315615cefdc90a80f110ef9fb2de86a7de3b3aa257a1a3d5754bd1a6b3100fc WHIRLPOOL d61690dfc742efe2950807d78066dbda6cc83a6b323bee939399bd43df4170722aecd8c61fe4f870093621141e88d088c06f9cc2ac486627b64f43ca5d624d7a +DIST apacheds-2.0.0-M15.tar.gz 9700047 SHA256 9320a1374284af75875c7f895c0283bd282b2e8e16c65ad7d1ad19b6f80f4947 SHA512 4aea1cd95206a92781ca29d7518f8b3b01aebed4f4284eec196abc8bdde0dcdea315eabbf80a03e54c9923c6d683424edfa488a12d69477ea57b527fe22944b6 WHIRLPOOL 6c9ffd6cc73957b71debce91866450d89f4ff28eb43bbd5f9b7701cc22a88bfc03bf553353c50e37d72f6b4eb17dd5d71c98d1441d19ce68b5a036a6c1b1959d +EBUILD apacheds-2.0.0_rc15.ebuild 1429 SHA256 3995cc44138677cc043c3f7af237af366a8418ef5df25780483fb9983e5a50ff SHA512 52ddc916c3fec895ce47f65b0b85c7ac45a68e3a8109a80fb7460264d351b705a548f4385359877db7730618bb4de5c4592f5fa280879506d974f165fbecf521 WHIRLPOOL 2532cc646a425da29d26da43113908d58a3d4b4da9439a0fd63f57c3c95aa8c0e0d67072c88065518f8a04c7f9c6c008472b1a42b42b4e6e09ba56c9e8ab2d50 diff --git a/net-nds/apacheds/apacheds-2.0.0_rc15.ebuild b/net-nds/apacheds/apacheds-2.0.0_rc15.ebuild new file mode 100644 index 0000000..55c0399 --- /dev/null +++ b/net-nds/apacheds/apacheds-2.0.0_rc15.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +inherit eutils prefix +MY_PV="${PV//_rc/-M}" + +DESCRIPTION="LDAP and Kerberos server written in Java" +HOMEPAGE="http://directory.apache.org/apacheds/" +SRC_URI="mirror://apache/directory/apacheds/dist/${MY_PV}/${PN}-${MY_PV}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~x86 ~amd64" +IUSE="" + +DEPEND=">=virtual/jre-1.6" +RDEPEND="${DEPEND}" + +S=${WORKDIR}/${PN}-${MY_PV} + +pkg_setup() { + enewgroup apacheds 288 + enewuser apacheds 288 -1 /dev/null apacheds +} + +src_install() { + insinto /usr/share/${PN} + doins lib/apache*.jar + + keepdir "/var/lib/${PN}" + fowners apacheds:apacheds "/var/lib/${PN}" + fperms 750 "/var/lib/${PN}" + keepdir "/var/run/${PN}" + fowners apacheds:apacheds "/var/run/${PN}" + keepdir "/var/log/${PN}" + fowners apacheds:apacheds "/var/log/${PN}" + fperms 750 "/var/log/${PN}" + keepdir "/var/tmp/${PN}" + fowners apacheds:apacheds "/var/tmp/${PN}" + keepdir "/etc/${PN}" + fowners apacheds:apacheds "/etc/${PN}" + + cp "${FILESDIR}"/apacheds{.conf,.init} "${T}" || die + eprefixify "${T}"/apacheds{.conf,.init} + sed -i -e "s|@SLOT@|${SLOT}|g" \ + -e "s|@INSTANCE_USER@|apacheds|g" \ + -e "s|@INSTANCE_GROUP@|apacheds|g" \ + "${T}"/apacheds{.conf,.init} || die + + newconfd "${T}"/apacheds.conf ${PN} + newinitd "${T}"/apacheds.init ${PN} +} diff --git a/net-nds/apacheds/files/apacheds.conf b/net-nds/apacheds/files/apacheds.conf new file mode 100644 index 0000000..d67cd14 --- /dev/null +++ b/net-nds/apacheds/files/apacheds.conf @@ -0,0 +1,25 @@ +# Set the handle of the JVM to use. If unset uses the system-vm. +# run 'eselect java-vm list' to get possible values. +# +#APACHEDS_JVM="icedtea-7" + +# Additional options to pass to the JVM. +# Example to set library path for tomcat-native: +# JAVA_OPTS="-Djava.library.path=/usr/lib" +# +#JAVA_OPTS="" + +# User/Group of this instance. +APACHEDS_USER=@INSTANCE_USER@ +APACHEDS_GROUP=@INSTANCE_GROUP@ + +# Directory path location of temporary directory the JVM should +# use (java.io.tmpdir). +# Note: This directory must exist and be read/writable by tomcat. +# See #246362 as an example where /var/tmp was deleted on shutdown. +# +#APACHEDS_TMPDIR="/@GENTOO_PORTAGE_EPREFIX@var/tmp/apacheds" + +# Additional options to pass to ApacheDS +# +#APACHEDS_OPTS="" diff --git a/net-nds/apacheds/files/apacheds.init b/net-nds/apacheds/files/apacheds.init new file mode 100644 index 0000000..b7fdefc --- /dev/null +++ b/net-nds/apacheds/files/apacheds.init @@ -0,0 +1,71 @@ +#!/@GENTOO_PORTAGE_EPREFIX@sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +PIDFILE=/@GENTOO_PORTAGE_EPREFIX@var/run/${RC_SVCNAME}.pid + +: ${APACHEDS_HOME:=/@GENTOO_PORTAGE_EPREFIX@var/run/${RC_SVCNAME}} +: ${APACHEDS_BASE:=/@GENTOO_PORTAGE_EPREFIX@var/lib/${RC_SVCNAME}} +: ${APACHEDS_TMPDIR:=/@GENTOO_PORTAGE_EPREFIX@var/tmp/${RC_SVCNAME}} +: ${APACHEDS_USER:=apacheds} +: ${APACHEDS_GROUP:=apacheds} + +export JAVA_HOME=`java-config ${TOMCAT_JVM:+--select-vm ${TOMCAT_JVM}} --jre-home` + +ADS_PWD=/usr/share/apacheds +# Building dynamically the classpath + +depend() { + use logger net +} + +start() { + ebegin "Starting ${RC_SVCNAME}" + + if [ ! -e "${APACHEDS_TMPDIR}" ]; then + eerror "APACHEDS_TMPDIR does not exist. Unable to start tomcat." + eerror "Please see /@GENTOO_PORTAGE_EPREFIX@etc/conf.d/${RC_SVCNAME} for more information." + eend 1 + fi + + ADS_CONTROLS="-Dapacheds.controls=org.apache.directory.api.ldap.codec.controls.cascade.CascadeFactory,org.apache.directory.api.ldap.codec.controls.manageDsaIT.ManageDsaITFactory,org.apache.directory.api.ldap.codec.controls.search.entryChange.EntryChangeFactory,org.apache.directory.api.ldap.codec.controls.search.pagedSearch.PagedResultsFactory,org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory,org.apache.directory.api.ldap.codec.controls.search.subentries.SubentriesFactory,org.apache.directory.api.ldap.extras.controls.ppolicy_impl.PasswordPolicyFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncDoneValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory,org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory" + + ADS_EXTENDED_OPERATIONS="-Dapacheds.extendedOperations=org.apache.directory.api.ldap.extras.extended.ads_impl.cancel.CancelFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.certGeneration.CertGenerationFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulShutdown.GracefulShutdownFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure.StoredProcedureFactory,org.apache.directory.api.ldap.extras.extended.ads_impl.gracefulDisconnect.GracefulDisconnectFactory" + + CLASSPATH= + for i in $(ls $ADS_PWD) + do + CLASSPATH=${CLASSPATH}:$ADS_PWD/${i} + done + + start-stop-daemon --start \ + --quiet --background \ + --chdir "${APACHEDS_TMPDIR}" \ + --user ${APACHEDS_USER}:${APACHEDS_GROUP} \ + --make-pidfile --pidfile ${PIDFILE} \ + --exec ${JAVA_HOME}/bin/java \ + -- \ + ${JAVA_OPTS} \ + ${ADS_CONTROLS} \ + ${ADS_EXTENDED_OPERATIONS} \ + -Dlog4j.configuration=file:/etc/apacheds/log4j.properties \ + -Dapacheds.log.dir=/var/log/${RC_SVCNAME} \ + -Djava.io.tmpdir="${APACHEDS_TMPDIR}" \ + -classpath "${CLASSPATH}" \ + org.apache.directory.server.UberjarMain \ + "${APACHEDS_HOME}" + + eend $? +} + +stop() { + ebegin "Stopping '${RC_SVCNAME}'" + + start-stop-daemon --stop \ + --quiet --retry=60 \ + --pidfile ${PIDFILE} + --signal=3 + + eend $? +} +