From 6d791e7c8e7a373863477dffd285c6c88e607604f03a8e0756b8f13d580c1fc1 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 6 Nov 2023 08:25:07 +0000 Subject: [PATCH] Accepting request 1123458 from home:darix:branches:devel:languages:python:mailman - ensure that we can create the user and group - make user and group creation verbose so we actually see errors - make it easier to notice to keep buildrequires and runtime requires version limits in sync. This will also help us to notice early when the version of other libraries do not match the requires encoded in the source code. OBS-URL: https://build.opensuse.org/request/show/1123458 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:mailman/python-HyperKitty?expand=0&rev=72 --- python-HyperKitty.changes | 18 +++++++++ python-HyperKitty.spec | 81 ++++++++++++++++++++++++--------------- 2 files changed, 69 insertions(+), 30 deletions(-) diff --git a/python-HyperKitty.changes b/python-HyperKitty.changes index 3d96ece..ea1abe4 100644 --- a/python-HyperKitty.changes +++ b/python-HyperKitty.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Mon Nov 6 01:20:05 UTC 2023 - Marcus Rueckert + +- ensure that we can create the user and group + +------------------------------------------------------------------- +Mon Nov 6 01:10:25 UTC 2023 - Marcus Rueckert + +- make user and group creation verbose so we actually see errors + +------------------------------------------------------------------- +Mon Nov 6 00:05:35 UTC 2023 - Marcus Rueckert + +- make it easier to notice to keep buildrequires and runtime + requires version limits in sync. This will also help us to notice + early when the version of other libraries do not match the + requires encoded in the source code. + ------------------------------------------------------------------- Thu Nov 2 09:27:37 UTC 2023 - Andreas Schneider diff --git a/python-HyperKitty.spec b/python-HyperKitty.spec index 36d2dfa..4b1a323 100644 --- a/python-HyperKitty.spec +++ b/python-HyperKitty.spec @@ -15,6 +15,25 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # +# keep in sync with setup.py +%global django_min_version 3.2 +%global django_max_version 4.3 +%global django_mailman3_min_version 1.3.10 +%global django_gravatar2_min_version 1.0.6 +%global djangorestframework_min_version 3.0.0 +%global robot_detection_min_version 0.3 +%global pytz_min_version 2012 +%global django_compressor_min_version 1.3 +%global mailmanclient_min_version 3.3.3 +# original this was >= 2.0.0, < 3.0 but overwritten by mistune3.patch +%global mistune_min_version 3.0 +%global python_dateutil_min_version 2.0 +%global networkx_min_version 2.0 +%global django_haystack_min_version 2.8.0 +%global django_extensions_min_version 1.3.7 +%global flufl_lock_min_version 4.0 +%global django_q_min_version 1.0.0 + %{?sle15_python_module_pythons} %global webapps_dir /srv/www/webapps @@ -71,14 +90,15 @@ Patch0: hyperkitty-settings.patch # PATCH-FIX-UPSTREAM mistune3.patch gl#mailman/hyperkitty#541 Patch2: mistune3.patch # -BuildRequires: %{python_module django-compressor >= 1.3} +BuildRequires: %{python_module Django >= %{django_min_version}} +BuildRequires: %{python_module django-compressor >= %{django_compressor_min_version}} BuildRequires: %{python_module Whoosh} BuildRequires: %{python_module django-debug-toolbar >= 2.2} BuildRequires: %{python_module django-extensions >= 1.3.7} -BuildRequires: %{python_module django-gravatar2 >= 1.0.6} +BuildRequires: %{python_module django-gravatar2 >= %{django_gravatar2_min_version}} BuildRequires: %{python_module isort} -BuildRequires: %{python_module mailmanclient >= 3.3.2} -BuildRequires: %{python_module mistune >= 2.0} +BuildRequires: %{python_module mailmanclient >= %{mailmanclient_min_version}} +BuildRequires: %{python_module mistune >= %{mistune_min_version}} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module xapian-haystack >= 2.1.0} BuildRequires: acl @@ -94,23 +114,22 @@ BuildArch: noarch BuildRequires: python3-packaging %endif # SECTION test requirements -BuildRequires: %{python_module Django >= 3.2} BuildRequires: %{python_module Whoosh >= 2.5.7} BuildRequires: %{python_module beautifulsoup4 >= 4.3.2} BuildRequires: %{python_module django-haystack >= 2.8.0} -BuildRequires: %{python_module django-mailman3 >= 1.3.10} -BuildRequires: %{python_module django-q >= 1.3.9} -BuildRequires: %{python_module djangorestframework >= 3.0.0} +BuildRequires: %{python_module django-mailman3 >= %{django_mailman3_min_version}} +BuildRequires: %{python_module django-q >= %{django_q_min_version}} +BuildRequires: %{python_module djangorestframework >= %{djangorestframework_min_version}} BuildRequires: %{python_module elasticsearch} -BuildRequires: %{python_module flufl.lock} +BuildRequires: %{python_module flufl.lock >= %{flufl_lock_min_version}} BuildRequires: %{python_module lxml} -BuildRequires: %{python_module mistune} -BuildRequires: %{python_module networkx >= 1.9.1} +BuildRequires: %{python_module mistune >= %{mistune_min_version}} +BuildRequires: %{python_module networkx >= %{networkx_min_version}} BuildRequires: %{python_module pytest-django} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module python-dateutil >= 2.0} -BuildRequires: %{python_module pytz >= 2012} -BuildRequires: %{python_module robot-detection >= 0.3} +BuildRequires: %{python_module python-dateutil >= %{python_dateutil_min_version}} +BuildRequires: %{python_module pytz >= %{pytz_min_version}} +BuildRequires: %{python_module robot-detection >= %{robot_detection_min_version}} # /SECTION %description @@ -118,23 +137,23 @@ A web interface to access GNU Mailman v3 archives. %package -n %{hyperkitty_pkgname} Summary: A web interface to access GNU Mailman v3 archives -Requires: %{mypython}-Django >= 3.2 -Requires: %{mypython}-Whoosh -Requires: %{mypython}-django-compressor >= 1.3 +# important sync with +Requires: (%{mypython}-Django >= %{django_min_version} with %{mypython}-Django < %{django_max_version}) +Requires: %{mypython}-django-compressor >= %{django_compressor_min_version} Requires: %{mypython}-django-debug-toolbar >= 2.2 Requires: %{mypython}-django-extensions >= 1.3.7 -Requires: %{mypython}-django-gravatar2 >= 1.0.6 +Requires: %{mypython}-django-gravatar2 >= %{django_gravatar2_min_version} Requires: %{mypython}-django-haystack >= 2.8.0 -Requires: %{mypython}-django-mailman3 >= 1.3.10 -Requires: %{mypython}-django-q >= 1.3.9 -Requires: %{mypython}-djangorestframework >= 3.0.0 -Requires: %{mypython}-flufl.lock -Requires: %{mypython}-mailmanclient >= 3.3.2 -Requires: %{mypython}-mistune -Requires: %{mypython}-networkx >= 1.9.1 -Requires: %{mypython}-python-dateutil >= 2.0 -Requires: %{mypython}-pytz >= 2012 -Requires: %{mypython}-robot-detection >= 0.3 +Requires: %{mypython}-django-mailman3 >= %{django_mailman3_min_version} +Requires: %{mypython}-django-q >= %{django_q_min_version} +Requires: %{mypython}-djangorestframework >= %{djangorestframework_min_version} +Requires: %{mypython}-flufl.lock >= %{flufl_lock_min_version} +Requires: %{mypython}-mailmanclient >= %{mailmanclient_min_version} +Requires: %{mypython}-mistune >= %{mistune_min_version} +Requires: %{mypython}-networkx >= %{networkx_min_version} +Requires: %{mypython}-python-dateutil >= %{python_dateutil_min_version} +Requires: %{mypython}-pytz >= %{pytz_min_version} +Requires: %{mypython}-robot-detection >= %{robot_detection_min_version} Requires: %{mypython}-xapian-haystack >= 2.1.0 %if "%{expand:%%%{mypython}_provides}" == "python3" Provides: python3-%{hyperkitty_pkgname} = %{version}-%{release} @@ -155,6 +174,8 @@ Requires: %{hyperkitty_pkgname} Requires: acl Requires: openssl Requires: sudo +Requires(pre): /usr/sbin/groupadd +Requires(pre): /usr/sbin/useradd %description -n %{hyperkitty_pkgname}-web A web user interface for GNU Mailman. @@ -293,8 +314,8 @@ export LANG=C.UTF-8 %pytest %pre -n %{hyperkitty_pkgname}-web -/usr/sbin/groupadd -r hyperkitty &>/dev/null || : -/usr/sbin/useradd -g hyperkitty -s /bin/false -r -c "HyperKitty" -d %{hyperkitty_basedir} hyperkitty &>/dev/null || : +/usr/sbin/groupadd -r hyperkitty || : +/usr/sbin/useradd -g hyperkitty -s /bin/false -r -c "HyperKitty" -d %{hyperkitty_basedir} hyperkitty || : %service_add_pre %{hyperkitty_services}