From 5351ed6061496283feff26cada716255a0e0e61b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 9 Jul 2016 01:40:40 -0400 Subject: improve pcr/acmetool --- pcr/acmetool/PKGBUILD | 114 ++++++++++++++++++------------- pcr/acmetool/acmetool-redirector.service | 12 ++++ pcr/acmetool/acmetool.sysusers | 1 + 3 files changed, 78 insertions(+), 49 deletions(-) create mode 100644 pcr/acmetool/acmetool-redirector.service create mode 100644 pcr/acmetool/acmetool.sysusers (limited to 'pcr') diff --git a/pcr/acmetool/PKGBUILD b/pcr/acmetool/PKGBUILD index 46d1cac70..85e642104 100644 --- a/pcr/acmetool/PKGBUILD +++ b/pcr/acmetool/PKGBUILD @@ -5,58 +5,59 @@ pkgver=0.0.54 url=https://github.com/hlandau/acme pkgdesc="Automatic certificate acquisition tool for ACME (Let's Encrypt)" -pkgrel=1 +pkgrel=2 arch=(x86_64 i686) depends=(libcap) makedepends=(go) +optdepends=('dialog') # When updating this package, my process is: -# - run `GOPATH=$PWD go get -d -u github.com/hlandau/acme/cmd/acmetool` -# - run this one-liner: find src -name .git | while read -r dir; do (cd $dir/.. && git log --pretty="$dir %H $(git describe --tags --always) %ci" -n1); done|sed -r 's|src/(.*)/\.git |\1 |'|while read -r dir hash desc date; do printf '%s %s %s %s\n' "$(date --rfc-3339=seconds -u --date="$date")" "$dir" "$desc" "$hash"; done|column -t|sort -n -# * verify that no timestamps are newer than that of github.com/hlandau/acme -# > roll back anything that is newer (be careful of commits that weren't yet merged!) -# * anything that has changed since PKGBUILD, verify that the license is the same +# - download the "official" binary from https://github.com/hlandau/acme/releases +# - run `$dir/bin/acmetool --version|sed -n 's/^git //p'|column -t` +# - paste that into the _source table below +# - move the `github.com/hlandau/acme` line to the top, change the git-describe to `v$pkgver` +# - insert/update the license info for each _source=( - #import-path license git-describe commit - "github.com/hlandau/acme MIT v$pkgver 296b3f53761540e9808965e37d363ff722d8b0cc" - - 'github.com/alecthomas/template BSD3 a0175ee a0175ee3bccc567396460bf5acd36800cb10c49c' - 'github.com/alecthomas/units MIT 2efee85 2efee857e7cfd4f3d0138cc3cbb1b4966962b93a' - 'github.com/coreos/go-systemd Apache v9-4-ga523235 a52323565816dee4d2f8dc5fdf1299f48757b848' - 'github.com/godbus/dbus BSD2 v4.0.0-5-g32c6cc2 32c6cc29c14570de4cf6d7e7737d68fb2d01ad15' - 'github.com/hlandau/degoutils MIT 389a847 389a84765529fb80bf6fff3cdcdf814cbc42ee47' - 'github.com/hlandau/xlog MIT v1.0.0 197ef798aed28e08ed3e176e678fda81be993a31' - 'github.com/hlandauf/gspt MIT 25f3bd3 25f3bd3f5948489aa5f31c949310ae9f2b0e956c' - 'github.com/jmhodges/clock MIT v1.0-4-g880ee4c 880ee4c335489bc78d01e4d0a254ae880734bc15' - 'github.com/mattn/go-isatty MIT 56b76bd 56b76bdf51f7708750eac80fa38b952bb9f32639' - 'github.com/mitchellh/go-wordwrap MIT ad45545 ad45545899c7b13c020ea92b2072220eefad42b8' - 'github.com/ogier/pflag BSD3 v0.0.1-7-g45c278a 45c278ab3607870051a2ea9040bb85fcb8557481' - 'github.com/peterhellberg/link MIT v1.0.0 d1cebc7ea14a5fc0de7cb4a45acae773161642c6' - 'github.com/satori/go.uuid MIT v1.1.0 879c5887cd475cd7864858769793b2ceb0d44feb' - 'github.com/shiena/ansicolor MIT a422bbe a422bbe96644373c5753384a59d678f7d261ff10' - 'golang.org/x/crypto BSD3 f3241ce f3241ce8505855877cc8a9717bd61a0f7c4ea83c' - 'golang.org/x/net BSD3 8bf2b39 8bf2b39827dbadfd566c4fae7a8790d12be8b23c' - 'gopkg.in/alecthomas/kingpin.v2 MIT v2.1.11 8cccfa8eb2e3183254457fb1749b2667fbc364c7' - 'gopkg.in/cheggaaa/pb.v1 BSD3 v1.0.3 8808370bf63524e115da1371ba42bce6739f3a6b' - 'gopkg.in/hlandau/configurable.v1 MIT v1.0.1 41496864a1fe3e0fef2973f22372b755d2897402' - 'gopkg.in/hlandau/easyconfig.v1 MIT v1.0.14 bc5afaa18a1a72fe424da647d6bb57ca4d7f83c4' - 'gopkg.in/hlandau/service.v2 ISC v2.0.15 601cce2a79c1e61856e27f43c28ed4d7d2c7a619' - 'gopkg.in/hlandau/svcutils.v1 MIT,Apache v1.0.7 09c5458e23bda3b8e4d925fd587bd44fbdb5950e' - 'gopkg.in/square/go-jose.v1 Apache v1.0.2 e3f973b66b91445ec816dd7411ad1b6495a5a2fc' - 'gopkg.in/tylerb/graceful.v1 MIT v1.2.7 84177357ab104029f9237abcb52339a7b80760ef' - 'gopkg.in/yaml.v2 MIT,LGPL3 a83829b a83829b6f1293c91addabc89d0571c246397bbf4' + #import-path commit git-describe license + "github.com/hlandau/acme 296b3f53761540e9808965e37d363ff722d8b0cc v$pkgver MIT" + + 'github.com/alecthomas/template a0175ee3bccc567396460bf5acd36800cb10c49c heads/master BSD3' + 'github.com/alecthomas/units 2efee857e7cfd4f3d0138cc3cbb1b4966962b93a heads/master MIT' + 'github.com/coreos/go-systemd a52323565816dee4d2f8dc5fdf1299f48757b848 heads/master Apache' + 'github.com/godbus/dbus 32c6cc29c14570de4cf6d7e7737d68fb2d01ad15 heads/master BSD2' + 'github.com/hlandau/degoutils 389a84765529fb80bf6fff3cdcdf814cbc42ee47 heads/master MIT' + 'github.com/hlandau/xlog 197ef798aed28e08ed3e176e678fda81be993a31 v1.0.0 MIT' + 'github.com/hlandauf/gspt 25f3bd3f5948489aa5f31c949310ae9f2b0e956c heads/master MIT' + 'github.com/jmhodges/clock 880ee4c335489bc78d01e4d0a254ae880734bc15 heads/master MIT' + 'github.com/mattn/go-isatty 56b76bdf51f7708750eac80fa38b952bb9f32639 heads/master MIT' + 'github.com/mitchellh/go-wordwrap ad45545899c7b13c020ea92b2072220eefad42b8 heads/master MIT' + 'github.com/ogier/pflag 45c278ab3607870051a2ea9040bb85fcb8557481 heads/master BSD3' + 'github.com/peterhellberg/link d1cebc7ea14a5fc0de7cb4a45acae773161642c6 v1.0.0 MIT' + 'github.com/satori/go.uuid 879c5887cd475cd7864858769793b2ceb0d44feb v1.1.0 MIT' + 'github.com/shiena/ansicolor a422bbe96644373c5753384a59d678f7d261ff10 heads/master MIT' + 'golang.org/x/crypto f3241ce8505855877cc8a9717bd61a0f7c4ea83c heads/master BSD3' + 'golang.org/x/net 8bf2b39827dbadfd566c4fae7a8790d12be8b23c heads/master BSD3' + 'gopkg.in/alecthomas/kingpin.v2 8cccfa8eb2e3183254457fb1749b2667fbc364c7 tags/v2.1.11 MIT' + 'gopkg.in/cheggaaa/pb.v1 8808370bf63524e115da1371ba42bce6739f3a6b v1.0.3 BSD3' + 'gopkg.in/hlandau/configurable.v1 41496864a1fe3e0fef2973f22372b755d2897402 v1.0.1 MIT' + 'gopkg.in/hlandau/easyconfig.v1 bc5afaa18a1a72fe424da647d6bb57ca4d7f83c4 v1.0.14 MIT' + 'gopkg.in/hlandau/service.v2 601cce2a79c1e61856e27f43c28ed4d7d2c7a619 v2.0.15 ISC' + 'gopkg.in/hlandau/svcutils.v1 09c5458e23bda3b8e4d925fd587bd44fbdb5950e v1.0.7 MIT,Apache' + 'gopkg.in/square/go-jose.v1 e3f973b66b91445ec816dd7411ad1b6495a5a2fc v1.0.2 Apache' + 'gopkg.in/tylerb/graceful.v1 84177357ab104029f9237abcb52339a7b80760ef tags/v1.2.7 MIT' + 'gopkg.in/yaml.v2 a83829b6f1293c91addabc89d0571c246397bbf4 heads/v2 MIT,LGPL3' ) _specparse() { - local import lic desc commit - read import lic desc commit <<<"$1" + local import commit desc lic + read import commit desc lic <<<"$1" local name=${import##*/}; name=${name%%.v*} local ver - vre='^v[^-]+$' + vre='^(tags/)?v[^-]+$' if [[ $desc =~ $vre ]]; then - ver="${desc#v}" - commit="$desc" + commit="${desc#tags/}" + ver="${commit#v}" else ver="$commit" fi @@ -85,17 +86,19 @@ _specparse() { license=($( for spec in "${_source[@]}"; do - read import lic desc commit <<<"$spec" + read import commit desc lic <<<"$spec" printf '%s\n' ${lic//,/ } done | sort -u )) source=($( for spec in "${_source[@]}"; do - local name ver url read name ver url <<<"$(_specparse "$spec")" echo "$name-$ver.tar.gz::$url" done -)) +) + acmetool-redirector.service + acmetool.sysusers +) md5sums=('10b9e98a923f8fa0c864f8bdd35fbecd' '46654457851ef6e7f795df572a710fb5' 'fef2a852aab48bbfd89cd872b315ce11' @@ -121,14 +124,16 @@ md5sums=('10b9e98a923f8fa0c864f8bdd35fbecd' 'a364243349d387c8a639f9b44db7b6e8' 'a2bdbf2c9ec7c0c70aedc85dfdbb8b33' '0aef876f153e0b862c3918fe0de88ce6' - 'ed07a5ae129a7203d7f5c1d68472d394') + 'ed07a5ae129a7203d7f5c1d68472d394' + '4a173e4c8b5208cc0c31b16216a88206' + 'a7663eb89e3a52c129d5061c3c173ce3') prepare() { cd "$srcdir" local spec for spec in "${_source[@]}"; do - local import lic desc commit - read import lic desc commit <<<"$spec" + local import commit desc lic + read import commit desc lic <<<"$spec" local name ver url read name ver url <<<"$(_specparse "$spec")" @@ -138,21 +143,32 @@ prepare() { } build() { + local buildinfo="$pkgname $pkgver"'$\n'"built for Parabola GNU/Linux-libre" + cd "$srcdir/gopath" - GOPATH=$PWD go install github.com/hlandau/acme/cmd/acmetool + GOPATH=$PWD go build \ + -ldflags "-X github.com/hlandau/degoutils/buildinfo.RawBuildInfo=$(base64 -w 0 <<< "$buildinfo")" \ + github.com/hlandau/acme/cmd/acmetool + + cd "$srcdir" + gopath/acmetool --help-man > acmetool.8 } package() { cd "$srcdir" - install -Dm755 gopath/bin/acmetool "$pkgdir"/usr/bin/acmetool + install -Dm755 gopath/acmetool "$pkgdir"/usr/bin/acmetool + install -Dm644 acmetool.8 "$pkgdir"/usr/share/man/man8/acmetool.8 + install -Dm644 acmetool-redirector.service "$pkgdir"/usr/lib/systemd/system/acmetool-redirector.service + install -Dm644 acmetool.sysusers "$pkgdir"/usr/lib/sysusers.d/acmetool.conf + install -d "$pkgdir"/usr/share/doc/$pkgname install -Dm644 acme-$pkgver/README.md acme-$pkgver/_doc/* -t "$pkgdir"/usr/share/doc/$pkgname install -d "$pkgdir"/usr/share/licenses/$pkgname local spec for spec in "${_source[@]}"; do - local import lic desc commit - read import lic desc commit <<<"$spec" + local import commit desc lic + read import commit desc lic <<<"$spec" local name ver url read name ver url <<<"$(_specparse "$spec")" diff --git a/pcr/acmetool/acmetool-redirector.service b/pcr/acmetool/acmetool-redirector.service new file mode 100644 index 000000000..b9cc5fd8d --- /dev/null +++ b/pcr/acmetool/acmetool-redirector.service @@ -0,0 +1,12 @@ +# This file is based on the output of `acmetool quickstart` +[Unit] +Description=acmetool HTTP redirector + +[Service] +Type=notify +ExecStart=/usr/bin/acmetool redirector --service.uid=daemon +Restart=always +RestartSec=30 + +[Install] +WantedBy=multi-user.target diff --git a/pcr/acmetool/acmetool.sysusers b/pcr/acmetool/acmetool.sysusers new file mode 100644 index 000000000..b764b7b05 --- /dev/null +++ b/pcr/acmetool/acmetool.sysusers @@ -0,0 +1 @@ +u acmetool - "ACME tool" -- cgit v1.2.3-54-g00ecf