From bdb98f9fc50617387469310c1783026d3f363bde5208fa8efa77a53adb09172d Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 23 Jan 2024 10:20:07 +0000 Subject: [PATCH 1/3] Accepting request 1140796 from home:mcalabkova:branches:openSUSE:Backports:SLE-15-SP6:mailman - Add patch find-flufl.patch to fix the tests with recent flufl.* - Don't require importlib-resources on new Pythons, they are already a part of a standard library OBS-URL: https://build.opensuse.org/request/show/1140796 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:mailman/python-mailman?expand=0&rev=90 --- find-flufl.patch | 30 ++++++++++++++++++++++++++++++ python-mailman.changes | 7 +++++++ python-mailman.spec | 8 +++++++- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 find-flufl.patch diff --git a/find-flufl.patch b/find-flufl.patch new file mode 100644 index 0000000..3718a93 --- /dev/null +++ b/find-flufl.patch @@ -0,0 +1,30 @@ +Index: mailman-3.3.9/setup.py +=================================================================== +--- mailman-3.3.9.orig/setup.py ++++ mailman-3.3.9/setup.py +@@ -119,8 +119,8 @@ case second 'm'. Any other spelling is + 'dnspython>=1.14.0', + 'falcon>=3.0.0', + 'flufl.bounce>=4.0', +- 'flufl.i18n>=3.2', +- 'flufl.lock>=5.1', ++ 'flufl-i18n>=3.2', ++ 'flufl_lock>=5.1', + 'gunicorn', + 'lazr.config', + 'python-dateutil>=2.0', +Index: mailman-3.3.9/src/mailman.egg-info/requires.txt +=================================================================== +--- mailman-3.3.9.orig/src/mailman.egg-info/requires.txt ++++ mailman-3.3.9/src/mailman.egg-info/requires.txt +@@ -7,8 +7,8 @@ click>=8.0.0 + dnspython>=1.14.0 + falcon>=3.0.0 + flufl.bounce>=4.0 +-flufl.i18n>=3.2 +-flufl.lock>=5.1 ++flufl-i18n>=3.2 ++flufl_lock>=5.1 + gunicorn + lazr.config + python-dateutil>=2.0 diff --git a/python-mailman.changes b/python-mailman.changes index 368b764..a6ce217 100644 --- a/python-mailman.changes +++ b/python-mailman.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jan 23 09:56:40 UTC 2024 - Markéta Machová + +- Add patch find-flufl.patch to fix the tests with recent flufl.* +- Don't require importlib-resources on new Pythons, they are already + a part of a standard library + ------------------------------------------------------------------- Mon Nov 6 00:27:43 UTC 2023 - Marcus Rueckert diff --git a/python-mailman.spec b/python-mailman.spec index 97b05ec..d8da215 100644 --- a/python-mailman.spec +++ b/python-mailman.spec @@ -86,6 +86,10 @@ Source31: python-mailman.rpmlintrc Source100: https://gitlab.com/mailman/mailman/-/raw/master/src/mailman/testing/ssl_test_cert.crt Source101: https://gitlab.com/mailman/mailman/-/raw/master/src/mailman/testing/ssl_test_key.key # +# PATCH-FIX-OPENSUSE mmachova@suse.com based on upstream merge request https://gitlab.com/mailman/mailman/-/merge_requests/1123 +# it won't be needed with new releases of flufl.lock and flufl.i18n, because the issue was fixed in pdm upstream https://github.com/pdm-project/pdm/pull/2057 +Patch0: find-flufl.patch +# BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -119,7 +123,6 @@ Requires: %{mypython}-flufl.bounce >= %{flufl_bounce_min_version} Requires: %{mypython}-flufl.i18n >= %{flufl_i18n_min_version} Requires: %{mypython}-flufl.lock >= %{flufl_lock_min_version} Requires: %{mypython}-gunicorn -Requires: %{mypython}-importlib-resources >= 1.1.0 Requires: %{mypython}-lazr.config Requires: %{mypython}-passlib Requires: %{mypython}-psycopg2 @@ -138,6 +141,9 @@ Provides: mailman = %{version} %if "%{expand:%%%{mypython}_provides}" == "python3" Provides: python3-mailman = %{version}-%{release} %endif +%if %{expand:%%%{mypython}_version_nodots} < 39 +Requires: %{mypython}-importlib-resources >= 1.1.0 +%endif Obsoletes: python3-mailman < %{version}-%{release} # help in replacing any previously installed multiflavor package back to the unprefixed package Provides: %{mypython}-mailman = %{version}-%{release} From d63b42b8546fb8ba4a72e53578ea9c8762bf2a0cc54338c9b7466904548841f9 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 16 Feb 2024 14:50:09 +0000 Subject: [PATCH 2/3] Accepting request 1146863 from home:mcalabkova:branches:devel:languages:python:mailman - Adapt to new RPM 4.19 and properly create mailman user/group (boo#1219674) - Build on Python 3.12 for the Factory OBS-URL: https://build.opensuse.org/request/show/1146863 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:mailman/python-mailman?expand=0&rev=91 --- mailman-user.conf | 3 +++ python-mailman.changes | 6 ++++++ python-mailman.spec | 47 ++++++++++++++++++++++++++++-------------- 3 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 mailman-user.conf diff --git a/mailman-user.conf b/mailman-user.conf new file mode 100644 index 0000000..fa5a232 --- /dev/null +++ b/mailman-user.conf @@ -0,0 +1,3 @@ +#Type Name ID GECOS Home directory Shell +u mailman - "mailman daemon user" /var/lib/mailman - +m mailman lock - - - diff --git a/python-mailman.changes b/python-mailman.changes index a6ce217..d5e48b4 100644 --- a/python-mailman.changes +++ b/python-mailman.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Feb 15 10:53:34 UTC 2024 - Markéta Machová + +- Adapt to new RPM 4.19 and properly create mailman user/group (boo#1219674) +- Build on Python 3.12 for the Factory + ------------------------------------------------------------------- Tue Jan 23 09:56:40 UTC 2024 - Markéta Machová diff --git a/python-mailman.spec b/python-mailman.spec index d8da215..5749788 100644 --- a/python-mailman.spec +++ b/python-mailman.spec @@ -1,7 +1,7 @@ # -# spec file +# spec file for package python-mailman # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,7 +15,7 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # -# keep in sync with setup.py + %global aiosmtpd_min_version 1.4.3 # normally it would be 1.6.2,!=1.7.0 but to avoid super comlex constructs in the spec file ... lets go with the version that we have in TW %global alembic_min_version 1.12 @@ -31,8 +31,6 @@ %global sqlalchemy_min_version 1.4.0 %global zope_interface_min_version 5.0 -%define mailman_user mailman -%define mailman_group mailman %define mailman_name mailman %define mailman_homedir %{_localstatedir}/lib/%{mailman_name} %define mailman_logdir %{_localstatedir}/log/%{mailman_name} @@ -49,9 +47,14 @@ %define psuffix %{nil} %bcond_with test %endif -%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150500 -# Newest python supported by mailman is Python 3.11 +%if 0%{?suse_version} >= 1600 +# Newest python supported by mailman is Python 3.12, but we have just Python 3.11 in SLE # See https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/docs/NEWS.rst +%define pythons python312 +%define mypython python312 +%define mypython_sitelib %{python312_sitelib} +%else +%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150500 %define pythons python311 %define mypython python311 %define mypython_sitelib %{python311_sitelib} @@ -61,6 +64,7 @@ %define mypython python3 %define mypython_sitelib %{python3_sitelib} %endif +%endif Name: python-mailman%{psuffix} Version: 3.3.9 Release: 0 @@ -74,6 +78,7 @@ Source10: mailman.cfg Source11: mailman.service Source12: mailman-tmpfiles.conf Source13: mailman.logrotate +Source14: mailman-user.conf # Source20: mailman-digests.service Source21: mailman-digests.timer @@ -93,6 +98,7 @@ Patch0: find-flufl.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +BuildRequires: sysuser-tools %if 0%{?suse_version} >= 1550 # use the real python3 primary for rpm pythondistdeps.py BuildRequires: python3-packaging @@ -128,7 +134,6 @@ Requires: %{mypython}-passlib Requires: %{mypython}-psycopg2 Requires: %{mypython}-python-dateutil >= %{python_dateutil_min_version} Requires: %{mypython}-requests -Requires: %{mypython}-setuptools Requires: %{mypython}-zope.component Requires: %{mypython}-zope.configuration Requires: %{mypython}-zope.event @@ -136,12 +141,12 @@ Requires: %{mypython}-zope.interface >= %{zope_interface_min_version} Requires: logrotate Requires(pre): /usr/sbin/groupadd Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives Provides: mailman = %{version} %if "%{expand:%%%{mypython}_provides}" == "python3" Provides: python3-mailman = %{version}-%{release} %endif -%if %{expand:%%%{mypython}_version_nodots} < 39 +%if 0%{?suse_version} < 1550 Requires: %{mypython}-importlib-resources >= 1.1.0 %endif Obsoletes: python3-mailman < %{version}-%{release} @@ -152,6 +157,13 @@ Obsoletes: %{mypython}-mailman < %{version}-%{release} %description -n mailman3 Mailman is a mailing list manager from the GNU project. +%package -n system-user-%{mailman_name} +Summary: System user and group mailman +%sysusers_requires + +%description -n system-user-%{mailman_name} +System user for use by the mailman client. + %prep %autosetup -p1 -n mailman-%{version} @@ -175,6 +187,8 @@ sed '/importlib_resources/d' -i src/mailman.egg-info/requires.txt setup.py %python_build ./generate_mo.sh +%sysusers_generate_pre %{SOURCE14} mailman system-user-%{mailman_name}.conf + %install %if !%{with test} %python_install @@ -209,6 +223,8 @@ install -m 0640 %{SOURCE10} %{buildroot}%{_sysconfdir}/%{mailman_name}.cfg install -m 0644 %{SOURCE11} %{buildroot}%{_unitdir}/%{mailman_name}.service install -m 0644 %{SOURCE12} %{buildroot}%{_tmpfilesdir}/%{mailman_name}.conf +install -D -m 0644 %{SOURCE14} %{buildroot}%{_sysusersdir}/system-user-%{mailman_name}.conf + install -m 0644 %{SOURCE20} %{buildroot}%{_unitdir}/%{mailman_name}-digests.service install -m 0644 %{SOURCE21} %{buildroot}%{_unitdir}/%{mailman_name}-digests.timer install -m 0644 %{SOURCE22} %{buildroot}%{_unitdir}/%{mailman_name}-notify.service @@ -245,13 +261,9 @@ sed -i "s:\(902\):4\1:" src/mailman/testing/testing.cfg %endif %if !%{with test} +%pre -n system-user-%{mailman_name} -f mailman.pre + %pre -n mailman3 -getent group %{mailman_group} >/dev/null || \ - %{_sbindir}/groupadd -r %{mailman_group} -getent passwd %{mailman_user} >/dev/null || \ - %{_sbindir}/useradd -r -g %{mailman_group} -s /sbin/nologin \ - -c "mailman daemon user" -d %{mailman_homedir} %{mailman_user} -%{_sbindir}/usermod -g %{mailman_group} %{mailman_user} >/dev/null %service_add_pre %{mailman_services} %if 0%{?suse_version} > 1500 # Prepare for migration to /usr/etc; save any old .rpmsave @@ -307,6 +319,9 @@ done %ghost %dir %{mailman_rundir} %ghost %dir %{_rundir}/lock %ghost %dir %{mailman_lockdir} + +%files -n system-user-%{mailman_name} +%{_sysusersdir}/system-user-%{mailman_name}.conf %endif %changelog From e4147c9c82e0782e4564e1a9e025e501e475e5e12d6969d09ee985d877a70556 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 21 Feb 2024 07:14:25 +0000 Subject: [PATCH 3/3] Accepting request 1148081 from home:mcalabkova:branches:devel:languages:python hopefully temporary fix for current CPythons + skipped tests revision, while I was at it OBS-URL: https://build.opensuse.org/request/show/1148081 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:mailman/python-mailman?expand=0&rev=92 --- python-mailman.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-mailman.spec b/python-mailman.spec index 5749788..911ff3d 100644 --- a/python-mailman.spec +++ b/python-mailman.spec @@ -252,10 +252,10 @@ rm src/mailman/mta/tests/test_aliases.py rm src/mailman/core/tests/test_logging.py # PermissionError: [Errno 13] Permission denied: '/usr/bin/master' rm src/mailman/commands/tests/test_cli_control.py -# https://gitlab.com/mailman/mailman/issues/654 -rm src/mailman/commands/tests/test_cli_create.py # do not use well known ports 9024 and 9025 sed -i "s:\(902\):4\1:" src/mailman/testing/testing.cfg +# https://gitlab.com/mailman/mailman/-/issues/1125 +rm src/mailman/handlers/tests/test_avoid_duplicates.py # %python_exec -m nose2 -v %endif