Blame SPECS/python-jsonpatch.spec

3e3a5e
%global pypi_name jsonpatch
3e3a5e
3e3a5e
%if 0%{?fedora} || 0%{?rhel} > 7
3e3a5e
# Enable python3 build by default
3e3a5e
%bcond_without python3
3e3a5e
%else
3e3a5e
%bcond_with python3
3e3a5e
%endif
3e3a5e
3e3a5e
%if 0%{?rhel} > 7
3e3a5e
# Disable python2 build by default
3e3a5e
%bcond_with python2
3e3a5e
%else
3e3a5e
%bcond_without python2
3e3a5e
%endif
3e3a5e
3e3a5e
Name:           python-%{pypi_name}
3e3a5e
Version:        1.21
3e3a5e
Release:        2%{?dist}
3e3a5e
Summary:        Applying JSON Patches in Python
3e3a5e
3e3a5e
License:        BSD
3e3a5e
URL:            https://github.com/stefankoegl/%{github_name}
3e3a5e
Source0:        https://pypi.io/packages/source/j/jsonpatch/%{pypi_name}-%{version}.tar.gz
3e3a5e
# tarball from pypi does not include file tests.js required for a specific test.
3e3a5e
# upstream issue https://github.com/stefankoegl/python-json-patch/issues/82
3e3a5e
Patch0:         0001-Skip-unit-test-in-packaging.patch
3e3a5e
3e3a5e
BuildArch:      noarch
3e3a5e
3e3a5e
%description
3e3a5e
Library to apply JSON Patches according to RFC 6902 - Python 2 build.
3e3a5e
3e3a5e
%if %{with python2}
3e3a5e
%package -n python2-%{pypi_name}
3e3a5e
Summary:        Applying JSON Patches in Python 2
3e3a5e
3e3a5e
BuildRequires:  python2-devel
3e3a5e
BuildRequires:  python2-setuptools
3e3a5e
BuildRequires:  python2-jsonpointer
3e3a5e
Requires:       python2-jsonpointer
3e3a5e
3e3a5e
%{?python_provide:%python_provide python2-%{pypi_name}}
3e3a5e
3e3a5e
%description -n python2-%{pypi_name}
3e3a5e
Library to apply JSON Patches according to RFC 6902 - Python 2 build.
3e3a5e
%endif # with python2
3e3a5e
3e3a5e
%if %{with python3}
3e3a5e
%package -n python3-%{pypi_name}
3e3a5e
Summary:        Applying JSON Patches in Python 3
3e3a5e
3e3a5e
BuildRequires:  python3-devel
3e3a5e
BuildRequires:  python3-setuptools
3e3a5e
BuildRequires:  python3-jsonpointer
3e3a5e
Requires:       python3-jsonpointer
3e3a5e
3e3a5e
%{?python_provide:%python_provide python3-%{pypi_name}}
3e3a5e
3e3a5e
%description -n python3-%{pypi_name}
3e3a5e
Library to apply JSON Patches according to RFC 6902 - Python 3 build.
3e3a5e
%endif # with python3
3e3a5e
3e3a5e
%prep
3e3a5e
%setup -qn %{pypi_name}-%{version}
3e3a5e
%patch0 -p1
3e3a5e
3e3a5e
3e3a5e
%build
3e3a5e
%if %{with python2}
3e3a5e
%py2_build
3e3a5e
%endif # with python2
3e3a5e
3e3a5e
%if %{with python3}
3e3a5e
LANG=en_US.utf8 %py3_build
3e3a5e
%endif # with python3
3e3a5e
3e3a5e
%install
3e3a5e
%if %{with python2}
3e3a5e
%py2_install
3e3a5e
for bin in jsondiff jsonpatch; do
3e3a5e
mv %{buildroot}%{_bindir}/$bin %{buildroot}%{_bindir}/$bin-%{python2_version}
3e3a5e
ln -s ./$bin-%{python2_version} %{buildroot}%{_bindir}/$bin-2
3e3a5e
%if !0%{?with_python3}
3e3a5e
ln -s ./$bin-%{python2_version} %{buildroot}%{_bindir}/$bin
3e3a5e
%endif
3e3a5e
done;
3e3a5e
%endif # with python2
3e3a5e
3e3a5e
%if %{with python3}
3e3a5e
LANG=en_US.utf8 %py3_install
3e3a5e
for bin in jsondiff jsonpatch; do
3e3a5e
mv %{buildroot}%{_bindir}/$bin %{buildroot}%{_bindir}/$bin-%{python3_version}
3e3a5e
ln -s ./$bin-%{python3_version} %{buildroot}%{_bindir}/$bin-3
3e3a5e
ln -s ./$bin-%{python3_version} %{buildroot}%{_bindir}/$bin
3e3a5e
done;
3e3a5e
%endif # with python3
3e3a5e
3e3a5e
%check
3e3a5e
%if %{with python2}
3e3a5e
%{__python2} tests.py
3e3a5e
%endif # with python2
3e3a5e
3e3a5e
%if %{with python3}
3e3a5e
%{__python3} tests.py
3e3a5e
%endif # with python3
3e3a5e
3e3a5e
%if %{with python2}
3e3a5e
%files -n python2-%{pypi_name}
3e3a5e
%doc README.md
3e3a5e
%license COPYING
3e3a5e
%if !0%{?with_python3}
3e3a5e
%{_bindir}/jsondiff
3e3a5e
%{_bindir}/jsonpatch
3e3a5e
%endif
3e3a5e
%{_bindir}/jsondiff-2*
3e3a5e
%{_bindir}/jsonpatch-2*
3e3a5e
%{python2_sitelib}/%{pypi_name}.py*
3e3a5e
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
3e3a5e
%endif # with python2
3e3a5e
3e3a5e
%if %{with python3}
3e3a5e
%files -n python3-%{pypi_name}
3e3a5e
%doc README.md
3e3a5e
%license COPYING
3e3a5e
%{_bindir}/jsondiff
3e3a5e
%{_bindir}/jsonpatch
3e3a5e
%{_bindir}/jsondiff-3*
3e3a5e
%{_bindir}/jsonpatch-3*
3e3a5e
%{python3_sitelib}/%{pypi_name}.py*
3e3a5e
%{python3_sitelib}/__pycache__/*
3e3a5e
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
3e3a5e
%endif # with python3
3e3a5e
3e3a5e
%changelog
3e3a5e
* Thu Mar 15 2018 Charalampos Stratakis <cstratak@redhat.com> - 1.21-2
3e3a5e
- Don't build Python 2 subpackage on EL > 7
3e3a5e
3e3a5e
* Tue Feb 6 2018 Alfredo Moralejo <amoralej@redhat.com> - 1.21-1
3e3a5e
- Update to 1.21
3e3a5e
3e3a5e
* Fri Sep 29 2017 Troy Dawson <tdawson@redhat.com> - 1.14-5
3e3a5e
- Cleanup spec file conditionals
3e3a5e
3e3a5e
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.14-4
3e3a5e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
3e3a5e
3e3a5e
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.14-3
3e3a5e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
3e3a5e
3e3a5e
* Fri Dec 09 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.14-2
3e3a5e
- Rebuild for Python 3.6
3e3a5e
- Added upstream patch for fixing python3 tests failures
3e3a5e
3e3a5e
* Mon Sep  5 2016 Haïkel Guémar <hguemar@fedoraproject.org> - 1.14-1
3e3a5e
- Upstream 1.14
3e3a5e
- Update to latest python packaging guidelines
3e3a5e
3e3a5e
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-9
3e3a5e
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
3e3a5e
3e3a5e
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-8
3e3a5e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
3e3a5e
3e3a5e
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-7
3e3a5e
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
3e3a5e
3e3a5e
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-6
3e3a5e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
3e3a5e
3e3a5e
* Fri Aug 29 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 1.2-5
3e3a5e
- Introduce python3- subpackage.
3e3a5e
3e3a5e
* Thu Jul 31 2014 Tom Callaway <spot@fedoraproject.org> - 1.2-4
3e3a5e
- fix license handling
3e3a5e
3e3a5e
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2-3
3e3a5e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
3e3a5e
3e3a5e
* Tue Oct 15 2013 Alan Pevec <apevec@gmail.com> - 1.2-2
3e3a5e
- add runtime dep on jsonpointer
3e3a5e
3e3a5e
* Fri Oct 11 2013 Alan Pevec <apevec@gmail.com> - 1.2-1
3e3a5e
- Update to 1.2
3e3a5e
3e3a5e
* Fri Sep 13 2013 Alan Pevec <apevec@gmail.com> - 1.1-2
3e3a5e
- review feedback: move %%check section, add missing build requirements
3e3a5e
3e3a5e
* Mon Jul 01 2013 Alan Pevec <apevec@gmail.com> - 1.1-1
3e3a5e
- Initial package.