diff --git a/kobo.spec b/kobo.spec index b098a2e..ac164a9 100644 --- a/kobo.spec +++ b/kobo.spec @@ -4,6 +4,8 @@ %bcond_without python3 %endif +%bcond_without python2 + %define debug_package %{nil} %define with_admin 1 @@ -40,6 +42,10 @@ %define with_python2_django 0 %endif +%if ! 0%{?with_python2} +%define with_python2_django 0 +%endif + Name: kobo Version: 0.10.0 @@ -50,7 +56,9 @@ URL: https://github.com/release-engineering/kobo Source0: %pypi_source BuildArch: noarch +%if 0%{?with_python2} BuildRequires: python2-devel >= 2.4 +%endif %if 0%{?with_python3} BuildRequires: python%{python3_pkgversion}-devel %endif @@ -58,6 +66,7 @@ BuildRequires: python%{python3_pkgversion}-devel %description Kobo is a set of python modules designed for rapid tools development. +%if 0%{?with_python2} %package -n python2-%{name} Summary: Python modules for tools development %{?python_provide:%python_provide python2-%{name}} @@ -67,7 +76,7 @@ Requires: python2dist(six) %description -n python2-%{name} Kobo is a set of python modules designed for rapid tools development. - +%endif %if 0%{?with_django} && 0%{with_python2_django} %package -n python2-%{name}-django @@ -83,7 +92,7 @@ Django components. %endif -%if 0%{?with_client} +%if 0%{?with_client} && 0%{?with_python2} %package -n python2-%{name}-client Summary: CLI client Requires: python2-kobo = %{version}-%{release} @@ -96,7 +105,7 @@ CLI client. %endif -%if 0%{?with_worker} +%if 0%{?with_worker} && 0%{?with_python2} %package -n python2-%{name}-worker Summary: Worker daemon processing tasks submitted to the hub Requires: python2-kobo = %{version}-%{release} @@ -123,7 +132,7 @@ Obsoletes: kobo-hub < 0.6.0-2 Hub is a xml-rpc and web interface to a task database. %endif - +%if 0%{?with_python2} %package -n python2-%{name}-rpmlib Summary: Functions to manipulate with RPM files Requires: python2-kobo = %{version}-%{release} @@ -135,7 +144,7 @@ Obsoletes: kobo-rpmlib < 0.6.0-2 %description -n python2-%{name}-rpmlib Rpmlib contains functions to manipulate with RPM files. - +%endif %if 0%{?with_admin} %package admin @@ -248,14 +257,19 @@ Python library for kobo-admin command. %build +%if 0%{?with_python2} %{py2_build} +%endif %if 0%{?with_python3} %{py3_build} %endif %install + +%if 0%{?with_python2} %{py2_install} +%endif %if 0%{?with_python3} # only package python3 version of kobo-admin @@ -306,7 +320,7 @@ rm -rf $RPM_BUILD_ROOT/%{python2_sitelib}/kobo/hub %endif - +%if 0%{?with_python2} %files -n python2-%{name} %dir %{python2_sitelib}/kobo %{python2_sitelib}/kobo/*.py* @@ -316,6 +330,7 @@ rm -rf $RPM_BUILD_ROOT/%{python2_sitelib}/kobo/hub %if "%{python2_version}" != "2.4" %{python2_sitelib}/%{name}-%{version}-py?.?.egg-info %endif +%endif %if 0%{?with_django} && 0%{with_python2_django} @@ -324,13 +339,13 @@ rm -rf $RPM_BUILD_ROOT/%{python2_sitelib}/kobo/hub %endif -%if 0%{?with_client} +%if 0%{?with_client} && 0%{?with_python2} %files -n python2-%{name}-client %{python2_sitelib}/kobo/client %endif -%if 0%{?with_worker} +%if 0%{?with_worker} && 0%{?with_python2} %files -n python2-%{name}-worker %{python2_sitelib}/kobo/worker %endif @@ -341,10 +356,10 @@ rm -rf $RPM_BUILD_ROOT/%{python2_sitelib}/kobo/hub %{python2_sitelib}/kobo/hub %endif - +%if 0%{?with_python2} %files -n python2-%{name}-rpmlib %{python2_sitelib}/kobo/rpmlib.py* - +%endif %if 0%{?with_admin} %files admin