From b192fbd0f7230c262be7ff5d2379554218b82830 Mon Sep 17 00:00:00 2001 From: Carl George Date: Sep 21 2018 13:55:18 +0000 Subject: Disable python2 subpackage on F30+ --- diff --git a/python-pdir2.spec b/python-pdir2.spec index ca715fa..e7f29ff 100644 --- a/python-pdir2.spec +++ b/python-pdir2.spec @@ -9,12 +9,20 @@ An improved version of dir() with better output. Attributes are grouped by\ types/functionalities, with beautiful colors. Supports ipython, ptpython,\ bpython, and Jupyter Notebook. +%if 0%{?fedora} >= 30 +%bcond_with python2 +%else +%bcond_without python2 +%endif +%bcond_without python3 + # Run the test on Fedora. In EPEL, we're missing python34-pandas. %{?fedora:%bcond_without tests} + Name: python-%{pkgname} Version: 0.3.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Pretty dir() printing with joy License: MIT URL: https://github.com/laike9m/pdir2 @@ -31,6 +39,7 @@ BuildArch: noarch %description %{_description} +%if %{with python2} %package -n python2-%{pkgname} Summary: %{summary} BuildRequires: python2-devel @@ -45,8 +54,10 @@ Requires: python%{?fedora:2}-enum34 %description -n python2-%{pkgname} %{_description} +%endif +%if %{with python3} %package -n python%{python3_pkgversion}-%{pkgname} Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel @@ -59,6 +70,7 @@ BuildRequires: python%{python3_pkgversion}-pandas %description -n python%{python3_pkgversion}-%{pkgname} %{_description} +%endif %prep @@ -66,37 +78,44 @@ BuildRequires: python%{python3_pkgversion}-pandas %build -%py2_build -%py3_build +%{?with_python2:%py2_build} +%{?with_python3:%py3_build} %install -%py2_install -%py3_install +%{?with_python2:%py2_install} +%{?with_python3:%py3_install} %if %{with tests} %check -%{__python2} -m pytest --verbose -%{__python3} -m pytest --verbose +%{?with_python2:PYTHONPATH=%{buildroot}%{python2_sitelib} py.test-%{python2_version} --verbose} +%{?with_python3:PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} --verbose} %endif +%if %{with python2} %files -n python2-%{pkgname} %license LICENSE %doc docs/README.rst %{python2_sitelib}/%{srcname} %{python2_sitelib}/%{eggname}-%{version}-py%{python2_version}.egg-info +%endif +%if %{with python3} %files -n python%{python3_pkgversion}-%{pkgname} %license LICENSE %doc docs/README.rst %{python3_sitelib}/%{srcname} %{python3_sitelib}/%{eggname}-%{version}-py%{python3_version}.egg-info +%endif %changelog +* Fri Sep 21 2018 Carl George - 0.3.0-5 +- Disable python2 subpackage on F30+ + * Sat Jul 14 2018 Fedora Release Engineering - 0.3.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild