Subject: [alpine-aports] [PATCH] community/cf-cli: new aport

From: Thomas Boerger <[email-masked]>
Date: Thu, 12 May 2016 12:22:51 +0000

https://github.com/cloudfoundry/cli
A CLI for Cloud Foundry written in Go
---
 community/cf-cli/APKBUILD | 67 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 community/cf-cli/APKBUILD

diff --git a/community/cf-cli/APKBUILD b/community/cf-cli/APKBUILD
new file mode 100644
index 0000000..b0b0e1d
--- /dev/null
+++ b/community/cf-cli/APKBUILD
@@ -0,0 +1,67 @@
+# Contributor: Thomas Boerger <[email-masked]>
+# Maintainer: Thomas Boerger <[email-masked]>
+pkgname=cf-cli
+pkgver=6.18.0
+pkgrel=0
+pkgdesc="A CLI for Cloud Foundry written in Go"
+url="https://github.com/cloudfoundry/cli"
+arch="all"
+license="Apache 2.0"
+depends=""
+depends_dev=""
+makedepends="$depends_dev go bash"
+install=""
+subpackages=""
+source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.gz"
+
+_disturl="dev.alpinelinux.org:/archive/$pkgname/"
+_gourl="github.com/cloudfoundry/cli"
+_builddir="$srcdir"/src/$_gourl
+
+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
+}
+
+snapshot() {
+  abuild clean && abuild deps
+  export GOPATH="$srcdir"
+
+  msg "Checking out v${pkgver} tag"
+  # go get will not checkout a specific tag
+	# so we run our own git checkout branch
+	git clone --quiet --branch v${pkgver} \
+		https://$_gourl $_builddir || return 1
+
+  # fetch deps
+  cd $_builddir
+  go get -v -d ./... || return 1
+
+  cd "$srcdir"
+  tar zcf $pkgname-$pkgver.tar.gz src || return 1
+
+  rsync --progress -La $pkgname-$pkgver.tar.gz \
+    $_disturl || return 1
+
+  cd $startdir && abuild undeps
+}
+
+build() {
+  cd "$_builddir" || return 1
+  export GOPATH="$srcdir"
+	./bin/build
+}
+
+package() {
+	cd "$_builddir"
+  install -Dm755 out/cf "$pkgdir"/usr/bin/cf || return 1
+}
+
+md5sums="947bcea7939dd9152188a7e9e8164090  cf-cli-6.18.0.tar.gz"
+sha256sums="ec62f0a7b181d7e25b10948f56f4de95bfef8ea225e340ceb1fa1bbe6c351ece  cf-cli-6.18.0.tar.gz"
+sha512sums="4e1f799da851b01711dad2b52e3d9ae33a6d71108dad42ad11f0c3057bb514504336c9266d4a492b5f237e677bee334248633fea32af02b3de7e909209793bb4  cf-cli-6.18.0.tar.gz"
-- 
2.8.1

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

---

From: Natanael Copa <[email-masked]>
Date: Wed, 22 Jun 2016 00:09:53 +0200

On Thu, 12 May 2016 12:22:51 +0000

>  create mode 100644 community/cf-cli/APKBUILD

Hi, thanks for the patch. It does not build for me.
 
> +++ b/community/cf-cli/APKBUILD

Can you please rename it to:

pkgname="cloudfoundry-cli"

> +_builddir="$srcdir"/src/$_gourl

Can  you please use the source tarball found on
https://github.com/cloudfoundry/cli/releases

Something like:

source="$pkgname-$pkgver.tar.gz::https://github.com/cloudfoundry/cli/archive/v$pkgver.tar.gz"

> +		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;

Please remove the snapshot func and use source tarball from github.

> +  export GOPATH="$srcdir"

Please be consistent with indentation. I know not everyone agrees on
how to indent things but it is best practices to use the indent style
of the project you contribute to.

Thanks!

-nc

---