From b2f97e6cdebe61959e6352d556ee329bcbecbc1f Mon Sep 17 00:00:00 2001 From: Martin Kutlak Date: Mar 26 2018 13:37:34 +0000 Subject: Drop python2 subpackage from F29+ Signed-off-by: Martin Kutlak --- diff --git a/ratelimitingfilter.spec b/ratelimitingfilter.spec index ef5ae68..f86a9ca 100644 --- a/ratelimitingfilter.spec +++ b/ratelimitingfilter.spec @@ -1,9 +1,16 @@ # Created by pyp2rpm-3.2.2 %global pypi_name ratelimitingfilter +# Disable python2 subpackage from F29+ +%if 0%{?fedora} > 28 + %bcond_with python2 +%else + %bcond_without python2 +%endif + Name: python-%{pypi_name} Version: 0.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A rate limiting filter for the Python logging system License: MIT @@ -11,9 +18,11 @@ URL: https://github.com/wkeeling/ratelimitingfilter Source0: https://files.pythonhosted.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch +%if %{with python2} BuildRequires: python2-devel BuildRequires: python2-mock BuildRequires: python2-setuptools +%endif BuildRequires: python3-devel BuildRequires: python3-mock @@ -26,6 +35,7 @@ handlers. The filter can be useful if you're using a handler such as Python's logging.handlers.SMTPHandler to send error notification emails. Error notification emails provide a useful means of keeping an eye on. +%if %{with python2} %package -n python2-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python2-%{pypi_name}} @@ -36,6 +46,7 @@ you to restrict the rate at which messages can pass through your logging handlers. The filter can be useful if you're using a handler such as Python's logging.handlers.SMTPHandler to send error notification emails. Error notification emails provide a useful means of keeping an eye on. +%endif %package -n python3-%{pypi_name} Summary: %{summary} @@ -54,7 +65,9 @@ Error notification emails provide a useful means of keeping an eye on. rm -rf %{pypi_name}.egg-info %build +%if %{with python2} %py2_build +%endif %py3_build %install @@ -62,17 +75,23 @@ rm -rf %{pypi_name}.egg-info # overwritten with every setup.py install. %py3_install +%if %{with python2} %py2_install +%endif %check +%if %{with python2} %{__python2} setup.py test +%endif %{__python3} setup.py test +%if %{with python2} %files -n python2-%{pypi_name} %doc README.md README.rst %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info +%endif %files -n python3-%{pypi_name} %doc README.md README.rst @@ -81,4 +100,7 @@ rm -rf %{pypi_name}.egg-info %changelog * Wed Mar 14 2018 Martin Kutlak - 0.6-1 +- Drop python2 subpackage from Fedora 29+ + +* Wed Mar 14 2018 Martin Kutlak - 0.6-1 - Initial package.