diff options
Diffstat (limited to 'pcr')
-rw-r--r-- | pcr/acmetool/PKGBUILD | 173 |
1 files changed, 105 insertions, 68 deletions
diff --git a/pcr/acmetool/PKGBUILD b/pcr/acmetool/PKGBUILD index 7aa453789..46d1cac70 100644 --- a/pcr/acmetool/PKGBUILD +++ b/pcr/acmetool/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Luke Shumaker <lukeshu@parabola.nu> pkgname=acmetool -pkgver=0.0.51 +pkgver=0.0.54 url=https://github.com/hlandau/acme pkgdesc="Automatic certificate acquisition tool for ACME (Let's Encrypt)" @@ -10,61 +10,109 @@ arch=(x86_64 i686) depends=(libcap) makedepends=(go) +# 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 _source=( - #import-path license version download-spec - "github.com/hlandau/acme MIT $pkgver %n-%v.tar.gz::https://github.com/hlandau/%n/archive/v%v.tar.gz" + #import-path license git-describe commit + "github.com/hlandau/acme MIT v$pkgver 296b3f53761540e9808965e37d363ff722d8b0cc" - 'github.com/coreos/go-systemd Apache 6 %n-%v.tar.gz::https://github.com/coreos/%n/archive/v%v.tar.gz' # master~5 - 'github.com/godbus/dbus BSD2 4.0.0 %n-%v.tar.gz::https://github.com/godbus/%n/archive/v%v.tar.gz' # master~5 - 'github.com/hlandau/xlog MIT 1.0.0 %n-%v.tar.gz::https://github.com/hlandau/%n/archive/v%v.tar.gz' - 'github.com/jmhodges/clock MIT 1.0 %n-%v.tar.gz::https://github.com/jmhodges/%n/archive/v%v.tar.gz' # master~4 - 'github.com/ogier/pflag BSD3 0.0.1 %n-%v.tar.gz::https://github.com/ogier/%n/archive/v%v.tar.gz' # master~7 - 'github.com/peterhellberg/link MIT 1.0.0 %n-%v.tar.gz::https://github.com/peterhellberg/%n/archive/v%v.tar.gz' - 'github.com/satori/go.uuid MIT 1.0.0 %n-%v.tar.gz::https://github.com/satori/%n/archive/v%v.tar.gz' - 'gopkg.in/alecthomas/kingpin.v2 MIT 2.1.11 %n-%v.tar.gz::https://github.com/alecthomas/%n/archive/v%v.tar.gz' - 'gopkg.in/cheggaaa/pb.v1 BSD3 1.0.3 %n-%v.tar.gz::https://github.com/cheggaaa/%n/archive/v%v.tar.gz' - 'gopkg.in/hlandau/configurable.v1 MIT 1.0.1 %n-%v.tar.gz::https://github.com/hlandau/%n/archive/v%v.tar.gz' - 'gopkg.in/hlandau/easyconfig.v1 MIT 1.0.14 %n-%v.tar.gz::https://github.com/hlandau/%n/archive/v%v.tar.gz' - 'gopkg.in/hlandau/service.v2 ISC 2.0.15 %n-%v.tar.gz::https://github.com/hlandau/%n/archive/v%v.tar.gz' - 'gopkg.in/hlandau/svcutils.v1 MIT,Apache 1.0.7 %n-%v.tar.gz::https://github.com/hlandau/%n/archive/v%v.tar.gz' - 'gopkg.in/square/go-jose.v1 Apache 1.0.2 %n-%v.tar.gz::https://github.com/square/%n/archive/v%v.tar.gz' - 'gopkg.in/tylerb/graceful.v1 MIT 1.2.5 %n-%v.tar.gz::https://github.com/tylerb/%n/archive/v%v.tar.gz' - - 'github.com/alecthomas/template BSD3 a0175ee3bccc567396460bf5acd36800cb10c49c %n-%v.tar.gz::https://github.com/alecthomas/%n/archive/%v.tar.gz' - 'github.com/alecthomas/units MIT 2efee857e7cfd4f3d0138cc3cbb1b4966962b93a %n-%v.tar.gz::https://github.com/alecthomas/%n/archive/%v.tar.gz' - 'github.com/hlandau/degoutils MIT 389a84765529fb80bf6fff3cdcdf814cbc42ee47 %n-%v.tar.gz::https://github.com/hlandau/%n/archive/%v.tar.gz' - 'github.com/hlandauf/gspt MIT 25f3bd3f5948489aa5f31c949310ae9f2b0e956c %n-%v.tar.gz::https://github.com/hlandauf/%n/archive/%v.tar.gz' - 'github.com/mattn/go-isatty MIT 56b76bdf51f7708750eac80fa38b952bb9f32639 %n-%v.tar.gz::https://github.com/mattn/%n/archive/%v.tar.gz' - 'github.com/mitchellh/go-wordwrap MIT ad45545899c7b13c020ea92b2072220eefad42b8 %n-%v.tar.gz::https://github.com/mitchellh/%n/archive/%v.tar.gz' - 'github.com/shiena/ansicolor MIT a422bbe96644373c5753384a59d678f7d261ff10 %n-%v.tar.gz::https://github.com/shiena/%n/archive/%v.tar.gz' - 'golang.org/x/crypto BSD3 5bcd134fee4dd1475da17714aac19c0aa0142e2f %n-%v.tar.gz::https://github.com/golang/%n/archive/%v.tar.gz' - 'golang.org/x/net BSD3 0c607074acd38c5f23d1344dfe74c977464d1257 %n-%v.tar.gz::https://github.com/golang/%n/archive/%v.tar.gz' - 'gopkg.in/yaml.v2 MIT,LGPL3 a83829b6f1293c91addabc89d0571c246397bbf4 %n-%v.tar.gz::https://github.com/go-yaml/%n/archive/%v.tar.gz' + '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' ) +_specparse() { + local import lic desc commit + read import lic desc commit <<<"$1" + + local name=${import##*/}; name=${name%%.v*} + + local ver + vre='^v[^-]+$' + if [[ $desc =~ $vre ]]; then + ver="${desc#v}" + commit="$desc" + else + ver="$commit" + fi + + local url pkg + case "$import" in + github.com/*) + url=https://$import/archive/${commit}.tar.gz + ;; + gopkg.in/*) + pkg=${import#gopkg.in/} + pkg=${pkg%%.v*} + [[ $pkg = */* ]] || pkg=go-${pkg}/${pkg} + url=https://github.com/${pkg}/archive/${commit}.tar.gz + ;; + golang.org/x/*) + url=https://github.com/golang/${import#golang.org/x/}/archive/${commit}.tar.gz + ;; + *) + error "You need to update the _specparse() function to support import: %q" "$import" + exit 3 + ;; + esac + echo "${name} ${ver} ${url}" +} + license=($( for spec in "${_source[@]}"; do - read import lic ver dlspec <<<"$spec" + read import lic desc commit <<<"$spec" printf '%s\n' ${lic//,/ } done | sort -u )) source=($( for spec in "${_source[@]}"; do - read import lic ver dlspec <<<"$spec" - name=${import##*/} - name=${name%%.v*} - dlspec=${dlspec//%v/$ver} - dlspec=${dlspec//%n/$name} - echo "${dlspec}" + local name ver url + read name ver url <<<"$(_specparse "$spec")" + echo "$name-$ver.tar.gz::$url" done )) -md5sums=('faa334178c2d410761826db50aa830ee' - '6644085da9ae245a41026379e8631a9c' - '23075bbed798cd3595fa3f13abf0a855' +md5sums=('10b9e98a923f8fa0c864f8bdd35fbecd' + '46654457851ef6e7f795df572a710fb5' + 'fef2a852aab48bbfd89cd872b315ce11' + 'e3a029e3c62796fdff8fc61ffe888235' + 'fa01f0cee040b8307cdc989ef95144be' + '11651a53b4e33190c230e12d9af41d1a' 'd15021ff2511e28417c4c0891c15a595' - '3740f33ada637ade0a2be702b6079c26' - '5f723bcbcf087db25c8f4632c284b8f7' + '5112b44c1dce49d44059c5fd20689aa6' + '785505b477269cfec6069918a1876497' + 'eaed246cf927a4aa2cd2c01959ccd632' + '123bc1f8f3dc842fc1dfccf65e4ffe6b' + 'bea03fee4cabfb602555e6b3ec4091f0' 'a100c218269357217b8619e5acff83e6' - 'b8446830f46c3253d9d59d79cae35a42' + 'd0cd15432cf30fae3d6594f3f0839171' + '4f1ce87e11abc3da157a380bce08a256' + '86c7c12e82422cbbe4c5378642b73ae8' + 'da6e0a74b19c40839fd8e9b3cc2673ed' '50ba53846f917bc2d7dbde289d257891' 'e1e375f2bed8df78d0f39dfb224ac137' 'b08b85ab86aa2bc685b0345f60709db3' @@ -72,30 +120,20 @@ md5sums=('faa334178c2d410761826db50aa830ee' '429d0652cb564b90691ee2be617c514b' 'a364243349d387c8a639f9b44db7b6e8' 'a2bdbf2c9ec7c0c70aedc85dfdbb8b33' - '91adf3962839df852ea8938ddc64c74c' - '46654457851ef6e7f795df572a710fb5' - 'fef2a852aab48bbfd89cd872b315ce11' - '11651a53b4e33190c230e12d9af41d1a' - '5112b44c1dce49d44059c5fd20689aa6' - 'eaed246cf927a4aa2cd2c01959ccd632' - '123bc1f8f3dc842fc1dfccf65e4ffe6b' - '4f1ce87e11abc3da157a380bce08a256' - 'e7b9d7a2285341c4b9a04a0591541968' - 'c3149e2e6d121cd0776f08703b2350ff' + '0aef876f153e0b862c3918fe0de88ce6' 'ed07a5ae129a7203d7f5c1d68472d394') prepare() { cd "$srcdir" - local spec import ver dlspec name tarname + local spec for spec in "${_source[@]}"; do - read import lic ver dlspec <<<"$spec" - name=${import##*/} - name=${name%%.v*} - dlspec=${dlspec//%v/$ver} - dlspec=${dlspec//%n/$name} - tarname="$(get_filename "${dlspec}")" + local import lic desc commit + read import lic desc commit <<<"$spec" + local name ver url + read name ver url <<<"$(_specparse "$spec")" + mkdir -p "$(dirname "gopath/src/$import")" - ln -srTf "${tarname%.tar.gz}" "gopath/src/$import" + ln -srTf "${name}-${ver}" "gopath/src/$import" done } @@ -111,16 +149,15 @@ package() { install -Dm644 acme-$pkgver/README.md acme-$pkgver/_doc/* -t "$pkgdir"/usr/share/doc/$pkgname install -d "$pkgdir"/usr/share/licenses/$pkgname - local spec import lic ver dlspec name base found + local spec for spec in "${_source[@]}"; do - read import lic ver dlspec <<<"$spec" - name=${import##*/} - name=${name%%.v*} + local import lic desc commit + read import lic desc commit <<<"$spec" + local name ver url + read name ver url <<<"$(_specparse "$spec")" - base=$name - if [[ $name != acme ]]; then - base=lib-$base - fi + local base=$name + [[ $name == acme ]] || base=lib-$base base="$pkgdir"/usr/share/licenses/$pkgname/$base case $name in acme) |