%{!?dotests: %define dotests 1} %define name python3-docutils %define srcname docutils %define version 0.15.2 %define release 1 %define is_python %(test -e /usr/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(python3_32 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /usr/bin/python3_64 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif Summary: Docutils -- Python Documentation Utilities Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz License: public domain, Python, 2-Clause BSD, GPL 3 (see COPYING.txt) Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch Vendor: docutils-develop list Url: https://pypi.org/ BuildRequires: python3, python3-devel Requires: python3 %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. %prep %setup -q -n %{srcname}-%{version} %build python3 setup.py build if [ "%{dotests}" == 1 ] then python3 test3/alltests.py fi %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} #renaming the files in bindir to avoid conflict with python-docutils cd ${RPM_BUILD_ROOT}/%{_bindir} for file in ${RPM_BUILD_ROOT}/%{_bindir}/*.py; do mv $file `basename $file .py` done cd ${RPM_BUILD_ROOT} mkdir -p usr/bin cd usr/bin ln -sf ../..%{_bindir}/* . %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/ %{_bindir}/* /usr/bin/* %{python_sitelib}/* %changelog * Fri Nov 08 2019 Baanu Tumma - 0.15.2-1 - Updated to latest version, built with python3 * Wed Sep 20 2017 Ravi Hirekurabar - 0.13.1-1 - Updated to 0.13.1 * Thu Jul 17 2013 Tristan Delhalle - 0.10-1 - - first version for AIX V6.1 and higher