summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7d38ed8083830bc99e909b12d0ce6672efd20241 (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
58
# Maintainer: GI_Jack <iamjacksemail@hackermail.com>

pkgname=tiedot
pkgver=3.4
pkgrel=2
pkgdesc="A NoSQL document database engine powered by Go"
arch=('i686' 'x86_64')
url="https://github.com/HouzuoGuo/tiedot/"
license=('BSD-2Clause')
makedepends=('go' 'jwt-go')
source=("https://github.com/HouzuoGuo/tiedot/archive/${pkgver}.tar.gz")
sha256sums=('696464b84599a686066ea89996a5a0e878cf2e2f022ea33178338e90906dabfc')

prepare() {
  cd "$pkgname-$pkgver"
  local dir_ext="build/src/github.com/HouzuoGuo/tiedot"
  mkdir -p "${dir_ext}"
  cp -ra data "${dir_ext}/data/"
  cp -ra db "${dir_ext}/db/"
  cp -ra dberr "${dir_ext}/dberr/"
  cp -ra gommap "${dir_ext}/gommap"
  cp -ra httpapi "${dir_ext}/httpapi"
  cp -ra tdlog "${dir_ext}/tdlog"
}

build() {
  cd "$pkgname-$pkgver"
  export GOPATH="${PWD}/build"
  go build
}

package() {
  cd "$pkgname-$pkgver"

  # Copy docs
  mkdir -p "${pkgdir}/usr/share"
  cp -ra doc "${pkgdir}/usr/share/doc/"
  cp -ra "extra" "${pkgdir}/usr/share/${pkgname}"

  # Config and Service
  mkdir -p "${pkgdir}/usr/lib/systemd/system/"
  install -Dm644 distributable/tiedot.service "${pkgdir}/usr/lib/systemd/system/tiedot.service"
  install -Dm644 distributable/etc/tiedot "${pkgdir}/etc/tiedot"

  # Copy source
  local dir_ext="${pkgdir}/usr/lib/go/src/github.com/HouzuoGuo/tiedot"
  mkdir -p "${dir_ext}"
  cp -ra "data" "${dir_ext}/data"
  cp -ra "db" "${dir_ext}/db"
  cp -ra "dberr" "${dir_ext}/dberr"
  cp -ra "gommap" "${dir_ext}/gommap"
  cp -ra "httpapi" "${dir_ext}/httpapi"
  cp -ra "tdlog" "${dir_ext}/tdlog"

  # install executables
  install -Dm 755 tiedot-${pkgver} "${pkgdir}/usr/bin/tiedot"
}