summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO8
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD32
-rw-r--r--telegraf.service14
4 files changed, 24 insertions, 34 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b5c47a10dde4..60aecf2395ea 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = telegraf
pkgdesc = Server-level metric gathering agent for InfluxDB
- pkgver = 0.1.7
+ pkgver = 0.1.9
pkgrel = 1
url = http://influxdb.org/
install = telegraf.install
@@ -10,10 +10,10 @@ pkgbase = telegraf
makedepends = go
makedepends = git
provides = telegraf
- backup = etc/telegraf.conf
- source = telegraf.service
+ backup = etc/telegraf/telegraf.conf
+ source = https://github.com/influxdb/telegraf/archive/v0.1.9.tar.gz
source = telegraf.install
- md5sums = SKIP
+ md5sums = ae8312d37649bd2538c50c6f9f9d8455
md5sums = SKIP
pkgname = telegraf
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..f52b2f5a9940
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+pkg/
+src/
+*.tar.xz
+*.tar.gz
diff --git a/PKGBUILD b/PKGBUILD
index 33f7aa4a3db6..7ae920b4c65f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Nicolas Leclercq <nicolas.private@gmail.com>
pkgname='telegraf'
-pkgver='0.1.7'
+pkgver='0.1.9'
pkgrel='1'
epoch=
pkgdesc='Server-level metric gathering agent for InfluxDB'
@@ -16,50 +16,50 @@ optdepends=()
provides=('telegraf')
conflicts=()
replaces=()
-backup=('etc/telegraf.conf')
+backup=('etc/telegraf/telegraf.conf')
options=()
install="$pkgname.install"
-source=("$pkgname.service"
+pkgtar="v${pkgver}.tar.gz"
+source=("https://github.com/influxdb/telegraf/archive/$pkgtar"
"$pkgname.install")
changelog=
noextract=()
-md5sums=('SKIP'
+md5sums=('ae8312d37649bd2538c50c6f9f9d8455'
'SKIP')
prepare()
{
export GOPATH="${srcdir}"
export GOBIN="$GOPATH/bin"
+ export TELEGRAFPATCH="$GOPATH/src/github.com/influxdb/telegraf"
if [ -d $GOBIN ]; then
- rm $GOBIN/*;
+ rm -rf $GOBIN;
fi;
- echo "Downloading $pkgname ..."
- go get github.com/influxdb/telegraf
+ echo "Extracting telegraf archive..."
+ mkdir -p $TELEGRAFPATCH
+ tar -C $TELEGRAFPATCH --strip-components=1 -xzf $pkgtar
+
}
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"
+ install -D -m644 "$GOPATH/src/github.com/influxdb/telegraf/scripts/telegraf.service" "$pkgdir/usr/lib/systemd/system/telegraf.service"
+ sed -i 's;/etc/opt/telegraf;/etc/telegraf;g' "$pkgdir/usr/lib/systemd/system/telegraf.service"
+ sed -i 's;/opt/telegraf;/usr/bin;g' "$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
+ mkdir -p "$pkgdir/etc/telegraf"
+ $GOPATH/src/github.com/influxdb/telegraf/telegraf -sample-config > "$pkgdir/etc/telegraf/telegraf.conf"
# license
install -Dm644 "$GOPATH/src/github.com/influxdb/telegraf/LICENSE" "$pkgdir/usr/share/licenses/telegraf/LICENSE"
diff --git a/telegraf.service b/telegraf.service
deleted file mode 100644
index e875afddf410..000000000000
--- a/telegraf.service
+++ /dev/null
@@ -1,14 +0,0 @@
-# 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