2023-04-03 12:47:37 +00:00
|
|
|
#/usr/bin/env bash
|
|
|
|
|
|
|
|
pkgname="dendrite"
|
2023-08-02 14:30:49 +00:00
|
|
|
arch="amd64"
|
2024-01-30 08:55:08 +00:00
|
|
|
pkgrel=2
|
2024-01-30 08:38:51 +00:00
|
|
|
pkgver="0.13.6"
|
2023-04-03 12:47:37 +00:00
|
|
|
pkgdesc="Dendrite is a second-generation Matrix homeserver written in Go!"
|
|
|
|
url="https://github.com/matrix-org/dendrite"
|
|
|
|
maintainer="Leafee98 <me@leafee98.com>"
|
|
|
|
|
|
|
|
source=(
|
|
|
|
"dendrite::git+https://github.com/matrix-org/dendrite.git#tag=v${pkgver}"
|
2023-12-13 08:37:27 +00:00
|
|
|
"dendrite.service::materials/dendrite.service"
|
2023-04-03 12:47:37 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
function build {
|
|
|
|
(
|
|
|
|
cd "${srcdir}/dendrite"
|
2023-06-30 14:06:04 +00:00
|
|
|
go build -o bin/ ./cmd/...
|
2023-04-03 12:47:37 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
function package {
|
|
|
|
for f in ${srcdir}/dendrite/bin/*
|
|
|
|
do
|
2023-12-13 08:37:27 +00:00
|
|
|
install -Dm755 -t "${pkgdir}/usr/lib/dendrite/" "$f";
|
2023-04-03 12:47:37 +00:00
|
|
|
done
|
|
|
|
|
2023-06-30 14:06:04 +00:00
|
|
|
install -Dm644 "${srcdir}/dendrite/dendrite-sample.yaml" "${pkgdir}/etc/dendrite/dendrite-sample.yaml"
|
2023-12-13 08:37:27 +00:00
|
|
|
install -Dm755 "${srcdir}/dendrite.service" "${pkgdir}/usr/lib/systemd/system/dendrite.service"
|
|
|
|
}
|
|
|
|
|
|
|
|
function debian_postinst {
|
|
|
|
cat << 'EOF'
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-01-30 08:55:08 +00:00
|
|
|
adduser --system --group dendrite
|
2023-12-13 08:37:27 +00:00
|
|
|
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
|
|
|
if systemctl is-active --quiet dendrite.service ; then
|
|
|
|
systemctl restart dendrite.service
|
|
|
|
fi
|
|
|
|
EOF
|
2023-04-03 12:47:37 +00:00
|
|
|
}
|