d6ce858
%global pypi_name jsonpointer
d6ce858
%global github_name python-json-pointer
d6ce858
f702e8e
%if 0%{?fedora} || 0%{?rhel} > 7
12d96e9
# Enable python3 build by default
12d96e9
%bcond_without python3
12d96e9
%else
12d96e9
%bcond_with python3
12d96e9
%endif
12d96e9
12d96e9
%if 0%{?rhel} > 7
12d96e9
# Disable python2 build by default
12d96e9
%bcond_with python2
12d96e9
%else
12d96e9
%bcond_without python2
1dc1020
%endif
1dc1020
d6ce858
Name:           python-%{pypi_name}
Alan Pevec af9c44a
Version:        1.10
3f7e949
Release:        15%{?dist}
d6ce858
Summary:        Resolve JSON Pointers in Python
d6ce858
d6ce858
License:        BSD
d6ce858
URL:            https://github.com/stefankoegl/%{github_name}
8c25b4b
Source0:        https://pypi.io/packages/source/j/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
d6ce858
d6ce858
BuildArch:      noarch
8c25b4b
d6ce858
d6ce858
%description
d6ce858
Library to resolve JSON Pointers according to RFC 6901.
d6ce858
12d96e9
%if %{with python2}
8c25b4b
%package -n python2-%{pypi_name}
8c25b4b
Summary:        Resolve JSON Pointers in Python
8c25b4b
8c25b4b
BuildRequires:  python2-devel
76f4d42
BuildRequires:  python2-setuptools
8c25b4b
8c25b4b
%{?python_provide:%python_provide python2-%{pypi_name}}
8c25b4b
8c25b4b
%description -n python2-%{pypi_name}
8c25b4b
Library to resolve JSON Pointers according to RFC 6901.
12d96e9
%endif # with python2
8c25b4b
12d96e9
%if %{with python3}
1dc1020
%package -n python3-%{pypi_name}
1dc1020
Summary:        Resolve JSON Pointers in Python
8c25b4b
8c25b4b
BuildRequires:  python3-devel
8c25b4b
BuildRequires:  python3-setuptools
8c25b4b
8c25b4b
%{?python_provide:%python_provide python3-%{pypi_name}}
8c25b4b
1dc1020
%description -n python3-%{pypi_name}
1dc1020
Library to resolve JSON Pointers according to RFC 6901.
12d96e9
%endif # with python3
1dc1020
d6ce858
%prep
Alan Pevec 6f76b31
%setup -q -n %{pypi_name}-%{version}
d6ce858
d6ce858
%build
12d96e9
%if %{with python2}
8c25b4b
%py2_build
12d96e9
%endif # with python2
12d96e9
%if %{with python3}
20e85ba
LC_ALL=C.UTF-8 %py3_build
12d96e9
%endif # with python3
d6ce858
d6ce858
%install
12d96e9
%if %{with python2}
8c25b4b
%py2_install
8c25b4b
mv %{buildroot}%{_bindir}/jsonpointer %{buildroot}%{_bindir}/jsonpointer-%{python2_version}
8c25b4b
ln -s ./jsonpointer-%{python2_version} %{buildroot}%{_bindir}/jsonpointer-2
12d96e9
%if %{without python3}
8c25b4b
ln -s ./jsonpointer-%{python2_version} %{buildroot}%{_bindir}/jsonpointer
12d96e9
%endif # without python3
12d96e9
%endif # with python2
8c25b4b
12d96e9
%if %{with python3}
20e85ba
LC_ALL=C.UTF-8 %py3_install
8c25b4b
mv %{buildroot}%{_bindir}/jsonpointer %{buildroot}%{_bindir}/jsonpointer-%{python3_version}
8c25b4b
ln -s ./jsonpointer-%{python3_version} %{buildroot}%{_bindir}/jsonpointer-3
8c25b4b
ln -s ./jsonpointer-%{python3_version} %{buildroot}%{_bindir}/jsonpointer
12d96e9
%endif # with python3
8c25b4b
d6ce858
d6ce858
%check
12d96e9
%if %{with python3}
1dc1020
%{__python3} tests.py
12d96e9
%endif # with python3
12d96e9
%if %{with python2}
12d96e9
%{__python2} tests.py
12d96e9
%endif # with python2
d6ce858
12d96e9
%if %{with python2}
8c25b4b
%files -n python2-%{pypi_name}
a3958cf
%doc README.md AUTHORS
a3958cf
%license COPYING
12d96e9
%if %{without python3}
8c25b4b
%{_bindir}/jsonpointer
12d96e9
%endif # without python3
8c25b4b
%{_bindir}/jsonpointer-2*
12d96e9
%{python2_sitelib}/%{pypi_name}.py*
12d96e9
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
12d96e9
%endif # with python2
d6ce858
12d96e9
%if %{with python3}
1dc1020
%files -n python3-%{pypi_name}
a3958cf
%doc README.md AUTHORS
a3958cf
%license COPYING
eec0249
%{_bindir}/jsonpointer
8c25b4b
%{_bindir}/jsonpointer-3*
1dc1020
%{python3_sitelib}/__pycache__/*
1dc1020
%{python3_sitelib}/%{pypi_name}.py*
1dc1020
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
12d96e9
%endif # with python3
1dc1020
d6ce858
%changelog
3f7e949
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-15
3f7e949
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
3f7e949
20e85ba
* Sun Nov 18 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.10-14
20e85ba
- Use C.UTF-8 locale
20e85ba
  See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot
20e85ba
db0c434
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-13
db0c434
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
db0c434
f48aa09
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 1.10-12
f48aa09
- Rebuilt for Python 3.7
f48aa09
12d96e9
* Tue Apr 03 2018 Charalampos Stratakis <cstratak@redhat.com> - 1.10-11
12d96e9
- Conditionalize the Python 2 subpackage and don't build it on EL > 7
12d96e9
76f4d42
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.10-10
76f4d42
- Update Python 2 dependency declarations to new packaging standards
76f4d42
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
76f4d42
7c2414c
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-9
7c2414c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
7c2414c
f702e8e
* Fri Sep 29 2017 Troy Dawson <tdawson@redhat.com> - 1.10-8
f702e8e
- Cleanup spec file conditionals
f702e8e
fda6962
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-7
fda6962
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
fda6962
e818e42
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-6
e818e42
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
e818e42
bad598e
* Fri Dec 09 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.10-5
bad598e
- Rebuild for Python 3.6
bad598e
8c25b4b
* Mon Sep  5 2016 Haïkel Guémar <hguemar@fedoraproject.org> - 1.10-4
8c25b4b
- Update to latest python guidelines
8c25b4b
099af04
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10-3
099af04
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
099af04
6bf4a08
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-2
6bf4a08
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
6bf4a08
Alan Pevec af9c44a
* Sat Dec 19 2015 Alan Pevec <alan.pevec@redhat.com> 1.10-1
Alan Pevec af9c44a
- Update to 1.10
Alan Pevec af9c44a
Alan Pevec af9c44a
* Sat Nov 14 2015 Tonet Jallo <tonet666p@gmail.com> - 1.9-4
eec0249
- Moved a line from files section to python3 files section
eec0249
80af90b
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9-3
80af90b
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
80af90b
Alan Pevec fdf29fa
* Fri Aug 07 2015 Alan Pevec <apevec@gmail.com> - 1.9-2
Alan Pevec fdf29fa
- Update to 1.9
Alan Pevec fdf29fa
e3b5f65
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-7
e3b5f65
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
e3b5f65
a3958cf
* Thu Jul 31 2014 Tom Callaway <spot@fedoraproject.org> - 1.0-6
a3958cf
- fix license handling
a3958cf
a8aa950
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-5
a8aa950
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
a8aa950
85ba469
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 1.0-4
85ba469
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
85ba469
1dc1020
* Wed Feb  5 2014 Thomas Spura <tomspur@fedoraproject.org> - 1.0-3
1dc1020
- add python3 subpackage (#1061622)
1dc1020
d6ce858
* Thu Sep 05 2013 Alan Pevec <apevec@gmail.com> - 1.0-2
d6ce858
- add AUTHORS to docs
d6ce858
d6ce858
* Mon Jul 01 2013 Alan Pevec <apevec@gmail.com> - 1.0-1
d6ce858
- Initial package.