Date: Thursday, October 20, 2022 @ 19:00:55
Author: dvzrv
Revision: 1333008
archrelease: copy trunk to community-testing-any
Added:
postorius/repos/community-testing-any/
postorius/repos/community-testing-any/PKGBUILD
(from rev 1333007, postorius/trunk/PKGBUILD)
postorius/repos/community-testing-any/keys/
postorius/repos/community-testing-any/postorius-1.3.6-settings.patch
(from rev 1333007, postorius/trunk/postorius-1.3.6-settings.patch)
postorius/repos/community-testing-any/postorius.install
(from rev 1333007, postorius/trunk/postorius.install)
postorius/repos/community-testing-any/postorius.sysusers
(from rev 1333007, postorius/trunk/postorius.sysusers)
postorius/repos/community-testing-any/postorius.tmpfiles
(from rev 1333007, postorius/trunk/postorius.tmpfiles)
postorius/repos/community-testing-any/postorius.uwsgi
(from rev 1333007, postorius/trunk/postorius.uwsgi)
--------------------------------+
PKGBUILD | 99 +++++++++++++++++++++++++++++++++++++++
postorius-1.3.6-settings.patch | 76 +++++++++++++++++++++++++++++
postorius.install | 9 +++
postorius.sysusers | 1
postorius.tmpfiles | 7 ++
postorius.uwsgi | 18 +++++++
6 files changed, 210 insertions(+)
Copied: postorius/repos/community-testing-any/PKGBUILD (from rev 1333007,
postorius/trunk/PKGBUILD)
===================================================================
--- community-testing-any/PKGBUILD (rev 0)
+++ community-testing-any/PKGBUILD 2022-10-20 19:00:55 UTC (rev 1333008)
@@ -0,0 +1,99 @@
+# Maintainer: David Runge <[email protected]>
+
+pkgname=postorius
+pkgver=1.3.6.r155.g1fad482b
+_commit=1fad482b5830c7910e250ab2933180bd96276921 # somewhere on master past
1.3.6
+pkgrel=1
+pkgdesc="The New Mailman Web UI"
+arch=(any)
+url="https://gitlab.com/mailman/postorius"
+license=(GPL3)
+depends=(python-cmarkgfm python-django python-django-mailman3
+python-mailmanclient python-readme-renderer)
+makedepends=(git python-build python-installer python-setuptools python-wheel)
+checkdepends=(mailman3 python-beautifulsoup4 python-isort python-pytest
+python-pytest-django python-vcrpy)
+optdepends=(
+ 'python-django-debug-toolbar: for debugging'
+ 'mailman3: for configuring a local mailman instance'
+ 'uwsgi-plugin-python: for running inside uwsgi'
+)
+replaces=(python-django-postorius)
+backup=(
+ etc/uwsgi/${pkgname}.ini
+ etc/webapps/$pkgname/settings_local.py
+ etc/webapps/$pkgname/urls.py
+)
+install=$pkgname.install
+source=(
+ git+https://gitlab.com/mailman/$pkgname#commit=$_commit
+ $pkgname-1.3.6-settings.patch
+ $pkgname.sysusers
+ $pkgname.tmpfiles
+ $pkgname.uwsgi
+)
+sha512sums=('SKIP'
+
'0fc6611c4d8846a387c1ec3d74b01cba9bc10e22abc6fa6aa4bff11711b66155623fd356adbd548244998e0c76e936b3488141d1c13a70ad7df04b327cb474bf'
+
'3884b818da2deb148279e50316f720c95f0aaa529777b1b3662d8ab253cda823a90682a9eb47e941ca5ba80eefcb9a2d4afacd29f0340d7f9828b36ebcee23b3'
+
'44925c7ce6d1c13bd5bdd2cb449fa978b8eaadaac7ecff74075c23a13478decc4acd1f2cd0399bf55c312d6a08985a3e80f6e7a6e85be9e3dcb93ffb526ca9fb'
+
'c042f00d0d8dc72dadd19023152e55246c4d7a4b9d53bca3a05e7b8cb38cac5116417440d4ae82350820c7cb0cd414dcce45fa6af9be19296c4ebd0862dba896')
+b2sums=('SKIP'
+
'ea175042786a1c2647fccc2026544c552ba56850582251a367873288daff136812556c47b3836cc040c684dbc129abe7fcdbf2faab896ffc5f864b378ffd5f00'
+
'1ef6dc98c6751e6d65e49812d08d813879b791a7f13622ea31ecadae6dd1859a918761d7723732ed2e4872b9cae61b84c8dbfec2dd2522de9f0929a1ee1cec24'
+
'502d59cb0009b7cdf108a1611d17470d1a73c2d06bf6d9509799b63d4bbb4bb0a2cb71a39eddb0dc5990ee6489625174de6ce2d7e04e77a601c90a6da6d69c84'
+
'4b80d60c88d46edd0e6e61ad2ff37ba3568c6c56a2abd449f903f7302aeec4a3bc91bbd3ee846731513fa1906df2e3d7d1c52b75a55214051fb96b048f9b4999')
+validpgpkeys=('541EA0448453394FF77A0ECC9D9B2BA061D0A67C') # Abhilash Raj
<[email protected]>
+
+pkgver() {
+ cd $pkgname
+ git describe --long | sed 's/\([^-]*-g\)/r\1/;s/v//g;s/-/./g'
+}
+
+prepare() {
+ # become FHS compliant and disable the use of debug
+ patch -d $pkgname -p1 -i ../$pkgname-1.3.6-settings.patch
+
+ touch settings_local.py
+}
+
+build() {
+ cd $pkgname
+ python -m build --wheel --no-isolation
+}
+
+check() {
+ cd $pkgname/example_project
+ # disable broken tests: https://gitlab.com/mailman/postorius/-/issues/556
+ pytest -vv ../src/$pkgname/tests -k "not
test_change_subscription_from_address_to_primary and not
test_access_list_options_multiple_subscriptions"
+}
+
+package() {
+ local site_packages=$(python -c "import site;
print(site.getsitepackages()[0])")
+
+ cd $pkgname
+ python -m installer --destdir="$pkgdir" dist/*.whl
+
+ # remove tests
+ rm -frv "$pkgdir/$site_packages/$pkgname/tests/"
+
+ # django project
+ install -vDm 644 example_project/{__init__,manage,settings,wsgi}.py -t
"$pkgdir/usr/share/webapps/$pkgname"
+ # symlink locale and static dirs to state dir
+ ln -svf /var/lib//$pkgname/locale/ "$pkgdir/usr/share/webapps/$pkgname"
+ ln -svf /var/lib/$pkgname/static/ "$pkgdir/usr/share/webapps/$pkgname"
+ # state dir
+ install -vdm 750 "$pkgdir/var/lib/$pkgname/data"
+ install -vdm 755 "$pkgdir/var/lib/$pkgname/"{locale,static}
+ # log dir
+ install -vdm 750 "$pkgdir/var/log/$pkgname"
+ # config
+ install -vDm 640 ../settings_local.py example_project/urls.py -t
"$pkgdir/etc/webapps/$pkgname"
+ ln -svf /etc/webapps/$pkgname/settings_local.py
"$pkgdir/usr/share/webapps/$pkgname/settings_local.py"
+ ln -svf /etc/webapps/$pkgname/urls.py
"$pkgdir/usr/share/webapps/$pkgname/urls.py"
+ # uwsgi
+ install -vDm 644 ../$pkgname.uwsgi "$pkgdir/etc/uwsgi/$pkgname.ini"
+ # tmpfiles.d
+ install -vDm 644 ../$pkgname.tmpfiles
"$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
+ # sysusers.d
+ install -vDm 644 ../$pkgname.sysusers
"$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
+}
Copied: postorius/repos/community-testing-any/postorius-1.3.6-settings.patch
(from rev 1333007, postorius/trunk/postorius-1.3.6-settings.patch)
===================================================================
--- community-testing-any/postorius-1.3.6-settings.patch
(rev 0)
+++ community-testing-any/postorius-1.3.6-settings.patch 2022-10-20
19:00:55 UTC (rev 1333008)
@@ -0,0 +1,76 @@
+diff --git i/example_project/settings.py w/example_project/settings.py
+index 1fae6bee..8ad39d28 100644
+--- i/example_project/settings.py
++++ w/example_project/settings.py
+@@ -26,16 +26,10 @@ For the full list of settings and their values, see
+ https://docs.djangoproject.com/en/1.9/ref/settings/
+ """
+
+-# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
+-import os
+-
+ # Compatibility with Bootstrap 3
+ from django.contrib.messages import constants as messages
+
+
+-BASE_DIR = os.path.dirname(os.path.abspath(__file__))
+-
+-
+ # Quick-start development settings - unsuitable for production
+ # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
+
+@@ -43,7 +37,7 @@ BASE_DIR = os.path.dirname(os.path.abspath(__file__))
+ SECRET_KEY = '$!-7^wl#wiifjbh)5@f7ji%x!vp7s1vzbvwt26hxv$idixq0u0'
+
+ # SECURITY WARNING: don't run with debug turned on in production!
+-DEBUG = True
++DEBUG = False
+
+ ADMINS = (
+ #('Admin', '[email protected]'),
+@@ -85,15 +79,15 @@ INSTALLED_APPS = (
+ 'allauth.socialaccount.providers.stackexchange',
+
+ # Dev only dependencies. Do not include in any production site.
+- 'debug_toolbar',
+- 'requests_panel',
++ # 'debug_toolbar',
++ # 'requests_panel',
+ )
+
+
+ MIDDLEWARE = [
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ # NOTE: Do not include DebugToolbarMiddleware in any production site.
+- 'debug_toolbar.middleware.DebugToolbarMiddleware',
++ # 'debug_toolbar.middleware.DebugToolbarMiddleware',
+ 'django.middleware.common.CommonMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.middleware.locale.LocaleMiddleware',
+@@ -142,7 +136,7 @@ WSGI_APPLICATION = 'wsgi.application'
+ DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+- 'NAME': os.path.join(BASE_DIR, 'postorius.db'),
++ 'NAME': '/var/lib/postorius/data/postorius.db',
+ }
+ }
+
+@@ -190,7 +184,7 @@ USE_TZ = True
+ # Don't put anything in this directory yourself; store your static files
+ # in apps' "static/" subdirectories and in STATICFILES_DIRS.
+ # Example: "/var/www/example.com/static/"
+-STATIC_ROOT = os.path.join(BASE_DIR, 'static')
++STATIC_ROOT = '/var/lib/postorius/static'
+
+ # URL prefix for static files.
+ # Example: "http://example.com/static/", "http://static.example.com/"
+@@ -269,7 +263,7 @@ LOGGING = {
+ 'level': 'INFO',
+ #'class': 'logging.handlers.RotatingFileHandler',
+ 'class': 'logging.handlers.WatchedFileHandler',
+- 'filename': os.path.join(BASE_DIR, 'logs', 'postorius.log'),
++ 'filename': '/var/log/postorius/postorius.log',
+ 'formatter': 'verbose',
+ },
+ },
Copied: postorius/repos/community-testing-any/postorius.install (from rev
1333007, postorius/trunk/postorius.install)
===================================================================
--- community-testing-any/postorius.install (rev 0)
+++ community-testing-any/postorius.install 2022-10-20 19:00:55 UTC (rev
1333008)
@@ -0,0 +1,9 @@
+post_install() {
+ echo "Run the following to create/migrate the database:"
+ echo "sudo -u postorius django-admin migrate --pythonpath
/usr/share/webapps/postorius/ --settings settings"
+}
+
+post_upgrade() {
+ echo "Run the following to update static files and compress them:"
+ echo "sudo -u postorius django-admin collectstatic --pythonpath
/usr/share/webapps/postorius --settings settings"
+}
Copied: postorius/repos/community-testing-any/postorius.sysusers (from rev
1333007, postorius/trunk/postorius.sysusers)
===================================================================
--- community-testing-any/postorius.sysusers (rev 0)
+++ community-testing-any/postorius.sysusers 2022-10-20 19:00:55 UTC (rev
1333008)
@@ -0,0 +1 @@
+u postorius - "GNU Mailman Web User Interface" -
Copied: postorius/repos/community-testing-any/postorius.tmpfiles (from rev
1333007, postorius/trunk/postorius.tmpfiles)
===================================================================
--- community-testing-any/postorius.tmpfiles (rev 0)
+++ community-testing-any/postorius.tmpfiles 2022-10-20 19:00:55 UTC (rev
1333008)
@@ -0,0 +1,7 @@
+z /etc/webapps/postorius/settings_local.py 0640 root postorius -
+z /etc/webapps/postorius/urls.py 0640 root postorius -
+d %L/postorius 750 postorius postorius -
+d %S/postorius/data 750 postorius postorius -
+d %S/postorius/locale - postorius postorius -
+d %S/postorius/static - postorius postorius -
+d %t/postorius - postorius postorius -
Copied: postorius/repos/community-testing-any/postorius.uwsgi (from rev
1333007, postorius/trunk/postorius.uwsgi)
===================================================================
--- community-testing-any/postorius.uwsgi (rev 0)
+++ community-testing-any/postorius.uwsgi 2022-10-20 19:00:55 UTC (rev
1333008)
@@ -0,0 +1,18 @@
+[uwsgi]
+procname-master = postorius
+master = true
+plugins = python
+socket = /run/postorius/%n.sock
+stats = /run/postorius/%n-stats.sock
+uid = postorius
+gid = postorius
+processes = 10
+cheaper = 2
+cheaper-step = 1
+idle = 120
+die-on-idle = true
+chdir = /usr/share/webapps/postorius
+module = wsgi
+home = /
+touch-reload = %p
+vacuum = true