summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f4a97dee761441b75317152a6fef330cd5b572c4 (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
# Maintainer: a821
# Contributor: christian rebischke <chris.rebischke at archlinux org>

pkgname=gopass-hibp-git
pkgver=1.15.13.r10.gb75cb16
pkgrel=1
pkgdesc="haveibeenpwnd.com integration for gopass"
arch=('x86_64')
url="https://github.com/gopasspw/gopass-hibp"
license=('MIT')
depends=('glibc')
makedepends=('go' 'git')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("git+${url}")
sha512sums=('SKIP')
options=('!lto')

pkgver() {
  cd ${pkgname%-git}
  git describe --long --tags | sed -e 's/^v//;s/-/.r/;s/-/./g'
}

prepare(){
  cd ${pkgname%-git}
  sed -i 's|-gcflags="-trimpath=$(GOPATH)" -asmflags="-trimpath=$(GOPATH)"||' Makefile
}

build(){
  cd ${pkgname%-git}
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
  make
}

package() {
  cd ${pkgname%-git}
  make DESTDIR="${pkgdir}" PREFIX="/usr" install
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}