Files
python-mailman-web/python-mailman-web.spec
2023-11-06 13:53:58 +00:00

112 lines
3.9 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
%if 0%{?suse_version} >= 1550
# Newest python supported by mailman is Python 3.11
%define pythons python311
%define mypython python311
%define __mypython %{__python311}
%define mypython_sitelib %{python311_sitelib}
%else
%{?sle15_python_module_pythons}
%define pythons python311
%define mypython python311
%define __mypython %{__python311}
%define mypython_sitelib %{python311_sitelib}
%endif
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: 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}
BuildRequires: HyperKitty >= %{hyperkitty_min_version}
# this should not be here but fixed in python readme renderer
BuildRequires: %{python_module cmarkgfm >= 0.8.0}
# /SECTION
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}
Requires: HyperKitty >= %{hyperkitty_min_version}
Obsoletes: python3-mailman-web < %{version}-%{release}
%python_subpackages
%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
%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
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# no upstream testsuite
%files %{python_files}
%doc README.rst docs/*.rst docs/*.toml
%license LICENSE.txt
%{python_sitelib}/mailman_web
%{python_sitelib}/mailman_web-%{version}*-info
%{_bindir}/mailman-web
%changelog