Fabio Alessandro Locati c59dabe
%if 0%{?rhel}
Fabio Alessandro Locati c59dabe
%global with_python3 0
Fabio Alessandro Locati c59dabe
%{!?__python2: %global __python2 /usr/bin/python2}
Fabio Alessandro Locati c59dabe
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
Fabio Alessandro Locati c59dabe
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
Fabio Alessandro Locati c59dabe
%{!?py2_build: %global py2_build %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"}}
Fabio Alessandro Locati c59dabe
%{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}}
947843a
%else
Fabio Alessandro Locati c59dabe
%global with_python3 1
947843a
%endif
947843a
Fabio Alessandro Locati c59dabe
%global pypi_name jmespath
947843a
Fabio Alessandro Locati c59dabe
Name:           python-%{pypi_name}
Fabio Alessandro Locati c59dabe
Version:        0.9.0
9d37873
Release:        5%{?dist}
Fabio Alessandro Locati c59dabe
Summary:        JSON Matching Expressions
947843a
Fabio Alessandro Locati c59dabe
License:        MIT
Fabio Alessandro Locati c59dabe
URL:            https://github.com/jmespath/jmespath.py
Fabio Alessandro Locati c59dabe
Source0:        https://pypi.python.org/packages/source/j/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
947843a
BuildArch:      noarch
Fabio Alessandro Locati c59dabe
947843a
947843a
%description
947843a
JMESPath allows you to declaratively specify how to extract elements from
947843a
a JSON document.
947843a
Fabio Alessandro Locati c59dabe
%package -n     python2-%{pypi_name}
947843a
Summary:        JSON Matching Expressions
Fabio Alessandro Locati 6dc4ea2
%{?el6:Provides: python-%{pypi_name}}
Fabio Alessandro Locati c59dabe
%{?python_provide:%python_provide python2-%{pypi_name}}
947843a
97de9eb
BuildRequires:  python2-devel
97de9eb
BuildRequires:  python-setuptools
97de9eb
Fabio Alessandro Locati c59dabe
%description -n python2-%{pypi_name}
947843a
JMESPath allows you to declaratively specify how to extract elements from
947843a
a JSON document.
947843a
Fabio Alessandro Locati c59dabe
%if 0%{?with_python3}
Fabio Alessandro Locati c59dabe
%package -n     python3-%{pypi_name}
Fabio Alessandro Locati c59dabe
Summary:        JSON Matching Expressions
Fabio Alessandro Locati c59dabe
%{?python_provide:%python_provide python3-%{pypi_name}}
947843a
97de9eb
BuildRequires:  python3-devel
97de9eb
BuildRequires:  python3-setuptools
97de9eb
Fabio Alessandro Locati c59dabe
%description -n python3-%{pypi_name}
Fabio Alessandro Locati c59dabe
JMESPath allows you to declaratively specify how to extract elements from
Fabio Alessandro Locati c59dabe
a JSON document.
Fabio Alessandro Locati c59dabe
%endif # with_python3
947843a
947843a
%prep
Fabio Alessandro Locati 6f4fe87
%setup -q -n %{pypi_name}-%{version}
Fabio Alessandro Locati c59dabe
rm -rf %{pypi_name}.egg-info
947843a
947843a
%build
Fabio Alessandro Locati c59dabe
%py2_build
Fabio Alessandro Locati c59dabe
%if 0%{?with_python3}
Fabio Alessandro Locati c59dabe
%py3_build
Fabio Alessandro Locati c59dabe
%endif # with_python3
947843a
947843a
%install
Fabio Alessandro Locati c59dabe
%if 0%{?with_python3}
Fabio Alessandro Locati c59dabe
%py3_install
97de9eb
mv %{buildroot}/%{_bindir}/jp.py %{buildroot}/%{_bindir}/jp.py-%{python3_version}
97de9eb
ln -sf %{_bindir}/jp.py-%{python3_version} %{buildroot}/%{_bindir}/jp.py-3
Fabio Alessandro Locati c59dabe
%endif # with_python3
947843a
Fabio Alessandro Locati c59dabe
%py2_install
97de9eb
mv %{buildroot}/%{_bindir}/jp.py %{buildroot}/%{_bindir}/jp.py-%{python2_version}
97de9eb
ln -sf %{_bindir}/jp.py-%{python2_version} %{buildroot}/%{_bindir}/jp.py-2
97de9eb
ln -sf %{_bindir}/jp.py-%{python2_version} %{buildroot}/%{_bindir}/jp.py
947843a
947843a
Fabio Alessandro Locati c59dabe
%files -n python2-%{pypi_name}
Fabio Alessandro Locati c59dabe
%{!?_licensedir:%global license %doc}
947843a
%doc README.rst
Fabio Alessandro Locati c59dabe
%license LICENSE.txt
Fabio Alessandro Locati c59dabe
%{_bindir}/jp.py
Fabio Alessandro Locati c59dabe
%{_bindir}/jp.py-2
Fabio Alessandro Locati c59dabe
%{_bindir}/jp.py-%{python2_version}
Fabio Alessandro Locati c59dabe
%{python2_sitelib}/%{pypi_name}
Fabio Alessandro Locati c59dabe
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
Fabio Alessandro Locati c59dabe
Fabio Alessandro Locati c59dabe
%if 0%{?with_python3}
Fabio Alessandro Locati c59dabe
%files -n python3-%{pypi_name}
947843a
%doc README.rst
Fabio Alessandro Locati c59dabe
%license LICENSE.txt
Fabio Alessandro Locati c59dabe
%{_bindir}/jp.py-3
Fabio Alessandro Locati c59dabe
%{_bindir}/jp.py-%{python3_version}
Fabio Alessandro Locati c59dabe
%{python3_sitelib}/%{pypi_name}
Fabio Alessandro Locati c59dabe
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
Fabio Alessandro Locati c59dabe
%endif # with_python3
947843a
947843a
%changelog
9d37873
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-5
9d37873
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
9d37873
97de9eb
* Mon Jun 27 2016 Haïkel Guémar <hguemar@fedoraproject.org> - 0.9.0-4
97de9eb
- Fix python2 subpackage requiring python3 (RHBZ#1342501)
97de9eb
a5148e0
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-3
a5148e0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
a5148e0
Fabio Alessandro Locati 7f11b83
* Wed Jan 06 2016 Fabio Alessandro Locati <fabio@locati.cc> - 0.9.0-2
Fabio Alessandro Locati 7f11b83
- Improve to set the Provides tag for EL6 too
Fabio Alessandro Locati 7f11b83
Fabio Alessandro Locati c59dabe
* Tue Dec 29 2015 Fabio Alessandro Locati <fabio@locati.cc> - 0.9.0-1
Fabio Alessandro Locati c59dabe
- Upgrade to upstream current version
Fabio Alessandro Locati c59dabe
- Improve the spec file
Fabio Alessandro Locati c59dabe
- Make possible to build in EL6
Fabio Alessandro Locati c59dabe
4ac8726
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-3
4ac8726
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
4ac8726
304a22c
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-2
304a22c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
304a22c
a2d32c4
* Fri Dec 19 2014 Lubomir Rintel <lkundrak@v3.sk> - 0.5.0-1
a2d32c4
- New version
a2d32c4
947843a
* Fri Jul 25 2014 Lubomir Rintel <lkundrak@v3.sk> - 0.4.1-2
947843a
- Add Python 3 support
947843a
947843a
* Fri Jul 25 2014 Lubomir Rintel <lkundrak@v3.sk> - 0.4.1-1
947843a
- Initial packaging