%bcond_with dotests %global __tar /opt/freeware/bin/tar %global py_major 3.9 %global py_minor 16 %global python_major python%{py_major} %global pkgname libcloud %global srcname apache-libcloud %global meta_package python3-%{pkgname} %global python3_sitearch %(%{python_major} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(0))") Name: %{python_major}-%{pkgname} Version: 2.8.0 Release: 2 Summary: A Python library to address multiple cloud provider APIs License: ASL 2.0 URL: https://pypi.python.org/pypi/%{pkgname} Source0: https://files.pythonhosted.org/packages/source/a/%{srcname}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: %{python_major}-devel >= %{py_major}.%{py_minor} BuildRequires: %{python_major}-setuptools >= 65.2.0 Requires: %{python_major} >= %{py_major}.%{py_minor} Requires: %{python_major}-requests >= 2.27.1 %description libcloud is a client library for interacting with many of \ the popular cloud server providers. It was created to make \ it easy for developers to build products that work between \ any of the services that it supports. Python 3 version. %package -n %{meta_package} Summary: Meta-package for %{name} Requires: python3 >= %{py_major}.%{py_minor} Requires: python3-requests >= 2.27.1 Requires: %{name} = %{version}-%{release} %description -n %{meta_package} This is a Meta-package for %{name} package. %prep %autosetup -n %{srcname}-%{version} # Delete shebang lines in the demos sed -i '1d' demos/gce_demo.py demos/compute_demo.py %build export PATH=/opt/freeware/bin:$PATH %{python_major} setup.py build # Fix permissions for demos chmod -x demos/gce_demo.py demos/compute_demo.py %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %{python_major} setup.py install --root %{buildroot} # The test suite is not packaged. # It is not executed because it requires valid cloud credentials rm -r $RPM_BUILD_ROOT%{python3_sitearch}/%{pkgname}/test %check %if %{with dotests} #python3 -m venv python_venv #. ./python_venv/bin/activate #pip3 install pytest #pip3 install hypothesis #ulimit -d unlimited #ulimit -n unlimited #ulimit -m unlimited # ulimit -f unlimited #( python runtests.py -m 'full' -v || true ) #deactivate %endif %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %license LICENSE %doc CHANGES.rst README.rst demos/ %{python3_sitearch}/* %files -n %{meta_package} %defattr(-,root,system,-) #Empty %changelog * Sun Feb 26 2023 Reshma V Kumar - 2.8.0-2 - Libcloud for python3.9