%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 swiftclient %global srcname python-swiftclient %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: 3.8.1 Release: 2 Summary: Python Swift client API and command-line script. License: APL URL: https://pypi.python.org/pypi/%{pkgname} Source0: https://files.pythonhosted.org/packages/source/s/%{pkgname}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: %{python_major}-devel >= %{py_major}.%{py_minor} BuildRequires: %{python_major}-setuptools >= 65.2.0 Requires: %{python_major}-requests >= 2.27.1 Requires: %{python_major}-six >= 1.13.0 Requires: %{python_major} >= %{py_major}.%{py_minor} %description Python-swiftclient includes a Swift API for Python (swiftclient) and a command line script (swift) to interface with an OpenStack Swift server. %package -n %{meta_package} Summary: Meta-package for %{name} Requires: python3 >= %{py_major}.%{py_minor} Requires: %{name} = %{version}-%{release} Requires: python3-requests >= 2.27.1 Requires: python3-six >= 1.13.0 %description -n %{meta_package} This is a Meta-package for %{name} package. %prep %autosetup -n %{srcname}-%{version} %build export PATH=/opt/freeware/bin:$PATH %{python_major} setup.py build %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %{python_major} setup.py install --root %{buildroot} #renaming the files in bindir to avoid conflict with python-swiftclient cd ${RPM_BUILD_ROOT}/%{_bindir} mv swift $RPM_BUILD_ROOT%{_bindir}/swift-3.9 ln -sf swift-3.9 swift-3 ln -sf swift-3.9 swift %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,-) %doc 32bit/AUTHORS 32bit/PKG-INFO 32bit/LICENSE 32bit/README.rst 32bit/CONTRIBUTING.md 32bit/ChangeLog 32bit/requirements.txt %doc 32bit/doc %{_bindir}/swift-%{py_major} %{python3_sitearch}/* %files -n %{meta_package} %defattr(-,root,system,-) %{_bindir}/swift-3 %{_bindir}/swift %changelog * Mon Apr 03 2023 Harshith K A - 3.8.1-2 - swiftclient for python3.9