Browse Source

Updated to v1.7.4

Óscar García Amor 1 year ago
parent
commit
d862fd8072
3 changed files with 26 additions and 23 deletions
  1. 6 4
      .SRCINFO
  2. 19 13
      PKGBUILD
  3. 1 6
      telegraf.install

+ 6 - 4
.SRCINFO

@@ -1,6 +1,6 @@
 pkgbase = telegraf
 	pkgdesc = Plugin-driven server agent for reporting metrics into InfluxDB
-	pkgver = 1.6.2
+	pkgver = 1.7.4
 	pkgrel = 1
 	url = http://influxdb.org/
 	install = telegraf.install
@@ -12,14 +12,16 @@ pkgbase = telegraf
 	makedepends = go
 	makedepends = git
 	backup = etc/telegraf/telegraf.conf
-	source = https://github.com/influxdata/telegraf/archive/1.6.2/telegraf-1.6.2.tar.gz
+	source = https://github.com/influxdata/telegraf/archive/1.7.4/telegraf-1.7.4.tar.gz
 	source = telegraf.install
 	source = telegraf.service
 	source = telegraf.sysusers
-	sha256sums = 93cc548f336a8e0750055e137458c9950e4d5f6e59b2cbf9da492e5c58977240
-	sha256sums = d05c3cd096dadc38a253ce7adf94be87b7bb3f050bd13c9ed13ed6bfd64c285f
+	source = telegraf.tmpfiles
+	sha256sums = d02432803c10a898449c468c6c1656c4e600e6291026385523f0983ad8b8a989
+	sha256sums = b8494d35b868a256eace5f7baa7caa9d8561ee506aded3c47bd6b2ee031b0745
 	sha256sums = ef54a27c036f11c44f32a42c81787dd0253f84e77170c2e8f9e268aca8773c33
 	sha256sums = acf95397a51077b7684e8e4f4db7266c42cf82f24bc969ef2bc112a0f914f4cd
+	sha256sums = 95284d1e92f812c4c301cd1f35692850ae127397e33b910a5af7f54bbeb8986e
 
 pkgname = telegraf
 

+ 19 - 13
PKGBUILD

@@ -1,7 +1,7 @@
 # Maintainer: "Amhairghin" Oscar Garcia Amor (https://ogarcia.me)
 
 pkgname='telegraf'
-pkgver='1.6.2'
+pkgver='1.7.4'
 pkgrel='1'
 pkgdesc='Plugin-driven server agent for reporting metrics into InfluxDB'
 arch=('i686' 'x86_64' 'armv6h' 'armv7h')
@@ -13,11 +13,13 @@ install="${pkgname}.install"
 source=("https://github.com/influxdata/${pkgname}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz"
         "${pkgname}.install"
         "${pkgname}.service"
-        "${pkgname}.sysusers")
-sha256sums=('93cc548f336a8e0750055e137458c9950e4d5f6e59b2cbf9da492e5c58977240'
-            'd05c3cd096dadc38a253ce7adf94be87b7bb3f050bd13c9ed13ed6bfd64c285f'
+        "${pkgname}.sysusers"
+        "${pkgname}.tmpfiles")
+sha256sums=('d02432803c10a898449c468c6c1656c4e600e6291026385523f0983ad8b8a989'
+            'b8494d35b868a256eace5f7baa7caa9d8561ee506aded3c47bd6b2ee031b0745'
             'ef54a27c036f11c44f32a42c81787dd0253f84e77170c2e8f9e268aca8773c33'
-            'acf95397a51077b7684e8e4f4db7266c42cf82f24bc969ef2bc112a0f914f4cd')
+            'acf95397a51077b7684e8e4f4db7266c42cf82f24bc969ef2bc112a0f914f4cd'
+            '95284d1e92f812c4c301cd1f35692850ae127397e33b910a5af7f54bbeb8986e')
 
 prepare() {
   export GOPATH="${srcdir}/gopath"
@@ -33,17 +35,11 @@ prepare() {
 
 build() {
   cd ${TELEGRAFPATH}
-  go install ./...
+  go install -ldflags="-X main.version=${pkgver}" ./...
 }
 
 package() {
-  # systemd user and service file
-  install -D -m644 "${srcdir}/${pkgname}.sysusers" \
-    "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
-  install -D -m644 "${srcdir}/${pkgname}.service" \
-    "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
-
-  # binaries
+  # binary
   install -D -m755 "${GOBIN}/telegraf" "${pkgdir}/usr/bin/telegraf"
 
   # configuration files
@@ -53,4 +49,14 @@ package() {
   # license
   install -Dm644 "${TELEGRAFPATH}/LICENSE" \
     "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+
+  # service
+  install -D -m644 "${srcdir}/${pkgname}.service" \
+    "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
+
+  # systemd user and home directory
+  install -D -m644 "${srcdir}/${pkgname}.sysusers" \
+    "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
+  install -D -m644 "${srcdir}/${pkgname}.tmpfiles" \
+    "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
 }

+ 1 - 6
telegraf.install

@@ -1,10 +1,5 @@
-post_install() {
-  systemd-sysusers telegraf.conf
-  mkdir -p /var/lib/telegraf
-  chown -R telegraf:telegraf /var/lib/telegraf
-}
-
 post_remove() {
   echo "Remember that the following directories aren't removed."
+  echo "  -> /etc/telegraf"
   echo "  -> /var/lib/telegraf"
 }