Blob Blame History Raw
%global modname parse

%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with python3
%else
%bcond_without python3
%endif

Name:           python-%{modname}
Version:        1.6.6
Release:        8%{?dist}
Summary:        Opposite of format()

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

%global _description \
Parse strings using a specification based on the Python format() syntax.\
\
"parse()" is the opposite of "format()"

%description %{_description}

%package -n python2-%{modname}
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{modname}}
BuildRequires:  python2-devel

%description -n python2-%{modname} %{_description}

Python 2 version.

%if %{with python3}
%package -n python3-%{modname}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{modname}}
BuildRequires:  python3-devel

%description -n python3-%{modname} %{_description}

Python 3 version.
%endif

%prep
%autosetup -n %{modname}-%{version} -p1
chmod -x README.rst

%build
%py2_build
%if %{with python3}
%py3_build
%endif

%install
%py2_install
%if %{with python3}
%py3_install
%endif

%check
%{__python2} test_parse.py
%if %{with python3}
%{__python3} test_parse.py
%endif

%files -n python2-%{modname}
%doc README.rst
%{python2_sitelib}/%{modname}-%{version}-*.egg-info
%{python2_sitelib}/%{modname}.py*

%if %{with python3}
%files -n python3-%{modname}
%doc README.rst
%{python3_sitelib}/%{modname}-%{version}-*.egg-info
%{python3_sitelib}/%{modname}.py
%{python3_sitelib}/__pycache__/%{modname}.*
%endif

%changelog
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.6-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.6.6-5
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.6-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Tue Apr 19 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.6.6-3
- Remove unneded BuildRequires
- Use %%python_provde
- Correctly split to python2- subpkg
- Fix spurious-executable-perm
- Don't use %%py3dir

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Dec 15 2015 Matěj Cepl <mcepl@redhat.com> - 1.6.6-1
- Upgrade to the latest upstream (#1291602)

* Mon Dec 14 2015 David King <amigadave@amigadave.com> - 1.6.4-4
- Fix test failure with Python 3.5 (#1291218)

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.4-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Jun 19 2014 Matěj Cepl <mcepl@redhat.com> - 1.6.4-1
- New upstream release.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 1.6.2-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Tue Aug 27 2013 Matěj Cepl <mcepl@redhat.com> - 1.6.2-4
- There is no official py3k support for RHEL-6.

* Wed Jul 24 2013 Matěj Cepl <mcepl@redhat.com> - 1.6.2-3
- We actually don't need 2to3.

* Wed Jul 24 2013 Matěj Cepl <mcepl@redhat.com> - 1.6.2-2
- make python3 package as well
- BR python-setuptools
- fix changelog

* Tue Jul 23 2013 Matěj Cepl <mcepl@redhat.com> - 1.6.2-1
- initial package for Fedora