summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2016-12-22 09:22:47 +0100
committerPatrick Lauer <patrick@gentoo.org>2016-12-22 09:40:07 +0100
commitc733cae62453824fe4e7f91944bef24a8f40f9e9 (patch)
treeee1e549947e89838429b8ceacf5f4ad17008ad69
parentnet-misc/curl: restore Prefix keywords, bug #597760 (diff)
downloadgentoo-c733cae62453824fe4e7f91944bef24a8f40f9e9.tar.gz
gentoo-c733cae62453824fe4e7f91944bef24a8f40f9e9.tar.bz2
gentoo-c733cae62453824fe4e7f91944bef24a8f40f9e9.zip
app-admin/aerospike-amc-community: Fix init script stop handling
Package-Manager: Portage-2.3.3, Repoman-2.3.1
-rw-r--r--app-admin/aerospike-amc-community/aerospike-amc-community-3.6.13-r1.ebuild64
-rw-r--r--app-admin/aerospike-amc-community/files/amc.init225
2 files changed, 89 insertions, 0 deletions
diff --git a/app-admin/aerospike-amc-community/aerospike-amc-community-3.6.13-r1.ebuild b/app-admin/aerospike-amc-community/aerospike-amc-community-3.6.13-r1.ebuild
new file mode 100644
index 000000000000..0a71ac8aeb70
--- /dev/null
+++ b/app-admin/aerospike-amc-community/aerospike-amc-community-3.6.13-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils user
+
+DESCRIPTION="Web UI based monitoring tool for Aerospike Community Edition Server"
+HOMEPAGE="http://www.aerospike.com"
+SRC_URI="http://www.aerospike.com/artifacts/${PN}/${PV}/${P}.all.x86_64.deb"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="app-crypt/gcr
+ dev-python/eventlet
+ dev-python/flask
+ dev-python/greenlet
+ dev-python/setproctitle
+ www-servers/gunicorn"
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+ default
+ mkdir "${P}"
+ tar -xf data.tar.xz -C "${S}" || die
+ tar -xzf "${S}"/opt/amc.tar.gz -C "${S}"/opt/ || die
+}
+
+src_install() {
+ mv opt/amc/amc/* opt/amc/
+ rm -rf opt/amc/amc
+ rm -f opt/amc/install
+ rm -f opt/amc/bin/uninstall
+ rm -f opt/amc/bin/amc_*.sh
+ rm -f opt/amc/bin/gunicorn
+ rm -rf opt/amc/server/site-packages/
+ rm -rf opt/amc/server/setups/
+
+ insinto /etc/logrotate.d
+ newins opt/amc/config/logrotate amc
+ rm -f opt/amc/config/logrotate
+
+ insinto /etc/cron.daily
+ newins opt/amc/config/logcron amc
+ rm -f opt/amc/config/logcron
+
+ sed -e 's@/tmp/amc.pid@/run/amc.pid@g' -i opt/amc/config/gunicorn_config.py || die
+
+ insinto /etc/amc/config
+ doins -r opt/amc/config/*
+ rm -rf opt/amc/config/
+
+ echo "${PV}" > opt/amc/amc_version
+
+ insinto /opt/amc/
+ doins -r opt/amc/*
+
+ keepdir /var/log/amc
+
+ newinitd "${FILESDIR}"/amc.init2 amc
+}
diff --git a/app-admin/aerospike-amc-community/files/amc.init2 b/app-admin/aerospike-amc-community/files/amc.init2
new file mode 100644
index 000000000000..6ec70eb1eb16
--- /dev/null
+++ b/app-admin/aerospike-amc-community/files/amc.init2
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mongodb/files/mongodb.initd-r2,v 1.2 2014/05/26 08:03:45 ultrabug Exp $
+
+config_file=${config_file:-/etc/amc/config/gunicorn_config.py}
+run_dir=${run_dir:-/run}
+
+command="/usr/bin/gunicorn"
+command_args="--daemon --config ${config_file} flaskapp:app"
+command_progress="true"
+retry='TERM/30/KILL/5'
+pidfile=${run_dir}/${SVCNAME}.pid
+user=${user:-root}
+group=${group:-root}
+start_stop_daemon_args="--user ${user} --group ${group}"
+required_files="${config_file}"
+
+depend() {
+ use net
+}
+
+start_post() {
+ ewaitfile 60 "${pidfile}"
+}