File python-checkdmarc.spec of Package checkdmarc

#
# spec file for package python-checkdmarc
#
# Copyright (c) 2024, Martin Hauke <mardnh@gmx.de>
#
# 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/
#


Name:           python-checkdmarc
Version:        5.6.2
Release:        0
Summary:        A parser for SPF and DMARC DNS records 
License:        Apache-2.0
URL:            https://domainaware.github.io/checkdmarc/
Source:         https://github.com/domainaware/checkdmarc/archive/refs/tags/%{version}.tar.gz#/checkdmarc-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module hatchling >= 1.8.1}
BuildRequires:  %{python_module pip}
# SECTION test requirements
BuildRequires:  %{python_module cryptography >= 41.0.7}
BuildRequires:  %{python_module dnspython >= 2.0.0}
BuildRequires:  %{python_module expiringdict >= 1.1.4}
BuildRequires:  %{python_module pem >= 23.1.0}
BuildRequires:  %{python_module publicsuffixlist >= 0.10.0}
BuildRequires:  %{python_module pyleri >= 1.3.2}
BuildRequires:  %{python_module pyOpenSSL >= 24.2.1}
BuildRequires:  %{python_module requests >= 2.25.0}
BuildRequires:  %{python_module timeout-decorator >= 0.4.1}
BuildRequires:  %{python_module xmltodict >= 0.14.2}
BuildRequires:  %{python_module pytest}
# /SECTION
BuildRequires:  fdupes
Requires:       python-cryptography >= 41.0.7
Requires:       python-dnspython >= 2.0.0
Requires:       python-expiringdict >= 1.1.4
Requires:       python-pem >= 23.1.0
Requires:       python-publicsuffixlist >= 0.10.0
Requires:       python-pyleri >= 1.3.2
Requires:       python-pyOpenSSL >= 24.2.1
Requires:       python-requests >= 2.25.0
Requires:       python-timeout-decorator >= 0.4.1
Requires:       python-xmltodict >= 0.14.2
BuildArch:      noarch
Requires(post): update-alternatives
Requires(postun):update-alternatives
%python_subpackages

%description
A Python module and command line utility for validating SPF and DMARC DNS
records.

Features
 - API and CLI
 - Can test multiple domains at once
 - CLI output in JSON or CSV format
 - Parses and validates MX, SPF, and DMARC records
 - Checks for DNSSEC deployment
 - Lists name servers
 - Checks for STARTTLS and TLS support on each mail server

%prep
%autosetup -p1 -n checkdmarc-%{version}
sed -i 's|%{_bindir}/env python3|%{_bindir}/python3|g' checkdmarc/_cli.py

%build
%pyproject_wheel

%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/checkdmarc
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%post
%python_install_alternative checkdmarc

%postun
%python_uninstall_alternative checkdmarc

%check
# FIXME: most tests require a function network setup
#%%pyunittest discover -v

%files %{python_files}
%doc CHANGELOG.md README.md
%license LICENSE
%python_alternative %{_bindir}/checkdmarc
%{python_sitelib}/checkdmarc
%{python_sitelib}/checkdmarc-%{version}.dist-info

%changelog
openSUSE Build Service is sponsored by