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
7 %define module siphashc
8 %define egg_name siphashc
9 %define pypi_name siphashc
10 Summary: Python module for siphash
11 Name: python-%{pypi_name}
15 Group: Libraries/Python
16 Source0: https://files.pythonhosted.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
17 # Source0-md5: f2078b9c12d4650a67ad29ab4c63d8cc
18 URL: https://github.com/WeblateOrg/siphashc
19 BuildRequires: rpm-pythonprov
20 BuildRequires: rpmbuild(macros) >= 1.714
22 BuildRequires: python-modules
23 BuildRequires: python-setuptools
26 BuildRequires: python3-modules
27 BuildRequires: python3-setuptools
29 Requires: python-modules
30 Obsoletes: python-siphashc3
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 Python module for siphash, based on floodberry's version.
36 %package -n python3-%{pypi_name}
37 Summary: Python module for siphash
38 Group: Libraries/Python
39 Requires: python3-modules
40 Obsoletes: python3-siphashc3
42 %description -n python3-%{pypi_name}
43 Python module for siphash, based on floodberry's version.
46 %setup -q -n %{pypi_name}-%{version}
48 # Remove bundled egg-info
49 rm -r %{pypi_name}.egg-info
53 %py_build %{?with_tests:test}
57 %py3_build %{?with_tests:test}
63 rm -rf _build/html/_sources
67 rm -rf $RPM_BUILD_ROOT
79 rm -rf $RPM_BUILD_ROOT
83 %defattr(644,root,root,755)
84 %attr(755,root,root) %{py_sitedir}/%{module}.so
85 %{py_sitedir}/%{egg_name}-%{version}-py*.egg-info
89 %files -n python3-%{pypi_name}
90 %defattr(644,root,root,755)
91 %attr(755,root,root) %{py3_sitedir}/%{module}.*.so
92 %{py3_sitedir}/%{egg_name}-%{version}-py*.egg-info