Blame SPECS/python-jmespath.spec

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