F41+: Stop building PDF documentation; drop -doc subpackage

This commit is contained in:
Benjamin A. Beasley 2024-07-05 16:09:14 -04:00
commit e8ed5df38f
2 changed files with 5 additions and 43 deletions

View file

@ -4,3 +4,5 @@ addFilter(r" spelling-error \('([Pp]rober)s?',")
addFilter(r" invalid-url Source[0-9]+: chardet-.*-filtered\.tar\.zst")
# Bogus; it is a perfectly fine zstandard file.
addFilter(r" inconsistent-file-extension chardet-.*-filtered\.tar\.zst$")
# The -doc subpackage was removed without an equivalent replacement.
addFilter(r" obsolete-not-provided python-chardet-doc$")

View file

@ -1,10 +1,3 @@
# Sphinx-generated HTML documentation is not suitable for packaging; see
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
#
# We can generate PDF documentation as a substitute.
# EL 9/10 has no /usr/bin/xindy
%bcond doc %{undefined rhel}
Name: python-chardet
Version: 5.2.0
Release: %autorelease
@ -32,16 +25,6 @@ BuildArch: noarch
BuildRequires: python3-devel
%if %{with doc}
BuildRequires: make
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(sphinx-rtd-theme)
BuildRequires: python3-sphinx-latex
BuildRequires: latexmk
BuildRequires: tex-xetex-bin
BuildRequires: /usr/bin/xindy
%endif
%global common_description %{expand:
Chardet: The Universal Character Encoding Detector
@ -69,23 +52,16 @@ disabled.}
%package -n python3-chardet
Summary: %{summary}
# Removed in F41:
Obsoletes: python-chardet-doc < 5.2.0-12
%description -n python3-chardet
%{common_description}
%package doc
Summary: Documentation for python-chardet
%description doc
%{common_description}
%prep
%autosetup -n chardet-%{version}
# Since pdflatex cannot handle Unicode inputs in general:
echo "latex_engine = 'xelatex'" >> docs/conf.py
%generate_buildrequires
%pyproject_buildrequires
@ -94,12 +70,6 @@ echo "latex_engine = 'xelatex'" >> docs/conf.py
%build
%pyproject_wheel
%if %{with doc}
PYTHONPATH="${PWD}" %make_build -C docs latex \
SPHINXOPTS='-j%{?_smp_build_ncpus}'
%make_build -C docs/_build/latex LATEXMKOPTS='-quiet'
%endif
%install
%pyproject_install
@ -114,20 +84,10 @@ install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 '%{SOURCE2}'
%files -n python3-chardet -f %{pyproject_files}
%if %{without doc}
%doc README.rst
%endif
%{_bindir}/chardetect
%{_mandir}/man1/chardetect.1*
%if %{with doc}
%files doc
%license LICENSE
%doc README.rst
%doc docs/_build/latex/chardet.pdf
%endif
%changelog
%autochangelog