# Contributor: Sören Tempel # Contributor: Eivind Uggedal # Maintainer: Roberto Oliveira pkgname=hub pkgver=2.7.0 pkgrel=0 pkgdesc="Extends git with extra features for GitHub" url="http://hub.github.com/" arch="all" license="MIT" makedepends="go dep bash ca-certificates" options="net !checkroot" subpackages=" $pkgname-doc $pkgname-bash-completion:bashcomp:noarch $pkgname-zsh-completion:zshcomp:noarch" source="$pkgname-$pkgver.tar.gz::https://github.com/github/hub/archive/v$pkgver.tar.gz" builddir="$srcdir/src/github.com/hub/$pkgname" prepare() { mkdir -p ${builddir%/*} mv "$srcdir"/$pkgname-$pkgver "$builddir"/ default_prepare } build() { cd "$builddir" export GOPATH="$srcdir" dep ensure -v ./script/build } check() { cd "$builddir" go test ./... } package() { cd "$builddir" install -Dm755 bin/$pkgname "$pkgdir/usr/bin/$pkgname" install -D -m644 share/man/man1/$pkgname.1.ronn "$pkgdir"/usr/share/man/man1/$pkgname.1 } bashcomp() { depends="" pkgdesc="Bash completions for $pkgname" install_if="$pkgname=$pkgver-r$pkgrel bash-completion" install -Dm644 "$builddir"/etc/hub.bash_completion.sh \ "$subpkgdir"/usr/share/bash-completion/completions/$pkgname } zshcomp() { depends="" pkgdesc="Zsh completions for $pkgname" install_if="$pkgname=$pkgver-r$pkgrel zsh" install -Dm644 "$builddir"/etc/$pkgname.zsh_completion \ "$subpkgdir"/usr/share/zsh/site-functions/_$pkgname } sha512sums="77223b0860bac42195dfc43e9164f5da446e414e32d0d3caa931f30e5b06d6f65cd69caa2f5097285a91d2ddb48265dfedec9dd8b361417556ff38782fa1a17c hub-2.7.0.tar.gz"