Subject: [alpine-aports] [PATCH] testing/telegraf: new aport

From: Ben Bailey <[email-masked]>
Date: Tue, 7 Jul 2015 15:10:49 -0500

How does this look for a first port?

https://github.com/influxdb/telegraf
plugin-driven server agent for reporting metrics into InfluxDB
---
 testing/telegraf/APKBUILD | 49
+++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 testing/telegraf/APKBUILD

diff --git a/testing/telegraf/APKBUILD b/testing/telegraf/APKBUILD
new file mode 100644
index 0000000..3c6b4f0
--- /dev/null
+++ b/testing/telegraf/APKBUILD
@@ -0,0 +1,49 @@
+# Contributor: Ben Bailey <[email-masked]>
+# Maintainer:
+pkgname=telegraf
+pkgver=0.1.3
+pkgrel=0
+pkgdesc="plugin-driven server agent for reporting metrics into InfluxDB"
+url="https://github.com/influxdb/telegraf"
+arch="x86_64"
+license="MIT"
+depends=""
+depends_dev="go coreutils"
+makedepends="$depends_dev"
+install=""
+subpackages=""
+source="$pkgname-$pkgver.tar.gz::
https://github.com/influxdb/telegraf/archive/v${pkgver}.tar.gz"
+_builddir="$srcdir"/"$pkgname"-"$pkgver"
+prepare() {
+  local i
+  cd "$_builddir"
+  for i in $source; do
+    case $i in
+    *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+    esac
+  done
+}
+
+build() {
+  export GOPATH="$srcdir"
+  export GOBIN="$GOPATH"/"$pkgname"/src/bin
+  export GOROOT=/usr/lib/go
+  unset CC
+  cd "$_builddir"
+  /usr/bin/go get -d ./...
+
+  #go build cmd/telegraf || return 1
+  /usr/bin/go install ./cmd/telegraf || return 1
+}
+
+package() {
+  cd "$_builddir"
+
+  install -dm755 "$pkgdir"/usr/bin || return 1
+  install -Dm755  $GOBIN/"$pkgname" "$pkgdir"/usr/bin
+  rm -f "$pkgdir"/usr/lib/*.la
+}
+
+md5sums="f509d91e05797b2fe1f9043314dcb6e2  telegraf-0.1.3.tar.gz"
+sha256sums="ed719e317e9918b314f92cdca09ab7e34fa12c357800fe31cb1c8978a2128f40
telegraf-0.1.3.tar.gz"
+sha512sums="aa770900723549ccad5888726888f19419927fff9c76d3764db835dc1d9c1cd892c2ee9420354155759e1a7b381672ff7ae4a742e97107009509db0b04342f09
telegraf-0.1.3.tar.gz"
--
2.4.1

-- 
Ben

---

From: Natanael Copa <[email-masked]>
Date: Mon, 13 Jul 2015 08:40:17 +0200

On Tue, 7 Jul 2015 15:10:49 -0500

> How does this look for a first port?

Hi, thanks, but patch is corrupt.

>  testing/telegraf/APKBUILD | 49

^^^ I think your mailer added a newline here

> +_builddir="$srcdir"/"$pkgname"-"$pkgver"

...

> +sha512sums="aa770900723549ccad5888726888f19419927fff9c76d3764db835dc1d9c1cd892c2ee9420354155759e1a7b381672ff7ae4a742e97107009509db0b04342f09

^^^^and it added another newline there.

Result is:

Applying: testing/telegraf: new aport
fatal: corrupt patch at line 34
Patch failed at 0001 testing/telegraf: new aport

I wonder if you should sent the patch as an attachment instead.

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---