%global pkgname jsonpath-rw
%if 0%{?fedora}
%global with_python3 1
%endif
Name: python-%{pkgname}
Version: 1.2.3
Release: 18%{?dist}
Summary: Extended implementation of JSONPath for Python
License: ASL 2.0
URL: https://github.com/kennknowles/python-jsonpath-rw
Source0: https://github.com/kennknowles/python-jsonpath-rw/archive/%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel, python2-setuptools
%global _description\
\
This library provides a robust and significantly extended implementation of\
JSONPath for Python, with a clear AST for meta-programming. It is tested with\
Python 2.6, 2.7, 3.2, 3.3, and PyPy.\
\
This library differs from other JSONPath implementations in that it is a full\
language implementation, meaning the JSONPath expressions are first class\
objects, easy to analyze, transform, parse, print, and extend.
%description %_description
%package -n python2-%{pkgname}
Summary: %summary
Requires: python2-ply
Requires: python2-decorator
Requires: python2-six
%{?python_provide:%python_provide python2-%{pkgname}}
%description -n python2-%{pkgname} %_description
%if 0%{?with_python3}
%package -n python3-%{pkgname}
Summary: Extended implementation of JSONPath for Python
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Requires: python3-ply
Requires: python3-decorator
Requires: python3-six
%description -n python3-%{pkgname}
This library provides a robust and significantly extended implementation of
JSONPath for Python, with a clear AST for meta-programming. It is tested with
Python 2.6, 2.7, 3.2, 3.3, and PyPy.
This library differs from other JSONPath implementations in that it is a full
language implementation, meaning the JSONPath expressions are first class
objects, easy to analyze, transform, parse, print, and extend.
%endif
%package doc
Summary: Documentation for %{name}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%if 0%{?rhel}
%{__python} setup.py build
%else
%{__python2} setup.py build
%endif
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install
%if 0%{?rhel}
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%else
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%endif
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
popd
%endif
%files -n python2-%{pkgname}
%doc README.rst LICENSE
%if 0%{?rhel}
%{python2_sitelib}/*
%else
%{python2_sitelib}/*
%endif
%if 0%{?with_python3}
%files -n python3-%{pkgname}
%doc README.rst LICENSE
%{python3_sitelib}/*
%endif
%changelog
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.3-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Jul 24 2018 Miro Hrončok <mhroncok@redhat.com> - 1.2.3-17
- Update Python macros to new packaging standards
(See https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package)
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.3-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.2.3-15
- Rebuilt for Python 3.7
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.2.3-14
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.3-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.2.3-12
- Python 2 binary package renamed to python2-jsonpath-rw
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.3-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.3-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.2.3-9
- Rebuild for Python 3.6
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-8
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-6
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 1.2.3-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
* Mon Jan 06 2014 Steve Linabery <slinaber@redhat.com> - 1.2.3-2
- Add python3 specific logic around files section for python3 pkg
* Thu Jan 02 2014 Steve Linabery <slinaber@redhat.com> - 1.2.3-1
- Initial packaging for Fedora