upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / gortr / trunk / PKGBUILD
blob4dba76682c79d2f253a081a401bb040821f37e86
1 # Maintainer: Tim Meusel <tim@bastelfreak.de>
2 # Contributor: Nigel Kukard <nkukard@LBSD.net>
3 # Contributor: Zhaofeng Li <hello@zhaofeng.li>
5 pkgname=gortr
6 pkgver=0.14.7
7 pkgrel=7
8 pkgdesc="The RPKI-to-Router server used at Cloudflare"
9 arch=('x86_64')
10 url='https://github.com/cloudflare/gortr'
11 license=('BSD')
12 depends=()
13 makedepends=('go')
14 backup=('etc/conf.d/gortr')
15 source=(
16   "gortr-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz"
17   'gortr.env'
18   'gortr.service'
19   'gortr.sysusers'
22 sha512sums=('02cd38da2af1af11a3384578c81cc07098b6e0a5abdf17cd70dcc7256c7a0ec687a60d590e7ce7a133faa28d0a768ef206c7a59672a10998e52b8a2dc2752a44'
23             '3b48c5aa6e4ee074df4e7087f664a114f9fd9b5d586f17cad9cc5af6a6bff788f46012dbec37b5c08e5b858bcbe7f59d7fc65e013104a57a5606e1c3d0b9ee61'
24             'c5a1bfb1957ef42d73811d087151c565beaec46b0d533dcd27661304e26e394040f0c4f3d75b1eedd6728e3c4a27c07db5a626cb8d8e8fe99bc6851f858df955'
25             'be46844e548f7eaf46c7f7b07db42b192c88f7c2cb980ab0dca952838ad0c80854f21414f12d47f62f51128ddd5d971e243a8846eece604228c2a4d13d64f1d7')
27 prepare(){
28   cd "$pkgname-$pkgver"
29   mkdir -p build/
32 build() {
33   cd "$pkgname-$pkgver"
34   export GOPATH="$srcdir"/go
35   export CGO_CPPFLAGS="${CPPFLAGS}"
36   export CGO_CFLAGS="${CFLAGS}"
37   export CGO_CXXFLAGS="${CXXFLAGS}"
38   export CGO_LDFLAGS="${LDFLAGS}"
39   export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
40   go build -o build ./cmd/...
43 check() {
44   cd "$pkgname-$pkgver"
45   go test ./...
48 package() {
49   install -Dm755 "${srcdir}/gortr-${pkgver}/build/gortr" "${pkgdir}/usr/bin/gortr"
50   install -Dm755 "${srcdir}/gortr-${pkgver}/build/rtrdump" "${pkgdir}/usr/bin/rtrdump"
51   install -Dm755 "${srcdir}/gortr-${pkgver}/build/rtrmon" "${pkgdir}/usr/bin/rtrmon"
52   install -Dm644 "${srcdir}/gortr.env" "${pkgdir}/etc/conf.d/gortr"
53   install -Dm644 "${srcdir}/gortr.service" "${pkgdir}/usr/lib/systemd/system/gortr.service"
54   install -Dm644 "${srcdir}/gortr.sysusers" "${pkgdir}/usr/lib/sysusers.d/gortr.conf"
55   install -Dm644 "${srcdir}/gortr-${pkgver}/cmd/gortr/cf.pub" "${pkgdir}/usr/lib/${pkgname}/cf.pub"
56   install -Dm644 "${srcdir}/gortr-${pkgver}/LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"