File getmail6.spec of Package getmail6

#
# spec file for package getmail6
#
# Copyright (c) 2021 SUSE LLC.
# Copyright (c) 2021 LISA GmbH, Bingen, Germany.
#
# 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 %{defined primary_python}
%global pythons %{primary_python}
%else
%global pythons python311
%endif

Name:           getmail6
Version:        6.19.10
Release:        0
Url:            https://github.com/getmail6/getmail6
Source:         https://github.com/getmail6/getmail6/archive/v%{version}/%{name}-%{version}.tar.gz
Summary:        Flexible, extensible mail retrieval system
License:        GPL-2.0-only
Group:          Productivity/Networking/Email/Utilities
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module wheel}
BuildRequires:  %{python_module setuptools}
Requires:       %{pythons}
Provides:       python-getmail
Provides:       python-getmailcore
Provides:       getmail = %{version}
Conflicts:      getmail < %{version}
Obsoletes:      getmail < %{version}
BuildArch:      noarch

%description
getmail6 is a flexible, extensible mail retrieval system with support for POP3,
IMAP4, SSL variants of both, maildirs, mboxrd files, external MDAs, arbitrary
message filtering, single-user and domain-mailboxes, and many other useful
features.

This is a prop -in replacement for package getmail.

%package doc
Summary:        Documentation for %{name}
Group:          Productivity/Networking/Email/Utilities

%description doc
getmail6 is a flexible, extensible mail retrieval system with support for POP3,
IMAP4, SSL variants of both, maildirs, mboxrd files, external MDAs, arbitrary
message filtering, single-user and domain-mailboxes, and many other useful
features.

This package contains the configuration, FAQ and troubleshooting
documentation, under %{_docdir}/%{name}-doc/

%prep
%setup -q

%if %{?suse_version} >= 1600
%build
%pyproject_wheel

%install
%pyproject_install
%else
%build
python3.11 setup.py build

%install
python3.11 setup.py install --prefix=%{_prefix} --root=%{buildroot}
%endif
rm -rv %{buildroot}%{_datadir}/doc/getmail

%files
%defattr(-,root,root,-)
%license docs/COPYING
%doc README docs/BUGS docs/CHANGELOG docs/HACKING docs/THANKS
%{_bindir}/getmail*
%{_mandir}/man1/*
%{python_sitelib}/getmailcore/
%{python_sitelib}/%{name}-%{version}*info

%files doc
%defattr(-,root,root,0755)
%license docs/COPYING
%doc docs/*.txt docs/*.html

%changelog
openSUSE Build Service is sponsored by