]>
Commit | Line | Data |
---|---|---|
87566cae JR |
1 | # |
2 | # TODO: versions 3.0.0+ support only python 3.6+ | |
3 | # | |
4ed00615 AM |
4 | # Conditional build: |
5 | %bcond_with doc # don't build doc | |
6 | %bcond_without tests # do not perform "make test" | |
7 | %bcond_without python2 # CPython 2.x module | |
8 | %bcond_without python3 # CPython 3.x module | |
9 | ||
87566cae | 10 | %define module lz4 |
4ed00615 AM |
11 | Summary: LZ4 bindings for Python |
12 | Name: python-%{module} | |
87566cae | 13 | Version: 2.2.1 |
8db740f5 | 14 | Release: 2 |
4ed00615 AM |
15 | License: BSD |
16 | Group: Libraries/Python | |
17 | Source0: http://pypi.debian.net/lz4/lz4-%{version}.tar.gz | |
87566cae | 18 | # Source0-md5: 778661bc5271b5befe11ee127c252a5d |
4ed00615 AM |
19 | URL: https://github.com/python-lz4/python-lz4 |
20 | BuildRequires: rpm-pythonprov | |
21 | BuildRequires: rpmbuild(macros) >= 1.714 | |
22 | %if %{with python2} | |
23 | BuildRequires: python-devel | |
e0748709 | 24 | BuildRequires: python-pkgconfig |
4ed00615 AM |
25 | %if %{with tests} |
26 | BuildRequires: python-future | |
e0748709 | 27 | BuildRequires: python-psutil |
4ed00615 | 28 | BuildRequires: python-pytest-cov |
03c7a58b | 29 | BuildRequires: python-pytest-runner |
4ed00615 AM |
30 | %endif |
31 | %endif | |
32 | %if %{with python3} | |
33 | BuildRequires: python3-devel | |
e0748709 | 34 | BuildRequires: python3-pkgconfig |
4ed00615 AM |
35 | %if %{with tests} |
36 | BuildRequires: python3-future | |
e0748709 | 37 | BuildRequires: python3-psutil |
4ed00615 | 38 | BuildRequires: python3-pytest-cov |
03c7a58b | 39 | BuildRequires: python3-pytest-runner |
4ed00615 AM |
40 | %endif |
41 | %endif | |
42 | BuildRequires: lz4-devel >= 1.7.5 | |
43 | Requires: python-modules | |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %description | |
47 | This package provides python bindings for the LZ4 compression library. | |
48 | ||
49 | %package -n python3-%{module} | |
50 | Summary: LZ4 bindings for Python | |
51 | Group: Libraries/Python | |
52 | Requires: python3-modules | |
53 | ||
54 | %description -n python3-%{module} | |
55 | This package provides python bindings for the LZ4 compression library. | |
56 | ||
57 | %package apidocs | |
58 | Summary: %{module} API documentation | |
59 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
60 | Group: Documentation | |
61 | ||
62 | %description apidocs | |
63 | API documentation for %{module}. | |
64 | ||
65 | %description apidocs -l pl.UTF-8 | |
66 | Dokumentacja API %{module}. | |
67 | ||
68 | %prep | |
69 | %setup -q -n %{module}-%{version} | |
70 | ||
71 | %build | |
72 | %if %{with python2} | |
73 | %py_build %{?with_tests:test} | |
74 | %endif | |
75 | ||
76 | %if %{with python3} | |
77 | %py3_build %{?with_tests:test} | |
78 | %endif | |
79 | ||
80 | %if %{with doc} | |
81 | cd docs | |
82 | %{__make} -j1 html | |
83 | rm -rf _build/html/_sources | |
84 | %endif | |
85 | ||
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | %if %{with python2} | |
89 | %py_install | |
90 | %py_postclean | |
91 | %endif | |
92 | ||
93 | %if %{with python3} | |
94 | %py3_install | |
95 | %endif | |
96 | ||
97 | %clean | |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | ||
100 | %if %{with python2} | |
101 | %files | |
102 | %defattr(644,root,root,755) | |
103 | %doc README.rst | |
104 | %dir %{py_sitedir}/%{module} | |
105 | %{py_sitedir}/%{module}/*.py[co] | |
106 | %dir %{py_sitedir}/%{module}/block | |
107 | %{py_sitedir}/%{module}/block/*.py[co] | |
108 | %dir %{py_sitedir}/%{module}/frame | |
109 | %{py_sitedir}/%{module}/frame/*.py[co] | |
110 | %attr(755,root,root) %{py_sitedir}/%{module}/*.so | |
111 | %attr(755,root,root) %{py_sitedir}/%{module}/block/*.so | |
112 | %attr(755,root,root) %{py_sitedir}/%{module}/frame/*.so | |
113 | %{py_sitedir}/%{module}-%{version}-py*.egg-info | |
114 | %endif | |
115 | ||
116 | %if %{with python3} | |
117 | %files -n python3-%{module} | |
118 | %defattr(644,root,root,755) | |
119 | %doc README.rst | |
120 | %dir %{py3_sitedir}/%{module} | |
121 | %{py3_sitedir}/%{module}/*.py | |
122 | %dir %{py3_sitedir}/%{module}/block | |
123 | %{py3_sitedir}/%{module}/block/*.py | |
124 | %dir %{py3_sitedir}/%{module}/frame | |
125 | %{py3_sitedir}/%{module}/frame/*.py | |
126 | %attr(755,root,root) %{py3_sitedir}/%{module}/*.so | |
127 | %attr(755,root,root) %{py3_sitedir}/%{module}/block/*.so | |
128 | %attr(755,root,root) %{py3_sitedir}/%{module}/frame/*.so | |
129 | %{py3_sitedir}/%{module}/__pycache__ | |
130 | %{py3_sitedir}/%{module}/block/__pycache__ | |
131 | %{py3_sitedir}/%{module}/frame/__pycache__ | |
132 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info | |
133 | %endif | |
134 | ||
135 | %if %{with doc} | |
136 | %files apidocs | |
137 | %defattr(644,root,root,755) | |
138 | %doc docs/_build/html/* | |
139 | %endif |