# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=4 inherit eutils prefix user 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() { ebegin "Creating apacheds user and group" enewgroup ${PN} enewuser ${PN} -1 -1 -1 ${PN} eend $? } src_install() { insinto /usr/share/${PN} doins lib/apacheds*.jar keepdir "/var/lib/${PN}" fowners apacheds:apacheds "/var/lib/${PN}" fperms 750 "/var/lib/${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}" insinto "/etc/default/${PN}" cp instances/default/conf/* ${T} sed -i -e "s|\(layout\.ConversionPattern=\).*$|\1%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n|g" \ "${T}/log4j.properties" doins "${T}"/log4j.properties "${T}"/config.ldif 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} }