Blame SPECS/python-jmespath.spec

e6fc3e
%if 0%{?rhel} && 0%{?rhel} <= 7
e6fc3e
%bcond_with python3
e6fc3e
%else
e6fc3e
%bcond_without python3
e6fc3e
%endif
e6fc3e
e6fc3e
%if 0%{?rhel} > 7
e6fc3e
# Disable python2 build by default
e6fc3e
%bcond_with python2
e6fc3e
%else
e6fc3e
%bcond_without python2
e6fc3e
%endif
e6fc3e
e6fc3e
%global pypi_name jmespath
e6fc3e
e6fc3e
Name:           python-%{pypi_name}
e6fc3e
Version:        0.9.0
e6fc3e
Release:        11%{?dist}
e6fc3e
Summary:        JSON Matching Expressions
e6fc3e
e6fc3e
License:        MIT
e6fc3e
URL:            https://github.com/jmespath/jmespath.py
e6fc3e
Source0:        https://pypi.python.org/packages/source/j/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
e6fc3e
BuildArch:      noarch
e6fc3e
e6fc3e
%description
e6fc3e
JMESPath allows you to declaratively specify how to extract elements from
e6fc3e
a JSON document.
e6fc3e
e6fc3e
%if %{with python2}
e6fc3e
%package -n     python2-%{pypi_name}
e6fc3e
Summary:        JSON Matching Expressions
e6fc3e
%{?el6:Provides: python-%{pypi_name}}
e6fc3e
%{?python_provide:%python_provide python2-%{pypi_name}}
e6fc3e
e6fc3e
BuildRequires:  python2-devel
e6fc3e
BuildRequires:  python2-mock
e6fc3e
BuildRequires:  python2-nose
e6fc3e
BuildRequires:  python2-setuptools
e6fc3e
%if 0%{?rhel} && 0%{?rhel} < 7
e6fc3e
BuildRequires:  python-ordereddict
e6fc3e
# tests specifically import simplejson as json if python version is 2.6
e6fc3e
BuildRequires:  python-simplejson
e6fc3e
BuildRequires:  python-unittest2
e6fc3e
%endif # rhel < 7
e6fc3e
e6fc3e
%description -n python2-%{pypi_name}
e6fc3e
JMESPath allows you to declaratively specify how to extract elements from
e6fc3e
a JSON document.
e6fc3e
%endif # with python2
e6fc3e
e6fc3e
%if %{with python3}
e6fc3e
%package -n     python3-%{pypi_name}
e6fc3e
Summary:        JSON Matching Expressions
e6fc3e
%{?python_provide:%python_provide python3-%{pypi_name}}
e6fc3e
e6fc3e
BuildRequires:  python3-devel
e6fc3e
BuildRequires:  python3-mock
e6fc3e
BuildRequires:  python3-nose
e6fc3e
BuildRequires:  python3-setuptools
e6fc3e
e6fc3e
Supplements:    ansible
e6fc3e
e6fc3e
%description -n python3-%{pypi_name}
e6fc3e
JMESPath allows you to declaratively specify how to extract elements from
e6fc3e
a JSON document.
e6fc3e
%endif # with python3
e6fc3e
e6fc3e
%prep
e6fc3e
%setup -q -n %{pypi_name}-%{version}
e6fc3e
rm -rf %{pypi_name}.egg-info
e6fc3e
e6fc3e
%build
e6fc3e
%if %{with python2}
e6fc3e
%py2_build
e6fc3e
%endif # with python2
e6fc3e
%if %{with python3}
e6fc3e
%py3_build
e6fc3e
%endif # with python3
e6fc3e
e6fc3e
%install
e6fc3e
%if %{with python3}
e6fc3e
%py3_install
e6fc3e
mv %{buildroot}/%{_bindir}/jp.py %{buildroot}/%{_bindir}/jp.py-%{python3_version}
e6fc3e
ln -sf %{_bindir}/jp.py-%{python3_version} %{buildroot}/%{_bindir}/jp.py-3
e6fc3e
%if %{without python2}
e6fc3e
ln -sf %{_bindir}/jp.py-%{python3_version} %{buildroot}/%{_bindir}/jp.py
e6fc3e
%endif # without python2
e6fc3e
%endif # with python3
e6fc3e
e6fc3e
%if %{with python2}
e6fc3e
%py2_install
e6fc3e
mv %{buildroot}/%{_bindir}/jp.py %{buildroot}/%{_bindir}/jp.py-%{python2_version}
e6fc3e
ln -sf %{_bindir}/jp.py-%{python2_version} %{buildroot}/%{_bindir}/jp.py-2
e6fc3e
ln -sf %{_bindir}/jp.py-%{python2_version} %{buildroot}/%{_bindir}/jp.py
e6fc3e
%endif # with python2
e6fc3e
e6fc3e
%check
e6fc3e
%if %{with python2}
e6fc3e
nosetests-%{python2_version}
e6fc3e
%endif # with python2
e6fc3e
%if %{with python3}
e6fc3e
nosetests-%{python3_version}
e6fc3e
%endif # with python3
e6fc3e
e6fc3e
%if %{with python2}
e6fc3e
%files -n python2-%{pypi_name}
e6fc3e
%doc README.rst
e6fc3e
%license LICENSE.txt
e6fc3e
%{_bindir}/jp.py
e6fc3e
%{_bindir}/jp.py-2
e6fc3e
%{_bindir}/jp.py-%{python2_version}
e6fc3e
%{python2_sitelib}/%{pypi_name}
e6fc3e
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
e6fc3e
%endif # with python2
e6fc3e
e6fc3e
%if %{with python3}
e6fc3e
%files -n python3-%{pypi_name}
e6fc3e
%doc README.rst
e6fc3e
%license LICENSE.txt
e6fc3e
%if %{without python2}
e6fc3e
%{_bindir}/jp.py
e6fc3e
%endif # without python2
e6fc3e
%{_bindir}/jp.py-3
e6fc3e
%{_bindir}/jp.py-%{python3_version}
e6fc3e
%{python3_sitelib}/%{pypi_name}
e6fc3e
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
e6fc3e
%endif # with python3
e6fc3e
e6fc3e
%changelog
e6fc3e
* Mon Jan 14 2019 Pavel Cahyna <pcahyna@redhat.com> - 0.9.0-11
e6fc3e
- Supplement: ansible, as we enable the json_query Jinja2 filter. RHBZ#1660559
e6fc3e
e6fc3e
* Fri Jun 15 2018 Charalampos Stratakis <cstratak@redhat.com> - 0.9.0-10
e6fc3e
- Conditionalize the python2 subpackage
e6fc3e
e6fc3e
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-9
e6fc3e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
e6fc3e
e6fc3e
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-8
e6fc3e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
e6fc3e
e6fc3e
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-7
e6fc3e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
e6fc3e
e6fc3e
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.9.0-6
e6fc3e
- Rebuild for Python 3.6
e6fc3e
e6fc3e
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-5
e6fc3e
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
e6fc3e
e6fc3e
* Mon Jun 27 2016 Haïkel Guémar <hguemar@fedoraproject.org> - 0.9.0-4
e6fc3e
- Fix python2 subpackage requiring python3 (RHBZ#1342501)
e6fc3e
e6fc3e
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-3
e6fc3e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e6fc3e
e6fc3e
* Wed Jan 06 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.9.0-2
e6fc3e
- Improve to set the Provides tag for EL6 too
e6fc3e
e6fc3e
* Tue Dec 29 2015 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.9.0-1
e6fc3e
- Upgrade to upstream current version
e6fc3e
- Improve the spec file
e6fc3e
- Make possible to build in EL6
e6fc3e
e6fc3e
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-3
e6fc3e
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
e6fc3e
e6fc3e
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-2
e6fc3e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
e6fc3e
e6fc3e
* Fri Dec 19 2014 Lubomir Rintel <lkundrak@v3.sk> - 0.5.0-1
e6fc3e
- New version
e6fc3e
e6fc3e
* Fri Jul 25 2014 Lubomir Rintel <lkundrak@v3.sk> - 0.4.1-2
e6fc3e
- Add Python 3 support
e6fc3e
e6fc3e
* Fri Jul 25 2014 Lubomir Rintel <lkundrak@v3.sk> - 0.4.1-1
e6fc3e
- Initial packaging