3 %bcond_with tests # do perform "make test" (broken - tests.js file missing)
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 Summary: Apply JSON-Patches (RFC 6902)
12 Group: Libraries/Python
13 Source0: https://files.pythonhosted.org/packages/source/j/jsonpatch/jsonpatch-%{version}.tar.gz
14 # Source0-md5: 8ef1ceb00dcf992c9e43611f698f9279
15 URL: https://pypi.python.org/pypi/jsonpatch
16 BuildRequires: rpm-pythonprov
17 BuildRequires: rpmbuild(macros) >= 1.714
19 BuildRequires: python-setuptools
21 BuildRequires: python-jsonpointer >= 1.9
25 BuildRequires: python3-setuptools
27 BuildRequires: python3-jsonpointer >= 1.9
30 Requires: python-jsonpointer >= 1.9
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 Library to apply JSON Patches according to RFC 6902.
37 %package -n python3-jsonpatch
38 Summary: Apply JSON-Patches (RFC 6902)
39 Group: Libraries/Python
40 Requires: python3-jsonpointer >= 1.9
42 %description -n python3-jsonpatch
43 Library to apply JSON Patches according to RFC 6902.
46 Summary: Apply JSON-Patches (RFC 6902)
47 Group: Libraries/Python
49 Requires: python3-jsonpatch = %{version}-%{release}
51 Requires: %{name} = %{version}-%{release}
54 %description -n jsonpatch
55 Library to apply JSON Patches according to RFC 6902.
59 %setup -q -n jsonpatch-%{version}
63 %py_build %{?with_tests:test}
67 %py3_build %{?with_tests:test}
71 rm -rf $RPM_BUILD_ROOT
80 # otherwise python2 scripts would be used
81 rm -f $RPM_BUILD_ROOT%{_bindir}/* || :
87 rm -rf $RPM_BUILD_ROOT
91 %defattr(644,root,root,755)
92 %doc AUTHORS README.md
93 %{py_sitescriptdir}/jsonpatch.py[co]
94 %{py_sitescriptdir}/jsonpatch-%{version}-py*.egg-info
98 %files -n python3-jsonpatch
99 %defattr(644,root,root,755)
100 %doc AUTHORS README.md
101 %{py3_sitescriptdir}/jsonpatch.py
102 %{py3_sitescriptdir}/__pycache__/*
103 %{py3_sitescriptdir}/jsonpatch-%{version}-py*.egg-info
107 %defattr(644,root,root,755)
108 %doc AUTHORS README.md
109 %attr(755,root,root) %{_bindir}/jsonpatch
110 %attr(755,root,root) %{_bindir}/jsondiff