summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 38e68bf68ae2028c3a10207aa5729073f601e7a7 (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
# Maintainer: Andrew Sun <adsun701 at gmail dot com>
# Contributor: Olivier Biesmans <o dot archlinux at biesmans dot fr>

pkgname=certigo
pkgver=1.15.1
pkgrel=1
pkgdesc='A utility to examine and validate certificates in a variety of formats'
arch=('x86_64' 'i686')
url='https://github.com/square/certigo'
license=('MIT')
makedepends=('go' 'git')
depends=('glibc')
source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/square/${pkgname}/archive/v${pkgver}.tar.gz")
sha256sums=('1c6b336a33fd944dfa1b05d3b592261d7538333a605078bdbb9889bbab088f0a')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  export GOFLAGS="-buildmode=pie -gcflags=all=-trimpath=${PWD} -asmflags=all=-trimpath=${PWD} -ldflags=-extldflags=-zrelro -ldflags=-extldflags=-znow"
  export CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2"
  export CGO_LDFLAGS="-Wl,-z,relro,-z,now"
  ./build
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  install -Dm755 "bin/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
  install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

# vim:set ts=2 sw=2 et: