summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Dartiguelongue <eva@gentoo.org>2015-09-13 16:34:09 +0200
committerGilles Dartiguelongue <eva@gentoo.org>2015-09-13 16:34:09 +0200
commit58b8e465054c33ae930cd4facee5d995d65e8414 (patch)
treecdd72e78bcf8b90e06873b6dd34197783eac3a87
parentdev-go/go-sqlite3: initial ebuild (diff)
downloadeva-58b8e465054c33ae930cd4facee5d995d65e8414.tar.gz
eva-58b8e465054c33ae930cd4facee5d995d65e8414.tar.bz2
eva-58b8e465054c33ae930cd4facee5d995d65e8414.zip
www-apps/grafana: initial ebuild
-rw-r--r--www-apps/grafana/Manifest11
-rw-r--r--www-apps/grafana/files/grafana.confd7
-rw-r--r--www-apps/grafana/files/grafana.ini198
-rw-r--r--www-apps/grafana/files/grafana.initd37
-rw-r--r--www-apps/grafana/grafana-2.1.2.ebuild81
-rw-r--r--www-apps/grafana/metadata.xml11
6 files changed, 345 insertions, 0 deletions
diff --git a/www-apps/grafana/Manifest b/www-apps/grafana/Manifest
new file mode 100644
index 0000000..d43862f
--- /dev/null
+++ b/www-apps/grafana/Manifest
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA512
+
+DIST grafana-2.1.2.tar.gz 19705127 SHA256 01a53f05b40ed1a3982456117731c393a1dab062cf668d84e6d8db2dd8133bd3 SHA512 945d0014f7770af56c5c7f6afc14c0332db74261d5b0b3af824bcf32fe719642b403d6693194de645b3059ecf1e0757b16cc15a2745ea2c5e8d74e72a3f58d29 WHIRLPOOL 37cffba5a2a73b18037b801e3c2289752e6a4d084d0a8b38e844367f4e05309ab6e903f77005b063c8b7bc8a0f7667edbc00946eb65695d0ee9580041092d7d6
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+
+iEYEAREKAAYFAlX1iWIACgkQ1fmVwcYIWAb/7QCeIJ+27tq3jZw8KGhKmi3jepga
+RmwAnR7GYyIsTXvMPnrtDLzkGSmYQOUC
+=M45/
+-----END PGP SIGNATURE-----
diff --git a/www-apps/grafana/files/grafana.confd b/www-apps/grafana/files/grafana.confd
new file mode 100644
index 0000000..207ef76
--- /dev/null
+++ b/www-apps/grafana/files/grafana.confd
@@ -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/files/grafana.ini b/www-apps/grafana/files/grafana.ini
new file mode 100644
index 0000000..6aaa69f
--- /dev/null
+++ b/www-apps/grafana/files/grafana.ini
@@ -0,0 +1,198 @@
+##################### Grafana Configuration Example #####################
+#
+# Everything has defaults so you only need to uncomment things you want to
+# change
+
+; app_mode = production
+
+#################################### Paths ####################################
+[paths]
+# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is useD)
+#
+;data = /var/lib/grafana
+#
+# Directory where grafana can store logs
+#
+;logs = /var/log/grafana
+
+#################################### Server ####################################
+[server]
+# Protocol (http or https)
+;protocol = http
+
+# The ip address to bind to, empty will bind to all interfaces
+;http_addr =
+
+# The http port to use
+;http_port = 3000
+
+# The public facing domain name used to access grafana from a browser
+;domain = localhost
+
+# The full public facing url
+;root_url = %(protocol)s://%(domain)s:%(http_port)s/
+
+# Log web requests
+;router_logging = false
+
+# the path relative working path
+;static_root_path = public
+
+# enable gzip
+;enable_gzip = false
+
+# https certs & key file
+;cert_file =
+;cert_key =
+
+#################################### Database ####################################
+[database]
+# Either "mysql", "postgres" or "sqlite3", it's your choice
+;type = sqlite3
+;host = 127.0.0.1:3306
+;name = grafana
+;user = root
+;password =
+
+# For "postgres" only, either "disable", "require" or "verify-full"
+;ssl_mode = disable
+
+# For "sqlite3" only, path relative to data_path setting
+;path = grafana.db
+
+#################################### Session ####################################
+[session]
+# Either "memory", "file", "redis", "mysql", default is "memory"
+;provider = file
+
+# Provider config options
+# memory: not have any config yet
+# file: session dir path, is relative to grafana data_path
+# redis: config like redis server addr, poolSize, password, e.g. `127.0.0.1:6379,100,grafana`
+# mysql: go-sql-driver/mysql dsn config string, e.g. `user:password@tcp(127.0.0.1)/database_name`
+;provider_config = sessions
+
+# Session cookie name
+;cookie_name = grafana_sess
+
+# If you use session in https only, default is false
+;cookie_secure = false
+
+# Session life time, default is 86400
+;session_life_time = 86400
+
+#################################### Analytics ####################################
+[analytics]
+# Server reporting, sends usage counters to stats.grafana.org every 24 hours.
+# No ip addresses are being tracked, only simple counters to track
+# running instances, dashboard and error counts. It is very helpful to us.
+# Change this option to false to disable reporting.
+;reporting_enabled = true
+
+# Google Analytics universal tracking code, only enabled if you specify an id here
+;google_analytics_ua_id =
+
+#################################### Security ####################################
+[security]
+# default admin user, created on startup
+;admin_user = admin
+
+# default admin password, can be changed before first start of grafana, or in profile settings
+;admin_password = admin
+
+# used for signing
+;secret_key = SW2YcwTIb9zpOOhoPsMm
+
+# Auto-login remember days
+;login_remember_days = 7
+;cookie_username = grafana_user
+;cookie_remember_name = grafana_remember
+
+#################################### Users ####################################
+[users]
+# disable user signup / registration
+;allow_sign_up = true
+
+# Allow non admin users to create organizations
+;allow_org_create = true
+
+# Set to true to automatically assign new users to the default organization (id 1)
+;auto_assign_org = true
+
+# Default role new users will be automatically assigned (if disabled above is set to true)
+;auto_assign_org_role = Viewer
+
+#################################### Anonymous Auth ##########################
+[auth.anonymous]
+# enable anonymous access
+;enabled = false
+
+# specify organization name that should be used for unauthenticated users
+;org_name = Main Org.
+
+# specify role for unauthenticated users
+;org_role = Viewer
+
+#################################### Github Auth ##########################
+[auth.github]
+;enabled = false
+;client_id = some_id
+;client_secret = some_secret
+;scopes = user:email
+;auth_url = https://github.com/login/oauth/authorize
+;token_url = https://github.com/login/oauth/access_token
+;api_url = https://api.github.com/user
+# Uncomment bellow to only allow specific email domains
+; allowed_domains = mycompany.com othercompany.com
+
+#################################### Google Auth ##########################
+[auth.google]
+;enabled = false
+;client_id = some_client_id
+;client_secret = some_client_secret
+;scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
+;auth_url = https://accounts.google.com/o/oauth2/auth
+;token_url = https://accounts.google.com/o/oauth2/token
+;api_url = https://www.googleapis.com/oauth2/v1/userinfo
+# Uncomment bellow to only allow specific email domains
+; allowed_domains = mycompany.com othercompany.com
+
+#################################### Logging ##########################
+[log]
+# Either "console", "file", default is "console"
+# Use comma to separate multiple modes, e.g. "console, file"
+;mode = console, file
+
+# Buffer length of channel, keep it as it is if you don't know what it is.
+;buffer_len = 10000
+
+# Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Trace"
+;level = Info
+
+# For "console" mode only
+[log.console]
+;level =
+
+# For "file" mode only
+[log.file]
+;level =
+# This enables automated log rotate(switch of following options), default is true
+;log_rotate = true
+
+# Max line number of single file, default is 1000000
+;max_lines = 1000000
+
+# Max size shift of single file, default is 28 means 1 << 28, 256MB
+;max_lines_shift = 28
+
+# Segment log daily, default is true
+;daily_rotate = true
+
+# Expired days of log file(delete after max days), default is 7
+;max_days = 7
+
+#################################### AMPQ Event Publisher ##########################
+[event_publisher]
+;enabled = false
+;rabbitmq_url = amqp://localhost/
+;exchange = grafana_events
diff --git a/www-apps/grafana/files/grafana.initd b/www-apps/grafana/files/grafana.initd
new file mode 100644
index 0000000..80a3f5d
--- /dev/null
+++ b/www-apps/grafana/files/grafana.initd
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+}
+
+start() {
+ ebegin "Starting grafana server"
+
+ touch /var/run/grafana.pid
+ chown ${GRAFANA_USER}:${GRAFANA_GROUP} /var/run/grafana.pid
+
+ start-stop-daemon --start -b \
+ --chdir /usr/share/grafana \
+ --user ${GRAFANA_USER}:${GRAFANA_GROUP} \
+ --exec /usr/sbin/grafana -- \
+ -pidfile=/var/run/grafana.pid \
+ -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 /var/run/grafana.pid \
+ --user "${GRAFANA_USER}" \
+ --retry=TERM/20/KILL/5
+
+ eend $?
+}
diff --git a/www-apps/grafana/grafana-2.1.2.ebuild b/www-apps/grafana/grafana-2.1.2.ebuild
new file mode 100644
index 0000000..fd649f5
--- /dev/null
+++ b/www-apps/grafana/grafana-2.1.2.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+EGO_PN="github.com/grafana/grafana"
+
+inherit golang-build user
+
+DESCRIPTION="Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & OpenTSDB"
+HOMEPAGE="http://grafana.org"
+SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND=""
+# XXX: finish packaging dependencies
+DEPEND="${RDEPEND}
+ >=net-libs/nodejs-0.12
+ dev-go/go-net:=
+ dev-go/go-oauth2:=
+ dev-go/go-sqlite3:=
+"
+
+STRIP_MASK="*.a"
+
+pkg_setup() {
+ enewgroup grafana
+ enewuser grafana -1 -1 /usr/share/grafana grafana
+}
+
+src_prepare() {
+ # XXX: move deps in place until they are packages
+ mkdir src || die
+ mv Godeps/_workspace/src/* src || die
+ # Remove packaged dependencies
+ rm -rf src/golang.org/x src/github.com/mattn || die
+
+ mkdir -p src/${EGO_PN} || die
+ mv *.go pkg src/${EGO_PN} || die
+
+ # For local npm installs
+ mkdir -p node_modules || die
+}
+
+src_compile() {
+ golang-build_src_compile
+
+ # XXX: no nodejs eclass to help with this mess yet
+ npm install || die
+ npm install grunt-cli || die
+ PATH="${PATH}:${S}/node_modules/.bin/" grunt || die
+}
+
+src_test() {
+ golang-build_src_test
+}
+
+src_install() {
+ golang-build_src_install
+
+ # Frontend assets
+ insinto /usr/share/${PN}
+ doins -r public conf
+
+ dosbin grafana
+
+ newconfd "${FILESDIR}"/grafana.confd grafana
+ newinitd "${FILESDIR}"/grafana.initd grafana
+
+ keepdir /etc/grafana
+ insinto /etc/grafana
+ doins "${FILESDIR}"/grafana.ini
+
+ keepdir /var/{lib,log}/grafana
+ fowners grafana:grafana /var/{lib,log}/grafana
+ fperms 0750 /var/{lib,log}/grafana
+}
diff --git a/www-apps/grafana/metadata.xml b/www-apps/grafana/metadata.xml
new file mode 100644
index 0000000..058bfdd
--- /dev/null
+++ b/www-apps/grafana/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>eva@gentoo.org</email>
+ <name>Gilles Dartiguelongue</name>
+</maintainer>
+<upstream>
+ <remote-id type="github">grafana/grafana</remote-id>
+</upstream>
+</pkgmetadata>