]>
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 JR |
13 | Version: 2.2.1 |
14 | Release: 1 | |
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 AM |
28 | BuildRequires: python-pytest-cov |
29 | %endif | |
30 | %endif | |
31 | %if %{with python3} | |
32 | BuildRequires: python3-devel | |
e0748709 | 33 | BuildRequires: python3-pkgconfig |
4ed00615 AM |
34 | %if %{with tests} |
35 | BuildRequires: python3-future | |
e0748709 | 36 | BuildRequires: python3-psutil |
4ed00615 AM |
37 | BuildRequires: python3-pytest-cov |
38 | %endif | |
39 | %endif | |
40 | BuildRequires: lz4-devel >= 1.7.5 | |
41 | Requires: python-modules | |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
43 | ||
44 | %description | |
45 | This package provides python bindings for the LZ4 compression library. | |
46 | ||
47 | %package -n python3-%{module} | |
48 | Summary: LZ4 bindings for Python | |
49 | Group: Libraries/Python | |
50 | Requires: python3-modules | |
51 | ||
52 | %description -n python3-%{module} | |
53 | This package provides python bindings for the LZ4 compression library. | |
54 | ||
55 | %package apidocs | |
56 | Summary: %{module} API documentation | |
57 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
58 | Group: Documentation | |
59 | ||
60 | %description apidocs | |
61 | API documentation for %{module}. | |
62 | ||
63 | %description apidocs -l pl.UTF-8 | |
64 | Dokumentacja API %{module}. | |
65 | ||
66 | %prep | |
67 | %setup -q -n %{module}-%{version} | |
68 | ||
69 | %build | |
70 | %if %{with python2} | |
71 | %py_build %{?with_tests:test} | |
72 | %endif | |
73 | ||
74 | %if %{with python3} | |
75 | %py3_build %{?with_tests:test} | |
76 | %endif | |
77 | ||
78 | %if %{with doc} | |
79 | cd docs | |
80 | %{__make} -j1 html | |
81 | rm -rf _build/html/_sources | |
82 | %endif | |
83 | ||
84 | %install | |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | %if %{with python2} | |
87 | %py_install | |
88 | %py_postclean | |
89 | %endif | |
90 | ||
91 | %if %{with python3} | |
92 | %py3_install | |
93 | %endif | |
94 | ||
95 | %clean | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
98 | %if %{with python2} | |
99 | %files | |
100 | %defattr(644,root,root,755) | |
101 | %doc README.rst | |
102 | %dir %{py_sitedir}/%{module} | |
103 | %{py_sitedir}/%{module}/*.py[co] | |
104 | %dir %{py_sitedir}/%{module}/block | |
105 | %{py_sitedir}/%{module}/block/*.py[co] | |
106 | %dir %{py_sitedir}/%{module}/frame | |
107 | %{py_sitedir}/%{module}/frame/*.py[co] | |
108 | %attr(755,root,root) %{py_sitedir}/%{module}/*.so | |
109 | %attr(755,root,root) %{py_sitedir}/%{module}/block/*.so | |
110 | %attr(755,root,root) %{py_sitedir}/%{module}/frame/*.so | |
111 | %{py_sitedir}/%{module}-%{version}-py*.egg-info | |
112 | %endif | |
113 | ||
114 | %if %{with python3} | |
115 | %files -n python3-%{module} | |
116 | %defattr(644,root,root,755) | |
117 | %doc README.rst | |
118 | %dir %{py3_sitedir}/%{module} | |
119 | %{py3_sitedir}/%{module}/*.py | |
120 | %dir %{py3_sitedir}/%{module}/block | |
121 | %{py3_sitedir}/%{module}/block/*.py | |
122 | %dir %{py3_sitedir}/%{module}/frame | |
123 | %{py3_sitedir}/%{module}/frame/*.py | |
124 | %attr(755,root,root) %{py3_sitedir}/%{module}/*.so | |
125 | %attr(755,root,root) %{py3_sitedir}/%{module}/block/*.so | |
126 | %attr(755,root,root) %{py3_sitedir}/%{module}/frame/*.so | |
127 | %{py3_sitedir}/%{module}/__pycache__ | |
128 | %{py3_sitedir}/%{module}/block/__pycache__ | |
129 | %{py3_sitedir}/%{module}/frame/__pycache__ | |
130 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info | |
131 | %endif | |
132 | ||
133 | %if %{with doc} | |
134 | %files apidocs | |
135 | %defattr(644,root,root,755) | |
136 | %doc docs/_build/html/* | |
137 | %endif |