summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f556ca8472389f528db5a73a50d478d24c08e1d1 (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
# Maintainer: Pedro H Lara Campos <root@pedrohlc.com>
# Contributor: Mark Wagie <mark.wagie@tutanota.com>
# Contributor: Alad Wenter <alad@mailbox.org>
# Contributor: Ben Morgan <neembi@gmail.com>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
_pkgname=repoctl
pkgname="${_pkgname}-devel-git"
pkgdesc="A supplement to repo-add and repo-remove which simplifies managing local repositories (devel branch from git)"
arch=('i686' 'x86_64' 'armv7h')
url="https://github.com/cassava/repoctl"
license=('MIT')
depends=('pacman')
makedepends=('go-pie' 'git')
options=()
source=("${_pkgname}::git+https://github.com/cassava/repoctl.git#branch=devel")
md5sums=('SKIP')
provides=('repoctl')
conflicts=('repoctl' 'repoctl-git')

pkgver=0.20.r11.g1102d3c
pkgrel=1
pkgver() {
  cd "${_pkgname}"
  git describe --tags --long | sed 's/^v//; s/-/.r/; s/-/./g'
}

prepare() {
  dest="$srcdir/src/github.com/cassava"
  mkdir -p "$dest"
	ln -rTsf "$srcdir/${_pkgname}" "$dest/repoctl"
}

build() {
  src="$srcdir/src/github.com/cassava/repoctl"
  cd "$src/cmd/repoctl"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
  export GOPATH="$srcdir"
  go build
}

package() {
  cd "${srcdir}/${_pkgname}"

  # Install repoctl program
  install -d "$pkgdir/usr/bin"
  install -m755 cmd/repoctl/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 -Dm644 LICENSE "$pkgdir/usr/share/licenses/repoctl/LICENSE"
}

# vim: set ts=2 sw=2: