diff --git a/python-productmd.spec b/python-productmd.spec index f101c74..7941c72 100644 --- a/python-productmd.spec +++ b/python-productmd.spec @@ -1,6 +1,17 @@ +%if 0%{?fedora} > 12 +%global with_python3 1 +%else +%if 0%{?rhel} && 0%{?rhel} <= 7 +%{!?__python2: %global __python2 /usr/bin/python2} +%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%else +%global with_python3 1 +%endif +%endif + Name: python-productmd Version: 1.0 -Release: 7%{?dist}.git3b72969 +Release: 8%{?dist}.git3b72969 Summary: Library providing parsers for metadata related to OS installation Group: Development/Tools @@ -10,8 +21,11 @@ URL: https://github.com/release-engineering/productmd #commit has used: 3b72969cca33021954ee61746c9ba5b3e3d47dd9 Source0: productmd-%{version}.tar.bz2 BuildRequires: python2-devel python-setuptools +%if 0%{?with_python3} BuildRequires: python3-devel python3-setuptools -BuildRequires: python-six python3-six +BuildRequires: python3-six +%endif +BuildRequires: python-six BuildArch: noarch @@ -19,6 +33,7 @@ BuildArch: noarch Python library providing parsers for metadata related to composes and installation media. +%if 0%{?with_python3} %package -n python3-productmd Summary: Library providing parsers for metadata related to OS installation Group: Development/Tools @@ -26,6 +41,7 @@ Group: Development/Tools %description -n python3-productmd Python library providing parsers for metadata related to composes and installation media. +%endif %prep %setup -qc -n productmd-%{version} @@ -40,14 +56,18 @@ pushd python2 CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build popd +%if 0%{?with_python3} pushd python3 CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build popd +%endif %install +%if 0%{?with_python3} pushd python3 %{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT popd +%endif pushd python2 %{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT @@ -58,9 +78,11 @@ pushd python2 %{__python2} ./setup.py test popd +%if 0%{?with_python3} pushd python3 %{__python3} ./setup.py test popd +%endif %files %defattr(-,root,root,-) @@ -70,13 +92,18 @@ popd %{python_sitelib}/productmd-%{version}-py?.?.egg-info +%if 0%{?with_python3} %files -n python3-productmd %license LICENSE %doc AUTHORS %{python3_sitelib}/productmd/ %{python3_sitelib}/productmd-%{version}-py?.?.egg-info +%endif %changelog +* Wed Dec 09 2015 Dennis Gilmore - 1.0-8.git3b72969 +- enable building only on python 2 on epel + * Tue Nov 10 2015 Fedora Release Engineering - 1.0-7.git3b72969 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5