summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 14cbbf031cc97eed360171add5f07f57250ecc9f (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
# Maintainer: George Rawlinson <george@rawlinson.net.nz>

pkgname=timescaledb-parallel-copy
pkgver=0.4.0
pkgrel=1
pkgdesc='A tool for parallel copying of CSV data into a TimescaleDB hypertable'
arch=('x86_64')
url='https://github.com/timescale/timescaledb-parallel-copy'
license=('Apache')
depends=('glibc')
makedepends=('git' 'go')
options=('!lto')
_commit='c0b5b0d8cefaacc9929f96e28e06b4c782ea3e90'
source=("$pkgname::git+$url#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  git describe --tags | sed 's/^v//'
}

prepare() {
  cd "$pkgname"

  # create directory for build output
  mkdir -p build

  # download dependencies
  go mod download
}

build() {
  cd "$pkgname"

  go build -v \
    -buildmode=pie \
    -trimpath \
    -mod=readonly \
    -modcacherw \
    -ldflags "-linkmode external -extldflags ${LDFLAGS}" \
    -o build \
    ./cmd/...
}

package() {
  cd "$pkgname"

  # binary
  install -vDm755 -t "$pkgdir/usr/bin" "build/$pkgname"
}