www-apps/grafana-bin: Fork and update to 5.2.0 69/181869/4 doc master
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Tue, 5 Jun 2018 15:28:39 +0000 (17:28 +0200)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Tue, 31 Jul 2018 11:34:07 +0000 (13:34 +0200)
Change-Id: I3f5cd58bf7d3c94bf96b7fa9a547eac4a38ec25e

www-apps/grafana-bin/Manifest [new file with mode: 0644]
www-apps/grafana-bin/files/grafana.confd [new file with mode: 0644]
www-apps/grafana-bin/files/grafana.initd.3 [new file with mode: 0644]
www-apps/grafana-bin/files/grafana.service [new file with mode: 0644]
www-apps/grafana-bin/grafana-bin-5.2.1.ebuild [new file with mode: 0644]
www-apps/grafana-bin/metadata.xml [new file with mode: 0644]

diff --git a/www-apps/grafana-bin/Manifest b/www-apps/grafana-bin/Manifest
new file mode 100644 (file)
index 0000000..51e1fc8
--- /dev/null
@@ -0,0 +1 @@
+DIST grafana-bin-5.2.1-armv7.tar.gz 27060022 BLAKE2B 65045691d136f1620517edbcf40c70cc4c98b1887e3d73718fb7698f8a2db79b433be3bff96941da36e4654dbc3d29f7e5e10416f8512b17d64ff8305fbd6bd1 SHA512 9cbc20c43ae847f152086cb999147970b5f311d7d63ad96fce2f358f694cd6a4678495798f37831a137426a7997265bc481e31c7500afc29e080aa2d1079ce3b
diff --git a/www-apps/grafana-bin/files/grafana.confd b/www-apps/grafana-bin/files/grafana.confd
new file mode 100644 (file)
index 0000000..207ef76
--- /dev/null
@@ -0,0 +1,7 @@
+# Config file for /etc/init.d/grafana
+
+# The user to run your application as.
+GRAFANA_USER=grafana
+
+# The group to run your application as.
+GRAFANA_GROUP=grafana
diff --git a/www-apps/grafana-bin/files/grafana.initd.3 b/www-apps/grafana-bin/files/grafana.initd.3
new file mode 100644 (file)
index 0000000..c454fb2
--- /dev/null
@@ -0,0 +1,38 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+       need localmount
+}
+
+start() {
+       ebegin "Starting grafana server"
+
+    checkpath -d -o "${GRAFANA_USER}:${GRAFANA_GROUP}" -m750 "/var/lib/grafana/dashboards"
+    checkpath -d -o "${GRAFANA_USER}:${GRAFANA_GROUP}" -m750 "/var/lib/grafana/plugins"
+    checkpath -d -o "${GRAFANA_USER}:${GRAFANA_GROUP}" -m750 "/var/lib/grafana/sessions"
+
+       start-stop-daemon --start -b \
+               --make-pidfile \
+               --pidfile /run/grafana.pid \
+               --chdir /usr/share/grafana \
+               --user ${GRAFANA_USER}:${GRAFANA_GROUP} \
+               --exec /usr/bin/grafana-server -- \
+               -config=/etc/grafana/grafana.ini \
+               cfg:default.paths.data=/var/lib/grafana \
+               cfg:default.paths.logs=/var/log/grafana
+
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping grafana server"
+
+       start-stop-daemon --stop \
+               --pidfile /run/grafana.pid \
+               --user "${GRAFANA_USER}" \
+               --retry=TERM/20/KILL/5
+
+       eend $?
+}
diff --git a/www-apps/grafana-bin/files/grafana.service b/www-apps/grafana-bin/files/grafana.service
new file mode 100644 (file)
index 0000000..dcf1de2
--- /dev/null
@@ -0,0 +1,25 @@
+[Unit]
+Description=Grafana
+Documentation=http://docs.grafana.org
+Wants=network-online.target
+After=network-online.target
+
+[Service]
+User=grafana
+Group=grafana
+Type=simple
+Restart=on-failure
+RuntimeDirectory=grafana
+WorkingDirectory=/usr/share/grafana
+ExecStart=/usr/bin/grafana-server                      \
+    --config=/etc/grafana/grafana.ini                  \
+    --pidfile=/run/grafana/grafana.pid                 \
+    cfg:default.paths.logs=/var/log/grafana            \
+    cfg:default.paths.data=/var/lib/grafana            \
+    cfg:default.paths.plugins=/var/lib/grafana/plugins
+LimitNOFILE=10000
+TimeoutStopSec=20
+UMask=0027
+
+[Install]
+WantedBy=multi-user.target
diff --git a/www-apps/grafana-bin/grafana-bin-5.2.1.ebuild b/www-apps/grafana-bin/grafana-bin-5.2.1.ebuild
new file mode 100644 (file)
index 0000000..ac39520
--- /dev/null
@@ -0,0 +1,62 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit user systemd
+
+MY_PN=${PN/-bin/}
+S=${WORKDIR}/${MY_PN}-${PV}
+
+DESCRIPTION="Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & OpenTSDB"
+HOMEPAGE="https://grafana.org"
+SRC_URI="https://s3-us-west-2.amazonaws.com/grafana-releases/release/${MY_PN}-${PV}.linux-armv7.tar.gz -> ${P}-armv7.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~arm"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+QA_EXECSTACK="usr/share/grafana/vendor/phantomjs/phantomjs"
+QA_PRESTRIPPED=${QA_EXECSTACK}
+
+pkg_setup() {
+       enewgroup grafana
+       enewuser grafana -1 -1 /usr/share/grafana grafana
+}
+
+src_install() {
+       keepdir /etc/grafana
+       insinto /etc/grafana
+       newins "${S}"/conf/sample.ini grafana.ini
+       rm "${S}"/conf/sample.ini || die
+
+       # Frontend assets
+       insinto /usr/share/${MY_PN}
+       doins -r public conf
+
+       dobin bin/grafana-cli
+       dobin bin/grafana-server
+
+       newconfd "${FILESDIR}"/grafana.confd grafana
+       newinitd "${FILESDIR}"/grafana.initd.3 grafana
+       systemd_newunit "${FILESDIR}"/grafana.service grafana.service
+
+       keepdir /var/{lib,log}/grafana
+       keepdir /var/lib/grafana/{dashboards,plugins}
+       fowners grafana:grafana /var/{lib,log}/grafana
+       fowners grafana:grafana /var/lib/grafana/{dashboards,plugins}
+       fperms 0750 /var/{lib,log}/grafana
+       fperms 0750 /var/lib/grafana/{dashboards,plugins}
+}
+
+postinst() {
+       elog "${PN} has built-in log rotation. Please see [log.file] section of"
+       elog "/etc/grafana/grafana.ini for related settings."
+       elog
+       elog "You may add your own custom configuration for app-admin/logrotate if you"
+       elog "wish to use external rotation of logs. In this case, you also need to make"
+       elog "sure the built-in rotation is turned off."
+}
diff --git a/www-apps/grafana-bin/metadata.xml b/www-apps/grafana-bin/metadata.xml
new file mode 100644 (file)
index 0000000..916283c
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <maintainer type="person">
+               <email>erkiferenc@gmail.com</email>
+       </maintainer>
+       <maintainer type="person">
+               <email>patrick@gentoo.org</email>
+       </maintainer>
+       <maintainer type="project">
+               <email>proxy-maint@gentoo.org</email>
+               <name>Proxy Maintainers</name>
+       </maintainer>
+</pkgmetadata>