]>
Commit | Line | Data |
---|---|---|
fbcebad6 JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # do perform "make test" (test/schemas files are missing) | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: Python object model built on JSON schema and JSON patch | |
8 | Name: python-warlock | |
d26bcda9 | 9 | Version: 1.3.3 |
b67b81fa | 10 | Release: 6 |
fbcebad6 JK |
11 | License: Apache v2.0 |
12 | Group: Libraries/Python | |
13 | Source0: https://files.pythonhosted.org/packages/source/w/warlock/warlock-%{version}.tar.gz | |
d26bcda9 | 14 | # Source0-md5: 746aba989d97762948e5fca6601f283f |
fbcebad6 JK |
15 | URL: https://pypi.python.org/pypi/warlock |
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-jsonpatch >= 0.10 | |
22 | BuildRequires: python-jsonschema >= 0.7 | |
23 | BuildRequires: python-six | |
24 | %endif | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-setuptools | |
28 | %if %{with tests} | |
29 | BuildRequires: python3-jsonpatch >= 0.10 | |
30 | BuildRequires: python3-jsonschema >= 0.7 | |
31 | BuildRequires: python3-six | |
32 | %endif | |
33 | %endif | |
34 | Requires: python-jsonpatch >= 0.10 | |
35 | Requires: python-jsonschema >= 0.7 | |
36 | Requires: python-six | |
37 | BuildArch: noarch | |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | %description | |
41 | Build self-validating python objects using JSON schemas. | |
42 | ||
43 | %package -n python3-warlock | |
44 | Summary: Python object model built on JSON schema and JSON patch | |
45 | Group: Libraries/Python | |
46 | Requires: python3-jsonpatch >= 0.10 | |
47 | Requires: python3-jsonschema >= 0.7 | |
48 | Requires: python3-six | |
49 | ||
50 | %description -n python3-warlock | |
51 | Build self-validating python objects using JSON schemas. | |
52 | ||
53 | %prep | |
54 | %setup -q -n warlock-%{version} | |
55 | ||
56 | %build | |
57 | %if %{with python2} | |
58 | %py_build | |
59 | ||
60 | %if %{with tests} | |
61 | PYTHONPATH=build-2/lib %{__python} -m unittest discover -t test test_core | |
62 | %endif | |
63 | %endif | |
64 | ||
65 | %if %{with python3} | |
66 | %py3_build | |
67 | ||
68 | %if %{with tests} | |
69 | PYTHONPATH=build-2/lib %{__python} -m unittest discover -t test test_core | |
70 | %endif | |
71 | %endif | |
72 | ||
73 | %install | |
74 | rm -rf $RPM_BUILD_ROOT | |
75 | ||
76 | %if %{with python2} | |
77 | %py_install | |
78 | ||
79 | %py_postclean | |
80 | %endif | |
81 | ||
82 | %if %{with python3} | |
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 README.md | |
93 | %{py_sitescriptdir}/warlock | |
94 | %{py_sitescriptdir}/warlock-%{version}-py*.egg-info | |
95 | %endif | |
96 | ||
97 | %if %{with python3} | |
98 | %files -n python3-warlock | |
99 | %defattr(644,root,root,755) | |
100 | %doc README.md | |
101 | %{py3_sitescriptdir}/warlock | |
102 | %{py3_sitescriptdir}/warlock-%{version}-py*.egg-info | |
103 | %endif | |
104 |