install dendrite to /usr/, add service and postinst
This commit is contained in:
parent
f3ca37573a
commit
0345418039
|
@ -10,6 +10,7 @@ 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 {
|
||||
|
@ -22,8 +23,23 @@ function build {
|
|||
function package {
|
||||
for f in ${srcdir}/dendrite/bin/*
|
||||
do
|
||||
install -Dm755 -t "${pkgdir}/usr/local/lib/dendrite/" "$f";
|
||||
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 dendrite
|
||||
|
||||
systemctl daemon-reload
|
||||
|
||||
if systemctl is-active --quiet dendrite.service ; then
|
||||
systemctl restart dendrite.service
|
||||
fi
|
||||
EOF
|
||||
}
|
||||
|
|
18
packages/normal/dendrite/materials/dendrite.service
Normal file
18
packages/normal/dendrite/materials/dendrite.service
Normal file
|
@ -0,0 +1,18 @@
|
|||
[Unit]
|
||||
Description=matrix home server
|
||||
After=network.target
|
||||
After=postgresql.service
|
||||
After=nats-server.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=dendrite
|
||||
Group=dendrite
|
||||
ExecStart=/usr/lib/dendrite/dendrite -config /etc/dendrite/dendrite.yaml -http-bind-address 127.0.0.1:8008
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
LimitNOFILE=65535
|
||||
MemoryMax=3072M
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in a new issue