]> git.pld-linux.org Git - packages/python-bitarray.git/blob - python-bitarray.spec
a9c67c898ea76030959303e9e6cbac0ee502ae7a
[packages/python-bitarray.git] / python-bitarray.spec
1 #
2 # Conditional build:
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
6
7 %define         module  bitarray
8 Summary:        Efficient arrays of booleans -- C extension
9 Name:           python-%{module}
10 Version:        1.0.1
11 Release:        4
12 License:        PSF
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
25 %if %{with python3}
26 BuildRequires:  python3-devel
27 BuildRequires:  python3-distribute
28 BuildRequires:  python3-modules
29 %endif
30 Requires:       python-libs
31 Requires:       python-modules
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %description
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.
45
46 %package apidoc
47 Summary:        %{module} API documentation
48 Summary(pl.UTF-8):      Dokumentacja API %{module}
49 Group:          Documentation
50
51 %description apidoc
52 API documentation for %{module}.
53
54 %description apidoc -l pl.UTF-8
55 Dokumentacja API %{module}.
56
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
62
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.
74
75 %prep
76 %setup -q -n %{module}-%{version}
77
78 %build
79 %if %{with python2}
80 %py_build
81 %if %{with tests}
82 cd build-2
83 PYTHONPATH=$(pwd)/$(echo lib.linux-*) \
84 %{__python} -c 'import bitarray; bitarray.test()'
85 cd ..
86 %endif
87 %endif
88 %if %{with python3}
89 %py3_build
90 %if %{with tests}
91 cd build-3
92 PYTHONPATH=$(pwd)/$(echo lib.linux-*) \
93 %{__python3} -c 'import bitarray; bitarray.test()'
94 cd ..
95 %endif
96 %endif
97
98 %if %{with doc}
99 cd docs
100 %{__make} -j1 html
101 rm -rf _build/html/_sources
102 %endif
103
104 %install
105 rm -rf $RPM_BUILD_ROOT
106 %py_install
107
108 %if %{with python3}
109 %py3_install
110 %endif
111
112 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
113 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
114
115 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
116 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
117
118 %clean
119 rm -rf $RPM_BUILD_ROOT
120
121 %files
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}
129
130 %if %{with python3}
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
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.082531 seconds and 2 git commands to generate.