76 lines
1.7 KiB
Bash
76 lines
1.7 KiB
Bash
# Copyright 1999-2016 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
# $Id$
|
|
|
|
EAPI=5
|
|
|
|
inherit java-pkg-2 user
|
|
|
|
DESCRIPTION="The Build Artifact Repository Manager"
|
|
ARCHBASEPAGE="http://archiva.apache.org/"
|
|
SRC_URI="mirror://apache/archiva/${PV}/binaries/${P}-bin.tar.gz"
|
|
|
|
LICENSE="apache-2.0"
|
|
SLOT="0"
|
|
KEYWORDS="~amd64"
|
|
|
|
IUSE="mysql"
|
|
|
|
COMMON_DEP="mysql? ( dev-java/jdbc-mysql )
|
|
"
|
|
|
|
RDEPEND=">=virtual/jre-1.7
|
|
${COMMON_DEP}"
|
|
DEPEND=">=virtual/jdk-1.7
|
|
app-arch/unzip
|
|
${COMMON_DEP}"
|
|
|
|
EANT_BUILD_TARGET=""
|
|
EANT_DOC_TARGET=""
|
|
ARCHBASE="/var/lib/${PN}"
|
|
|
|
pkg_setup() {
|
|
enewgroup archiva
|
|
enewuser archiva -1 /bin/sh ${ARCHBASE} archiva
|
|
}
|
|
|
|
src_prepare() {
|
|
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}
|
|
}
|