summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVianney Bouchaud2023-07-25 09:47:54 +0200
committerVianney Bouchaud2023-07-25 09:47:54 +0200
commit7ab243eda3c8d275426f138134fc7d4abf5e4053 (patch)
tree3c5c9a493ff004dd3118d5cff0cd7009c299473e
parentf4e3701c1b74f62f7ffbf39d23486a3879e0a4cf (diff)
downloadaur-k8s-ldap-auth.tar.gz
upgpkg: k8s-ldap-auth 4.0.0-2
following go package guidelines for k8s-ldap-auth
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD32
2 files changed, 26 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 1715c9f766ea..6f24262f13dd 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -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
diff --git a/PKGBUILD b/PKGBUILD
index 08b8ed3ee995..115de842ae2d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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"
}