alpha-quadrant/dev-java/apache-archiva/apache-archiva-2.2.7.ebuild

76 lines
1.6 KiB
Bash
Raw Normal View History

# Copyright 1999-2019 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=8
inherit java-pkg-2
DESCRIPTION="The Build Artifact Repository Manager"
ARCHBASEPAGE="http://archiva.apache.org/"
SRC_URI="mirror://apache/archiva/${PV}/binaries/${P}-bin.tar.gz"
HOMEPAGE="https://archiva.apache.org/"
LICENSE="apache-2.0"
SLOT="0"
KEYWORDS="~amd64"
IUSE="mysql"
DEPEND="
acct-group/archiva
acct-user/archiva
mysql? ( dev-java/jdbc-mysql )
app-arch/unzip
>=virtual/jre-1.8
"
RDEPEND="
${DEPEND}
"
EANT_BUILD_TARGET=""
EANT_DOC_TARGET=""
ARCHBASE="/var/lib/${PN}"
src_prepare() {
default
rm lib/{*.dll,*-solaris-*,*-macosx-*}
rm bin/{*.bat,*-windows-*,*-solaris-*,*-macosx-*}
rm lib/libwrapper-linux-x86-32.so
sed -i \
-e "s!set.default.ARCHIVA_BASE=.*!set.default.ARCHIVA_BASE=${ARCHBASE}!g" \
-e "s!wrapper\.working\.dir=.*!wrapper.working.dir=/opt/${P}!g" \
conf/wrapper.conf
sed -i -e "s!uname -p!uname -m!g" bin/archiva
}
src_install() {
diropts -m0775 -o archiva -g archiva
keepdir ${ARCHBASE}/{data,temp}
keepdir /var/log/${PN}
insinto /etc/${PN}
doins conf/*
chown archiva:archiva conf/archiva.xml
dosym /etc/${PN} ${ARCHBASE}/conf
dosym /var/log/${PN} ${ARCHBASE}/logs
insinto /opt/${P}
doins -r apps contexts lib
doins LICENSE NOTICE
exeinto /opt/${P}/bin
doexe bin/{wrapper-linux-x86-64,archiva}
sed -e "s!##ARCHIVA##!${P}!g" \
-e "s!##ARCHBASE##!${ARCHBASE}!g" \
${FILESDIR}/apache-archiva.conf.d > apache-archiva.conf.d
newinitd ${FILESDIR}/apache-archiva.init.d ${PN}
newconfd apache-archiva.conf.d ${PN}
}