%global srcname docutils %global __python3 /usr/bin/python3.11 %global python3_pkgversion 3.11 Name: python-%{srcname} Version: 0.20.1 Release: 1%{?dist} Summary: System for processing plaintext documentation # See COPYING.txt for information License: Public Domain and BSD and Python and GPLv3+ URL: http://docutils.sourceforge.net Source0: https://sourceforge.net/projects/%{srcname}/files/%{srcname}/%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %global _description %{expand: The Docutils project specifies a plaintext markup language, reStructuredText, which is easy to read and quick to write. The project includes a python library to parse rST files and transform them into other useful formats such as HTML, XML, and TeX as well as commandline tools that give the enduser access to this functionality. Currently, the library supports parsing rST that is in standalone files and PEPs (Python Enhancement Proposals). Work is underway to parse rST from Python inline documentation modules and packages.} %description %_description %package -n python%{python3_pkgversion}-%{srcname} Summary: %{summary} %description -n python%{python3_pkgversion}-%{srcname} %_description %prep %autosetup -n %{srcname}-%{version} # Remove shebang from library files sed -i -e '/#! *\/usr\/bin\/.*/{1D}' $(grep -Erl '^#!.+python' %{srcname}) iconv -f ISO88592 -t UTF8 tools/editors/emacs/IDEAS.rst > tmp mv tmp tools/editors/emacs/IDEAS.rst # We want the licenses but don't need this build file rm -f licenses/docutils.conf # https://bugzilla.redhat.com/show_bug.cgi?id=1687377 rm test/test_writers/test_odt.py %build %py3_build %install %py3_install mv docs/user/rst/images/biohazard.swf ./biohazard.swf # docutils setup.py runs 2to3 on a copy of the tests and puts it in sitelib. rm -rf %{buildroot}%{python3_sitelib}/test for file in %{buildroot}/%{_bindir}/*.py; do mv $file `dirname $file`/`basename $file .py` done for bin in %{buildroot}%{_bindir}/rst*; do mv $bin $bin-%{python3_pkgversion} done mv %{buildroot}%{_bindir}/docutils %{buildroot}%{_bindir}/docutils-%{python3_pkgversion} %check mv biohazard.swf docs/user/rst/images/biohazard.swf %{python3} test/alltests.py rm docs/user/rst/images/biohazard.swf %files -n python%{python3_pkgversion}-%{srcname} %license COPYING.txt licenses/* %doc BUGS.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt %doc THANKS.txt docs tools/editors %{python3_sitelib}/%{srcname}/ %{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/ %{_bindir}/rst* %{_bindir}/docutils-%{python3_pkgversion} %changelog