summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d3a6d9d544c91ea9471df8b387228549b32d846e (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
# Maintainer: LightQuantum <cy.n01@outlook.com>
pkgname=calorina-git
_pkgname=calorina
pkgver=4.1.0.r0.g6843422
pkgrel=1
pkgdesc='Project Calorina - a complete rewrite of cleardns'
arch=('x86_64')
url="https://gitlab.com/NickCao/calorina"
license=('GPL3')
makedepends=('go')
backup=("etc/$_pkgname/config.toml")
source=("git+https://gitlab.com/NickCao/$_pkgname"
    calorina.service)
md5sums=('SKIP'
         '14dc2936e63fe910017e18ab006747a2')

pkgver() {
    cd $_pkgname
    git describe --long --tags |sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $_pkgname
  CGO_ENABLED=0 go build \
    -gcflags "all=-trimpath=$PWD" \
    -asmflags "all=-trimpath=$PWD" \
    -ldflags "-extldflags $LDFLAGS" \
    -o $_pkgname cmd/${_pkgname}d/main.go
}

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

  install -Dm755 $_pkgname/$_pkgname "$pkgdir"/usr/bin/${_pkgname}d
  install -Dm644 $_pkgname.service "$pkgdir"/usr/lib/systemd/system/$_pkgname.service
  install -Dm644 $_pkgname/share/config.toml "$pkgdir"/etc/$_pkgname/config.toml
}