debian-packages/packages/normal/dendrite/DEBBUILD
leafee98 82200e1ab6
All checks were successful
ci/woodpecker/push/build Pipeline was successful
fix: adduser with '--group' to create group together
2024-01-30 16:55:08 +08:00

46 lines
1 KiB
Plaintext

#/usr/bin/env bash
pkgname="dendrite"
arch="amd64"
pkgrel=2
pkgver="0.13.6"
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}"
"dendrite.service::materials/dendrite.service"
)
function build {
(
cd "${srcdir}/dendrite"
go build -o bin/ ./cmd/...
)
}
function package {
for f in ${srcdir}/dendrite/bin/*
do
install -Dm755 -t "${pkgdir}/usr/lib/dendrite/" "$f";
done
install -Dm644 "${srcdir}/dendrite/dendrite-sample.yaml" "${pkgdir}/etc/dendrite/dendrite-sample.yaml"
install -Dm755 "${srcdir}/dendrite.service" "${pkgdir}/usr/lib/systemd/system/dendrite.service"
}
function debian_postinst {
cat << 'EOF'
#!/usr/bin/env bash
adduser --system --group dendrite
systemctl daemon-reload
if systemctl is-active --quiet dendrite.service ; then
systemctl restart dendrite.service
fi
EOF
}