From eab992157cfa6b4e7b3d4f2eeb1fbbd72b4b66f3 Mon Sep 17 00:00:00 2001 From: Haikel Guemar Date: Mon, 5 Sep 2016 17:53:26 +0200 Subject: [PATCH] Upstream 1.14 - Update to latest python packaging guidelines --- python-jsonpatch.spec | 82 ++++++++++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 29 deletions(-) diff --git a/python-jsonpatch.spec b/python-jsonpatch.spec index f666117..4a87e35 100644 --- a/python-jsonpatch.spec +++ b/python-jsonpatch.spec @@ -1,29 +1,38 @@ %global pypi_name jsonpatch -%global github_name python-json-patch -%global commit f6f3cd235337209fc96b71316215a40d1cd3026c -%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%if 0%{?fedora} %global with_python3 1 +%endif Name: python-%{pypi_name} -Version: 1.2 -Release: 9%{?dist} +Version: 1.14 +Release: 1%{?dist} Summary: Applying JSON Patches in Python License: BSD URL: https://github.com/stefankoegl/%{github_name} #Source0: https://pypi.python.org/packages/source/j/%{pypi_name}/%{pypi_name}-%{version}.tar.gz # pypi tarball does not contain README.md and tests.py -Source0: https://github.com/stefankoegl/%{github_name}/archive/%{commit}/%{github_name}-%{version}-%{shortcommit}.tar.gz +Source0: https://pypi.io/packages/source/j/jsonpatch/%{pypi_name}-%{version}.tar.gz BuildArch: noarch + +%description +Library to apply JSON Patches according to RFC 6902 - Python 2 build. + +%package -n python2-%{pypi_name} +Summary: Applying JSON Patches in Python 2 + BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-jsonpointer Requires: python-jsonpointer -%description +%{?python_provide:%python_provide python2-%{pypi_name}} + +%description -n python2-%{pypi_name} Library to apply JSON Patches according to RFC 6902 - Python 2 build. + %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: Applying JSON Patches in Python 3 @@ -33,63 +42,78 @@ BuildRequires: python3-setuptools BuildRequires: python3-jsonpointer Requires: python3-jsonpointer +%{?python_provide:%python_provide python3-%{pypi_name}} + %description -n python3-%{pypi_name} Library to apply JSON Patches according to RFC 6902 - Python 3 build. %endif %prep -%setup -qn %{github_name}-%{commit} - -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -%endif +%setup -qn %{pypi_name}-%{version} %build -%{__python} setup.py build +%py2_build %if 0%{?with_python3} -pushd %{py3dir} -LANG=en_US.utf8 %{__python3} setup.py build -popd +LANG=en_US.utf8 %py3_build %endif %install -%{__python} setup.py install --skip-build --root %{buildroot} +%py2_install +for bin in jsondiff jsonpatch; do +mv %{buildroot}%{_bindir}/$bin %{buildroot}%{_bindir}/$bin-%{python2_version} +ln -s ./$bin-%{python2_version} %{buildroot}%{_bindir}/$bin-2 +%if !0%{?with_python3} +ln -s ./$bin-%{python2_version} %{buildroot}%{_bindir}/$bin +%endif +done; %if 0%{?with_python3} -pushd %{py3dir} -LANG=en_US.utf8 %{__python3} setup.py install --skip-build --root %{buildroot} -popd +LANG=en_US.utf8 %py3_install +for bin in jsondiff jsonpatch; do +mv %{buildroot}%{_bindir}/$bin %{buildroot}%{_bindir}/$bin-%{python3_version} +ln -s ./$bin-%{python3_version} %{buildroot}%{_bindir}/$bin-3 +ln -s ./$bin-%{python3_version} %{buildroot}%{_bindir}/$bin +done; %endif %check -%{__python} tests.py +%{__python2} tests.py %if 0%{?with_python3} -pushd %{py3dir} %{__python3} tests.py -popd %endif -%files +%files -n python2-%{pypi_name} %doc README.md -%{!?_licensedir:%global license %%doc} %license COPYING -%{python_sitelib}/%{pypi_name}.py* -%{python_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info +%if !0%{?with_python3} +%{_bindir}/jsondiff +%{_bindir}/jsonpatch +%endif +%{_bindir}/jsondiff-2* +%{_bindir}/jsonpatch-2* +%{python2_sitelib}/%{pypi_name}.py* +%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %if 0%{?with_python3} %files -n python3-%{pypi_name} %doc README.md -%{!?_licensedir:%global license %%doc} %license COPYING +%{_bindir}/jsondiff +%{_bindir}/jsonpatch +%{_bindir}/jsondiff-3* +%{_bindir}/jsonpatch-3* %{python3_sitelib}/%{pypi_name}.py* %{python3_sitelib}/__pycache__/* %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif %changelog +* Mon Sep 5 2016 Haïkel Guémar - 1.14-1 +- Upstream 1.14 +- Update to latest python packaging guidelines + * Tue Jul 19 2016 Fedora Release Engineering - 1.2-9 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages