mailman-web: integrated folder structure, added rc script

This commit is contained in:
Tim Biermann 2024-02-26 21:20:31 +01:00
parent 6de0316969
commit 2471ec349c
Signed by: tb
GPG Key ID: 42F8B4E30B673606
6 changed files with 84 additions and 21 deletions

View File

@ -1,3 +1,10 @@
drwxr-xr-x root/root etc/
drwxr-xr-x root/root etc/rc.d/
-rwxr-xr-x root/root etc/rc.d/mailman-web
drwxr-xr-x root/root etc/webapps/
drwxr-xr-x root/root etc/webapps/mailman-web/
-rw-r----- root/root etc/webapps/mailman-web/settings.py
-rw-r----- root/root etc/webapps/mailman-web/urls.py
drwxr-xr-x root/root usr/ drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/bin/ drwxr-xr-x root/root usr/bin/
-rwxr-xr-x root/root usr/bin/mailman-web -rwxr-xr-x root/root usr/bin/mailman-web
@ -37,5 +44,12 @@ drwxr-xr-x root/root usr/lib/python3.10/site-packages/mailman_web/tests/__pycach
-rw-r--r-- root/root usr/lib/python3.10/site-packages/mailman_web/tests/__pycache__/test_basic.cpython-310.opt-2.pyc -rw-r--r-- root/root usr/lib/python3.10/site-packages/mailman_web/tests/__pycache__/test_basic.cpython-310.opt-2.pyc
-rw-r--r-- root/root usr/lib/python3.10/site-packages/mailman_web/tests/settings.py -rw-r--r-- root/root usr/lib/python3.10/site-packages/mailman_web/tests/settings.py
-rw-r--r-- root/root usr/lib/python3.10/site-packages/mailman_web/tests/test_basic.py -rw-r--r-- root/root usr/lib/python3.10/site-packages/mailman_web/tests/test_basic.py
-rw-r--r-- root/root usr/lib/python3.10/site-packages/mailman_web/urls.py lrwxrwxrwx root/root usr/lib/python3.10/site-packages/mailman_web/urls.py -> /etc/webapps/mailman-web/urls.py
-rw-r--r-- root/root usr/lib/python3.10/site-packages/mailman_web/wsgi.py -rw-r--r-- root/root usr/lib/python3.10/site-packages/mailman_web/wsgi.py
drwxr-xr-x root/root var/
drwxr-xr-x root/root var/lib/
drwxr-xr-x root/root var/lib/mailman-web/
drwxr-x--- root/root var/lib/mailman-web/data/
drwxr-xr-x root/root var/lib/mailman-web/static/
drwxr-xr-x root/root var/log/
drwxr-x--- root/root var/log/mailman-web/

View File

@ -1,7 +1,8 @@
untrusted comment: verify with /etc/ports/contrib.pub untrusted comment: verify with /etc/ports/contrib.pub
RWSagIOpLGJF34tBuTQbRbu9LBXqzG5dGWzGxNXc4dS5mD2o2ZAfCiMu5TqqJQsyIIQ+qhOx3HXbdN5Awwzj+LwgJmZCQ+J/SwY= RWSagIOpLGJF3wVKDaLR+PFRjaO0m0932ressDrtbA/7ed9ILjvHMl1T0wO+edueDbp8gc2h7CABEiI3ybxTmM6llQ5IQaRsnwA=
SHA256 (Pkgfile) = b0a450181936bbf508a6a7b43d57c301319adf2b80175dce5ff04edba1831753 SHA256 (Pkgfile) = 768b20029a9ddf01f87a01a0b5f537176c0d4469ad64da83e708da638fe0261c
SHA256 (.footprint) = 47123a45167785a79e51a71842baaa45366b3bf12c6e7f9080e60602e9a9b766 SHA256 (.footprint) = c46c7e5a5ba38a7f1e282c33b0fcb805589a3985245d54fc722cdfbf1e72dc5e
SHA256 (mailman-web-0.0.8.tar.gz) = 9cdfcbf97d91be6eabaa4b1c9ece139f64c0af9f4ee6508939bbdc269e8cd3e4 SHA256 (mailman-web-0.0.8.tar.gz) = 9cdfcbf97d91be6eabaa4b1c9ece139f64c0af9f4ee6508939bbdc269e8cd3e4
SHA256 (mailman-web.service) = f9ae706a1df0a7d454fde6d8df76decd090246a591d31447e44f6e0f07a0d1f6
SHA256 (settings.py) = cc93831cffbbd67527f984d2698e04aeae115a1d5a696395de0f25d887ad96c0
SHA256 (mailman-web-0.0.5-fhs.patch) = 026ab5afcd530f7ce0655211613d9ec1d0c26cc1b87057d85ee0619e5f377a65 SHA256 (mailman-web-0.0.5-fhs.patch) = 026ab5afcd530f7ce0655211613d9ec1d0c26cc1b87057d85ee0619e5f377a65
SHA256 (mailman-web-0.0.8-remove_django_versioned_dependency.patch) = c0445492f4534328dd0cc4808f88bf279d1428bb9de6c1d8ac830534d681f75d

View File

@ -8,15 +8,26 @@ name=mailman-web
version=0.0.8 version=0.0.8
release=1 release=1
source=(https://pypi.org/packages/source/m/mailman-web/mailman-web-$version.tar.gz source=(https://pypi.org/packages/source/m/mailman-web/mailman-web-$version.tar.gz
mailman-web-0.0.5-fhs.patch mailman-web.service
mailman-web-0.0.8-remove_django_versioned_dependency.patch) settings.py
mailman-web-0.0.5-fhs.patch)
build() { build() {
cd $name-$version cd $name-$version
local site_packages=$(/usr/bin/python3 -c "import site; print(site.getsitepackages()[0])")
patch -Np1 -i $SRC/mailman-web-0.0.5-fhs.patch patch -Np1 -i $SRC/mailman-web-0.0.5-fhs.patch
#patch -Np1 -i $SRC/mailman-web-0.0.8-remove_django_versioned_dependency.patch
/usr/bin/python3 -m build --wheel --skip-dependency-check --no-isolation /usr/bin/python3 -m build --wheel --skip-dependency-check --no-isolation
/usr/bin/python3 -m installer --compile-bytecode 2 --destdir=$PKG dist/*.whl /usr/bin/python3 -m installer --compile-bytecode 2 --destdir=$PKG dist/*.whl
install -vDm 640 ../settings.py "$PKG/etc/webapps/$name/settings.py"
install -vDm 640 mailman_web/urls.py "$PKG/etc/webapps/$name/urls.py"
ln -sfv /etc/webapps/$name/urls.py "$PKG/$site_packages/${name/-/_}/urls.py"
install -vdm 750 "$PKG/var/lib/$name/data/"
install -vdm 755 "$PKG/var/lib/$name/static/"
install -vdm 750 "$PKG/var/log/$name/"
install -Dm755 $SRC/mailman-web.service $PKG/etc/rc.d/$name
} }

View File

@ -1,13 +0,0 @@
diff --git i/setup.cfg w/setup.cfg
index 95eb36e..ab441e5 100644
--- i/setup.cfg
+++ w/setup.cfg
@@ -23,7 +23,7 @@ setup_requires =
setuptools-scm
install_requires =
django-allauth > 0.56.0
- django >=3.2, <4.2
+ django
django-mailman3 >= 1.3.11
postorius >= 1.3.10
hyperkitty >= 1.3.8

45
mailman-web/mailman-web.service Executable file
View File

@ -0,0 +1,45 @@
#!/bin/sh
#
# /etc/rc.d/mailman: start/stop mailman daemon
#
SSD=/sbin/start-stop-daemon
PROG=/usr/bin/mailman-web
PID=/run/mailman-web/master.pid
USER=mailman
PORT=8000
OPTS="runserver $PORT --settings settings --pythonpath /etc/webapps/mailman-web/"
case $1 in
start)
if [ ! -e /run/mailman-web ]; then
mkdir -p /run/mailman-web
fi
$SSD --start -c $USER --background --pidfile $PID --make-pidfile --exec $PROG -- $OPTS
;;
stop)
$SSD --stop -c $USER --retry 10 --pidfile $PID --remove-pidfile
;;
restart)
$0 stop
$0 start
;;
reload)
$0 stop
$0 start
;;
status)
$SSD --status -u $USER -c $USER --pidfile $PID
case $? in
0) echo "$PROG is running with pid $(cat $PID)" ;;
1) echo "$PROG is not running but the pid file $PID exists" ;;
3) echo "$PROG is not running" ;;
4) echo "Unable to determine the program status" ;;
esac
;;
*)
echo "usage: $0 [start|stop|restart|reload|status]"
;;
esac
# End of file

5
mailman-web/settings.py Normal file
View File

@ -0,0 +1,5 @@
# mailman-web config
from mailman_web.settings.base import *
from mailman_web.settings.mailman import *
# modifications to the file should begin below this comment