%global pkgname aiosmtpd
%global summary Asyncio-based SMTP server
%global _description \
This is a server for SMTP and related protocols, similar in utility \
to the standard library’s smtpd.py module, but rewritten to be based \
on asyncio for Python 3.
%global srcname %{pkgname}
%global with_docs 0
Name: python-%{pkgname}
Version: 1.0
Release: 6%{?dist}
Summary: %{summary}
License: ASL 2.0
URL: https://github.com/aio-libs/aiosmtpd
Source0: https://pypi.org/packages/source/a/%{srcname}/%{srcname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python-srpm-macros
BuildRequires: python%{python3_pkgversion}-devel >= 3.4
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-atpublic
BuildRequires: python%{python3_pkgversion}-nose2
BuildRequires: python%{python3_pkgversion}-flufl-testing
%if 0%{?with_docs}
BuildRequires: python%{python3_pkgversion}-sphinx
%endif
%if 0%{?with_python3_other}
BuildRequires: python%{python3_other_pkgversion}-devel >= 3.4
BuildRequires: python%{python3_other_pkgversion}-setuptools
BuildRequires: python%{python3_other_pkgversion}-atpublic
BuildRequires: python%{python3_other_pkgversion}-nose2
BuildRequires: python%{python3_other_pkgversion}-flufl-testing
%endif
%description %{_description}
%package -n python%{python3_pkgversion}-%{pkgname}
Summary: %{summary}
Requires: python%{python3_pkgversion}-atpublic
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pkgname}}
%description -n python%{python3_pkgversion}-%{pkgname} %{_description}
%if 0%{?with_python3_other}
%package -n python%{python3_other_pkgversion}-%{pkgname}
Summary: %{summary}
Requires: python%{python3_other_pkgversion}-atpublic
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{pkgname}}
%description -n python%{python3_other_pkgversion}-%{pkgname} %{_description}
%endif
%prep
%autosetup -n %{srcname}-%{version}
%build
%py3_build
%if 0%{?with_python3_other}
%py3_other_build
%endif
%if 0%{?with_docs}
%{__python3} setup.py build_sphinx
%endif
%install
%py3_install
# Cleanups
rm -rf %{buildroot}%{python3_sitelib}/examples
rm -f %{buildroot}%{python3_sitelib}/aiosmtpd/docs/.gitignore
%if 0%{?with_python3_other}
%py3_other_install
# Avoid name clash
mv %{buildroot}%{_bindir}/aiosmtpd \
%{buildroot}%{_bindir}/aiosmtpd-%{python3_other_version}
# Cleanups
rm -rf %{buildroot}%{python3_other_sitelib}/examples
rm -f %{buildroot}%{python3_other_sitelib}/aiosmtpd/docs/.gitignore
%endif
%check
%{__python3} -m nose2 -v
%if 0%{?with_python3_other}
%{__python3_other} -m nose2 -v
%endif
%files -n python%{python3_pkgversion}-%{pkgname}
%doc README.rst examples
%if 0%{?with_docs}
%doc build/sphinx/html
%endif
%{_bindir}/aiosmtpd
%{python3_sitelib}/aiosmtpd/
%{python3_sitelib}/%{srcname}-%{version}*-py%{python3_version}.egg-info/
%if 0%{?with_python3_other}
%files -n python%{python3_other_pkgversion}-%{pkgname}
%doc README.rst examples build/sphinx/html
%{_bindir}/aiosmtpd-%{python3_other_version}
%{python3_other_sitelib}/aiosmtpd/
%{python3_other_sitelib}/%{srcname}-%{version}*-py%{python3_other_version}.egg-info/
%endif
%changelog
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.0-5
- Rebuilt for Python 3.7
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Jun 03 2017 Aurelien Bompard <abompard@fedoraproject.org> - 1.0-0.1.a5
- Update to 1.0 final.
* Mon Apr 10 2017 Aurelien Bompard <abompard@fedoraproject.org> - 1.0-0.1.a5
- Update to 1.0a5.
* Wed Dec 14 2016 Aurelien Bompard <abompard@fedoraproject.org> - 1.0-0.1.a4
- Initial package.