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-modules
25 Requires: python-modules
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 bitmath simplifies many facets of interacting with file sizes in
31 various units. Examples include: converting between SI and NIST prefix
32 units (GiB to kB), converting between units of the same type (SI to
33 SI, or NIST to NIST), basic arithmetic operations (subtracting 42KiB
34 from 50GiB), rich comparison operations (1024 Bytes == 1KiB), bitwise
35 operations (<<, >>, &, |, ^), and sorting.
37 In addition to the conversion and math operations, bitmath provides
38 human readable representations of values which are suitable for use in
39 interactive shells as well as larger scripts and applications.
41 %package -n python3-%{module}
42 Summary: Module for representing file sizes with different prefix notations
43 Group: Libraries/Python
45 %description -n python3-%{module}
46 bitmath simplifies many facets of interacting with file sizes in
47 various units. Examples include: converting between SI and NIST prefix
48 units (GiB to kB), converting between units of the same type (SI to
49 SI, or NIST to NIST), basic arithmetic operations (subtracting 42KiB
50 from 50GiB), rich comparison operations (1024 Bytes == 1KiB), bitwise
51 operations (<<, >>, &, |, ^), and sorting.
53 In addition to the conversion and math operations, bitmath provides
54 human readable representations of values which are suitable for use in
55 interactive shells as well as larger scripts and applications.
58 Summary: %{module} API documentation
59 Summary(pl.UTF-8): Dokumentacja API %{module}
63 API documentation for %{module}.
65 %description apidocs -l pl.UTF-8
66 Dokumentacja API %{module}.
69 %setup -q -n %{module}-%{version}-1
73 %py_build %{?with_tests:test}
77 %py3_build %{?with_tests:test}
83 rm -rf _build/html/_sources
87 rm -rf $RPM_BUILD_ROOT
100 rm -rf $RPM_BUILD_ROOT
104 %defattr(644,root,root,755)
106 %dir %{py_sitescriptdir}/%{module}
107 %{py_sitescriptdir}/%{module}/*.py[co]
108 %if "%{py_ver}" > "2.4"
109 %{py_sitescriptdir}/%{module}-%{version}*.egg-info
114 %files -n python3-%{module}
115 %defattr(644,root,root,755)
117 %{py3_sitescriptdir}/%{module}
118 %{py3_sitescriptdir}/%{module}-%{version}*-py*.egg-info
123 %defattr(644,root,root,755)
124 %doc docs/_build/html/*