Files
python-mailman-web/python-mailman-web.spec
Matej Cepl 92c0fe2f4f Accepting request 1153613 from home:bnavigator:branches:devel:languages:python:mailman
- Simplify python flavor selection
  * Go back to primary python3 on Tumbleweed
  * Use SLE15 python module pythons on 15.x
- Replace pseudo python singlespec rewriter in order to not give
  the wrong impression

OBS-URL: https://build.opensuse.org/request/show/1153613
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:mailman/python-mailman-web?expand=0&rev=15
2024-03-01 20:48:44 +00:00

124 lines
4.4 KiB
RPMSpec

#
# spec file for package python-mailman-web
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# keep in sync with setup.cfg
%global django_min_version 3.2
%global django_max_version 4.3
%global django_allauth_min_version 0.56.0
%global django_mailman3_min_version 1.3.11
%global postorius_min_version 1.3.10
%global hyperkitty_min_version 1.3.8
# Always only build one flavor: primary python for TW, python311 from the SLE15 python module for 15.x
%if 0%{?suse_version} >= 1550
%define pythons python3
%else
%{?sle15_python_module_pythons}
%endif
%global mypython %pythons
%global mypython_sitelib %{expand:%%{%{mypython}_sitelib}}
Name: python-mailman-web
Version: 0.0.8
Release: 0
Summary: Mailman 3 Web interface
License: GPL-3.0-only
URL: https://gitlab.com/mailman/mailman-web
Source: https://files.pythonhosted.org/packages/source/m/mailman-web/mailman-web-%{version}.tar.gz
Source99: python-mailman-web-rpmlintrc
Patch1: allow-newer-django.patch
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%if 0%{?suse_version} >= 1550
# use the real python3 primary for rpm pythondistdeps.py
BuildRequires: python3-packaging
%endif
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module Django >= %{django_min_version} with %python-Django < %{django_max_version}}
BuildRequires: %{python_module Whoosh}
BuildRequires: %{python_module django-settings-toml >= 0.0.3}
BuildRequires: %{python_module django-mailman3 >= %{django_mailman3_min_version}}
BuildRequires: %{python_module django-allauth > %{django_allauth_min_version}}
BuildRequires: (postorius >= %{postorius_min_version} with %{mypython}-postorius)
BuildRequires: (HyperKitty >= %{hyperkitty_min_version} with %{mypython}-HyperKitty)
# this should not be here but fixed in python readme renderer
BuildRequires: %{python_module cmarkgfm >= 0.8.0}
# /SECTION
%description
This is a Django project that contains default settings and url settings for
the Mailman 3 Web Interface. It consists of the following sub-projects:
Postorius
Hyperkitty
%package -n %{mypython}-mailman-web
Summary: Mailman 3 Web interface
Requires: (%{mypython}-Django >= %{django_min_version} with %{mypython}-Django < %{django_max_version})
Requires: %{mypython}-django-allauth > %{django_allauth_min_version}
Requires: %{mypython}-django-mailman3 >= %{django_mailman3_min_version}
Requires: %{mypython}-Whoosh
Requires: %{mypython}-django-settings-toml >= 0.0.3
Requires: (postorius >= %{postorius_min_version} with %{mypython}-postorius)
Requires: (HyperKitty >= %{hyperkitty_min_version} with %{mypython}-HyperKitty)
# help in replacing any previously installed python 3.6 flavor package
%if 0%{?suse_version} < 1550
Obsoletes: python3-mailman-web < %{version}-%{release}
%endif
%description -n %{mypython}-mailman-web
This is a Django project that contains default settings and url settings for
the Mailman 3 Web Interface. It consists of the following sub-projects:
Postorius
Hyperkitty
%prep
%setup -q -n mailman-web-%{version}
# remove shebang. it is installad without +x bits and supposed to be called with /usr/bin/python3.x manage.py
sed -i '1{/env python/d}' mailman_web/manage.py
%autopatch -p1
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# no upstream testsuite
%files -n %{mypython}-mailman-web
%doc README.rst docs/*.rst docs/*.toml
%license LICENSE.txt
%{mypython_sitelib}/mailman_web
%{mypython_sitelib}/mailman_web-%{version}.dist-info
%{_bindir}/mailman-web
%changelog