]>
Commit | Line | Data |
---|---|---|
adb95e6d JK |
1 | # |
2 | # Conditional build: | |
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 | |
6 | ||
7 | Summary: Apply JSON-Patches (RFC 6902) | |
8 | Name: python-jsonpatch | |
9 | Version: 1.16 | |
a4cf4b76 | 10 | Release: 5 |
adb95e6d JK |
11 | License: BSD |
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 | |
18 | %if %{with python2} | |
19 | BuildRequires: python-setuptools | |
20 | %if %{with tests} | |
21 | BuildRequires: python-jsonpointer >= 1.9 | |
22 | %endif | |
23 | %endif | |
24 | %if %{with python3} | |
25 | BuildRequires: python3-setuptools | |
26 | %if %{with tests} | |
27 | BuildRequires: python3-jsonpointer >= 1.9 | |
28 | %endif | |
29 | %endif | |
30 | Requires: python-jsonpointer >= 1.9 | |
31 | BuildArch: noarch | |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
35 | Library to apply JSON Patches according to RFC 6902. | |
36 | ||
37 | %package -n python3-jsonpatch | |
38 | Summary: Apply JSON-Patches (RFC 6902) | |
39 | Group: Libraries/Python | |
40 | Requires: python3-jsonpointer >= 1.9 | |
41 | ||
42 | %description -n python3-jsonpatch | |
43 | Library to apply JSON Patches according to RFC 6902. | |
44 | ||
45 | %package -n jsonpatch | |
46 | Summary: Apply JSON-Patches (RFC 6902) | |
47 | Group: Libraries/Python | |
48 | %if %{with python3} | |
49 | Requires: python3-jsonpatch = %{version}-%{release} | |
50 | %else | |
51 | Requires: %{name} = %{version}-%{release} | |
52 | %endif | |
53 | ||
54 | %description -n jsonpatch | |
55 | Library to apply JSON Patches according to RFC 6902. | |
56 | ||
57 | ||
58 | %prep | |
59 | %setup -q -n jsonpatch-%{version} | |
60 | ||
61 | %build | |
62 | %if %{with python2} | |
63 | %py_build %{?with_tests:test} | |
64 | %endif | |
65 | ||
66 | %if %{with python3} | |
67 | %py3_build %{?with_tests:test} | |
68 | %endif | |
69 | ||
70 | %install | |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | ||
73 | %if %{with python2} | |
74 | %py_install | |
75 | ||
76 | %py_postclean | |
77 | %endif | |
78 | ||
79 | %if %{with python3} | |
80 | # otherwise python2 scripts would be used | |
81 | rm -f $RPM_BUILD_ROOT%{_bindir}/* || : | |
82 | ||
83 | %py3_install | |
84 | %endif | |
85 | ||
86 | %clean | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
89 | %if %{with python2} | |
90 | %files | |
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 | |
95 | %endif | |
96 | ||
97 | %if %{with python3} | |
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 | |
104 | %endif | |
105 | ||
106 | %files -n jsonpatch | |
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 |