diff options
author | ml | 2020-05-10 09:44:57 +0200 |
---|---|---|
committer | ml | 2020-05-10 09:44:57 +0200 |
commit | 7c636dbbfcbcc59acdd19feb0085decf72defccb (patch) | |
tree | 5fbffe1a048faefdce8b24920b8bd994441c1b1b | |
download | aur-7c636dbbfcbcc59acdd19feb0085decf72defccb.tar.gz |
newpkg: keys-pub 0.0.43-1
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 65 |
3 files changed, 88 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..cd46e5cde460 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = keys-pub + pkgdesc = keys.pub CLI client and service (keys, keysd) + pkgver = 0.0.43 + pkgrel = 1 + url = https://keys.pub/ + arch = x86_64 + arch = i686 + license = MIT + makedepends = git + makedepends = go + makedepends = gzip + depends = libfido2 + optdepends = org.freedesktop.secrets: storing secrets + source = keys-pub-0.0.43.tar.gz::https://github.com/keys-pub/keysd/archive/v0.0.43.tar.gz + sha256sums = 710df1fb4c478c3c5768433e60f41f9b3ad3424724a06b6f1dc1b8dbde511377 + +pkgname = keys-pub + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..695e2a016807 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/pkg/ +/src/ +/*.log +/*.tar.gz +/*.pkg.tar* diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..2feb3593f6b7 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,65 @@ +# Maintainer: ml <ml@visu.li> +# TODO systemd service +pkgname=keys-pub +pkgver=0.0.43 +pkgrel=1 +pkgdesc='keys.pub CLI client and service (keys, keysd)' +arch=('x86_64' 'i686') +url='https://keys.pub/' +license=('MIT') +depends=('libfido2') +makedepends=('git' 'go' 'gzip') +optdepends=('org.freedesktop.secrets: storing secrets') +source=("${pkgname}-${pkgver}.tar.gz::https://github.com/keys-pub/keysd/archive/v${pkgver}.tar.gz") +sha256sums=('710df1fb4c478c3c5768433e60f41f9b3ad3424724a06b6f1dc1b8dbde511377') + +prepare() { + cd "keysd-${pkgver}" + # replace all keys-pub/keysd modules except http/api (tests fail) + find -type f -name go.mod -exec sed -i 's#// \?\(replace github.com/keys-pub/keysd\)#\1#g; /^replace github.com\/keys-pub\/keysd\/http\/api/d' {} + + + # add missing replaces + echo 'replace github.com/keys-pub/keysd/firestore => ../../firestore' >> http/client/go.mod + for i in service/go.mod wormhole/go.mod; do + echo 'replace github.com/keys-pub/keysd/firestore => ../firestore' >>"$i" + done + + # go mod tidy all over the place + find -type f -name go.mod -execdir go mod tidy \; +} + +build() { + local _commit=$(zcat "${pkgname}-${pkgver}.tar.gz" | git get-tar-commit-id) + local -a x=( + main.version="$pkgver" + main.commit="${_commit:?}" + main.date="$(date -u -d @${SOURCE_DATE_EPOCH:-$EPOCHSECONDS} +%FT%TZ)" + ) + + cd "keysd-${pkgver}/service" + export CGO_ENABLED=1 + export CGO_LDFLAGS="$LDFLAGS" + export CGO_CFLAGS="$CFLAGS" + export CGO_CPPFLAGS="$CPPFLAGS" + export CGO_CXXFLAGS="$CXXFLAGS" + export GOFLAGS='-buildmode=pie -trimpath -modcacherw -mod=readonly' + + go build -o .. -ldflags "${x[*]/#/-X=}" ./{keys,keysd} + go build -o ../fido2.so -buildmode=plugin ./fido2 +} + +check() { + cd "keysd-${pkgver}" + # firestore tests require external dependencies, http/api never used + find -type f -name go.mod -not \( -path ./firestore/go.mod -or -path ./http/api/go.mod \) -execdir go test -short ./... \; +} + +package() { + cd "keysd-${pkgver}" + install -Dm755 keys -t "${pkgdir}/usr/bin" + install -Dm755 keysd -t "${pkgdir}/usr/lib/${pkgname}" + install -m644 fido2.so -t "${pkgdir}/usr/lib/${pkgname}" + install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}" + # ln keysd so we don't have to put fido2.so inside /usr/bin + ln -sf "/usr/lib/${pkgname}/keysd" "${pkgdir}/usr/bin/keysd" +} |