Blame postfix-mta-sts-resolver.spec

6c16d62
%global pypi_name postfix_mta_sts_resolver
6c16d62
6c16d62
Name:           postfix-mta-sts-resolver
fc051d5
Version:        1.1.4
c992e30
Release:        2%{?dist}
6c16d62
Summary:        Daemon providing MTA-STS map to Postfix
6c16d62
6c16d62
License:        MIT
6c16d62
URL:            https://github.com/Snawoot/%{name}
6c16d62
6c16d62
# pypi version is stripped down without manpages, doc and examples
6c16d62
Source0:        https://github.com/Snawoot/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
6c16d62
Source1:        mta-sts-daemon.yml
6c16d62
Source2:        postfix-mta-sts-resolver.service
6c16d62
# since python3-aioredis is unavailable
6c16d62
Patch0:         postfix-mta-sts-resolver_tests_without_redis.patch
6c16d62
6c16d62
BuildArch:      noarch
6c16d62
6c16d62
BuildRequires:  python%{python3_pkgversion}-devel >= 3.5.3
6c16d62
BuildRequires:  python%{python3_pkgversion}-setuptools
6c16d62
BuildRequires:  python%{python3_pkgversion}-wheel
6c16d62
%if 0%{?fedora} || 0%{?rhel} < 8
6c16d62
BuildRequires:  rubygem-asciidoctor
e06fbd1
BuildRequires:  make
6c16d62
%endif
6c16d62
%if 0%{?fedora} || 0%{?rhel} >= 8
6c16d62
BuildRequires:  systemd-rpm-macros
6c16d62
%else
6c16d62
BuildRequires:  systemd
6c16d62
%endif
6c16d62
#BuildRequires:  python%%{python3_pkgversion}-pytest
6c16d62
#BuildRequires:  python%%{python3_pkgversion}-pytest-asyncio
6c16d62
#BuildRequires:  python%%{python3_pkgversion}-pytest-timeout
6c16d62
#BuildRequires:  python%%{python3_pkgversion}-pytest-cov
6c16d62
BuildRequires:  python%{python3_pkgversion}-async-generator
6c16d62
BuildRequires:  python%{python3_pkgversion}-aiodns
6c16d62
BuildRequires:  python%{python3_pkgversion}-aiohttp
6c16d62
BuildRequires:  python%{python3_pkgversion}-yaml
6c16d62
BuildRequires:  python%{python3_pkgversion}-aiosqlite
6c16d62
6c16d62
Requires(pre):  shadow-utils
6c16d62
Requires:       python%{python3_pkgversion}-async-generator
6c16d62
Requires:       python%{python3_pkgversion}-aiodns
6c16d62
Requires:       python%{python3_pkgversion}-aiohttp
6c16d62
Requires:       python%{python3_pkgversion}-yaml
6c16d62
Recommends:     python%{python3_pkgversion}-aiosqlite
7bb5f9f
Recommends:     python%{python3_pkgversion}-uvloop
6c16d62
# optional deps:
6c16d62
#   - python3-aioredis is not packaged in Fedora or EL
6c16d62
6c16d62
6c16d62
%description
6c16d62
postfix-mta-sts-resolver provides a lookup daemon and command line
6c16d62
query utility for MTA-STS policies (RFC 8461).  The daemon provides TLS
6c16d62
client policy to Postfix via socketmap.
6c16d62
6c16d62
6c16d62
%prep
6c16d62
%autosetup -p1 -n %{name}-%{version}
6c16d62
# remove useless shebangs
6c16d62
sed -i '/^#!\/usr\/bin\/env/ d' postfix_mta_sts_resolver/*.py
6c16d62
6c16d62
6c16d62
%build
6c16d62
  %py3_build
6c16d62
%if 0%{?fedora} || 0%{?rhel} < 8
6c16d62
  make doc
6c16d62
%endif
6c16d62
6c16d62
6c16d62
%install
6c16d62
  %py3_install
6c16d62
6c16d62
  install -p -D -m 0640 %{SOURCE1} %{buildroot}%{_sysconfdir}/mta-sts-daemon.yml
6c16d62
  install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
6c16d62
6c16d62
  mkdir -p %{buildroot}%{_sharedstatedir}/mta-sts
6c16d62
6c16d62
  %if 0%{?fedora} || 0%{?rhel} < 8
6c16d62
  mkdir -p %{buildroot}%{_mandir}/man1
6c16d62
  install -p -D -m 0644 man/*.1 %{buildroot}%{_mandir}/man1/
6c16d62
  mkdir -p %{buildroot}%{_mandir}/man5
6c16d62
  install -p -D -m 0644 man/*.5 %{buildroot}%{_mandir}/man5/
6c16d62
  %endif
6c16d62
6c16d62
6c16d62
# these include runtime tests using DNS/WEB services which are not separate from unit tests
6c16d62
#%%check
6c16d62
#  TOXENV= i%%{__python3} -m pytest
6c16d62
6c16d62
6c16d62
%files
6c16d62
%license LICENSE
6c16d62
%doc README.md config_examples
6c16d62
%if 0%{?fedora} || 0%{?rhel} < 8
6c16d62
%{_mandir}/man*/*
6c16d62
%endif
6c16d62
%{python3_sitelib}/%{pypi_name}
6c16d62
%{python3_sitelib}/%{pypi_name}-*.egg-info
6c16d62
%{_bindir}/mta-sts-query
6c16d62
%{_bindir}/mta-sts-daemon
6c16d62
%config(noreplace) %attr(0640,root,mta-sts) %{_sysconfdir}/mta-sts-daemon.yml
6c16d62
%{_unitdir}/%{name}.service
6c16d62
%dir %attr(0755,mta-sts,mta-sts) %{_sharedstatedir}/mta-sts
6c16d62
6c16d62
6c16d62
%pre
6c16d62
getent group mta-sts >/dev/null || groupadd -r mta-sts
6c16d62
getent passwd mta-sts >/dev/null || \
6c16d62
    useradd -r -g mta-sts -d %{_sharedstatedir}/mta-sts -s /sbin/nologin \
6c16d62
    -c "Postfix MTA-STS Map Daemon" mta-sts
6c16d62
6c16d62
6c16d62
%post
6c16d62
%systemd_post %{name}.service
6c16d62
6c16d62
6c16d62
%preun
6c16d62
%systemd_preun %{name}.service
6c16d62
6c16d62
6c16d62
%postun
6c16d62
%systemd_postun_with_restart %{name}.service
6c16d62
6c16d62
6c16d62
%changelog
c992e30
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.4-2
c992e30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
c992e30
fc051d5
* Wed Oct 26 2022 Marc Dequènes (Duck) <duck@redhat.com> - 1.1.4-1
fc051d5
- NUR
7bb5f9f
- recommends now available uvloop
c971500
- updated postfix-mta-sts-resolver_tests_without_redis.patch
fc051d5
c27530f
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-9
c27530f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
c27530f
34c4f5a
* Tue Jun 14 2022 Python Maint <python-maint@redhat.com> - 1.0.0-8
34c4f5a
- Rebuilt for Python 3.11
34c4f5a
e14fc80
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-7
e14fc80
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
e14fc80
fcf135e
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-6
fcf135e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
fcf135e
33f8a4c
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.0.0-5
33f8a4c
- Rebuilt for Python 3.10
33f8a4c
e06fbd1
* Mon Mar 08 2021 Marc Dequènes (Duck) <duck@redhat.com> - 1.0.0-4
e06fbd1
- add BuildRequires on make for the doc
e06fbd1
564c0f4
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.0.0-3
564c0f4
- Rebuilt for updated systemd-rpm-macros
564c0f4
  See https://pagure.io/fesco/issue/2583.
564c0f4
66f102c
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-2
66f102c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
66f102c
6c16d62
* Thu Aug 20 2020 Marc Dequènes (Duck) <duck@redhat.com> - 1.0.0-1
6c16d62
- NUR
6c16d62
- preserve file timestamps when installing files
6c16d62
- remove useless shebangs
6c16d62
- remove now useless systemd_requires macro
6c16d62
- don't install manpages as %%doc, it's now automatic
6c16d62
- use _sharedstatedir macro when appropriate
6c16d62
- fix typo in description
6c16d62
- use systemd-rpm-macros for newer systems
6c16d62
6c16d62
* Mon May 11 2020 Marc Dequènes (Duck) <duck@redhat.com> - 0.8.2-1
6c16d62
- initial packaging
6c16d62