summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rawlinson2022-03-17 21:30:23 +1300
committerGeorge Rawlinson2022-03-17 21:30:23 +1300
commit98ba5b8bf54abf2e86390dfdc0152082319a3ae1 (patch)
tree038d398af40165b713261784fbf504fad0d77877
downloadaur-98ba5b8bf54abf2e86390dfdc0152082319a3ae1.tar.gz
addpkg: passphrase2pgp 1.2.0-1
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD67
2 files changed, 85 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..89fca8396724
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = passphrase2pgp
+ pkgdesc = Predictable, passphrase-based PGP key generator
+ pkgver = 1.2.0
+ pkgrel = 1
+ url = https://github.com/skeeto/passphrase2pgp
+ arch = x86_64
+ license = Unlicense
+ checkdepends = bash
+ checkdepends = gnupg
+ checkdepends = openssh
+ makedepends = git
+ makedepends = go
+ depends = glibc
+ options = !lto
+ source = passphrase2pgp::git+https://github.com/skeeto/passphrase2pgp.git#commit=89270b52ec9eb7d922b8c5e20912c9b9f1bd3d8a
+ b2sums = SKIP
+
+pkgname = passphrase2pgp
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..f0f198466042
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,67 @@
+# Maintainer: George Rawlinson <grawlinson@archlinux.org>
+
+pkgname=passphrase2pgp
+pkgver=1.2.0
+pkgrel=1
+pkgdesc="Predictable, passphrase-based PGP key generator"
+arch=('x86_64')
+url="https://github.com/skeeto/passphrase2pgp"
+license=('Unlicense')
+depends=('glibc')
+makedepends=('git' 'go')
+checkdepends=('bash' 'gnupg' 'openssh')
+options=('!lto')
+_commit='89270b52ec9eb7d922b8c5e20912c9b9f1bd3d8a'
+source=("$pkgname::git+$url.git#commit=$_commit")
+b2sums=('SKIP')
+
+pkgver() {
+ cd "$pkgname"
+
+ git describe --tags | sed 's/^v//'
+}
+
+prepare() {
+ cd "$pkgname"
+
+ # download dependencies
+ go mod download
+
+ # prevent recompilation during tests
+ sed \
+ -i 'test.bash' \
+ -e '/go build/d'
+}
+
+build() {
+ cd "$pkgname"
+
+ # set Go flags
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+
+ go build -v \
+ -trimpath \
+ -buildmode=pie \
+ -mod=readonly \
+ -modcacherw \
+ -ldflags "-linkmode external -extldflags ${LDFLAGS}" \
+ .
+}
+
+check() {
+ cd "$pkgname"
+
+ bash test.bash
+}
+
+package() {
+ cd "$pkgname"
+
+ # binary
+ install -vDm755 -t "$pkgdir/usr/bin" "$pkgname"
+
+ # documentation
+ install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
+}