diff options
author | Nicolas Leclercq | 2015-09-02 20:06:52 +0200 |
---|---|---|
committer | Nicolas Leclercq | 2015-09-02 20:06:52 +0200 |
commit | 85cc60b860fe549b4bdf53e2aff7052b1e73215b (patch) | |
tree | b5e035ad2d53b323ecc9821741d4ef1d0372827c | |
download | aur-85cc60b860fe549b4bdf53e2aff7052b1e73215b.tar.gz |
Release 0.1.7
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | PKGBUILD | 66 | ||||
-rw-r--r-- | telegraf.install | 10 | ||||
-rw-r--r-- | telegraf.service | 14 |
4 files changed, 110 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b5c47a10dde4 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = telegraf + pkgdesc = Server-level metric gathering agent for InfluxDB + pkgver = 0.1.7 + pkgrel = 1 + url = http://influxdb.org/ + install = telegraf.install + arch = i686 + arch = x86_64 + license = MIT + makedepends = go + makedepends = git + provides = telegraf + backup = etc/telegraf.conf + source = telegraf.service + source = telegraf.install + md5sums = SKIP + md5sums = SKIP + +pkgname = telegraf + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..33f7aa4a3db6 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,66 @@ +# Maintainer: Nicolas Leclercq <nicolas.private@gmail.com> + +pkgname='telegraf' +pkgver='0.1.7' +pkgrel='1' +epoch= +pkgdesc='Server-level metric gathering agent for InfluxDB' +arch=('i686' 'x86_64') +url='http://influxdb.org/' +license=('MIT') +groups=() +depends=() +makedepends=('go' 'git') +checkdepends=() +optdepends=() +provides=('telegraf') +conflicts=() +replaces=() +backup=('etc/telegraf.conf') +options=() +install="$pkgname.install" +source=("$pkgname.service" + "$pkgname.install") +changelog= +noextract=() +md5sums=('SKIP' + 'SKIP') + +prepare() +{ + export GOPATH="${srcdir}" + export GOBIN="$GOPATH/bin" + if [ -d $GOBIN ]; then + rm $GOBIN/*; + fi; + + echo "Downloading $pkgname ..." + go get github.com/influxdb/telegraf +} +build() +{ + export GOPATH="${srcdir}" + export GOBIN="$GOPATH/bin" + + echo "Building $pkgname ..." + cd "$GOPATH/src/github.com/influxdb/telegraf" + make +} +package() +{ + export GOPATH="${srcdir}" + export GOBIN="$GOPATH/bin" + + # systemctl service file + install -D -m644 "$srcdir/telegraf.service" "$pkgdir/usr/lib/systemd/system/telegraf.service" + + # binaries + install -D -m755 "$GOPATH/src/github.com/influxdb/telegraf/telegraf" "$pkgdir/usr/bin/telegraf" + + # configuration file + mkdir -p "$pkgdir/etc" + $GOPATH/src/github.com/influxdb/telegraf/telegraf -sample-config > $pkgdir/etc/telegraf.conf + + # license + install -Dm644 "$GOPATH/src/github.com/influxdb/telegraf/LICENSE" "$pkgdir/usr/share/licenses/telegraf/LICENSE" +} diff --git a/telegraf.install b/telegraf.install new file mode 100644 index 000000000000..15f23d7f1f2f --- /dev/null +++ b/telegraf.install @@ -0,0 +1,10 @@ +post_install() { + post_upgrade + passwd -l telegraf &>/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 telegraf >/dev/null || groupadd telegraf + getent passwd telegraf >/dev/null || useradd -c 'telegraf' -g telegraf -s /bin/false telegraf +} diff --git a/telegraf.service b/telegraf.service new file mode 100644 index 000000000000..e875afddf410 --- /dev/null +++ b/telegraf.service @@ -0,0 +1,14 @@ +# If you modify this, please also make sure to edit init.sh + +[Unit] +Description=Server-level metric gathering agent for InfluxDB +After=network.target + +[Service] +User=telegraf +Group=telegraf +ExecStart=/usr/bin/telegraf -config /etc/telegraf.conf +Restart=on-failure + +[Install] +WantedBy=multi-user.target |