~alpine/aports

1

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

Thomas Boerger <thomas@webhippie.de>
Details
Message ID
<1463055771-8174-1-git-send-email-thomas@webhippie.de>
Sender timestamp
1463055771
DKIM signature
missing
Download raw message
Patch: +67 -0
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 <thomas@webhippie.de>
# Maintainer: Thomas Boerger <thomas@webhippie.de>
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:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20160622000953.56f563ff@ncopa-desktop.copa.dup.pw>
In-Reply-To
<1463055771-8174-1-git-send-email-thomas@webhippie.de> (view parent)
Sender timestamp
1466546993
DKIM signature
missing
Download raw message
On Thu, 12 May 2016 12:22:51 +0000
Thomas Boerger <thomas@webhippie.de> wrote:

> 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

Hi, thanks for the patch. It does not build for me.
 
> 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 <thomas@webhippie.de>
> +# Maintainer: Thomas Boerger <thomas@webhippie.de>
> +pkgname=cf-cli

Can you please rename it to:

pkgname="cloudfoundry-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

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"


> +
> +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() {

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


> +
> +build() {
> +  cd "$_builddir" || return 1
> +  export GOPATH="$srcdir"
> +	./bin/build
> +}

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


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)