mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-util/artifactory-bin: treeclean
Bug: https://bugs.gentoo.org/834501 Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>
This commit is contained in:
@@ -1 +0,0 @@
|
||||
DIST artifactory-6.3.3.zip 98166641 BLAKE2B 33d760bc0f763ba0d8e091ce5484b3a90df4e57f291ea7a96a69bed13579c3c17af0005f95dbda847b2ab428d7dc36ddbee594d008f6e3badbb04e45c3b5dd89 SHA512 12f545d5e66b70e35d8b9967baadcfb503df7457bc48957a80b38d447cc9f024ce8f33b2463da65f5616161906bc64652fdd042446c5e8615e24ecc7f23a527b
|
||||
@@ -1,110 +0,0 @@
|
||||
# Copyright 1999-2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# Using a binary ebuild until a source ebuild is doable.
|
||||
# This was previously blocked by two major bugs upstream:
|
||||
# A lack of documented build instructions - https://www.jfrog.com/jira/browse/RTFACT-8960
|
||||
# A lack of source releases - https://www.jfrog.com/jira/browse/RTFACT-8961
|
||||
# Upstream now releases source and instructions (yay!), but most of artifactory's
|
||||
# dependencies are not in portage yet.
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit java-pkg-2 systemd
|
||||
|
||||
MY_P="${P/-bin}"
|
||||
MY_PN="${PN/-bin}"
|
||||
MY_PV="${PV/-bin}"
|
||||
|
||||
DESCRIPTION="The world's most advanced repository manager for maven"
|
||||
HOMEPAGE="http://www.jfrog.org/products.php"
|
||||
SRC_URI="https://bintray.com/artifact/download/jfrog/artifactory/jfrog-artifactory-oss-${MY_PV}.zip -> ${MY_P}.zip"
|
||||
S="${WORKDIR}/${MY_PN}-oss-${MY_PV}"
|
||||
|
||||
LICENSE="AGPL-3+"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="ssl"
|
||||
|
||||
DEPEND="
|
||||
acct-group/artifactory
|
||||
acct-user/artifactory
|
||||
"
|
||||
RDEPEND="
|
||||
${DEPEND}
|
||||
>=virtual/jre-1.8
|
||||
"
|
||||
BDEPEND="app-arch/unzip"
|
||||
|
||||
limitsdfile=40-${MY_PN}.conf
|
||||
|
||||
print_limitsdfile() {
|
||||
printf "# Start of ${limitsdfile} from ${P}\n\n"
|
||||
printf "@${MY_PN}\t-\tnofile\t32000\n"
|
||||
printf "\n# End of ${limitsdfile} from ${P}\n"
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
if use ssl ; then
|
||||
cp "${FILESDIR}/artifactory.xml" tomcat/conf/Catalina/localhost/artifactory.xml || die
|
||||
cp "${FILESDIR}/server.xml" tomcat/conf/server.xml || die
|
||||
fi
|
||||
|
||||
# Reverse https://www.jfrog.com/jira/browse/RTFACT-7123
|
||||
sed -i -e "s%artifactory.repo.global.disabled=true%artifactory.repo.global.disabled=false%g;" \
|
||||
etc/artifactory.system.properties || die
|
||||
|
||||
# See FIXME in src_install(), this can probably go away,
|
||||
# but catalina.sh may need to be fixed for that:
|
||||
sed -i -e "s%/etc/opt/jfrog/artifactory/default%/etc/conf.d/${MY_PN}%g;" \
|
||||
misc/service/setenv.sh || die
|
||||
|
||||
einfo "Generating ${limitsdfile}"
|
||||
print_limitsdfile > "${S}/${limitsdfile}"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local ARTIFACTORY_HOME="/opt/artifactory"
|
||||
local TOMCAT_HOME="${ARTIFACTORY_HOME}/tomcat"
|
||||
|
||||
insinto ${ARTIFACTORY_HOME}
|
||||
doins -r etc misc tomcat webapps
|
||||
|
||||
dodir /etc/opt/jfrog
|
||||
dosym ${ARTIFACTORY_HOME}/etc /etc/opt/jfrog/artifactory
|
||||
|
||||
exeinto ${ARTIFACTORY_HOME}/bin
|
||||
doexe bin/*
|
||||
|
||||
# FIXME: this is called by catalina.sh (it echoes the variables before starting
|
||||
# artifactory, as well as makes sure log dir, etc. exists). Those directories
|
||||
# could probably be moved to the ebuild and the script removed from catalina.sh
|
||||
# without consequence (and quieter starts). Would need to check if CATALINA_*
|
||||
# variables are actually used anywhere (from reading code don't appear to be
|
||||
# actually needed)
|
||||
exeinto ${TOMCAT_HOME}/bin
|
||||
doexe misc/service/setenv.sh
|
||||
doexe tomcat/bin/*
|
||||
|
||||
keepdir ${ARTIFACTORY_HOME}/backup
|
||||
keepdir ${ARTIFACTORY_HOME}/data
|
||||
keepdir ${ARTIFACTORY_HOME}/run
|
||||
keepdir ${ARTIFACTORY_HOME}/work
|
||||
keepdir ${TOMCAT_HOME}/logs/catalina
|
||||
keepdir ${TOMCAT_HOME}/temp
|
||||
keepdir ${TOMCAT_HOME}/work
|
||||
keepdir /var/opt/jfrog/artifactory/run
|
||||
|
||||
newconfd "${FILESDIR}/confd" ${MY_PN}
|
||||
newinitd "${FILESDIR}/initd-r3" ${MY_PN}
|
||||
|
||||
systemd_dounit misc/service/artifactory.service
|
||||
|
||||
fowners -R artifactory:artifactory ${ARTIFACTORY_HOME}
|
||||
fperms -R u+w ${TOMCAT_HOME}/work
|
||||
|
||||
insinto /etc/security/limits.d
|
||||
doins "${S}/${limitsdfile}"
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
<Context path="/artifactory" docBase="${artifactory.home}/webapps/artifactory.war" processTlds="false">
|
||||
<Manager pathname="" />
|
||||
<Valve className="org.apache.catalina.valves.RemoteIpValve" protocolHeader="x-forwarded-proto"/>
|
||||
</Context>
|
||||
@@ -1,5 +0,0 @@
|
||||
ARTIFACTORY_HOME=/opt/artifactory
|
||||
ARTIFACTORY_PID=$ARTIFACTORY_HOME/run/artifactory.pid
|
||||
ARTIFACTORY_USER=artifactory
|
||||
JAVA_OPTIONS="-server -Xms2g -Xmx8g -Xss256k -XX:PermSize=128m -XX:MaxPermSize=256m -XX:+UseG1GC"
|
||||
TOMCAT_HOME=$ARTIFACTORY_HOME/tomcat
|
||||
@@ -1,165 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Manages the services needed to run Artifactory on a dedicated Tomcat"
|
||||
command="/opt/artifactory/tomcat/bin/catalina.sh"
|
||||
pidfile="/opt/artifactory/run/artifactory.pid"
|
||||
procname="artifactory"
|
||||
user=${ARTIFACTORY_USER:-artifactory}
|
||||
group=${group:-artifactory}
|
||||
|
||||
# Artifactory can be very slow to start, and without locking,
|
||||
# restarting via runscript is very error prone
|
||||
CATALINA_LOCK_FILE="$(dirname $pidfile)/lock"
|
||||
|
||||
CATALINA_MGMT_PORT=8015
|
||||
REQUIRED_JAVA_VERSION="1.8"
|
||||
START_TIMEOUT=300
|
||||
|
||||
# Helper functions:
|
||||
is_mgmt_port_used() {
|
||||
mgmt_port_used=$(netstat -vatn | grep LISTEN | grep $CATALINA_MGMT_PORT | wc -l)
|
||||
}
|
||||
|
||||
get_pid_info() {
|
||||
pidValue=""
|
||||
javaPs=""
|
||||
if [ -e "$pidfile" ]; then
|
||||
pidValue=$(cat $pidfile)
|
||||
if [ -n "$pidValue" ]; then
|
||||
javaPs="$(ps -p $pidValue | grep java)"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
depend() {
|
||||
need net nginx
|
||||
use dns logger netmount
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
if [ -z "$ARTIFACTORY_HOME" ] || [ ! -d "$ARTIFACTORY_HOME" ]; then
|
||||
eerror "Artifactory home folder not defined or does not exists at $ARTIFACTORY_HOME"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z "$pidfile" ]; then
|
||||
eerror "Artifactory pid destination pidfile was not set!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z "$TOMCAT_HOME" ] || [ ! -d "$TOMCAT_HOME" ]; then
|
||||
eerror "Tomcat Artifactory folder not defined or does not exists at $TOMCAT_HOME"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z "$ARTIFACTORY_USER" ]; then
|
||||
ARTIFACTORY_USER=$user
|
||||
fi
|
||||
|
||||
current_open_file_limit=$(su -l $ARTIFACTORY_USER -c "ulimit -n")
|
||||
desired_open_file_limit=32000
|
||||
if [ "$current_open_file_limit" != "unlimited" ] && [ $current_open_file_limit -lt $desired_open_file_limit ]; then
|
||||
eerror "Maximum number of open files ($current_open_file_limit) is too small!"
|
||||
eerror "You should add:"
|
||||
eerror "artifactory soft nofile $desired_open_file_limit"
|
||||
eerror "artifactory hard nofile $desired_open_file_limit"
|
||||
eerror "to your /etc/security/limits.conf file."
|
||||
return 1
|
||||
fi
|
||||
|
||||
current_max_process_limit=$(su -l $ARTIFACTORY_USER -c "ulimit -u")
|
||||
desired_max_process_limit=1024
|
||||
if [ "$current_max_process_limit" != "unlimited" ] && [ $current_max_process_limit -lt $desired_max_process_limit ]; then
|
||||
eerror "Number of processes $current_max_process_limit is too small!"
|
||||
eerror "You should add:"
|
||||
eerror "artifactory soft nproc $desired_max_process_limit"
|
||||
eerror "artifactory hard nproc $desired_max_process_limit"
|
||||
eerror "to your /etc/security/limits.conf file."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -n "$JAVA_HOME" ] && [ -x "$JAVA_HOME/bin/java" ]; then
|
||||
einfo "Found java executable in $JAVA_HOME"
|
||||
_java="$JAVA_HOME/bin/java"
|
||||
elif command -v java > dev/null 2>&1 ; then
|
||||
_java=java
|
||||
else
|
||||
eerror "No Java Runtime Environment (jre) found! At least java-$REQUIRED_JAVA_VERSION is required."
|
||||
return 1
|
||||
fi
|
||||
if [ "$_java" ]; then
|
||||
java_version=$($_java -version 2>&1 | grep 'version' | cut -d ' ' -f3 | tr -d \")
|
||||
java_major=$(echo $java_version | cut -d . -f1-2)
|
||||
if [ "$java_major" != "$REQUIRED_JAVA_VERSION" ] ; then
|
||||
eerror "Java version $java_version is too old, java-$REQUIRED_JAVA_VERSION is required."
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# We have to pass start/stop through to catalina.sh, which doesn't understand restart (and restart can't be overridden in OpenRC):
|
||||
start() {
|
||||
get_pid_info
|
||||
is_mgmt_port_used
|
||||
if [ $mgmt_port_used -ne 0 ] || [ -n "$javaPs" ]; then
|
||||
eerror "$RC_SERVICE already started!"
|
||||
return 1
|
||||
else
|
||||
ebegin "Starting $RC_SERVICE"
|
||||
start-stop-daemon --exec $command --pidfile $pidfile --user $user:$group --wait $START_TIMEOUT start
|
||||
RETVAL=$?
|
||||
eend $RETVAL "start-stop-daemon failed to start $RC_SERVICE"
|
||||
fi
|
||||
|
||||
|
||||
is_mgmt_port_used
|
||||
seconds=1
|
||||
while [ $mgmt_port_used -eq 0 ] && [ $seconds -lt $START_TIMEOUT ]; do
|
||||
sleep 1
|
||||
seconds=$((seconds+1))
|
||||
is_mgmt_port_used
|
||||
done
|
||||
if [ $mgmt_port_used -eq 0 ]; then
|
||||
eerror "$RC_SERVICE did not start in $START_TIMEOUT seconds!"
|
||||
return 1
|
||||
elif [ $mgmt_port_used -eq 1 ]; then
|
||||
einfo "$RC_SERVICE started"
|
||||
[ $RETVAL=0 ] && touch $CATALINA_LOCK_FILE
|
||||
else
|
||||
eerror "Got unexpected result when checking port $CATALINA_MGMT_PORT"
|
||||
return 1
|
||||
fi
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping $RC_SERVICE"
|
||||
start-stop-daemon --stop --pidfile $pidfile --retry $START_TIMEOUT stop
|
||||
RETVAL=$?
|
||||
eend $RETVAL "Failed to stop $RC_SERVICE!"
|
||||
|
||||
[ $RETVAL=0 ] && rm -f "$CATALINA_LOCK_FILE" "$pidfile"
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
status() {
|
||||
is_mgmt_port_used
|
||||
if [ $mgmt_port_used -eq 0 ]; then
|
||||
if [ -e "$pidfile" ]; then
|
||||
eerror "$RC_SERVICE stopped but the pid file $pidfile still exists!"
|
||||
RETVAL=1
|
||||
else
|
||||
if [ -e "$CATALINA_LOCK_FILE" ]; then
|
||||
eerror "$RC_SERVICE is stopped but the lock file $CATALINA_LOCK_FILE still exists!"
|
||||
RETVAL=2
|
||||
else
|
||||
eerror "$RC_SERVICE is stopped"
|
||||
RETVAL=3
|
||||
fi
|
||||
fi
|
||||
else
|
||||
einfo "$RC_SERVICE is running"
|
||||
RETVAL=0
|
||||
fi
|
||||
return $RETVAL
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<Server port="8015" shutdown="SHUTDOWN">
|
||||
|
||||
<Service name="Catalina">
|
||||
<Connector port="8081" protocol="HTTP/1.1"
|
||||
maxThreads="500" minSpareThreads="20"
|
||||
enableLookups="false" disableUploadTimeout="true"
|
||||
backlog="100"/>
|
||||
<!-- This is the optional AJP connector -->
|
||||
<Connector port="8019" protocol="AJP/1.3"/>
|
||||
|
||||
<Engine name="Catalina" defaultHost="localhost">
|
||||
<Host name="localhost" appBase="webapps"/>
|
||||
</Engine>
|
||||
|
||||
</Service>
|
||||
</Server>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<!-- maintainer-needed -->
|
||||
</pkgmetadata>
|
||||
@@ -763,11 +763,6 @@ dev-python/pkgutil_resolve_name
|
||||
# Removal after 2023-03-01. Bug #890244.
|
||||
www-client/dillo
|
||||
|
||||
# John Helmert III <ajak@gentoo.org> (2023-01-08)
|
||||
# Multiple vulnerabilities include remote code execution, maintainer
|
||||
# needed, removal in 30 days. Bug #834501
|
||||
dev-util/artifactory-bin
|
||||
|
||||
# Sam James <sam@gentoo.org> (2023-01-05)
|
||||
# Breaks reverse dependencies: bug #889694, bug #888579.
|
||||
=sys-fs/btrfs-progs-6.1.1
|
||||
|
||||
Reference in New Issue
Block a user