summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cfb1b95586d3f68de7b1a572f00ab4c12adfcc34 (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
# Maintainer: aksr <aksr at t-com dot me>
pkgname=codesearch-git
pkgver=r26.a45d81b
pkgrel=2
epoch=
pkgdesc="A tool for indexing and then performing regular expression searches over large bodies of source code."
arch=('i686' 'x86_64')
url="https://github.com/google/codesearch"
license=('BSD 3-Clause')
groups=()
depends=('')
makedepends=('git' 'go')
optdepends=()
checkdepends=()
provides=('codesearch')
conflicts=('codesearch')
_goroot=github.com/google/codesearch
_gourl=github.com/google/codesearch/cmd/...

pkgver() {
  GOPATH="$srcdir" go get ${_gourl}
  cd "$srcdir/src/${_goroot}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  GOPATH="$srcdir" go get -fix -v -x ${_gourl}
}

package() {
  cd "$srcdir"
  mkdir -p "$pkgdir/usr/bin"
  install -m755 "bin/cgrep" "$pkgdir/usr/bin/${pkgname%-*}-cgrep"
  install -m755 "bin/cindex" "$pkgdir/usr/bin/${pkgname%-*}-cindex"
  install -m755 "bin/csearch" "$pkgdir/usr/bin/${pkgname%-*}-csearch"
  cd "$srcdir/src/$_goroot"
  install -Dm644 README "$pkgdir/usr/share/doc/${pkgname%-*}/README"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/${pkgname%-*}/LICENSE"
}