First version of cargo-deb packaging setup

This commit is contained in:
Paul van Tilburg 2020-05-31 22:49:07 +02:00
parent 18f33b1ece
commit 79692db45d
No known key found for this signature in database
GPG key ID: C6DE073EDA9EEC4D
7 changed files with 176 additions and 0 deletions

26
debian/postinst vendored Normal file
View file

@ -0,0 +1,26 @@
#!/bin/sh
set -e
CONDUIT_DATABASE_PATH=/var/lib/matrix-conduit
case "$1" in
configure)
# Create the `_matrix-conduit` user if it does not exist yet.
if ! getent passwd _matrix-conduit > /dev/null ; then
echo 'Adding system user for the Conduit Matrix homeserver' 1>&2
adduser --system --group --quiet \
--home $CONDUIT_DATABASE_PATH \
--disabled-login \
--force-badname \
_matrix-conduit
fi
# Create the database path if it does not exist yet.
if [ ! -d "$CONDUIT_DATABASE_PATH" ]; then
mkdir -p "$CONDUIT_DATABASE_PATH"
chown _matrix-conduit "$CONDUIT_DATABASE_PATH"
fi
;;
esac
#DEBHELPER#