Gentoo Archives: gentoo-commits

From: Austin English <wizardedit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/artifactory-bin/
Date: Tue, 07 Mar 2017 00:22:41
Message-Id: 1488846148.9a571e496e8e66cd5417bde570e53549bd87efa4.wizardedit@gentoo
1 commit: 9a571e496e8e66cd5417bde570e53549bd87efa4
2 Author: Austin English <wizardedit <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 7 00:22:07 2017 +0000
4 Commit: Austin English <wizardedit <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 7 00:22:28 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a571e49
7
8 dev-util/artifactory-bin: add limits.d file
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11
12 .../artifactory-bin-4.16.0-r1.ebuild | 110 +++++++++++++++++++++
13 1 file changed, 110 insertions(+)
14
15 diff --git a/dev-util/artifactory-bin/artifactory-bin-4.16.0-r1.ebuild b/dev-util/artifactory-bin/artifactory-bin-4.16.0-r1.ebuild
16 new file mode 100644
17 index 00000000000..cb6e42f39ff
18 --- /dev/null
19 +++ b/dev-util/artifactory-bin/artifactory-bin-4.16.0-r1.ebuild
20 @@ -0,0 +1,110 @@
21 +# Copyright 1999-2017 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +# Using a binary ebuild until a source ebuild is doable.
25 +# This was previously blocked by two major bugs upstream:
26 +# A lack of documented build instructions - https://www.jfrog.com/jira/browse/RTFACT-8960
27 +# A lack of source releases - https://www.jfrog.com/jira/browse/RTFACT-8961
28 +# Upstream now releases source and instructions (yay!), but most of artifactory's
29 +# dependencies are not in portage yet.
30 +
31 +EAPI=6
32 +
33 +inherit user
34 +
35 +MY_P="${P/-bin}"
36 +MY_PN="${PN/-bin}"
37 +MY_PV="${PV/-bin}"
38 +
39 +DESCRIPTION="The world's most advanced repository manager for maven"
40 +HOMEPAGE="http://www.jfrog.org/products.php"
41 +SRC_URI="https://bintray.com/artifact/download/jfrog/artifactory/jfrog-artifactory-oss-${MY_PV}.zip -> ${MY_P}.zip"
42 +
43 +LICENSE="AGPL-3+"
44 +SLOT="0"
45 +KEYWORDS="~x86 ~amd64"
46 +IUSE="ssl"
47 +
48 +RDEPEND=">=virtual/jre-1.8"
49 +DEPEND=">=virtual/jdk-1.8
50 + app-arch/unzip"
51 +
52 +S="${WORKDIR}/${MY_PN}-oss-${MY_PV}"
53 +
54 +pkg_setup() {
55 + enewgroup artifactory
56 + enewuser artifactory -1 /bin/sh -1 artifactory
57 +}
58 +
59 +limitsdfile=40-${MY_PN}.conf
60 +
61 +print_limitsdfile() {
62 + printf "# Start of ${limitsdfile} from ${P}\n\n"
63 + printf "@${MY_PN}\t-\tnofile\t32000\n"
64 + printf "\n# End of ${limitsdfile} from ${P}\n"
65 +}
66 +
67 +src_prepare() {
68 + default
69 +
70 + if use ssl ; then
71 + cp "${FILESDIR}/artifactory.xml" tomcat/conf/Catalina/localhost/artifactory.xml || die
72 + cp "${FILESDIR}/server.xml" tomcat/conf/server.xml || die
73 + fi
74 +
75 + # Reverse https://www.jfrog.com/jira/browse/RTFACT-7123
76 + sed -i -e "s%artifactory.repo.global.disabled=true%artifactory.repo.global.disabled=false%g;" \
77 + etc/artifactory.system.properties || die
78 +
79 + # See FIXME in src_install(), this can probably go away,
80 + # but catalina.sh may need to be fixed for that:
81 + sed -i -e "s%/etc/opt/jfrog/artifactory/default%/etc/conf.d/${MY_PN}%g;" \
82 + misc/service/setenv.sh || die
83 +
84 + einfo "Generating ${limitsdfile}"
85 + print_limitsdfile > "${S}/${limitsdfile}"
86 +}
87 +
88 +src_install() {
89 + local ARTIFACTORY_HOME="/opt/artifactory"
90 + local TOMCAT_HOME="${ARTIFACTORY_HOME}/tomcat"
91 +
92 + insinto ${ARTIFACTORY_HOME}
93 + doins -r etc logs misc tomcat webapps
94 +
95 + dodir /etc/opt/jfrog
96 + dosym ${ARTIFACTORY_HOME}/etc /etc/opt/jfrog/artifactory
97 +
98 + dosym ${ARTIFACTORY_HOME}/logs /var/log/artifactory
99 +
100 + exeinto ${ARTIFACTORY_HOME}/bin
101 + doexe bin/*
102 +
103 + # FIXME: this is called by catalina.sh (it echoes the variables before starting
104 + # artifactory, as well as makes sure log dir, etc. exists). Those directories
105 + # could probably be moved to the ebuild and the script removed from catalina.sh
106 + # without consequence (and quieter starts). Would need to check if CATALINA_*
107 + # variables are actually used anywhere (from reading code don't appear to be
108 + # actually needed)
109 + exeinto ${TOMCAT_HOME}/bin
110 + doexe misc/service/setenv.sh
111 + doexe tomcat/bin/*
112 +
113 + keepdir ${ARTIFACTORY_HOME}/backup
114 + keepdir ${ARTIFACTORY_HOME}/data
115 + keepdir ${ARTIFACTORY_HOME}/run
116 + keepdir ${ARTIFACTORY_HOME}/work
117 + keepdir ${TOMCAT_HOME}/logs/catalina
118 + keepdir ${TOMCAT_HOME}/temp
119 + keepdir ${TOMCAT_HOME}/work
120 + keepdir /var/opt/jfrog/artifactory/run
121 +
122 + newconfd "${FILESDIR}/confd" ${MY_PN}
123 + newinitd "${FILESDIR}/initd-r2" ${MY_PN}
124 +
125 + fowners -R artifactory:artifactory ${ARTIFACTORY_HOME}
126 + fperms -R u+w ${TOMCAT_HOME}/work
127 +
128 + insinto /etc/security/limits.d
129 + doins "${S}/${limitsdfile}"
130 +}