]> git.pld-linux.org Git - packages/python-lz4.git/blob - python-lz4.spec
- added pl and docs, completed dependencies
[packages/python-lz4.git] / python-lz4.spec
1 #
2 # TODO: versions 3.0.0+ support only python 3.6+
3 #
4 # Conditional build:
5 %bcond_without  doc     # Sphinx documentation
6 %bcond_without  tests   # unit tests
7 %bcond_without  python2 # CPython 2.x module
8 %bcond_without  python3 # CPython 3.x module
9
10 %define         module  lz4
11 Summary:        LZ4 bindings for Python
12 Summary(pl.UTF-8):      Wiązania LZ4 dla Pythona
13 Name:           python-%{module}
14 # keep 2.x here for python2 support
15 Version:        2.2.1
16 Release:        2
17 License:        BSD
18 Group:          Libraries/Python
19 #Source0Download: https://pypi.org/simple/lz4/
20 Source0:        https://files.pythonhosted.org/packages/source/l/lz4/lz4-%{version}.tar.gz
21 # Source0-md5:  778661bc5271b5befe11ee127c252a5d
22 URL:            https://github.com/python-lz4/python-lz4
23 BuildRequires:  lz4-devel >= 1:1.7.5
24 BuildRequires:  py3c >= 1.0
25 %if %{with python2}
26 BuildRequires:  python-devel >= 1:2.7
27 BuildRequires:  python-pkgconfig
28 BuildRequires:  python-setuptools
29 BuildRequires:  python-setuptools_scm
30 %if %{with tests}
31 BuildRequires:  python-future
32 BuildRequires:  python-psutil
33 BuildRequires:  python-pytest >= 3.3.1
34 BuildRequires:  python-pytest-cov
35 BuildRequires:  python-pytest-runner
36 %endif
37 %endif
38 %if %{with python3}
39 BuildRequires:  python3-devel >= 1:3.4
40 BuildRequires:  python3-pkgconfig
41 BuildRequires:  python3-setuptools
42 BuildRequires:  python3-setuptools_scm
43 %if %{with tests}
44 BuildRequires:  python3-psutil
45 BuildRequires:  python3-pytest >= 3.3.1
46 BuildRequires:  python3-pytest-cov
47 BuildRequires:  python3-pytest-runner
48 %endif
49 %endif
50 BuildRequires:  rpm-build >= 4.6
51 BuildRequires:  rpm-pythonprov
52 BuildRequires:  rpmbuild(macros) >= 1.714
53 %if %{with doc}
54 BuildRequires:  python-sphinx_bootstrap_theme
55 BuildRequires:  sphinx-pdg-2 >= 1.6.0
56 %endif
57 Requires:       lz4-libs >= 1:1.7.5
58 Requires:       python-modules >= 1:2.7
59 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60
61 %description
62 This package provides python bindings for the LZ4 compression library.
63
64 %package -n python3-%{module}
65 Summary:        LZ4 bindings for Python
66 Summary(pl.UTF-8):      Wiązania LZ4 dla Pythona
67 Group:          Libraries/Python
68 Requires:       lz4-libs >= 1:1.7.5
69 Requires:       python3-modules >= 1:3.4
70
71 %description -n python3-%{module}
72 This package provides python bindings for the LZ4 compression library.
73
74 %package apidocs
75 Summary:        API documentation for Python %{module} module
76 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona %{module}
77 Group:          Documentation
78 BuildArch:      noarch
79
80 %description apidocs
81 API documentation for Python %{module} module.
82
83 %description apidocs -l pl.UTF-8
84 Dokumentacja API modułu Pythona %{module}.
85
86 %prep
87 %setup -q -n %{module}-%{version}
88
89 %build
90 %if %{with python2}
91 %py_build %{?with_tests:test}
92 %endif
93
94 %if %{with python3}
95 %py3_build %{?with_tests:test}
96 %endif
97
98 %if %{with doc}
99 PYTHONPATH=$(pwd)/$(echo build-2/lib.*):$(pwd) \
100 %{__make} -C docs html \
101         SPHINXBUILD=sphinx-build-2
102 %endif
103
104 %install
105 rm -rf $RPM_BUILD_ROOT
106
107 %if %{with python2}
108 %py_install
109
110 %py_postclean
111 %endif
112
113 %if %{with python3}
114 %py3_install
115 %endif
116
117 %clean
118 rm -rf $RPM_BUILD_ROOT
119
120 %if %{with python2}
121 %files
122 %defattr(644,root,root,755)
123 %doc LICENSE README.rst
124 %dir %{py_sitedir}/%{module}
125 %{py_sitedir}/%{module}/*.py[co]
126 %dir %{py_sitedir}/%{module}/block
127 %{py_sitedir}/%{module}/block/*.py[co]
128 %dir %{py_sitedir}/%{module}/frame
129 %{py_sitedir}/%{module}/frame/*.py[co]
130 %attr(755,root,root) %{py_sitedir}/%{module}/*.so
131 %attr(755,root,root) %{py_sitedir}/%{module}/block/*.so
132 %attr(755,root,root) %{py_sitedir}/%{module}/frame/*.so
133 %{py_sitedir}/%{module}-%{version}-py*.egg-info
134 %endif
135
136 %if %{with python3}
137 %files -n python3-%{module}
138 %defattr(644,root,root,755)
139 %doc LICENSE README.rst
140 %dir %{py3_sitedir}/%{module}
141 %{py3_sitedir}/%{module}/*.py
142 %dir %{py3_sitedir}/%{module}/block
143 %{py3_sitedir}/%{module}/block/*.py
144 %dir %{py3_sitedir}/%{module}/frame
145 %{py3_sitedir}/%{module}/frame/*.py
146 %attr(755,root,root) %{py3_sitedir}/%{module}/*.so
147 %attr(755,root,root) %{py3_sitedir}/%{module}/block/*.so
148 %attr(755,root,root) %{py3_sitedir}/%{module}/frame/*.so
149 %{py3_sitedir}/%{module}/__pycache__
150 %{py3_sitedir}/%{module}/block/__pycache__
151 %{py3_sitedir}/%{module}/frame/__pycache__
152 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
153 %endif
154
155 %if %{with doc}
156 %files apidocs
157 %defattr(644,root,root,755)
158 %doc docs/_build/html/{_static,*.html,*.js}
159 %endif
This page took 0.069695 seconds and 3 git commands to generate.