summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhuoyun Wei2016-03-16 12:48:21 +0800
committerZhuoyun Wei2016-03-16 12:55:50 +0800
commiteccddee493df6f5f71d0f39ee0ec4cdd39716f81 (patch)
tree01cff45abd7bae076625d71ae1529ec75723f99a
downloadaur-eccddee493df6f5f71d0f39ee0ec4cdd39716f81.tar.gz
[grafana-bin] 2.6.0
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD32
-rw-r--r--grafana.install13
-rw-r--r--grafana.service19
4 files changed, 82 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..441e6dd9f07
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = grafana-bin
+ pkgdesc = A general purpose dashboard and graph composer. It supports graphite, influxdb or opentsdb - binary version
+ pkgver = 2.6.0
+ pkgrel = 1
+ url = http://grafana.org
+ install = grafana.install
+ arch = x86_64
+ license = Apache
+ provides = grafana
+ conflicts = grafana
+ backup = etc/grafana/grafana.ini
+ source = https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0.linux-x64.tar.gz
+ source = grafana.service
+ sha256sums = 4b0d61b42168e8e3368c91c1783908bd23ab07a203d26e9572f855b565e18ac4
+ sha256sums = 44ceb7aad648c8e46a65026109fc0327bc6e01ba7060d97d9e83a3e8ad65379c
+
+pkgname = grafana-bin
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..347ed5a8828
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,32 @@
+# Maintainer: Zhuoyun Wei <wzyboy@wzyboy.org>
+# Contributor: Carsten Feuls <archlinux@carstenfeuls.de>
+# Contributor: Gilles Hamel <hamelg at laposte dot net>
+
+pkgname=grafana-bin
+_pkgname=grafana
+pkgver=2.6.0
+pkgrel=1
+pkgdesc="A general purpose dashboard and graph composer. It supports graphite, influxdb or opentsdb - binary version"
+url="http://grafana.org"
+conflicts=('grafana')
+provides=('grafana')
+arch=('x86_64')
+license=('Apache')
+install=${_pkgname}.install
+backup=("etc/${_pkgname}/${_pkgname}.ini")
+source=("https://grafanarel.s3.amazonaws.com/builds/${_pkgname}-${pkgver}.linux-x64.tar.gz"
+ "grafana.service")
+sha256sums=('4b0d61b42168e8e3368c91c1783908bd23ab07a203d26e9572f855b565e18ac4'
+ '44ceb7aad648c8e46a65026109fc0327bc6e01ba7060d97d9e83a3e8ad65379c')
+
+
+package() {
+ install -Dm644 "${srcdir}/grafana.service" "$pkgdir/usr/lib/systemd/system/grafana.service"
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ install -dm755 "${pkgdir}/var/lib/grafana"
+ install -dm755 "${pkgdir}/var/log/grafana"
+ install -Dm755 bin/grafana-server "$pkgdir/usr/bin/grafana-server"
+ install -Dm644 conf/sample.ini "$pkgdir/etc/${_pkgname}/${_pkgname}.ini"
+ install -Dm644 conf/defaults.ini "$pkgdir/usr/share/grafana/conf/defaults.ini"
+ cp -r vendor public "$pkgdir/usr/share/grafana/"
+}
diff --git a/grafana.install b/grafana.install
new file mode 100644
index 00000000000..f6ef82a7f50
--- /dev/null
+++ b/grafana.install
@@ -0,0 +1,13 @@
+post_install() {
+ getent group grafana >/dev/null || groupadd -r grafana
+ getent passwd grafana >/dev/null || useradd -d /var/lib/grafana -g grafana -r -M -s /bin/false grafana
+ chown grafana:grafana /var/{lib,log}/grafana
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ userdel grafana
+}
diff --git a/grafana.service b/grafana.service
new file mode 100644
index 00000000000..08cbaffe919
--- /dev/null
+++ b/grafana.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Grafana server
+Documentation=http://docs.grafana.org
+After=network.target
+
+[Service]
+User=grafana
+Group=grafana
+Type=simple
+WorkingDirectory=/usr/share/grafana
+ExecStart=/usr/bin/grafana-server \
+ --config=/etc/grafana/grafana.ini \
+ cfg:default.paths.logs=/var/log/grafana \
+ cfg:default.paths.data=/var/lib/grafana
+LimitNOFILE=10000
+TimeoutStopSec=20
+
+[Install]
+WantedBy=multi-user.target