Reduce unused bconds

This commit is contained in:
Miro Hrončok 2019-08-26 13:02:21 +02:00
parent 137515e3d1
commit bbc5fab8e5

View File

@ -1,13 +1,10 @@
%global modname six %global modname six
%bcond_without wheel
%bcond_without tests %bcond_without tests
%bcond_without python2 %bcond_without python2
%bcond_without python3
%global python2_wheelname %{modname}-%{version}-py2.py3-none-any.whl %global python_wheelname %{modname}-%{version}-py2.py3-none-any.whl
%global python3_wheelname %python2_wheelname
Name: python-%{modname} Name: python-%{modname}
Version: 1.12.0 Version: 1.12.0
@ -38,10 +35,7 @@ BuildRequires: python2-pytest
BuildRequires: python2-tkinter BuildRequires: python2-tkinter
%endif %endif
%if %{with wheel}
BuildRequires: python2-pip BuildRequires: python2-pip
BuildRequires: python2-wheel
%endif
%description -n python2-%{modname} %{_description} %description -n python2-%{modname} %{_description}
Python 2 version. Python 2 version.
@ -49,7 +43,6 @@ Python 2 version.
%endif %endif
%if %{with python3}
%package -n python3-%{modname} %package -n python3-%{modname}
Summary: %{summary} Summary: %{summary}
%{?python_provide:%python_provide python3-%{modname}} %{?python_provide:%python_provide python3-%{modname}}
@ -62,56 +55,27 @@ BuildRequires: python3-pytest
BuildRequires: python3-tkinter BuildRequires: python3-tkinter
%endif %endif
%if %{with wheel}
BuildRequires: python%{python3_pkgversion}-pip BuildRequires: python%{python3_pkgversion}-pip
BuildRequires: python%{python3_pkgversion}-wheel BuildRequires: python%{python3_pkgversion}-wheel
%endif
%description -n python3-%{modname} %{_description} %description -n python3-%{modname} %{_description}
Python 3 version. Python 3 version.
%endif
%prep %prep
%autosetup -n %{modname}-%{version} %autosetup -n %{modname}-%{version}
%build %build
%if %{with python2}
%if %{with wheel}
%py2_build_wheel
%else
%py2_build
%endif
%endif
%if %{with python3}
%if %{with wheel}
%py3_build_wheel %py3_build_wheel
%else
%py3_build
%endif
%endif
%install %install
%py3_install_wheel %{python_wheelname}
%if %{with python2} %if %{with python2}
%if %{with wheel} %py2_install_wheel %{python_wheelname}
%py2_install_wheel %{python2_wheelname}
%else
%py2_install
%endif %endif
%endif
%if %{with python3}
%if %{with wheel}
%py3_install_wheel %{python3_wheelname}
%else
%py3_install
%endif
%endif
%if %{with tests} %if %{with tests}
%check %check
@ -129,14 +93,12 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-3 -rfsxX test_six.py
%{python2_sitelib}/%{modname}.py* %{python2_sitelib}/%{modname}.py*
%endif %endif
%if %{with python3}
%files -n python3-%{modname} %files -n python3-%{modname}
%license LICENSE %license LICENSE
%doc README.rst documentation/index.rst %doc README.rst documentation/index.rst
%{python3_sitelib}/%{modname}-*.dist-info/ %{python3_sitelib}/%{modname}-*.dist-info/
%{python3_sitelib}/%{modname}.py %{python3_sitelib}/%{modname}.py
%{python3_sitelib}/__pycache__/%{modname}.* %{python3_sitelib}/__pycache__/%{modname}.*
%endif
%changelog %changelog