diff options
author | Vianney Bouchaud | 2023-07-25 09:47:54 +0200 |
---|---|---|
committer | Vianney Bouchaud | 2023-07-25 09:47:54 +0200 |
commit | 7ab243eda3c8d275426f138134fc7d4abf5e4053 (patch) | |
tree | 3c5c9a493ff004dd3118d5cff0cd7009c299473e | |
parent | f4e3701c1b74f62f7ffbf39d23486a3879e0a4cf (diff) | |
download | aur-k8s-ldap-auth.tar.gz |
upgpkg: k8s-ldap-auth 4.0.0-2
following go package guidelines for k8s-ldap-auth
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 32 |
2 files changed, 26 insertions, 8 deletions
@@ -1,7 +1,7 @@ pkgbase = k8s-ldap-auth pkgdesc = Kubernetes webhook token authentication plugin implementation using ldap. pkgver = 4.0.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/vbouchaud/k8s-ldap-auth arch = x86_64 arch = armv7l @@ -3,7 +3,7 @@ pkgname=k8s-ldap-auth pkgdesc="Kubernetes webhook token authentication plugin implementation using ldap." pkgver=4.0.0 -pkgrel=1 +pkgrel=2 arch=('x86_64' 'armv7l' 'armv7h' 'aarch64') url="https://github.com/vbouchaud/k8s-ldap-auth" license=('MPL2') @@ -19,18 +19,36 @@ sha256sums=( "404606ac6ce95ceebbc30e5df1fc2a4dbec50cdf00e26c907129677903f7340b" ) +prepare(){ + cd $pkgname-$pkgver + mkdir -p build/ +} + build() { - export GOPATH="$srcdir"/gopath + cd $pkgname-$pkgver + export GOPATH="$srcdir/gopath" export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" - export CGO_LDFLAGS="${LDFLAGS}" - export CGO_ENABLED=1 - cd "$srcdir/$pkgname-$pkgver" - make VERSION=v$pkgver k8s-ldap-auth + goversion=$(go version | sed -r 's/go version go(.+)\s.+/\1/') + gopkg=vbouchaud/$pkgname + + go build \ + -trimpath \ + -buildmode=pie \ + -mod=readonly \ + -modcacherw \ + -ldflags "\ + -linkmode=external \ + -buildid='' + -extldflags=\"${LDFLAGS}\" \ + -X $gopkg/version.APPNAME=${pkgname} \ + -X $gopkg/version.VERSION=v${pkgver} \ + -X $gopkg/version.GOVERSION=${goversion}" \ + -o build . } package() { - install -D -m0755 "${srcdir}/$pkgname-$pkgver/k8s-ldap-auth" "${pkgdir}/usr/bin/k8s-ldap-auth" + install -D -m0755 "${srcdir}/$pkgname-$pkgver/build/k8s-ldap-auth" "${pkgdir}/usr/bin/k8s-ldap-auth" } |