summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6585a67a858c5c9d8ade3662442dd78b8b625c1f (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
50
51
52
53
54
55
56
57
# Maintainer: Alad Wenter <alad@mailbox.org>
# Contributor: Ben Morgan <neembi@gmail.com>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>

pkgname=repoctl-git
pkgver=0.16.r0.gc8fd238
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' 'git')
conflicts=('repoctl')
provides=('repoctl')
source=("$pkgname::git+https://github.com/cassava/repoctl.git")
sha256sums=('SKIP')

pkgver() {
  cd "$pkgname"
  git describe --tags --long | sed 's/^v//; s/-/.r/; s/-/./g'
}

prepare() {
  local dest="$srcdir/src/github.com/cassava"

  mkdir -p "$dest"
  mv "$srcdir/$pkgname" "$dest/repoctl"

  cd "$srcdir"
  ln -s "$dest/repoctl" "$pkgname"
}

build() {
  local src="$srcdir/src/github.com/cassava/repoctl"

  cd "$src/cmd/repoctl"
  GOPATH="$srcdir" go build

  cd "$src/cmd/repols"
  GOPATH="$srcdir" go build
}

package() {
  cd "$pkgname"

  # Install repoctl program
  install -Dm755 cmd/repoctl/repoctl -t "$pkgdir/usr/bin/"
  install -Dm755 cmd/repols/repols -t "$pkgdir/usr/bin/"

  # Install other documentation
  install -Dm644 README.md NEWS.md -t "$pkgdir/usr/share/doc/repoctl/"
  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/repoctl/"

  # Install completion files
  install -Dm644 contrib/zsh_completion "$pkgdir/usr/share/zsh/site-functions/_repoctl"
}