2 %bcond_with doc # Sphinx documentation
3 %bcond_with tests # unit tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 %define module bitstring
8 %define egg_name bitstring
9 %define pypi_name bitstring
10 Summary: A Python module to help you manage your bits
11 Name: python-%{pypi_name}
15 Group: Libraries/Python
16 Source0: https://github.com/scott-griffiths/bitstring/archive/bitstring-%{version}.tar.gz
17 # Source0-md5: ba96be1d2ae5ad35e4263c6a1c8bc310
18 URL: https://github.com/scott-griffiths/bitstring
19 BuildRequires: rpm-pythonprov
20 BuildRequires: rpmbuild(macros) >= 1.714
22 BuildRequires: python-modules
23 BuildRequires: python-setuptools
26 BuildRequires: python3-modules
27 BuildRequires: python3-setuptools
29 Requires: python-modules
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 bitstring is a pure Python module designed to help make the creation
35 and analysis of binary data as simple and natural as possible.
37 Bitstrings can be constructed from integers (big and little endian),
38 hex, octal, binary, strings or files. They can be sliced, joined,
39 reversed, inserted into, overwritten, etc. with simple functions or
40 slice notation. They can also be read from, searched and replaced, and
41 navigated in, similar to a file or stream.
43 %package -n python3-%{pypi_name}
44 Summary: A Python module to help you manage your bits
45 Group: Libraries/Python
46 Requires: python3-modules
48 %description -n python3-%{pypi_name}
49 bitstring is a pure Python module designed to help make the creation
50 and analysis of binary data as simple and natural as possible.
52 Bitstrings can be constructed from integers (big and little endian),
53 hex, octal, binary, strings or files. They can be sliced, joined,
54 reversed, inserted into, overwritten, etc. with simple functions or
55 slice notation. They can also be read from, searched and replaced, and
56 navigated in, similar to a file or stream.
59 Summary: API documentation for Python %{module} module
60 Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module}
64 API documentation for Python %{module} module.
66 %description apidocs -l pl.UTF-8
67 Dokumentacja API modułu Pythona %{module}.
70 %setup -q -n %{pypi_name}-%{pypi_name}-%{version}
74 %py_build %{?with_tests:test}
78 %py3_build %{?with_tests:test}
84 rm -rf _build/html/_sources
88 rm -rf $RPM_BUILD_ROOT
93 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
94 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
104 rm -rf $RPM_BUILD_ROOT
108 %defattr(644,root,root,755)
110 %{py_sitescriptdir}/%{module}.py[co]
111 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
115 %files -n python3-%{pypi_name}
116 %defattr(644,root,root,755)
118 %{py3_sitescriptdir}/%{module}.py
119 %{py3_sitescriptdir}/__pycache__/%{module}.*.py[co]
120 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
125 %defattr(644,root,root,755)
126 %doc docs/_build/html/*