]> git.pld-linux.org Git - packages/python-bitstring.git/blame - python-bitstring.spec
rebuild with python 3.10
[packages/python-bitstring.git] / python-bitstring.spec
CommitLineData
d8dd0aa7
AM
1# Conditional build:
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
6
7%define module bitstring
8%define egg_name bitstring
9%define pypi_name bitstring
10Summary: A Python module to help you manage your bits
11Name: python-%{pypi_name}
12Version: 3.1.5
166a5ea9 13Release: 5
d8dd0aa7
AM
14License: MIT
15Group: Libraries/Python
16Source0: https://github.com/scott-griffiths/bitstring/archive/bitstring-%{version}.tar.gz
17# Source0-md5: ba96be1d2ae5ad35e4263c6a1c8bc310
18URL: https://github.com/scott-griffiths/bitstring
19BuildRequires: rpm-pythonprov
20BuildRequires: rpmbuild(macros) >= 1.714
21%if %{with python2}
22BuildRequires: python-modules
23BuildRequires: python-setuptools
24%endif
25%if %{with python3}
26BuildRequires: python3-modules
27BuildRequires: python3-setuptools
28%endif
29Requires: python-modules
30BuildArch: noarch
31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33%description
34bitstring is a pure Python module designed to help make the creation
35and analysis of binary data as simple and natural as possible.
36
37Bitstrings can be constructed from integers (big and little endian),
38hex, octal, binary, strings or files. They can be sliced, joined,
39reversed, inserted into, overwritten, etc. with simple functions or
40slice notation. They can also be read from, searched and replaced, and
41navigated in, similar to a file or stream.
42
43%package -n python3-%{pypi_name}
44Summary: A Python module to help you manage your bits
45Group: Libraries/Python
46Requires: python3-modules
47
48%description -n python3-%{pypi_name}
49bitstring is a pure Python module designed to help make the creation
50and analysis of binary data as simple and natural as possible.
51
52Bitstrings can be constructed from integers (big and little endian),
53hex, octal, binary, strings or files. They can be sliced, joined,
54reversed, inserted into, overwritten, etc. with simple functions or
55slice notation. They can also be read from, searched and replaced, and
56navigated in, similar to a file or stream.
57
58%package apidocs
59Summary: API documentation for Python %{module} module
60Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module}
61Group: Documentation
62
63%description apidocs
64API documentation for Python %{module} module.
65
66%description apidocs -l pl.UTF-8
67Dokumentacja API modułu Pythona %{module}.
68
69%prep
70%setup -q -n %{pypi_name}-%{pypi_name}-%{version}
71
72%build
73%if %{with python2}
74%py_build %{?with_tests:test}
75%endif
76
77%if %{with python3}
78%py3_build %{?with_tests:test}
79%endif
80
81%if %{with doc}
82cd doc
83%{__make} -j1 html
84rm -rf _build/html/_sources
85%endif
86
87%install
88rm -rf $RPM_BUILD_ROOT
89
90%if %{with python2}
91%py_install
92
93%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
94%py_comp $RPM_BUILD_ROOT%{py_sitedir}
95
96%py_postclean
97%endif
98
99%if %{with python3}
100%py3_install
101%endif
102
103%clean
104rm -rf $RPM_BUILD_ROOT
105
106%if %{with python2}
107%files
108%defattr(644,root,root,755)
109%doc README.rst
110%{py_sitescriptdir}/%{module}.py[co]
111%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
112%endif
113
114%if %{with python3}
115%files -n python3-%{pypi_name}
116%defattr(644,root,root,755)
117%doc README.rst
118%{py3_sitescriptdir}/%{module}.py
119%{py3_sitescriptdir}/__pycache__/%{module}.*.py[co]
120%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
121%endif
122
123%if %{with doc}
124%files apidocs
125%defattr(644,root,root,755)
126%doc docs/_build/html/*
127%endif
This page took 0.196908 seconds and 4 git commands to generate.