]> git.pld-linux.org Git - packages/python-bitarray.git/blame - python-bitarray.spec
rebuild with python 3.10
[packages/python-bitarray.git] / python-bitarray.spec
CommitLineData
3476df9a
JR
1#
2# Conditional build:
3%bcond_without tests # do not perform "make test"
446688ef 4%bcond_without python2 # Python 3.x module
3476df9a
JR
5%bcond_without python3 # Python 3.x module
6
7%define module bitarray
8Summary: Efficient arrays of booleans -- C extension
9Name: python-%{module}
ee6a3db6 10Version: 1.0.1
db3eccac 11Release: 4
3476df9a
JR
12License: PSF
13Group: Libraries/Python
ee6a3db6 14# Source0: https://pypi.python.org/packages/source/b/bitarray/%{module}-%{version}.tar.gz
729a915f
JR
15Source0: https://github.com/ilanschnell/bitarray/archive/%{version}/%{module}-%{version}.tar.gz
16# Source0-md5: 046fce932e24c8ce717500b129750f9c
3476df9a
JR
17URL: https://pypi.python.org/pypi/bitarray/
18BuildRequires: python-devel
19BuildRequires: python-distribute
20BuildRequires: rpm-pythonprov
21# if py_postclean is used
49eda72a 22BuildRequires: rpmbuild(macros) >= 1.710
3476df9a
JR
23# when python3 present
24BuildRequires: sed >= 4.0
25%if %{with python3}
26BuildRequires: python3-devel
27BuildRequires: python3-distribute
28BuildRequires: python3-modules
29%endif
30Requires: python-libs
31Requires: python-modules
32BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34%description
446688ef
JK
35This module provides an object type which efficiently represents an
36array of booleans. Bitarrays are sequence types and behave very much
37like usual lists. Eight bits are represented by one byte in a
38contiguous block of memory. The user can select between two
39representations; little-endian and big-endian. All of the
40functionality is implemented in C. Methods for accessing the machine
41representation are provided. This can be useful when bit level access
42to binary files is required, such as portable bitmap image files
43(.pbm). Also, when dealing with compressed data which uses variable
44bit length encoding, you may find this module useful.
3476df9a
JR
45
46%package apidoc
47Summary: %{module} API documentation
48Summary(pl.UTF-8): Dokumentacja API %{module}
49Group: Documentation
50
51%description apidoc
52API documentation for %{module}.
53
54%description apidoc -l pl.UTF-8
55Dokumentacja API %{module}.
56
57%package -n python3-%{module}
58Summary: Efficient arrays of booleans -- C extension
59Group: Libraries/Python
60Requires: python3-libs
61Requires: python3-modules
62
63%description -n python3-%{module}
446688ef
JK
64This module provides an object type which efficiently represents an
65array of booleans. Bitarrays are sequence types and behave very much
66like usual lists. Eight bits are represented by one byte in a
67contiguous block of memory. The user can select between two
68representations; little-endian and big-endian. All of the
69functionality is implemented in C. Methods for accessing the machine
70representation are provided. This can be useful when bit level access
71to binary files is required, such as portable bitmap image files
72(.pbm). Also, when dealing with compressed data which uses variable
73bit length encoding, you may find this module useful.
3476df9a
JR
74
75%prep
76%setup -q -n %{module}-%{version}
77
3476df9a
JR
78%build
79%if %{with python2}
ee6a3db6
AM
80%py_build
81%if %{with tests}
82cd build-2
83PYTHONPATH=$(pwd)/$(echo lib.linux-*) \
84%{__python} -c 'import bitarray; bitarray.test()'
85cd ..
86%endif
3476df9a
JR
87%endif
88%if %{with python3}
ee6a3db6
AM
89%py3_build
90%if %{with tests}
91cd build-3
92PYTHONPATH=$(pwd)/$(echo lib.linux-*) \
93%{__python3} -c 'import bitarray; bitarray.test()'
94cd ..
95%endif
3476df9a
JR
96%endif
97
98%if %{with doc}
99cd docs
100%{__make} -j1 html
101rm -rf _build/html/_sources
102%endif
103
104%install
105rm -rf $RPM_BUILD_ROOT
446688ef 106%py_install
3476df9a
JR
107
108%if %{with python3}
446688ef 109%py3_install
3476df9a
JR
110%endif
111
112install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
113cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
114
3476df9a
JR
115%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
116%py_comp $RPM_BUILD_ROOT%{py_sitedir}
117
118%clean
119rm -rf $RPM_BUILD_ROOT
120
121%files
122%defattr(644,root,root,755)
123%doc AUTHORS CHANGE_LOG README.rst TODO
3476df9a
JR
124%dir %{py_sitedir}/%{module}
125%{py_sitedir}/%{module}/*.py[co]
126%attr(755,root,root) %{py_sitedir}/%{module}/*.so
127%{py_sitedir}/bitarray-*.egg-info
128%{_examplesdir}/%{name}-%{version}
129
130%if %{with python3}
131%files -n python3-%{module}
3476df9a 132%defattr(644,root,root,755)
446688ef 133%doc AUTHORS CHANGE_LOG README.rst TODO
3476df9a
JR
134%dir %{py3_sitedir}/%{module}
135%{py3_sitedir}/%{module}/*.py*
136%{py3_sitedir}/%{module}/__pycache__
137%attr(755,root,root) %{py3_sitedir}/%{module}/*.so
138%{py3_sitedir}/%{module}-%{version}-py*.egg-info
139%endif
140
141%if %{with doc}
142%files apidoc
143%defattr(644,root,root,755)
144%doc docs/_build/html/*
145%endif
This page took 0.129717 seconds and 4 git commands to generate.