3 %bcond_without tests # do not perform "make test"
4 %bcond_without python2 # Python 3.x module
5 %bcond_without python3 # Python 3.x module
7 %define module bitarray
8 Summary: Efficient arrays of booleans -- C extension
13 Group: Libraries/Python
14 # Source0: https://pypi.python.org/packages/source/b/bitarray/%{module}-%{version}.tar.gz
15 Source0: https://github.com/ilanschnell/bitarray/archive/%{version}/%{module}-%{version}.tar.gz
16 # Source0-md5: 046fce932e24c8ce717500b129750f9c
17 URL: https://pypi.python.org/pypi/bitarray/
18 BuildRequires: python-devel
19 BuildRequires: python-distribute
20 BuildRequires: rpm-pythonprov
21 # if py_postclean is used
22 BuildRequires: rpmbuild(macros) >= 1.710
23 # when python3 present
24 BuildRequires: sed >= 4.0
26 BuildRequires: python3-devel
27 BuildRequires: python3-modules
30 Requires: python-modules
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 This module provides an object type which efficiently represents an
35 array of booleans. Bitarrays are sequence types and behave very much
36 like usual lists. Eight bits are represented by one byte in a
37 contiguous block of memory. The user can select between two
38 representations; little-endian and big-endian. All of the
39 functionality is implemented in C. Methods for accessing the machine
40 representation are provided. This can be useful when bit level access
41 to binary files is required, such as portable bitmap image files
42 (.pbm). Also, when dealing with compressed data which uses variable
43 bit length encoding, you may find this module useful.
46 Summary: %{module} API documentation
47 Summary(pl.UTF-8): Dokumentacja API %{module}
51 API documentation for %{module}.
53 %description apidoc -l pl.UTF-8
54 Dokumentacja API %{module}.
56 %package -n python3-%{module}
57 Summary: Efficient arrays of booleans -- C extension
58 Group: Libraries/Python
59 Requires: python3-libs
60 Requires: python3-modules
62 %description -n python3-%{module}
63 This module provides an object type which efficiently represents an
64 array of booleans. Bitarrays are sequence types and behave very much
65 like usual lists. Eight bits are represented by one byte in a
66 contiguous block of memory. The user can select between two
67 representations; little-endian and big-endian. All of the
68 functionality is implemented in C. Methods for accessing the machine
69 representation are provided. This can be useful when bit level access
70 to binary files is required, such as portable bitmap image files
71 (.pbm). Also, when dealing with compressed data which uses variable
72 bit length encoding, you may find this module useful.
75 %setup -q -n %{module}-%{version}
82 PYTHONPATH=$(pwd)/$(echo lib.linux-*) \
83 %{__python} -c 'import bitarray; bitarray.test()'
91 PYTHONPATH=$(pwd)/$(echo lib.linux-*) \
92 %{__python3} -c 'import bitarray; bitarray.test()'
100 rm -rf _build/html/_sources
104 rm -rf $RPM_BUILD_ROOT
111 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
112 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
114 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
115 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
118 rm -rf $RPM_BUILD_ROOT
121 %defattr(644,root,root,755)
122 %doc AUTHORS CHANGE_LOG README.rst TODO
123 %dir %{py_sitedir}/%{module}
124 %{py_sitedir}/%{module}/*.py[co]
125 %attr(755,root,root) %{py_sitedir}/%{module}/*.so
126 %{py_sitedir}/bitarray-*.egg-info
127 %{_examplesdir}/%{name}-%{version}
130 %files -n python3-%{module}
131 %defattr(644,root,root,755)
132 %doc AUTHORS CHANGE_LOG README.rst TODO
133 %dir %{py3_sitedir}/%{module}
134 %{py3_sitedir}/%{module}/*.py*
135 %{py3_sitedir}/%{module}/__pycache__
136 %attr(755,root,root) %{py3_sitedir}/%{module}/*.so
137 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
142 %defattr(644,root,root,755)
143 %doc docs/_build/html/*