2 %bcond_without tests # unit tests
3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
6 %define module hurry.filesize
7 %define egg_name hurry.filesize
8 %define pypi_name hurry.filesize
9 Summary: Python library for human readable file sizes (or anything sized in bytes)
10 Name: python-%{pypi_name}
14 Group: Libraries/Python
15 Source0: https://pypi.debian.net/%{module}/%{module}-%{version}.tar.gz
16 # Source0-md5: 8549ccd09bb31b5ff1e8e8c1eacc7794
17 URL: https://pypi.org/project/hurry.filesize/
18 BuildRequires: rpm-pythonprov
19 BuildRequires: rpmbuild(macros) >= 1.714
21 BuildRequires: python-modules
22 BuildRequires: python-setuptools
25 BuildRequires: python3-modules
26 BuildRequires: python3-setuptools
28 Requires: python-modules
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 Python library for human readable file sizes (or anything sized in
36 %package -n python3-%{pypi_name}
37 Summary: Python library for human readable file sizes (or anything sized in bytes)
38 Group: Libraries/Python
39 Requires: python3-modules
41 %description -n python3-%{pypi_name}
42 Python library for human readable file sizes (or anything sized in
46 %setup -q -n %{pypi_name}-%{version}
50 %py_build %{?with_tests:test}
54 %py3_build %{?with_tests:test}
58 rm -rf $RPM_BUILD_ROOT
63 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
64 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
74 rm -rf $RPM_BUILD_ROOT
78 %defattr(644,root,root,755)
80 %dir %{py_sitescriptdir}/hurry
81 %{py_sitescriptdir}/hurry/filesize
82 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
83 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.pth
87 %files -n python3-%{pypi_name}
88 %defattr(644,root,root,755)
90 %dir %{py3_sitescriptdir}/hurry
91 %{py3_sitescriptdir}/hurry/filesize
92 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
93 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.pth