update LavinMQ bundled sources #23
@@ -7,3 +7,5 @@ packaging/alpine/*/*/tmp/
|
||||
packaging/alpine/*/*/*.apk
|
||||
packaging/alpine/*/*/*.tar.*
|
||||
!packaging/alpine/*/*/*-vendor.tar.gz
|
||||
!packaging/alpine/local/lavinmq/lavinmq-*-shards.tar.gz
|
||||
!packaging/alpine/local/lavinmq/lavinmq-*-assets.tar.gz
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Maintainer: Joachim Schlöffel <joachim.schloeffel@financial-service-plus.de>
|
||||
pkgname=lavinmq
|
||||
pkgver=2.10.1
|
||||
pkgrel=1
|
||||
pkgver=2.10.2
|
||||
pkgrel=0
|
||||
pkgdesc="High-performance AMQP and MQTT message queue server"
|
||||
url="https://github.com/cloudamqp/lavinmq"
|
||||
arch="x86_64"
|
||||
@@ -82,9 +82,9 @@ _logrotate() {
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
1c2c932a0698227abfe8353988ea75b48f9048f183d85410797af5bc14495e2cb4497e72acc8fc9ff9ef8f78e8ebb648a1b40b5cf7f1b86e18597d10297417ff lavinmq-2.10.1.tar.gz
|
||||
d0dfdd5c0e474024f57deb9e31c76e3f176e798c8d21dea53d3aea1b05436bd03fa34e69ccddf322bc89adedce5f379df5a316cddbbdfe12520e5bf672ad8228 lavinmq-2.10.1-shards.tar.gz
|
||||
ae3cea2534b211abbcbd1e4fcb6da73dfaf383a19aef1c45f367cba77492cc20a7ce8283fc42f26c0a023149114c369bed307fb8cde0b8f27fba61165092e986 lavinmq-2.10.1-assets.tar.gz
|
||||
35757407adb6fdd6378c65cde229471bd362b6a7fdc13279658312ef8a7304c0557619a1394a0b4cf33ef25ffb6c039f65c217f2af37bf12fc01b73d84e55e69 lavinmq-2.10.2.tar.gz
|
||||
d0dfdd5c0e474024f57deb9e31c76e3f176e798c8d21dea53d3aea1b05436bd03fa34e69ccddf322bc89adedce5f379df5a316cddbbdfe12520e5bf672ad8228 lavinmq-2.10.2-shards.tar.gz
|
||||
ae3cea2534b211abbcbd1e4fcb6da73dfaf383a19aef1c45f367cba77492cc20a7ce8283fc42f26c0a023149114c369bed307fb8cde0b8f27fba61165092e986 lavinmq-2.10.2-assets.tar.gz
|
||||
62a609d50f28db960098c4c84ce4f1dad78413366a9a9aca18fe321114d687be3bf7b71924d4ace69bd74383c5ac40d2ee09ae0eef9c1bfe653b97448e42e110 lavinmq.confd
|
||||
1853196e70297b5c4a2207fde50df735620cf6d99c4994644fd676bffaf863d67300ad7ae771c4bbb86fce1a0485c2a7968cf912c5f5bb878e08b15e5a28ba1b lavinmq.initd
|
||||
9999dd6a96bd29a3d0bda1b2110af940b15acf1250a0f3ba6c93d16bd62063ab1c1dfa4c237da99bbb401150517abde59e2c7275f4b72c3eb7c90e1ce61d43b9 lavinmq.logrotate
|
||||
|
||||
@@ -55,23 +55,14 @@ Wrapper settings in `/etc/conf.d/lavinmq`:
|
||||
|
||||
1. In `APKBUILD`, set `pkgver` to the new upstream version and reset `pkgrel`
|
||||
to `0`.
|
||||
2. Add versioned vendored archives for the locked Shards dependencies and
|
||||
frontend assets. If the new upstream `shard.lock` and the asset rules in its
|
||||
`Makefile` are unchanged, the existing archives can be reused under the new
|
||||
names:
|
||||
2. Generate the versioned, locked Shards and frontend-asset archives:
|
||||
|
||||
```sh
|
||||
cd packaging/alpine/local/lavinmq
|
||||
cp lavinmq-2.10.1-shards.tar.gz lavinmq-<version>-shards.tar.gz
|
||||
cp lavinmq-2.10.1-assets.tar.gz lavinmq-<version>-assets.tar.gz
|
||||
git add -f lavinmq-<version>-shards.tar.gz lavinmq-<version>-assets.tar.gz
|
||||
ALPINE_PACKAGE=lavinmq mise run apk:update-generated
|
||||
```
|
||||
|
||||
When `shard.lock` changes, extract the upstream source, run
|
||||
`shards install --production` in it, and create the shards archive with
|
||||
`tar -czf lavinmq-<version>-shards.tar.gz lib`. If the asset rules change,
|
||||
download the files specified by the new `Makefile` to a staging directory
|
||||
and create `lavinmq-<version>-assets.tar.gz` from that directory's contents.
|
||||
The hook uses the upstream `shard.lock` and `Makefile`, so it also refreshes
|
||||
the bundled inputs when either dependency list changes.
|
||||
3. From the repository root, refresh checksums and build the package:
|
||||
|
||||
```sh
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
package_dir="${PACKAGE_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}"
|
||||
repo_root="${REPO_ROOT:-$(cd "${package_dir}/../../../.." && pwd)}"
|
||||
pkgver="$(awk -F= '$1 == "pkgver" { print $2; exit }' "${package_dir}/APKBUILD")"
|
||||
distfiles_dir="${repo_root}/.cache/apk-distfiles"
|
||||
shards_cache_dir="${repo_root}/.cache/shards"
|
||||
source_archive="${distfiles_dir}/lavinmq-${pkgver}.tar.gz"
|
||||
shards_archive="${package_dir}/lavinmq-${pkgver}-shards.tar.gz"
|
||||
assets_archive="${package_dir}/lavinmq-${pkgver}-assets.tar.gz"
|
||||
tmpdir="$(mktemp -d)"
|
||||
assets_dir="${tmpdir}/assets"
|
||||
|
||||
cleanup() {
|
||||
rm -rf "${tmpdir}"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
mkdir -p "${distfiles_dir}" "${shards_cache_dir}"
|
||||
if [[ ! -f "${source_archive}" ]]; then
|
||||
curl --fail --location --retry 3 --silent --show-error \
|
||||
--output "${source_archive}" \
|
||||
"https://github.com/cloudamqp/lavinmq/archive/refs/tags/v${pkgver}.tar.gz"
|
||||
fi
|
||||
|
||||
tar -xzf "${source_archive}" -C "${tmpdir}"
|
||||
source_dir="${tmpdir}/lavinmq-${pkgver}"
|
||||
if [[ ! -d "${source_dir}" ]]; then
|
||||
printf 'unexpected LavinMQ source archive layout: %s\n' "${source_archive}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# shard.lock pins the Crystal dependencies. `make js` fetches exactly the
|
||||
# frontend assets declared by this upstream version's Makefile.
|
||||
(
|
||||
cd "${source_dir}"
|
||||
SHARDS_CACHE_PATH="${shards_cache_dir}" shards install --production
|
||||
make js
|
||||
)
|
||||
|
||||
tar --create --gzip --file "${shards_archive}" \
|
||||
--directory "${source_dir}" \
|
||||
--sort=name --mtime='UTC 1970-01-01' --owner=0 --group=0 --numeric-owner \
|
||||
lib
|
||||
mkdir -p "${assets_dir}"
|
||||
# The offline Makefile patch intentionally reads every asset from the root of
|
||||
# .alpine-assets, including helpers.segment.js which upstream stores in chunks/.
|
||||
find "${source_dir}/static/js/lib" -type f -exec cp -p {} "${assets_dir}/" \;
|
||||
tar --create --gzip --file "${assets_archive}" \
|
||||
--directory "${assets_dir}" \
|
||||
--sort=name --mtime='UTC 1970-01-01' --owner=0 --group=0 --numeric-owner \
|
||||
.
|
||||
|
||||
printf 'Updated %s and %s\n' "${shards_archive##*/}" "${assets_archive##*/}"
|
||||
Reference in New Issue
Block a user