--- /dev/null
+DIST grafana-bin-5.2.1-armv7.tar.gz 27060022 BLAKE2B 65045691d136f1620517edbcf40c70cc4c98b1887e3d73718fb7698f8a2db79b433be3bff96941da36e4654dbc3d29f7e5e10416f8512b17d64ff8305fbd6bd1 SHA512 9cbc20c43ae847f152086cb999147970b5f311d7d63ad96fce2f358f694cd6a4678495798f37831a137426a7997265bc481e31c7500afc29e080aa2d1079ce3b
--- /dev/null
+# 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
--- /dev/null
+#!/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 $?
+}
--- /dev/null
+[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
--- /dev/null
+# 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."
+}
--- /dev/null
+<?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>