3 %bcond_with tests # do not perform "make test"
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
8 Summary: Module for representing file sizes with different prefix notations
13 Group: Libraries/Python
14 Source0: https://github.com/tbielawa/bitmath/archive/%{version}-1.tar.gz
15 # Source0-md5: b589c9ceb7f518da043e089d519e8579
16 URL: https://github.com/tbielawa/bitmath
17 BuildRequires: rpm-pythonprov
18 BuildRequires: rpmbuild(macros) >= 1.710
20 BuildRequires: python-distribute
23 BuildRequires: python3-distribute
24 BuildRequires: python3-modules
26 Requires: python-modules
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 bitmath simplifies many facets of interacting with file sizes in
32 various units. Examples include: converting between SI and NIST prefix
33 units (GiB to kB), converting between units of the same type (SI to
34 SI, or NIST to NIST), basic arithmetic operations (subtracting 42KiB
35 from 50GiB), rich comparison operations (1024 Bytes == 1KiB), bitwise
36 operations (<<, >>, &, |, ^), and sorting.
38 In addition to the conversion and math operations, bitmath provides
39 human readable representations of values which are suitable for use in
40 interactive shells as well as larger scripts and applications.
42 %package -n python3-%{module}
43 Summary: Module for representing file sizes with different prefix notations
44 Group: Libraries/Python
46 %description -n python3-%{module}
47 bitmath simplifies many facets of interacting with file sizes in
48 various units. Examples include: converting between SI and NIST prefix
49 units (GiB to kB), converting between units of the same type (SI to
50 SI, or NIST to NIST), basic arithmetic operations (subtracting 42KiB
51 from 50GiB), rich comparison operations (1024 Bytes == 1KiB), bitwise
52 operations (<<, >>, &, |, ^), and sorting.
54 In addition to the conversion and math operations, bitmath provides
55 human readable representations of values which are suitable for use in
56 interactive shells as well as larger scripts and applications.
59 Summary: %{module} API documentation
60 Summary(pl.UTF-8): Dokumentacja API %{module}
64 API documentation for %{module}.
66 %description apidocs -l pl.UTF-8
67 Dokumentacja API %{module}.
70 %setup -q -n %{module}-%{version}-1
74 %py_build %{?with_tests:test}
78 %py3_build %{?with_tests:test}
84 rm -rf _build/html/_sources
88 rm -rf $RPM_BUILD_ROOT
101 rm -rf $RPM_BUILD_ROOT
105 %defattr(644,root,root,755)
107 %dir %{py_sitescriptdir}/%{module}
108 %{py_sitescriptdir}/%{module}/*.py[co]
109 %if "%{py_ver}" > "2.4"
110 %{py_sitescriptdir}/%{module}-%{version}*.egg-info
115 %files -n python3-%{module}
116 %defattr(644,root,root,755)
118 %{py3_sitescriptdir}/%{module}
119 %{py3_sitescriptdir}/%{module}-%{version}*-py*.egg-info
124 %defattr(644,root,root,755)
125 %doc docs/_build/html/*