%if %{?rhel} > 7 %global with_python3 1 %global with_python2 0 %else %global with_python3 0 %global with_python2 1 %endif Summary: A powerful declarative parser/builder for binary data Name: python-construct Version: 2.8.10 Release: 2%{?dist} License: MIT URL: http://construct.readthedocs.org # 2.8.10 source tarball is not published on PyPI # https://github.com/construct/construct/issues/301 #Source0: https://pypi.io/packages/source/c/construct/construct-%{version}.tar.gz Source0: https://github.com/construct/construct/archive/v2.8.10.tar.gz # # patches_base=v2.8.10 # BuildArch: noarch %description Construct is a powerful declarative parser (and builder) for binary data. Instead of writing imperative code to parse a piece of data, you declaratively define a data structure that describes your data. As this data structure is not code, you can use it in one direction to parse data into Pythonic objects, and in the other direction, convert (build) objects into binary data. %if 0%{?with_python2} %package -n python2-construct Summary: A powerful declarative parser/builder for binary data %{?python_provide:%python_provide python2-construct} BuildRequires: python-devel Requires: python-six %description -n python2-construct Instead of writing imperative code to parse a piece of data, you declaratively define a data structure that describes your data. As this data structure is not code, you can use it in one direction to parse data into Pythonic objects, and in the other direction, convert (build) objects into binary data. This is the Python 2 version of the package. %endif %if 0%{?with_python3} %package -n python3-construct Summary: A powerful declarative parser/builder for binary data %{?python_provide:%python_provide python2-construct} BuildRequires: python3-devel Requires: python3-six %description -n python3-construct Construct is a powerful declarative parser (and builder) for binary data. Instead of writing imperative code to parse a piece of data, you declaratively define a data structure that describes your data. As this data structure is not code, you can use it in one direction to parse data into Pythonic objects, and in the other direction, convert (build) objects into binary data. This is the Python 3 version of the package. %endif %prep %setup -q -n construct-%{version} %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} %py3_install %endif %if 0%{?with_python2} %files -n python2-construct %doc README.rst LICENSE %{python2_sitelib}/construct %{python2_sitelib}/construct-%{version}-py?.?.egg-info %endif %if 0%{?with_python3} %files -n python3-construct %doc README.rst LICENSE %{python3_sitelib}/construct %{python3_sitelib}/construct-%{version}-py?.?.egg-info %endif %changelog * Thu Jan 24 2019 Javier Peña - 2.8.10-2 - Update for RHEL 8 - Made python 2 version only for RHEL < 8 * Sat Feb 04 2017 Alan Pevec 2.8.10-1 - Update to 2.8.10 * Sat Jun 07 2014 Fedora Release Engineering - 2.5.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Wed May 14 2014 Bohuslav Kabrda - 2.5.1-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 * Sun Aug 04 2013 Fedora Release Engineering - 2.5.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Sat Jun 08 2013 Terje Rosten - 2.5.1-1 - initial package