summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ec5afeefa1bbd3a4becc002ecb89739cfe214d7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Contributor: Ben Morgan <neembi@gmail.com>
# Maintainer: Stefan Husmann <stefan-husmann@t-online.de>

pkgname=repoctl-git
pkgver=v0.13.13.gfee62fa
pkgrel=1
pkgdesc="A supplement to repo-add and repo-remove which simplifies managing local repositories"
arch=('i686' 'x86_64')
url="https://github.com/cassava/repoctl"
license=('MIT')
depends=('pacman')
makedepends=('go')
replaces=('repo-keep')
source=("git+https://github.com/cassava/${pkgname%-git}.git")
md5sums=('SKIP')

pkgver() {
  cd ${pkgname%-git}
  git describe --tags|sed 's/-/./g'
}

build() {
  # Get and build the builder.
  gopath=${srcdir}/go
  if [[ -d ${gopath} ]]; then
    rm -rf ${gopath}
  fi
  mkdir ${gopath}
  GOPATH=${gopath} go get github.com/constabulary/gb/...

  cd ${srcdir}/${pkgname%-git}
  ${gopath}/bin/gb build
}

package() {
  cd ${srcdir}/${pkgname%-git}

  # Install repoctl program
  install -d ${pkgdir}/usr/bin
  install -m755 bin/repoctl ${pkgdir}/usr/bin/

  # Install other documentation
  install -d ${pkgdir}/usr/share/doc/repoctl
  install -m644 README.md NEWS.md ${pkgdir}/usr/share/doc/repoctl/

  # Install completion files
  install -d ${pkgdir}/usr/share/zsh/site-functions/
  install -m644 contrib/zsh_completion ${pkgdir}/usr/share/zsh/site-functions/_repoctl
}