aboutsummaryrefslogtreecommitdiffstats
path: root/community/influxdb
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@alpinelinux.org>2018-05-08 18:58:36 +0000
committerCarlo Landmeter <clandmeter@alpinelinux.org>2018-05-08 18:58:43 +0000
commit11ae2ed9b20cef67fb2437001585d1e901921d32 (patch)
tree79f991245b05bfc86935c27809cbb2449e9fcf86 /community/influxdb
parent08fb3c070346762cc71103e3ffb6ed9811de9514 (diff)
downloadaports-11ae2ed9b20cef67fb2437001585d1e901921d32.tar.bz2
aports-11ae2ed9b20cef67fb2437001585d1e901921d32.tar.xz
testing/influxdb: move to community
Diffstat (limited to 'community/influxdb')
-rw-r--r--community/influxdb/APKBUILD64
-rw-r--r--community/influxdb/influxdb.initd16
-rw-r--r--community/influxdb/influxdb.logrotate8
-rw-r--r--community/influxdb/influxdb.pre-install10
4 files changed, 98 insertions, 0 deletions
diff --git a/community/influxdb/APKBUILD b/community/influxdb/APKBUILD
new file mode 100644
index 0000000000..30c37c9a93
--- /dev/null
+++ b/community/influxdb/APKBUILD
@@ -0,0 +1,64 @@
+# Contributor: Stefan Wagner <stw@bit-strickerei.de>
+# Maintainer: Stefan Wagner <stw@bit-strickerei.de>
+pkgname=influxdb
+pkgver=1.5.2
+pkgrel=0
+pkgdesc="Scalable datastore for metrics, events, and real-time analytics"
+url="https://www.influxdata.com/time-series-platform/influxdb/"
+arch="all !aarch64"
+license="MIT"
+makedepends="go go-gdm python2 asciidoc xmlto"
+pkgusers="influxdb"
+pkggroups="influxdb"
+install="$pkgname.pre-install"
+options="!check" # has not tests
+subpackages="$pkgname-doc"
+source="$pkgname-$pkgver.tar.gz::https://github.com/influxdata/$pkgname/archive/v$pkgver.tar.gz
+ influxdb.initd
+ influxdb.logrotate
+ "
+builddir="$srcdir/src/github.com/influxdata/$pkgname"
+
+prepare() {
+ mkdir -p ${builddir%/*}
+ mv "$srcdir"/$pkgname-$pkgver "$builddir"/ || return 1
+ export GOPATH="$srcdir"
+ cd "$builddir"
+ gdm restore
+ default_prepare
+}
+
+build() {
+ export GOPATH="$srcdir"
+ cd "$builddir"
+ local path
+ for path in $(find ./cmd/* -maxdepth 0 -type d); do
+ go build -v -work -x -ldflags="-X main.version=$pkgver" \
+ -o ./bin/${path##*/} $path
+ done
+ make -C man
+}
+
+package() {
+ cd "$builddir"
+ local path bindir
+ for path in $(find ./cmd/* -maxdepth 0 -type d); do
+ case "${path##*/}" in
+ influxd) bindir=sbin ;;
+ *) bindir=bin ;;
+ esac
+ install -Dm755 ./bin/"${path##*/}" "$pkgdir"/usr/$bindir/"${path##*/}"
+ done
+
+ install -d "$pkgdir/usr/share/man/man1/"
+ install -Dm644 man/*.1 "$pkgdir/usr/share/man/man1/"
+
+ install -Dm644 "etc/config.sample.toml" "$pkgdir/etc/influxdb/influxdb.conf"
+
+ install -Dm755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname"
+ install -Dm644 "$srcdir/$pkgname.logrotate" "$pkgdir/etc/logrotate.d/$pkgname"
+}
+
+sha512sums="4f31284824ca54c0af91c032c5873a8d459680ac8d073ef84c1be1d7dfd0a4a30121308e6428b1d6508ea78ef105ea5ea08013ad5180291027d9dc842ff6165c influxdb-1.5.2.tar.gz
+55d5776fde330001f254fed4b01163d576d1995c23b08ef64c3c33b7a53fa49c71092867a17149d3148af7a8e17dc4779481afe9dd54a86eeee16168dbb964e0 influxdb.initd
+5d754e3aeec912bae8f5bf2f84153d4ccc82918d9c728631e8b9ad6737fab3352af0ab63f46ac80aab6384d779bae5d321da0465f26fd8798a9694f7d79f879d influxdb.logrotate"
diff --git a/community/influxdb/influxdb.initd b/community/influxdb/influxdb.initd
new file mode 100644
index 0000000000..491e97d308
--- /dev/null
+++ b/community/influxdb/influxdb.initd
@@ -0,0 +1,16 @@
+#!/sbin/openrc-run
+
+pidfile=/run/influxdb.pid
+start_stop_daemon_args="--user influxdb --stderr /var/log/influxdb/influxdb.log"
+command=/usr/sbin/influxd
+command_args="${EXTRA_OPTS}"
+command_background="yes"
+
+depend() {
+ need net
+ after firewall
+}
+
+start_pre() {
+ checkpath -d -o influxdb:influxdb -m755 /var/lib/influxdb /var/log/influxdb
+}
diff --git a/community/influxdb/influxdb.logrotate b/community/influxdb/influxdb.logrotate
new file mode 100644
index 0000000000..e4a3d27580
--- /dev/null
+++ b/community/influxdb/influxdb.logrotate
@@ -0,0 +1,8 @@
+/var/log/influxdb/influxdb.log {
+ daily
+ missingok
+ copytruncate
+ rotate 7
+ compress
+ notifempty
+}
diff --git a/community/influxdb/influxdb.pre-install b/community/influxdb/influxdb.pre-install
new file mode 100644
index 0000000000..3fbf12b1d4
--- /dev/null
+++ b/community/influxdb/influxdb.pre-install
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+username=influxdb
+groupname="$username"
+
+addgroup -S "$groupname" 2>/dev/null
+adduser -S -D -H -h /var/lib/"$username" -s /sbin/nologin -G "$groupname" \
+ -g "$groupname" "$username" 2>/dev/null
+
+exit 0