]> git.pld-linux.org Git - packages/python-bitmath.git/blob - python-bitmath.spec
2c8c2a769957dcf44ff238616c76af2e221206fe
[packages/python-bitmath.git] / python-bitmath.spec
1 #
2 # Conditional build:
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
6
7 %define         module  bitmath
8 Summary:        Module for representing file sizes with different prefix notations
9 Name:           python-%{module}
10 Version:        1.0.6
11 Release:        12
12 License:        BSD
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
19 %if %{with python2}
20 BuildRequires:  python-distribute
21 %endif
22 %if %{with python3}
23 BuildRequires:  python3-modules
24 %endif
25 Requires:       python-modules
26 BuildArch:      noarch
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
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.
36
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.
40
41 %package -n python3-%{module}
42 Summary:        Module for representing file sizes with different prefix notations
43 Group:          Libraries/Python
44
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.
52
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.
56
57 %package apidocs
58 Summary:        %{module} API documentation
59 Summary(pl.UTF-8):      Dokumentacja API %{module}
60 Group:          Documentation
61
62 %description apidocs
63 API documentation for %{module}.
64
65 %description apidocs -l pl.UTF-8
66 Dokumentacja API %{module}.
67
68 %prep
69 %setup -q -n %{module}-%{version}-1
70
71 %build
72 %if %{with python2}
73 %py_build %{?with_tests:test}
74 %endif
75
76 %if %{with python3}
77 %py3_build %{?with_tests:test}
78 %endif
79
80 %if %{with doc}
81 cd docs
82 %{__make} -j1 html
83 rm -rf _build/html/_sources
84 %endif
85
86 %install
87 rm -rf $RPM_BUILD_ROOT
88
89 %if %{with python2}
90 %py_install
91
92 %py_postclean
93 %endif
94
95 %if %{with python3}
96 %py3_install
97 %endif
98
99 %clean
100 rm -rf $RPM_BUILD_ROOT
101
102 %if %{with python2}
103 %files
104 %defattr(644,root,root,755)
105 %doc README.md
106 %dir %{py_sitescriptdir}/%{module}
107 %{py_sitescriptdir}/%{module}/*.py[co]
108 %if "%{py_ver}" > "2.4"
109 %{py_sitescriptdir}/%{module}-%{version}*.egg-info
110 %endif
111 %endif
112
113 %if %{with python3}
114 %files -n python3-%{module}
115 %defattr(644,root,root,755)
116 %doc README.md
117 %{py3_sitescriptdir}/%{module}
118 %{py3_sitescriptdir}/%{module}-%{version}*-py*.egg-info
119 %endif
120
121 %if %{with doc}
122 %files apidocs
123 %defattr(644,root,root,755)
124 %doc docs/_build/html/*
125 %endif
This page took 0.573307 seconds and 2 git commands to generate.