Date: Thursday, October 20, 2022 @ 19:15:20 Author: dvzrv Revision: 1333011
upgpkg: mailman-web 0.0.5.r12.gb79b7b5-1: Update to current HEAD. Upstream has not done any release in a long time, even after providing them with fixes for django 4.0 and django 4.1 and contacting them about this multiple times. Backporting patches has become extremely cumbersome, as they do not cleanly apply on top of the source tarball (e.g. setuptools seems to change setup.py). So we are permanently switching to git sources and do not bother with backporting commits on top of 0.0.5 for our own sanity. Remove all now included (backported) patches. Modified: mailman-web/trunk/PKGBUILD Deleted: mailman-web/trunk/mailman-web-0.0.5-django4.patch ---------------------------------+ PKGBUILD | 32 ++-- mailman-web-0.0.5-django4.patch | 300 -------------------------------------- 2 files changed, 16 insertions(+), 316 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-10-20 19:11:24 UTC (rev 1333010) +++ PKGBUILD 2022-10-20 19:15:20 UTC (rev 1333011) @@ -1,14 +1,15 @@ # Maintainer: David Runge <[email protected]> pkgname=mailman-web -pkgver=0.0.5 -pkgrel=5 +pkgver=0.0.5.r12.gb79b7b5 +_commit=b79b7b5d51f21732ec503089e80d80fe12f6d66e # somewhere on master past 0.0.5 +pkgrel=1 pkgdesc="The web interface for Mailman 3" arch=(any) url="https://gitlab.com/mailman/mailman-web" license=(GPL3) depends=(hyperkitty postorius python-django python-whoosh) -makedepends=(python-build python-installer python-setuptools-scm python-wheel) +makedepends=(git python-build python-installer python-setuptools-scm python-wheel) optdepends=( 'mailman3: for interacting with a local mailman instance' 'uwsgi-plugin-python: for running inside uwsgi' @@ -19,42 +20,41 @@ ) options=() source=( - https://files.pythonhosted.org/packages/source/${pkgname::1}/$pkgname/$pkgname-$pkgver.tar.gz + git+https://gitlab.com/mailman/mailman-web#commit=$_commit $pkgname-qcluster.service settings.py $pkgname.sysusers $pkgname.tmpfiles $pkgname.uwsgi - $pkgname-0.0.5-django4.patch $pkgname-0.0.5-fhs.patch ) -sha512sums=('3a46372cbe332754e2fef4088651d6ab5c95ad90f0faaca091cd89eb69d73c8fb222861fafd8312d10b244c76a86c2e4018301fc5c18d15570c3e88c1015e9af' +sha512sums=('SKIP' '5440c170f50cbc4c95e0cf4c9d2c8a03759e0d13c2f9c604a6eaedfde9abcc4ae6cc9845d53d58cd4ee06373bab166f3115a59ebac3b77fe1d33ab7054c7c5d7' 'cf255da4028a36a21473166a44c4a104b58ed824b81a08548bd89a861f9684bf89d166c4827b8dd5d9e516a9b0a30bbf26733f9a7e3f0d85f1c5c29f3929a3db' '4044b2500dc63ec1cea829d0189428de590755006c38d6f82e5a51af8935409a1ea5a5fb1f676d2331ceb59383cf79730837427eff32ad82f900068684aa3b45' '07aa2af5f72dccdfe32f3f220d798e5e6d57ed6875566e33ad610a05a063861a84aa6bb6d4c9a172711862855e7eae68a19fd6dcd098893f4a365579bd29cf57' '744a0f0af9c5683b50bf43816262917edeb47e954aba1ac7c9d831eddf3c5e63e307811e35161ac3a717b08f7d9c3dface0a2703a7c2a0f6d3a9882ce445109f' - 'df591eb1deada23166131eb06d8dfaccfbbccf8c61d3befebedd56c6de45f02e0311d6c2d87632cffe2ba335883473de642300af192a5dc4983b6fa6c7381759' '311b968255435f20ee3c9d4c88e7c4f122b93b6fef8b586896e5cd3bf63e95fae1b4a770cacb3e6eb35859b5a69f26f98c3cd9ca44fcfb509ef676556f2fb67e') -b2sums=('dcc5fbae4ab17b107e59f02eb83e1f1bb1662f63fb1c6c4731b6a8dec0a2eeeac1986f99022fe7e2049aebbcd8bcb682bf4454fc4691a590f31a4ed4d744f73b' +b2sums=('SKIP' '48d65925bbbe4f17c1d4a656eb533621904fbffee06ff0ce09fbc9ad69cd947269998f31a9a172645d9389d98caf8395e4a3d9fbaafeedbf52b774725d446e29' '40c2583cf72597fbcdfeecabb8aa10cb2fe1e5f9b60669bdc933e4884899325f70ba4ab9f27dc702aacf26f0b0de400b26245c7770a9b3e8cc0b0641478028d6' 'c57e70b949947ce3d30053886620221346d87416034cd004dcd91107e55a0123fb37a6c68796168ddabaab467b0f77dd8292e650df05e2e1eed0ec4d63becc2b' '80ca9c95c9bb3ce42bd4e3efbea59bc6cbbdabd35c504ee5c7414b8c657d863119921577fb618e0709631d05704d24698a2575f12aed81cf1cf16cd8ce116ed9' '7f39c6752f54048e1268c94010fa2fbdc6cc7db0c931c616469068ba835330b9cb8ec183978f2047fd8e0aff88b25de7437cbb112dbdad25f795e25f2419f809' - '71a20511842ed441269d214a58d0bd56b6d6f1c6a830463c45235e729bf8f88e22b0265be28d156509a2eeef3629db6559e69c3570cb489d87b92075f7e0edcb' '7c176a0ae2ea3cb266b08e821c971ff00d39c2cb3de2b93de6b69e4c38e4647b1b42df468bb0d8ac72f02b069d34969d29e586093f7183a19371d83cabdd3fc7') +pkgver() { + cd $pkgname + git describe --long | sed 's/\([^-]*-g\)/r\1/;s/v//g;s/-/./g' +} + prepare() { - # add patch for django >= 4.0: https://gitlab.com/mailman/mailman-web/-/merge_requests/23 - patch -Np1 -d $pkgname-$pkgver -i ../$pkgname-0.0.5-django4.patch # set FHS and packaging compliant default locations - patch -Np1 -d $pkgname-$pkgver -i ../$pkgname-0.0.5-fhs.patch - + patch -Np1 -d $pkgname -i ../$pkgname-0.0.5-fhs.patch } build() { - cd $pkgname-$pkgver + cd $pkgname python -m build --wheel --no-isolation } @@ -61,13 +61,13 @@ package() { local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") - cd $pkgname-$pkgver + cd $pkgname python -m installer --destdir="$pkgdir" dist/*.whl # config install -vDm 640 ../settings.py "$pkgdir/etc/webapps/$pkgname/settings.py" install -vDm 640 mailman_web/urls.py "$pkgdir/etc/webapps/$pkgname/urls.py" - ln -sfv /etc/webapps/$pkgname/urls.py "$pkgdir$site_packages/${pkgname/-/_}/urls.py" + ln -sfv /etc/webapps/$pkgname/urls.py "$pkgdir/$site_packages/${pkgname/-/_}/urls.py" install -vdm 750 "$pkgdir/var/lib/$pkgname/data/" install -vdm 755 "$pkgdir/var/lib/$pkgname/static/" Deleted: mailman-web-0.0.5-django4.patch =================================================================== --- mailman-web-0.0.5-django4.patch 2022-10-20 19:11:24 UTC (rev 1333010) +++ mailman-web-0.0.5-django4.patch 2022-10-20 19:15:20 UTC (rev 1333011) @@ -1,300 +0,0 @@ -diff -ruN a/.flake8 b/.flake8 ---- a/.flake8 1970-01-01 01:00:00.000000000 +0100 -+++ b/.flake8 2022-08-12 19:43:01.553759779 +0200 -@@ -0,0 +1,14 @@ -+[flake8] -+max-line-length = 79 -+output-file = flake8.txt -+max-complexity = 10 -+exclude = -+ .git -+ .tox -+ .venv -+ .cache -+ .eggs -+ .pytest* -+ *.egg-info -+ examples -+ doc -diff -ruN a/.gitignore b/.gitignore ---- a/.gitignore 2019-03-25 02:16:20.000000000 +0100 -+++ b/.gitignore 2022-08-12 19:43:01.560426406 +0200 -@@ -1,4 +1,5 @@ - *.eggs/ -+*.egg-info/ - *__pycache__/ - *.db - /mailman-web.toml -diff -ruN a/.gitlab-ci.yml b/.gitlab-ci.yml ---- a/.gitlab-ci.yml 2019-03-25 02:16:20.000000000 +0100 -+++ b/.gitlab-ci.yml 2022-08-12 19:43:01.560426406 +0200 -@@ -1,6 +1,11 @@ -+--- -+ - image: maxking/mailman-ci-runner - - - docs: - script: - - tox -e docs -+lint: -+ script: -+ - tox -e lint -diff -ruN a/docs/conf.py b/docs/conf.py ---- a/docs/conf.py 2021-01-20 01:10:36.000000000 +0100 -+++ b/docs/conf.py 2022-08-12 19:43:01.560426406 +0200 -@@ -65,7 +65,7 @@ - # - # This is also used if you do content translation via gettext catalogs. - # Usually you set "language" from the command line for these cases. --language = None -+language = 'en' - - # List of patterns, relative to source directory, that match files and - # directories to ignore when looking for source files. -@@ -194,6 +194,7 @@ - - add_module_names = False - -+ - # -- Modify the docstring - def process_docstring(app, what, name, obj, options, lines): - if what not in ('module'): -@@ -205,5 +206,6 @@ - """.format(pp.pformat(obj)).splitlines()) - return - -+ - def setup(app): - app.connect('autodoc-process-docstring', process_docstring) -diff -ruN a/docs/settings.py b/docs/settings.py ---- a/docs/settings.py 2021-01-20 01:10:36.000000000 +0100 -+++ b/docs/settings.py 2022-08-12 19:43:01.560426406 +0200 -@@ -1,8 +1,8 @@ - # Mailman Web configuration file. - # /etc/mailman3/settings.py - --from mailman_web.settings.base import * --from mailman_web.settings.mailman import * -+from mailman_web.settings.base import * # noqa: F403 -+from mailman_web.settings.mailman import * # noqa: F403 - - - #: Default list of admins who receive the emails from error logging. -@@ -14,7 +14,7 @@ - DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', -- 'NAME': ‘mailmanweb’, -+ 'NAME': 'mailmanweb', - 'USER': '<db_username>', - 'PASSWORD': '<password>', - 'HOST': 'localhost', -@@ -28,7 +28,7 @@ - - - # Make sure that this directory is created or Django will fail on start. --LOGGING['handlers']['file']['filename'] = '/opt/mailman/web/logs/mailmanweb.log' -+LOGGING['handlers']['file']['filename'] = '/opt/mailman/web/logs/mailmanweb.log' # noqa: F405,E501 - - #: See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts - ALLOWED_HOSTS = [ -diff -ruN a/mailman_web/manage.py b/mailman_web/manage.py ---- a/mailman_web/manage.py 2021-02-03 06:09:38.000000000 +0100 -+++ b/mailman_web/manage.py 2022-08-12 19:43:01.560426406 +0200 -@@ -3,12 +3,16 @@ - import sys - from pathlib import Path - -+ - def setup(): - """Setup environment for Mailman web.""" - if os.getenv('DJANGO_SETTINGS_MODULE') is not None: - return - -- MAILMAN_WEB_CONFIG = os.getenv('MAILMAN_WEB_CONFIG', '/etc/mailman3/settings.py') -+ MAILMAN_WEB_CONFIG = os.getenv( -+ 'MAILMAN_WEB_CONFIG', -+ '/etc/mailman3/settings.py', -+ ) - - if not os.path.exists(MAILMAN_WEB_CONFIG): - print('Mailman web configuration file at {} does not exist'.format( -@@ -22,6 +26,7 @@ - - os.environ['DJANGO_SETTINGS_MODULE'] = config_path.stem - -+ - def main(): - setup() - -diff -ruN a/mailman_web/settings/base.py b/mailman_web/settings/base.py ---- a/mailman_web/settings/base.py 2021-01-22 22:32:26.000000000 +0100 -+++ b/mailman_web/settings/base.py 2022-08-12 19:43:01.560426406 +0200 -@@ -1,5 +1,6 @@ - # Build paths inside the project like this: os.path.join(BASE_DIR, ...) - import os -+from django.contrib.messages import constants as messages - from pathlib import Path - - #: The base directory for logs and database. -@@ -130,8 +131,9 @@ - #: 'OPTIONS': {'charset': 'utf8mb4'} # Enable utf8 4-byte encodings. - #: - #: Check out --#: `Django documentation <https://docs.djangoproject.com/en/3.0/ref/settings/#databases>`_ --#: for more details. -+#: `Django documentation -+#: <https://docs.djangoproject.com/en/3.0/ref/settings/#databases>`_ for -+#: more details. - DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', -@@ -146,7 +148,7 @@ - AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': -- 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', -+ 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', # noqa: E501 - }, - { - 'NAME': -@@ -226,8 +228,6 @@ - #: https://docs.djangoproject.com/en/dev/topics/email/#email-backends - EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' - --# Compatibility with Bootstrap 3 --from django.contrib.messages import constants as messages # flake8: noqa - MESSAGE_TAGS = { - messages.ERROR: 'danger' - } -@@ -248,9 +248,8 @@ - 'filters': ['require_debug_false'], - 'class': 'django.utils.log.AdminEmailHandler' - }, -- 'file':{ -+ 'file': { - 'level': 'INFO', -- #'class': 'logging.handlers.RotatingFileHandler', - 'class': 'logging.handlers.WatchedFileHandler', - 'filename': os.path.join(BASE_DIR, 'logs', 'mailmanweb.log'), - 'formatter': 'verbose', -@@ -283,16 +282,12 @@ - }, - 'formatters': { - 'verbose': { -- 'format': '%(levelname)s %(asctime)s %(process)d %(name)s %(message)s' -+ 'format': '%(levelname)s %(asctime)s %(process)d %(name)s %(message)s' # noqa: E501 - }, - 'simple': { - 'format': '%(levelname)s %(message)s' - }, - }, -- #'root': { -- # 'handlers': ['file'], -- # 'level': 'INFO', -- #}, - } - - #: Current Django Site being served. This is used to customize the web host -diff -ruN a/mailman_web/settings/mailman.py b/mailman_web/settings/mailman.py ---- a/mailman_web/settings/mailman.py 2021-04-11 07:33:12.000000000 +0200 -+++ b/mailman_web/settings/mailman.py 2022-08-12 19:43:01.560426406 +0200 -@@ -1,5 +1,3 @@ --import os -- - #: Mailman Core default API Path - MAILMAN_REST_API_URL = 'http://localhost:8001' - #: Mailman Core API user -@@ -33,7 +31,7 @@ - ACCOUNT_AUTHENTICATION_METHOD = "username_email" - ACCOUNT_EMAIL_REQUIRED = True - ACCOUNT_EMAIL_VERIFICATION = "mandatory" --ACCOUNT_UNIQUE_EMAIL = True -+ACCOUNT_UNIQUE_EMAIL = True - - #: Protocol for URLs generated for authentication, like email - #: confirmation. -@@ -42,7 +40,8 @@ - - #: Extra configuration for Social auth. For these configuration to be used. - #: each of the social account providers must be first added in INSTALLED_APPS. --#: See :py:data:`mailman_web.settings.base.INSTALLED_APPS` for more configuration. -+#: See :py:data:`mailman_web.settings.base.INSTALLED_APPS` for more -+#: configuration. - SOCIALACCOUNT_PROVIDERS = { - 'openid': { - 'SERVERS': [ -diff -ruN a/mailman_web/urls.py b/mailman_web/urls.py ---- a/mailman_web/urls.py 2020-05-26 03:34:31.000000000 +0200 -+++ b/mailman_web/urls.py 2022-08-12 19:43:01.560426406 +0200 -@@ -17,19 +17,19 @@ - # Postorius. If not, see <http://www.gnu.org/licenses/>. - - --from django.conf.urls import include, url -+from django.conf.urls import include - from django.contrib import admin --from django.urls import reverse_lazy -+from django.urls import path, reverse_lazy - from django.views.generic import RedirectView - - urlpatterns = [ -- url(r'^$', RedirectView.as_view( -- url=reverse_lazy('list_index'), -- permanent=True)), -- url(r'^mailman3/', include('postorius.urls')), -- url(r'^archives/', include('hyperkitty.urls')), -- url(r'', include('django_mailman3.urls')), -- url(r'^accounts/', include('allauth.urls')), -- # Django admin -- url(r'^admin/', admin.site.urls), -+ path( -+ '', -+ RedirectView.as_view(url=reverse_lazy('list_index'), permanent=True), -+ ), -+ path('mailman3/', include('postorius.urls')), -+ path('archives/', include('hyperkitty.urls')), -+ path('', include('django_mailman3.urls')), -+ path('accounts/', include('allauth.urls')), -+ path('admin/', admin.site.urls), - ] -diff -ruN a/mailman_web/wsgi.py b/mailman_web/wsgi.py ---- a/mailman_web/wsgi.py 2019-10-01 03:56:13.000000000 +0200 -+++ b/mailman_web/wsgi.py 2022-08-12 19:43:01.560426406 +0200 -@@ -7,8 +7,6 @@ - https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ - """ - --import os -- - from django.core.wsgi import get_wsgi_application - from mailman_web.manage import setup - -diff -ruN a/setup.cfg b/setup.cfg ---- a/setup.cfg 2021-09-17 17:03:22.707365000 +0200 -+++ b/setup.cfg 2022-08-12 19:43:40.623515642 +0200 -@@ -22,7 +22,7 @@ - setuptools - setuptools-scm - install_requires = -- Django<3.1 -+ django >=3.2, <4.1 - postorius - hyperkitty - whoosh -diff -ruN a/tox.ini b/tox.ini ---- a/tox.ini 2021-01-20 01:10:36.000000000 +0100 -+++ b/tox.ini 2022-08-12 19:43:01.560426406 +0200 -@@ -1,5 +1,10 @@ - [tox] --envlist = docs -+envlist = docs, lint -+ -+[testenv:lint] -+deps = flake8 -+basepython = python3 -+commands = flake8 . - - [testenv:docs] - deps = sphinx
