dev-util/gtk-builder-convert: Version bump
[gentoo.git] / dev-util / artifactory-bin / artifactory-bin-4.7.7.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 # Using a binary ebuild until a source ebuild is doable.
6 # This is currently blocked by two major bugs upstream:
7 # A lack of documented build instructions - https://www.jfrog.com/jira/browse/RTFACT-8960
8 # A lack of source releases - https://www.jfrog.com/jira/browse/RTFACT-8961
9
10 EAPI=6
11
12 inherit user
13
14 MY_P="${P/-bin}"
15 MY_PN="${PN/-bin}"
16 MY_PV="${PV/-bin}"
17
18 DESCRIPTION="The world's most advanced repository manager for maven"
19 HOMEPAGE="http://www.jfrog.org/products.php"
20 SRC_URI="https://bintray.com/artifact/download/jfrog/artifactory/jfrog-artifactory-oss-${MY_PV}.zip -> ${MY_P}.zip"
21
22 LICENSE="LGPL-3+"
23 SLOT="0"
24 KEYWORDS="~x86 ~amd64"
25 IUSE="ssl"
26
27 RDEPEND=">=virtual/jre-1.8"
28 DEPEND=">=virtual/jdk-1.8
29                 app-arch/unzip"
30
31 S="${WORKDIR}/${MY_PN}-oss-${MY_PV}"
32
33 pkg_setup() {
34         enewgroup artifactory
35         enewuser artifactory -1 /bin/sh -1 artifactory
36 }
37
38 src_prepare() {
39         default
40
41         if use ssl ; then
42                 cp "${FILESDIR}/artifactory.xml" tomcat/conf/Catalina/localhost/artifactory.xml || die
43                 cp "${FILESDIR}/server.xml" tomcat/conf/server.xml || die
44         fi
45
46         # Reverse https://www.jfrog.com/jira/browse/RTFACT-7123
47         sed -i -e "s%artifactory.repo.global.disabled=true%artifactory.repo.global.disabled=false%g;" \
48                 etc/artifactory.system.properties || die
49
50         # See FIXME in src_install(), this can probably go away,
51         # but catalina.sh may need to be fixed for that:
52         sed -i -e "s%/etc/opt/jfrog/artifactory/default%/etc/conf.d/${MY_PN}%g;" \
53                 misc/service/setenv.sh || die
54 }
55
56 src_install() {
57         local ARTIFACTORY_HOME="/opt/artifactory"
58         local TOMCAT_HOME="${ARTIFACTORY_HOME}/tomcat"
59
60         insinto ${ARTIFACTORY_HOME}
61         doins -r etc logs misc tomcat webapps
62
63         dodir /etc/opt/jfrog
64         dosym ${ARTIFACTORY_HOME}/etc /etc/opt/jfrog/artifactory
65
66         dosym ${ARTIFACTORY_HOME}/logs /var/log/artifactory
67
68         exeinto ${ARTIFACTORY_HOME}/bin
69         doexe bin/*
70
71         # FIXME: this is called by catalina.sh (it echoes the variables before starting
72         # artifactory, as well as makes sure log dir, etc. exists). Those directories
73         # could probably be moved to the ebuild and the script removed from catalina.sh
74         # without consequence (and quieter starts). Would need to check if CATALINA_*
75         # variables are actually used anywhere (from reading code don't appear to be
76         # actually needed)
77         exeinto ${TOMCAT_HOME}/bin
78         doexe misc/service/setenv.sh
79         doexe tomcat/bin/*
80
81         keepdir ${ARTIFACTORY_HOME}/backup
82         keepdir ${ARTIFACTORY_HOME}/data
83         keepdir ${ARTIFACTORY_HOME}/run
84         keepdir ${ARTIFACTORY_HOME}/work
85         keepdir ${TOMCAT_HOME}/logs/catalina
86         keepdir ${TOMCAT_HOME}/temp
87         keepdir ${TOMCAT_HOME}/work
88         keepdir /var/opt/jfrog/artifactory/run
89
90         newconfd "${FILESDIR}/confd" ${MY_PN}
91         newinitd "${FILESDIR}/initd" ${MY_PN}
92
93         fowners -R artifactory:artifactory ${ARTIFACTORY_HOME}
94         fperms -R u+w ${TOMCAT_HOME}/work
95 }