]> git.pld-linux.org Git - packages/python-bitarray.git/blame - python-bitarray.spec
rebuild with tests and docs
[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
fdc46207 11Release: 7
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
3476df9a
JR
27BuildRequires: python3-modules
28%endif
29Requires: python-libs
30Requires: python-modules
31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33%description
446688ef
JK
34This module provides an object type which efficiently represents an
35array of booleans. Bitarrays are sequence types and behave very much
36like usual lists. Eight bits are represented by one byte in a
37contiguous block of memory. The user can select between two
38representations; little-endian and big-endian. All of the
39functionality is implemented in C. Methods for accessing the machine
40representation are provided. This can be useful when bit level access
41to binary files is required, such as portable bitmap image files
42(.pbm). Also, when dealing with compressed data which uses variable
43bit length encoding, you may find this module useful.
3476df9a
JR
44
45%package apidoc
46Summary: %{module} API documentation
47Summary(pl.UTF-8): Dokumentacja API %{module}
48Group: Documentation
49
50%description apidoc
51API documentation for %{module}.
52
53%description apidoc -l pl.UTF-8
54Dokumentacja API %{module}.
55
56%package -n python3-%{module}
57Summary: Efficient arrays of booleans -- C extension
58Group: Libraries/Python
59Requires: python3-libs
60Requires: python3-modules
61
62%description -n python3-%{module}
446688ef
JK
63This module provides an object type which efficiently represents an
64array of booleans. Bitarrays are sequence types and behave very much
65like usual lists. Eight bits are represented by one byte in a
66contiguous block of memory. The user can select between two
67representations; little-endian and big-endian. All of the
68functionality is implemented in C. Methods for accessing the machine
69representation are provided. This can be useful when bit level access
70to binary files is required, such as portable bitmap image files
71(.pbm). Also, when dealing with compressed data which uses variable
72bit length encoding, you may find this module useful.
3476df9a
JR
73
74%prep
75%setup -q -n %{module}-%{version}
76
3476df9a
JR
77%build
78%if %{with python2}
ee6a3db6
AM
79%py_build
80%if %{with tests}
81cd build-2
82PYTHONPATH=$(pwd)/$(echo lib.linux-*) \
83%{__python} -c 'import bitarray; bitarray.test()'
84cd ..
85%endif
3476df9a
JR
86%endif
87%if %{with python3}
ee6a3db6
AM
88%py3_build
89%if %{with tests}
90cd build-3
91PYTHONPATH=$(pwd)/$(echo lib.linux-*) \
92%{__python3} -c 'import bitarray; bitarray.test()'
93cd ..
94%endif
3476df9a
JR
95%endif
96
97%if %{with doc}
98cd docs
99%{__make} -j1 html
100rm -rf _build/html/_sources
101%endif
102
103%install
104rm -rf $RPM_BUILD_ROOT
446688ef 105%py_install
3476df9a
JR
106
107%if %{with python3}
446688ef 108%py3_install
3476df9a
JR
109%endif
110
111install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
112cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
113
3476df9a
JR
114%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
115%py_comp $RPM_BUILD_ROOT%{py_sitedir}
116
117%clean
118rm -rf $RPM_BUILD_ROOT
119
120%files
121%defattr(644,root,root,755)
122%doc AUTHORS CHANGE_LOG README.rst TODO
3476df9a
JR
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}
128
129%if %{with python3}
130%files -n python3-%{module}
3476df9a 131%defattr(644,root,root,755)
446688ef 132%doc AUTHORS CHANGE_LOG README.rst TODO
3476df9a
JR
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
138%endif
139
140%if %{with doc}
141%files apidoc
142%defattr(644,root,root,755)
143%doc docs/_build/html/*
144%endif
This page took 0.100324 seconds and 4 git commands to generate.