%bcond_without dotests %global __tar /opt/freeware/bin/tar %global py_major 3.9 %global py_minor 16 %global python_major python%{py_major} %global pkgname resolvelib %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: 0.5.4 Release: 1 Summary: Resolve abstract dependencies into concrete ones License: ISC URL: https://pypi.python.org/pypi/%{pkgname} #Download source code from github. Tarball hosted in pypi site doesn't include the test-suite. Source0: https://files.pythonhosted.org/packages/source/r/%{pkgname}/%{pkgname}-%{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} %description ResolveLib at the highest level provides a Resolver class that includes dependency resolution logic. You give it some things, and a little information on how it should interact with them, and it will spit out a resolution result. Intended Usage :: import resolvelib Things I want to resolve. requirements [...] Implement logic so the resolver understands the requirement format. class... %package -n %{meta_package} Summary: Meta-package for %{name} Requires: python3 >= %{py_major}.%{py_minor} Requires: %{name} = %{version}-%{release} %description -n %{meta_package} This is a Meta-package for %{name} package. %prep %autosetup -n %{pkgname}-%{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} %check %if %{with dotests} export PYTHONPATH="%{buildroot}%{python3_sitearch}" python3.9 -m venv python_venv --system-site-packages . ./python_venv/bin/activate pip3.9 install commentjson python3.9 -m pytest deactivate %endif %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %license LICENSE %doc README.rst %{python3_sitearch}/* %files -n %{meta_package} %defattr(-,root,system,-) #Empty %changelog * Fri Aug 04 2023 Reshma V Kumar - 0.5.4-1 - Initial port for AIX Toolbox