Add PKGBUILD and systemd files

This commit is contained in:
Edgar P. Burkhart 2022-05-21 12:12:34 +02:00
parent 52c18329d2
commit c93dd0fa97
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
6 changed files with 57 additions and 1 deletions

26
PKGBUILD Normal file
View file

@ -0,0 +1,26 @@
pkgname=nummi
pkgver=0.1.0
pkgrel=1
pkgdesc="Web-based accounting interface"
arch=("any")
url="https://git.edgarpierre.fr/edpibu/nummi"
license=("AGPL3")
depends=(
"gunicorn: server"
"python-django: django server"
)
optdepends=("postgresql: database")
source=(
"${pkgname}"
"${pkgname}.service"
"${pkgname}.socket"
)
package() {
install -Dm755 ${pkgname}/${pkgname} -t "${pkgdir}"/opt/
install -Dm644 ${pkgname}.service -t "${pkgdir}"/usr/lib/systemd/system/
install -Dm644 ${pkgname}.socket -t "${pkgdir}"/usr/lib/systemd/system/
install -Dm644 ${pkgname}.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/${pkgname}.conf
install -Dm644 ${pkgname}.sysusers "${pkgdir}"/usr/lib/sysusers.d/${pkgname}.conf
}

19
nummi.service Normal file
View file

@ -0,0 +1,19 @@
[Unit]
Description=Nummi server (accounting)
Requires=nummi.socket
After=network.target
[Service]
Type=notify
User=nummi
Group=nummi
RuntimeDirectory=nummi
WorkingDirectory=/opt/nummi
ExecStart=/usr/bin/gunicorn nummi.asgi:application
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
TimeoutStopSec=5
PrivateTmp=true
[Install]
WantedBy=multi-user.target

9
nummi.socket Normal file
View file

@ -0,0 +1,9 @@
[Unit]
Description=Nummi socket
[Socket]
ListenStream=/run/nummi.socket
SocketUser=http
[Install]
WantedBy=sockets.target

1
nummi.sysusers Normal file
View file

@ -0,0 +1 @@
u nummi - "Nummi daemon user" /var/lib/nummi /usr/bin/bash

1
nummi.tmpfiles Normal file
View file

@ -0,0 +1 @@
d /var/lib/nummi 0750 nummi nummi

View file

@ -14,7 +14,7 @@ from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
MEDIA_ROOT = BASE_DIR.joinpath("media") MEDIA_ROOT = Path("/var/lib/nummi")
# Quick-start development settings - unsuitable for production # Quick-start development settings - unsuitable for production