2024-01-30 08:38:02 +00:00
|
|
|
#/usr/bin/env bash
|
|
|
|
|
|
|
|
pkgname="matrix-media-repo"
|
|
|
|
arch="amd64"
|
2024-01-31 06:11:51 +00:00
|
|
|
pkgrel=1
|
|
|
|
pkgver=1.3.3.57.ge781d64
|
2024-01-30 08:38:02 +00:00
|
|
|
pkgdesc="matrix-media-repo (aka MMR) is a highly customizable multi-domain media repository for Matrix."
|
|
|
|
url="https://github.com/t2bot/matrix-media-repo"
|
|
|
|
maintainer="Leafee98 <me@leafee98.com>"
|
|
|
|
|
|
|
|
source=(
|
2024-03-04 05:47:30 +00:00
|
|
|
"matrix-media-repo::git+https://github.com/t2bot/matrix-media-repo.git#branch=main"
|
2024-01-30 08:38:02 +00:00
|
|
|
"matrix-media-repo.service::materials/matrix-media-repo.service"
|
|
|
|
)
|
|
|
|
|
|
|
|
function pkgver {
|
|
|
|
git -C "${srcdir}/matrix-media-repo" describe --tags --long | sed -e 's/^v//; s/-/./g'
|
|
|
|
}
|
|
|
|
|
|
|
|
function build {
|
|
|
|
(
|
|
|
|
cd "${srcdir}/matrix-media-repo"
|
|
|
|
bash ./build.sh
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
function package {
|
|
|
|
for f in ${srcdir}/matrix-media-repo/bin/*
|
|
|
|
do
|
|
|
|
install -Dm755 -t "${pkgdir}/usr/lib/matrix-media-repo/" "$f";
|
|
|
|
done
|
|
|
|
|
|
|
|
install -Dm644 "${srcdir}/matrix-media-repo/config.sample.yaml" "${pkgdir}/etc/matrix-media-repo/config.sample.yaml"
|
|
|
|
install -Dm755 "${srcdir}/matrix-media-repo.service" "${pkgdir}/usr/lib/systemd/system/matrix-media-repo.service"
|
|
|
|
}
|
|
|
|
|
|
|
|
function debian_postinst {
|
|
|
|
cat << 'EOF'
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
service_name="matrix-media-repo.service"
|
|
|
|
|
2024-01-30 08:55:08 +00:00
|
|
|
adduser --system --group matrix-media-repo
|
2024-01-30 08:38:02 +00:00
|
|
|
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
|
|
|
if systemctl is-active --quiet ${service_name} ; then
|
|
|
|
systemctl restart ${service_name}
|
|
|
|
fi
|
|
|
|
EOF
|
|
|
|
}
|