summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Martinez2021-08-16 18:17:13 -0500
committerLuis Martinez2021-08-16 18:17:13 -0500
commitd9a2da1aa56db1e73130a4853733d67ae6c380f7 (patch)
tree5055a29b53ff4bfbb6dfcce20fde99c57350427f
downloadaur-d9a2da1aa56db1e73130a4853733d67ae6c380f7.tar.gz
initial commit
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD46
2 files changed, 62 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..7b0f701ba916
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = zauth-git
+ pkgdesc = 2FA CLI application with andOTP support
+ pkgver = r4.d8fc712
+ pkgrel = 1
+ url = https://github.com/grijul/zauth
+ arch = x86_64
+ license = MIT
+ makedepends = git
+ makedepends = go
+ depends = glibc
+ provides = zauth
+ conflicts = zauth
+ source = zauth-git::git+https://github.com/grijul/zauth
+ sha256sums = SKIP
+
+pkgname = zauth-git
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d469780f92b9
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>
+
+pkgname=zauth-git
+pkgver=r4.d8fc712
+pkgrel=1
+pkgdesc="2FA CLI application with andOTP support"
+arch=('x86_64')
+url="https://github.com/grijul/zauth"
+license=('MIT')
+depends=('glibc')
+makedepends=('git' 'go')
+provides=("${pkgname%-git}")
+conflicts=("${pkgname%-git}")
+source=("$pkgname::git+$url")
+sha256sums=('SKIP')
+
+pkgver() {
+ cd "$pkgname"
+ ( set -o pipefail
+ git describe --long --tags 2&>/dev/null | sed 's/^v//;s/-/.r/;s/-/./' ||
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ )
+}
+
+build() {
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+
+ cd "$pkgname"
+ go build -o zauth
+}
+
+check() {
+ cd "$pkgname"
+ go test ./...
+}
+
+package() {
+ cd "$pkgname"
+ install -Dm 755 zauth -t "$pkgdir/usr/bin/"
+ install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
+ install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
+}