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-distribute
28 BuildRequires: python3-modules
31 Requires: python-modules
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 This module provides an object type which efficiently represents an
36 array of booleans. Bitarrays are sequence types and behave very much
37 like usual lists. Eight bits are represented by one byte in a
38 contiguous block of memory. The user can select between two
39 representations; little-endian and big-endian. All of the
40 functionality is implemented in C. Methods for accessing the machine
41 representation are provided. This can be useful when bit level access
42 to binary files is required, such as portable bitmap image files
43 (.pbm). Also, when dealing with compressed data which uses variable
44 bit length encoding, you may find this module useful.
47 Summary: %{module} API documentation
48 Summary(pl.UTF-8): Dokumentacja API %{module}
52 API documentation for %{module}.
54 %description apidoc -l pl.UTF-8
55 Dokumentacja API %{module}.
57 %package -n python3-%{module}
58 Summary: Efficient arrays of booleans -- C extension
59 Group: Libraries/Python
60 Requires: python3-libs
61 Requires: python3-modules
63 %description -n python3-%{module}
64 This module provides an object type which efficiently represents an
65 array of booleans. Bitarrays are sequence types and behave very much
66 like usual lists. Eight bits are represented by one byte in a
67 contiguous block of memory. The user can select between two
68 representations; little-endian and big-endian. All of the
69 functionality is implemented in C. Methods for accessing the machine
70 representation are provided. This can be useful when bit level access
71 to binary files is required, such as portable bitmap image files
72 (.pbm). Also, when dealing with compressed data which uses variable
73 bit length encoding, you may find this module useful.
76 %setup -q -n %{module}-%{version}
83 PYTHONPATH=$(pwd)/$(echo lib.linux-*) \
84 %{__python} -c 'import bitarray; bitarray.test()'
92 PYTHONPATH=$(pwd)/$(echo lib.linux-*) \
93 %{__python3} -c 'import bitarray; bitarray.test()'
101 rm -rf _build/html/_sources
105 rm -rf $RPM_BUILD_ROOT
112 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
113 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
115 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
116 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
119 rm -rf $RPM_BUILD_ROOT
122 %defattr(644,root,root,755)
123 %doc AUTHORS CHANGE_LOG README.rst TODO
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}
131 %files -n python3-%{module}
132 %defattr(644,root,root,755)
133 %doc AUTHORS CHANGE_LOG README.rst TODO
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
143 %defattr(644,root,root,755)
144 %doc docs/_build/html/*