Files
python-mailman-web/python-mailman-web.spec

96 lines
3.0 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/
#
%if 0%{?suse_version} >= 1550
# Newest python supported by mailman is Python 3.9 -- https://gitlab.com/mailman/mailman/-/issues/936
%define pythons python39
%define mypython python39
%define __mypython %{__python39}
%define mypython_sitelib %{python39_sitelib}
%else
%{?!python_module:%define python_module() python3-%{**}}
%define pythons python3
%define mypython python3
%define __mypython %{__python3}
%define mypython_sitelib %{python3_sitelib}
%endif
Name: python-mailman-web
Version: 0.0.5
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
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}
BuildRequires: %{python_module Whoosh}
BuildRequires: %{python_module django-settings-toml >= 0.0.3}
BuildRequires: postorius
BuildRequires: HyperKitty
# /SECTION
Requires: %{mypython}-Django
Requires: %{mypython}-Whoosh
Requires: %{mypython}-django-settings-toml >= 0.0.3
Requires: postorius
Requires: HyperKitty
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
%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