upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / rootlesskit / trunk / PKGBUILD
blob5e01670fac53dcaf2895255c660bf1f9b2059085
1 # Maintainer: George Rawlinson <grawlinson@archlinux.org>
2 # Contributor: Steven Allen <steven@stebalien.com>
3 # Contributor: Hugo Osvaldo Barrera <hugo@barrera.io>
5 pkgname=rootlesskit
6 pkgver=1.1.0
7 pkgrel=1
8 pkgdesc='Native "fake root" for implementing rootless containers'
9 arch=('x86_64')
10 url='https://github.com/rootless-containers/rootlesskit'
11 license=('Apache')
12 depends=('glibc' 'shadow')
13 makedepends=('git' 'go')
14 checkdepends=('openbsd-netcat')
15 options=('!lto')
16 _commit='6222b477d4c3ce6eea2bcff0586e43c95d1c0bb7'
17 source=("$pkgname::git+https://github.com/rootless-containers/rootlesskit.git#commit=$_commit")
18 b2sums=('SKIP')
20 pkgver() {
21   cd "$pkgname"
23   git describe --tags | sed 's/^v//'
26 prepare(){
27   cd "$pkgname"
29   # create directory for build output
30   mkdir build
32   # download dependencies
33   go mod download
36 build() {
37   cd "$pkgname"
39   # set Go flags
40   export CGO_CPPFLAGS="${CPPFLAGS}"
41   export CGO_CFLAGS="${CFLAGS}"
42   export CGO_CXXFLAGS="${CXXFLAGS}"
44   go build -v \
45     -trimpath \
46     -buildmode=pie \
47     -mod=readonly \
48     -modcacherw \
49     -ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
50     -o build \
51     ./cmd/...
54 # tests fail :(
55 #check() {
56 #  cd "$pkgname"
57 #  go test -v ./...
60 package() {
61   cd "$pkgname"
63   # binaries
64   install -vDm755 -t "$pkgdir/usr/bin" build/*
66   # documentation
67   install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
68   cp -vr docs "$pkgdir/usr/share/doc/$pkgname"