alpha-quadrant/dev-java/artifactory/artifactory-2.6.4.ebuild

104 lines
3.1 KiB
Bash
Raw Normal View History

2011-05-30 09:18:46 +02:00
2011-05-30 11:44:15 +02:00
EAPI=2
2011-05-30 09:18:46 +02:00
2011-05-30 11:44:15 +02:00
inherit eutils
2011-05-30 09:18:46 +02:00
DESCRIPTION="Artifactory Maven Artifact Server"
HOMEPAGE="http://www.jfrog.org/products.php"
SLOT="0"
2011-11-22 15:02:54 +01:00
RESTRICT="mirror"
2011-05-30 11:44:15 +02:00
SRC_URI="mirror://sourceforge/${PN}/${P}.zip"
KEYWORDS="~amd64 ~x86"
2011-05-30 09:18:46 +02:00
2011-05-30 11:44:15 +02:00
LICENSE="LGPL-3"
IUSE="mysql derby postgres"
2011-05-30 09:18:46 +02:00
2011-11-23 10:52:59 +01:00
RDEPEND=">=virtual/jre-1.5
dev-java/jsr305
mysql? ( dev-java/jdbc-mysql )
"
2011-11-22 15:02:54 +01:00
DEPEND=">=virtual/jdk-1.5
dev-java/jsr305
mysql? ( dev-java/jdbc-mysql )
"
2011-05-30 09:18:46 +02:00
2011-05-30 11:44:15 +02:00
ARTIFACTORY_HOME=/var/lib/${PN}
ARTIFACTORY_INSTALL=/usr/share/${PN}
ARTIFACTORY_USER=artifact
2011-05-30 09:18:46 +02:00
pkg_setup() {
enewgroup artifact
2011-05-30 11:44:15 +02:00
enewuser ${ARTIFACTORY_USER} -1 /bin/sh -1 artifact
2011-05-30 09:18:46 +02:00
}
2011-05-30 11:44:15 +02:00
src_install() {
cd "${S}/bin"
ls | grep -E "\.(bat|exe)" | xargs rm || die "remove failed"
dodir ${ARTIFACTORY_HOME}
dodir ${ARTIFACTORY_INSTALL}
diropts -m775 -o ${ARTIFACTORY_USER} -g artifact
keepdir /etc/artifactory
keepdir /etc/artifactory/plugins/
keepdir ${ARTIFACTORY_HOME}/
keepdir ${ARTIFACTORY_HOME}/data/
keepdir ${ARTIFACTORY_HOME}/work/
keepdir ${ARTIFACTORY_HOME}/backup/
keepdir /var/log/artifactory/
keepdir /var/run/artifactory/
keepdir /var/tmp/artifactory/
dosym /var/log/artifactory ${ARTIFACTORY_HOME}/logs
dosym /etc/artifactory ${ARTIFACTORY_HOME}/etc
CONFIG=${D}/etc/artifactory/default
echo "#!/bin/bash" >> ${CONFIG}
echo "#export ARTIFACTORY_CONSOLE=/var/logs/artifactoy/consoleout.log" >> ${CONFIG}
echo "#export JAVA_HOME=$(java-config --jre-home)" >> ${CONFIG}
echo "export ARTIFACTORY_HOME=${ARTIFACTORY_HOME}" >> ${CONFIG}
echo "export ARTIFACTORY_USER=${ARTIFACTORY_USER}" >> ${CONFIG}
# remove unneeded configs
rm -r ${S}/etc/repo/*mssql
2011-11-22 15:02:54 +01:00
rm -r ${S}/etc/repo/*oracle*
2011-05-30 11:44:15 +02:00
if ! use derby; then
rm -r ${S}/etc/repo/*derby
fi
if ! use mysql; then
rm -r ${S}/etc/repo/*mysql
2011-11-23 10:52:59 +01:00
else
dosym $(java-config -p jdbc-mysql) ${ARTIFACTORY_INSTALL}/lib/jdbc-mysql.jar
dosym $(java-config -p c3p0) ${ARTIFACTORY_INSTALL}/lib/c3p0.jar
2011-05-30 11:44:15 +02:00
fi
if ! use postgres; then
rm -r ${S}/etc/repo/*postgresql
2011-11-23 10:52:59 +01:00
else
dosym $(java-config -p jdbc-postgresql) ${ARTIFACTORY_INSTALL}/lib/jdbc-postgresql.jar
2011-05-30 11:44:15 +02:00
fi
2011-11-22 15:02:54 +01:00
chown ${ARTIFACTORY_USER}:artifact ${S}/etc/repo
# remove windows-wrapper
2011-05-30 11:44:15 +02:00
rm ${S}/lib/wrapper*
sed -i -e "s:<SystemProperty name=\"artifactory.home\" default=\"..\"/>/webapps:${ARTIFACTORY_INSTALL}/webapps:" "${S}"/etc/jetty.xml
sed -i -e "s:<SystemProperty name=\"artifactory.home\" default=\"..\"/>/logs:/var/log/artifactory:" "${S}"/etc/jetty.xml
2011-05-30 09:18:46 +02:00
cd "${S}"
2011-05-30 11:44:15 +02:00
cp -pPR clilib lib webapps ${PN}.jar "${D}${ARTIFACTORY_INSTALL}" || die "failed to copy libs"
cp -pPR etc/* "${D}/etc/artifactory" || die "failed to copy conf"
2011-05-30 09:18:46 +02:00
2011-05-30 11:44:15 +02:00
sed -i -e "s:CLI_DIR=\`dirname \$0\`:CLI_DIR=${ARTIFACTORY_INSTALL}/clilib:" "${S}"/bin/artadmin
sed -i -e "s:\`dirname \"\$0\"\`\/\.\.:${ARTIFACTORY_INSTALL}:" "${S}"/bin/artifactory.sh
2011-05-30 09:18:46 +02:00
2011-05-30 11:44:15 +02:00
exeinto /usr/bin
doexe bin/artadmin
2011-05-30 09:18:46 +02:00
2011-05-30 11:44:15 +02:00
newinitd "${FILESDIR}"/artifactory.initd artifactory
newconfd "${FILESDIR}"/artifactory.confd artifactory
elog "Artifact storage is /var/lib/artifact. Ensure that there is enough space."
elog "The default password for user 'admin' is 'password'."
2011-11-22 15:02:54 +01:00
elog "After upgrading clean up the jetty-dir '${ARTIFACTORY_INSTALL}/work'"
2011-05-30 11:44:15 +02:00
}