s3lph
d473c1677b
Some checks failed
/ ansible-semaphore (push) Failing after 37s
/ atlasswprobe (push) Successful in 10m8s
/ daliserver (push) Successful in 2m24s
/ forgejo (push) Successful in 6m37s
/ forgejo-runner (push) Successful in 1m45s
/ http-mqtt-bridge (push) Successful in 5m0s
/ keycloak-24 (push) Successful in 10m23s
/ keycloak-25 (push) Successful in 9m56s
/ linux-diversion-ath-regd-optional (push) Successful in 18m30s
/ lottieconverter (push) Successful in 1m3s
/ matterbridge (push) Successful in 3m56s
/ matrix-element-web (push) Successful in 1m38s
/ matrix-hydrogen (push) Successful in 1m13s
/ matrix.to (push) Successful in 5m57s
/ maubot (push) Successful in 4m41s
/ maubot-plugin-spaceapi (push) Successful in 2m19s
/ maubot-plugin-ultimaker (push) Successful in 2m20s
/ mautrix-signal (push) Successful in 1m16s
/ mautrix-telegram (push) Successful in 1m15s
/ mediawiki-extension-auth-remoteuser (push) Successful in 1m6s
/ mediawiki-extension-nativesvghandler (push) Successful in 1m4s
/ mediawiki-extension-openidconnect (push) Successful in 1m26s
/ mediawiki-extension-pluggableauth (push) Successful in 1m9s
/ mqtt2prometheus (push) Successful in 4m15s
/ prometheus-ipmi-exporter (push) Successful in 1m45s
/ prometheus-dnsbl-exporter (push) Successful in 1m34s
/ prometheus2influxdb (push) Successful in 33s
/ python3-mautrix (push) Successful in 1m17s
/ python3-telethon (push) Successful in 1m24s
/ repo.s3lph.me-apt-source (push) Successful in 32s
/ republik-feeder (push) Successful in 1m8s
/ woodpecker-agent (push) Successful in 2m19s
/ woodpecker-cli (push) Successful in 2m16s
55 lines
2 KiB
Bash
Executable file
55 lines
2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
set -exo pipefail
|
|
|
|
API_URL=https://api.github.com/repos/element-hq/element-web/releases
|
|
JQ_EXPR='.[] | select( .prerelease==false and .draft==false and .target_commitish=="refs/heads/develop" ) | "\(.tag_name[1:]) \(.published_at) \(.assets[] | select(.name|test("element-.*.tar.gz$")).browser_download_url )"'
|
|
|
|
ROOT=$(pwd)
|
|
function fetch() {
|
|
cd "${SRCDIR}"
|
|
wget "${URL}" --output-document "element-web-${VERSION}.tar.gz"
|
|
tar --strip-components 1 -xf "element-web-${VERSION}.tar.gz"
|
|
rm -f "element-web-${VERSION}.tar.gz"
|
|
}
|
|
|
|
function prepare() {
|
|
mkdir -p \
|
|
"${PKGDIR}/DEBIAN" \
|
|
"${PKGDIR}/usr/share/matrix-element-web" \
|
|
"${PKGDIR}/etc/matrix-element-web" \
|
|
"${PKGDIR}/etc/apache2/sites-available"
|
|
cp -r "${SRCDIR}" "${PKGDIR}/usr/share/matrix-element-web/html"
|
|
cp "${ROOT}/debian.control" "${PKGDIR}/DEBIAN/control"
|
|
cp "${ROOT}/debian.conffiles" "${PKGDIR}/DEBIAN/conffiles"
|
|
cp "${ROOT}/matrix-element-web.site.conf" "${PKGDIR}/etc/apache2/sites-available/matrix-element-web.site.conf"
|
|
mv "${PKGDIR}/usr/share/matrix-element-web/html/config.sample.json" "${PKGDIR}/etc/matrix-element-web/config.json"
|
|
ln -s "/etc/matrix-element-web/config.json" "${PKGDIR}/usr/share/matrix-element-web/html/config.json"
|
|
sed -re "s/__VERSION__/${VERSION}/g" -i "${PKGDIR}/DEBIAN/control"
|
|
sed -re "s/__MAINTAINER__/${MAINTAINER}/g" -i "${PKGDIR}/DEBIAN/control"
|
|
# root:www-data
|
|
chown 0:33 -R "${PKGDIR}/usr/share/matrix-element-web" "${PKGDIR}/etc/matrix-element-web"
|
|
find "${PKGDIR}" -exec touch -m -d "${ISODATE}" {} \;
|
|
}
|
|
|
|
function package() {
|
|
cd "${BUILDDIR}"
|
|
dpkg-deb --build "${PKGDIR}" "${BUILDDIR}"
|
|
}
|
|
|
|
function build() {
|
|
read VERSION ISODATE URL <<<$(curl "${API_URL}" | jq -r "${JQ_EXPR}" | head -1)
|
|
export VERSION
|
|
export ISODATE
|
|
export URL
|
|
export BUILDDIR=${ROOT}/build
|
|
export SRCDIR=${ROOT}/build/srcdir
|
|
export PKGDIR=${ROOT}/build/pkgdir
|
|
mkdir -p ${SRCDIR} ${PKGDIR}
|
|
fetch
|
|
prepare
|
|
package
|
|
}
|
|
|
|
|
|
build
|