%global modname parse %if 0%{?rhel} > 7 || 0%{?fedora} >= 12 %bcond_without python3 %else %bcond_with python3 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from %distutils.sysconfig import get_python_lib; print(get_python_lib())")} %endif Name: python-parse Version: 1.6.4 Release: 4%{?dist} Summary: Opposite of format() Group: Development/Libraries License: BSD URL: http://pypi.python.org/pypi/parse Source0: http://pypi.python.org/packages/source/p/%{modname}/%{modname}-%{version}.tar.gz # https://bugzilla.redhat.com/show_bug.cgi?id=1291218 Patch0: parse-python-3.5-test.patch BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools %if %{with python3} BuildRequires: python3-devel BuildRequires: python3-setuptools %endif %description Parse strings using a specification based on the Python format() syntax. ``parse()`` is the opposite of ``format()`` %if %{with python3} %package -n python3-%{modname} Summary: Opposite of format() Group: Development/Libraries %description -n python3-%{modname} Parse strings using a specification based on the Python format() syntax. ``parse()`` is the opposite of ``format()`` This package works with Python 3. %endif %prep %setup -q -n %{modname}-%{version} %patch0 -p1 # Remove bundled egg-info in case it exists rm -rf %{modname}.egg-info %if %{with python3} rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' %endif %build %{__python} setup.py build %if %{with python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install # Must do the python3 install first because the scripts in /usr/bin are # overwritten with every setup.py install (and we want the python2 # version to be the default for now). %if %{with python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root=%{buildroot} popd %endif %{__python} setup.py install -O1 --skip-build --root=%{buildroot} %check %{__python} test_parse.py %if %{with python3} pushd %{py3dir} %{__python3} test_parse.py popd %endif %files %doc README.rst %{python_sitelib}/%{modname}* %if %{with python3} %files -n python3-%{modname} %doc README.rst %{python3_sitelib}/%{modname}* %{python3_sitelib}/__pycache__/%{modname}* %endif %changelog * Mon Dec 14 2015 David King - 1.6.4-4 - Fix test failure with Python 3.5 (#1291218) * Tue Nov 10 2015 Fedora Release Engineering - 1.6.4-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Thu Jun 18 2015 Fedora Release Engineering - 1.6.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Thu Jun 19 2014 Matěj Cepl - 1.6.4-1 - New upstream release. * Sat Jun 07 2014 Fedora Release Engineering - 1.6.2-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Wed May 28 2014 Kalev Lember - 1.6.2-5 - Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 * Tue Aug 27 2013 Matěj Cepl - 1.6.2-4 - There is no official py3k support for RHEL-6. * Wed Jul 24 2013 Matěj Cepl - 1.6.2-3 - We actually don't need 2to3. * Wed Jul 24 2013 Matěj Cepl - 1.6.2-2 - make python3 package as well - BR python-setuptools - fix changelog * Tue Jul 23 2013 Matěj Cepl - 1.6.2-1 - initial package for Fedora