1c9d49a
Name:           python-docutils
b45de3a
Version:        0.20.1
1306508
Release:        %autorelease
d3e618d
Summary:        System for processing plaintext documentation
b9c4331
cecfe5a
# See COPYING.txt for information
27a914e
# PSF-2.0 was chosen for the SPDX identifier as it's the spirit of the original
27a914e
# author's notice, even though the shipped license text is copied from Python 2.1.1
27a914e
# See: https://gitlab.com/fedora/legal/fedora-license-data/-/issues/216
27a914e
License:        LicenseRef-Fedora-Public-Domain AND BSD-2-Clause AND BSD-3-Clause AND PSF-2.0 AND GPL-3.0-or-later
b1352a0
URL:            https://docutils.sourceforge.net
1c9d49a
Source0:        https://sourceforge.net/projects/docutils/files/docutils/%{version}/docutils-%{version}.tar.gz
7d581d9
f53885c
BuildArch:      noarch
b9c4331
ead4789
BuildRequires:  pyproject-rpm-macros
be08119
BuildRequires:  python%{python3_pkgversion}-devel
1115cfe
dbc9e77
%global _description %{expand:
909612b
The Docutils project specifies a plaintext markup language, reStructuredText,
909612b
which is easy to read and quick to write.  The project includes a python
909612b
library to parse rST files and transform them into other useful formats such
909612b
as HTML, XML, and TeX as well as commandline tools that give the enduser
909612b
access to this functionality.
909612b
909612b
Currently, the library supports parsing rST that is in standalone files and
909612b
PEPs (Python Enhancement Proposals).  Work is underway to parse rST from
dbc9e77
Python inline documentation modules and packages.}
909612b
dbc9e77
%description %_description
9fef409
9fef409
1c9d49a
%package -n python%{python3_pkgversion}-docutils
dbc9e77
Summary:        %{summary}
9fef409
1c9d49a
%description -n python%{python3_pkgversion}-docutils %_description
a3401df
9fef409
b9c4331
%prep
c89db54
%autosetup -p1 -n docutils-%{version}
2d2a8c1
9fef409
# Remove shebang from library files
1c9d49a
sed -i -e '/#! *\/usr\/bin\/.*/{1D}' $(grep -Erl '^#!.+python' docutils)
8cb9a4d
a3401df
# We want the licenses but don't need this build file
a3401df
rm -f licenses/docutils.conf
0b34bb0
54a4d52
ead4789
%generate_buildrequires
ead4789
%pyproject_buildrequires -r
ead4789
ead4789
b9c4331
%build
ead4789
%pyproject_wheel
9fef409
b9c4331
b9c4331
%install
ead4789
%pyproject_install
ead4789
%pyproject_save_files docutils
a3401df
29b45cc
for file in %{buildroot}%{_bindir}/*.py; do
29b45cc
  mv $file $(dirname $file)/$(basename $file .py)
4adf7b7
done
4adf7b7
0bc00b8
9fef409
%check
ead4789
export PYTHONPATH=%{buildroot}%{python3_sitelib}
dbc9e77
%{python3} test/alltests.py
a3401df
9fef409
ead4789
%files -n python%{python3_pkgversion}-docutils -f %{pyproject_files}
Orion Poplawski b031920
%license COPYING.txt licenses/*
526d5f9
%doc BUGS.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt THANKS.txt
dbc9e77
%{_bindir}/rst*
5e62abe
%{_bindir}/docutils
4adf7b7
a3401df
b9c4331
%changelog
1306508
%autochangelog