%bcond_with dotests %global __tar /opt/freeware/bin/tar %global py_major 3.9 %global py_minor 15 %global python_major python%{py_major} %global pkgname docutils %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.19 Release: 1 Summary: Docutils -- Python Documentation Utilities License: public domain, Python, 2-Clause BSD, GPL 3 (see COPYING.txt) URL: https://pypi.python.org/pypi/%{pkgname} Source0: https://files.pythonhosted.org/packages/source/d/%{pkgname}/%{pkgname}-%{version}.tar.gz BuildArch: noarch BuildRequires: %{python_major}-devel >= %{py_major} BuildRequires: %{python_major}-setuptools >= 65.2.0 Requires: %{python_major} >= %{py_major}.%{py_minor} %description Docutils is a modular system for processing documentation into useful formats, such as HTML, XML, and LaTeX. For input Docutils supports reStructuredText, an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax. %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} #renaming the files in bindir to avoid conflict with python3-docutils cd ${RPM_BUILD_ROOT}/%{_bindir} for file in ${RPM_BUILD_ROOT}/%{_bindir}/*.py; do mv $file `basename $file .py`-3.9 ln -s `basename $file .py`-3.9 `basename $file .py` done %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 BUGS.txt COPYING.txt FAQ.txt HISTORY.txt PKG-INFO README.txt RELEASE-NOTES.txt THANKS.txt licenses %doc docs/ %{python3_sitearch}/* /opt/freeware/bin/*3.9 %files -n %{meta_package} %defattr(-,root,system,-) /opt/freeware/bin/* %exclude /opt/freeware/bin/*3.9 %changelog * Thu Dec 29 2022 Aditya Kamath - 0.19 - Docutils for python3.9