From faf7204dd600508cf8170d7f14d6cb7389cccad3 Mon Sep 17 00:00:00 2001 From: Michael Aldridge Date: Sat, 11 Nov 2017 23:17:57 -0800 Subject: [PATCH] New package: grafana-4.6.1 --- srcpkgs/grafana/INSTALL | 9 ++++++ srcpkgs/grafana/files/grafana/run | 3 ++ srcpkgs/grafana/template | 46 +++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 srcpkgs/grafana/INSTALL create mode 100644 srcpkgs/grafana/files/grafana/run create mode 100644 srcpkgs/grafana/template diff --git a/srcpkgs/grafana/INSTALL b/srcpkgs/grafana/INSTALL new file mode 100644 index 0000000000..51703dd807 --- /dev/null +++ b/srcpkgs/grafana/INSTALL @@ -0,0 +1,9 @@ +case "$ACTION" in + post) + if [ "$UPDATE" = "yes" ] ; then + : + else + chown _grafana:_grafana /var/lib/grafana + fi + ;; +esac diff --git a/srcpkgs/grafana/files/grafana/run b/srcpkgs/grafana/files/grafana/run new file mode 100644 index 0000000000..4b90fc204f --- /dev/null +++ b/srcpkgs/grafana/files/grafana/run @@ -0,0 +1,3 @@ +#!/bin/sh + +exec chpst -u _grafana:_grafana grafana-server -homepath /usr/share/grafana/ -config /etc/grafana/grafana.ini diff --git a/srcpkgs/grafana/template b/srcpkgs/grafana/template new file mode 100644 index 0000000000..d36cffecac --- /dev/null +++ b/srcpkgs/grafana/template @@ -0,0 +1,46 @@ +# Template file for 'grafana' +pkgname=grafana +version=4.6.1 +revision=1 +build_style=go +go_import_path=github.com/grafana/grafana +go_package="${go_import_path}/pkg/cmd/grafana-cli ${go_import_path}/pkg/cmd/grafana-server" +short_desc="The open platform for beautiful analytics and monitoring" +maintainer="Michael Aldridge " +license="Apache-2.0" +homepage="https://grafana.com" +distfiles="https://github.com/grafana/grafana/archive/v${version}.tar.gz + https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-${version}.linux-x64.tar.gz" +checksum="7c9f82e97fcf248776a08596ff00298402af8660f6e975c15a2b680abd692de2 + 587cb56c76fa8496caf93d4f31ca0b9850a3608f9aa94f439adea1357c36e510" + +system_accounts="_grafana" +_grafana_homedir="/var/lib/grafana" + +conf_files="/etc/grafana/grafana.ini" + +post_install() { + vlicense LICENSE.md + + vmkdir var/lib/grafana + touch ${DESTDIR}/var/lib/grafana/.empty + + # These artifacts are pulled from the binary distribution + # because they can't be built by Void. + vmkdir usr/share/grafana + vcopy public usr/share/grafana/ + vcopy conf usr/share/grafana/ + + # This next step is an aweful hack, we need to create the base + # config file to allow this to startup out of the box, but we + # don't want to version the config file. + vmkdir etc/grafana + vinstall conf/defaults.ini 0644 etc/grafana grafana.ini + sed -i "s:data = data:data = /var/lib/grafana/data:" ${DESTDIR}/etc/grafana/grafana.ini + sed -i "s:data/log:/var/log/grafana:" ${DESTDIR}/etc/grafana/grafana.ini + sed -i "s:data/plugins:/var/lib/grafana/plugins:" ${DESTDIR}/etc/grafana/grafana.ini + sed -i "s:grafana.db:/var/lib/grafana/grafana.db:" ${DESTDIR}/etc/grafana/grafana.ini + + # And finally, the service directory + vsv grafana +}