summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8f610ca38de2ab8150ac5b44352862ce4a5bda62 (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
# Maintainer: Dmitri Goutnik <dg@syrec.org>

pkgname=trdsql
pkgver=0.4.0
pkgrel=1
pkgdesc="Tool that can execute SQL queries on CSV, LTSV and JSON"
arch=('i686' 'x86_64')
url="https://github.com/noborus/${pkgname}"
license=('MIT')
depends=('glibc')
makedepends=('go' 'dep')
source=("$pkgname-$pkgver.tar.gz::${url}/archive/v${pkgver}.tar.gz")
sha256sums=('9d9afb41b4344cb23979cc58620142a41be0ca28c014346ce6d0b797cf6671e5')

prepare() {
  mkdir -p "${srcdir}/src/github.com/noborus"
  mv "${srcdir}/${pkgname}-${pkgver}" "${srcdir}/src/github.com/noborus/${pkgname}"
}

build() {
  cd "${srcdir}/src/github.com/noborus/${pkgname}"
  export GOPATH="${srcdir}"
  dep ensure
  go build -o ${pkgname}
}

# check() {
#   cd "${srcdir}/src/github.com/noborus/${pkgname}"
#   export GOPATH="${srcdir}"
#   go test ./...
# }

package() {
  cd "${srcdir}/src/github.com/noborus/${pkgname}"
  install -Dm755 ${pkgname} "${pkgdir}/usr/bin/${pkgname}"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
  install -Dm644 completion/trdsql-completion.zsh "${pkgdir}/usr/share/zsh/site-functions/_${pkgname}"
}