summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Dray2015-06-02 22:30:07 +1000
committerJustin Dray2015-06-02 22:30:49 +1000
commit735cb4eb06470fd5021492fd7aafd1783d02ce1d (patch)
tree1dca20c8bfb8eef5f8f7874b611733b3ba235647
downloadaur-735cb4eb06470fd5021492fd7aafd1783d02ce1d.tar.gz
Added influxdb-git
-rw-r--r--.SRCINFO30
-rw-r--r--PKGBUILD74
-rw-r--r--influxdb.install16
-rw-r--r--influxdb.service14
4 files changed, 134 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..ff4911ae8239
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,30 @@
+pkgbase = influxdb-git
+ pkgdesc = Scalable datastore for metrics, events, and real-time analytics
+ pkgver = v0.9.0.rc31.r74.g1fb9c54
+ pkgrel = 1
+ url = http://influxdb.org/
+ install = influxdb.install
+ arch = i686
+ arch = x86_64
+ license = MIT
+ makedepends = autoconf
+ makedepends = protobuf
+ makedepends = bison
+ makedepends = flex
+ makedepends = go
+ makedepends = gawk
+ makedepends = mercurial
+ makedepends = git
+ depends = leveldb
+ depends = rocksdb
+ provides = influxdb
+ backup = etc/influxdb.conf
+ source = git+https://github.com/influxdb/influxdb.git
+ source = influxdb.service
+ source = influxdb.install
+ md5sums = SKIP
+ md5sums = a73293aa5489a70bdfa01f8a5dfee359
+ md5sums = 56d2385232a6be54df21ec890d66f00c
+
+pkgname = influxdb-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..71b4d07fef9e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,74 @@
+# Maintainer: Justin Dray <justin@dray.be>
+# Contributor: Nicolas Leclercq <nicolas.private@gmail.com>
+# Contributor: Charles B. Johnson <mail@cbjohnson.info>
+# Contributor: Daichi Shinozaki <dsdseg@gmail.com>
+# Contributor: Ben Alex <ben.alex@acegi.com.au>
+
+_pkgname='influxdb'
+pkgname="$_pkgname-git"
+pkgver=v0.9.0.rc31.r74.g1fb9c54
+pkgrel=1
+epoch=
+pkgdesc='Scalable datastore for metrics, events, and real-time analytics'
+arch=('i686' 'x86_64')
+url='http://influxdb.org/'
+license=('MIT')
+groups=()
+depends=('leveldb' 'rocksdb')
+makedepends=('autoconf' 'protobuf' 'bison' 'flex' 'go' 'gawk' 'mercurial' 'git')
+checkdepends=()
+optdepends=()
+provides=('influxdb')
+conflicts=()
+replaces=()
+backup=('etc/influxdb.conf')
+options=()
+install="$_pkgname.install"
+changelog=
+source=("git+https://github.com/influxdb/influxdb.git"
+ "$_pkgname.service"
+ "$_pkgname.install")
+noextract=()
+md5sums=('SKIP'
+ 'a73293aa5489a70bdfa01f8a5dfee359'
+ '56d2385232a6be54df21ec890d66f00c')
+
+pkgver() {
+ cd "$_pkgname"
+ git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+build() {
+ export GOPATH="$srcdir"
+ mkdir -p "$srcdir/src/github.com/influxdb"
+ mv "$srcdir/influxdb" "$srcdir/src/github.com/influxdb/"
+ cd "$srcdir/src/github.com/influxdb/influxdb"
+ go get -u -f ./...
+ go build ./...
+ go install ./...
+}
+
+check() {
+ cd "$srcdir/src/github.com/influxdb/influxdb"
+ # Required for testing
+ go get github.com/davecgh/go-spew/spew
+ go test -v ./...
+}
+
+package() {
+ # systemctl service file
+ install -D -m644 "$srcdir/influxdb.service" "$pkgdir/usr/lib/systemd/system/influxdb.service"
+
+ cd "$srcdir/src/github.com/influxdb/influxdb"
+
+ # influxdb binary
+ install -D -m755 "$srcdir/bin/influx" "$pkgdir/usr/bin/influx"
+ install -D -m755 "$srcdir/bin/influxd" "$pkgdir/usr/bin/influxd"
+ install -D -m755 "$srcdir/bin/urlgen" "$pkgdir/usr/bin/urlgen"
+
+ # configuration file
+ cd etc
+ sed -i 's|/var/opt/influxdb/raft|/var/lib/influxdb/raft|g' config.sample.toml
+ sed -i 's|/var/opt/influxdb/db|/var/lib/influxdb/db|g' config.sample.toml
+ install -D -m644 config.sample.toml "$pkgdir/etc/influxdb.conf"
+}
diff --git a/influxdb.install b/influxdb.install
new file mode 100644
index 000000000000..7d09d7c53978
--- /dev/null
+++ b/influxdb.install
@@ -0,0 +1,16 @@
+post_install() {
+ post_upgrade
+ passwd -l influxdb &>/dev/null
+}
+
+post_upgrade() {
+ # create user/group that the daemon will run as by default, do not delete this on uninstall, as it will own files
+ getent group influxdb >/dev/null || groupadd influxdb
+ getent passwd influxdb >/dev/null || useradd -c 'InfluxDB' -g influxdb -d '/var/lib/influxdb' -m -s /bin/bash influxdb
+ mkdir -p /var/lib/influxdb/db
+ mkdir -p /var/lib/influxdb/raft
+ chown influxdb:influxdb -R /var/lib/influxdb
+
+ mkdir -p /var/log/influxdb
+ chown influxdb:influxdb -R /var/log/influxdb
+}
diff --git a/influxdb.service b/influxdb.service
new file mode 100644
index 000000000000..67d6bc68b13e
--- /dev/null
+++ b/influxdb.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=InfluxDB
+
+[Service]
+User=influxdb
+Group=influxdb
+Type=simple
+LimitNOFILE=4096
+ExecStart=/usr/bin/influxd -config /etc/influxdb.conf
+RuntimeDirectory=influxdb
+RuntimeDirectoryMode=0755
+
+[Install]
+WantedBy=multi-user.target