Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79352f26ed | ||
|
|
2d53ba6cff | ||
|
|
ce9ff1d2dc | ||
|
|
026a9ac732 |
5 changed files with 66 additions and 38 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -4,4 +4,3 @@
|
||||||
/chardet-5.0.0-filtered.tar.xz
|
/chardet-5.0.0-filtered.tar.xz
|
||||||
/chardet-5.1.0-filtered.tar.xz
|
/chardet-5.1.0-filtered.tar.xz
|
||||||
/chardet-5.2.0-filtered.tar.xz
|
/chardet-5.2.0-filtered.tar.xz
|
||||||
/chardet-5.2.0-filtered.tar.zst
|
|
||||||
|
|
|
||||||
20
get_source
20
get_source
|
|
@ -26,23 +26,9 @@ ARCHIVE="$(find . -mindepth 1 -maxdepth 1 -type f -name '*.tar.gz' -print -quit)
|
||||||
echo "--> Extracting: $(basename "${ARCHIVE}")" 1>&2
|
echo "--> Extracting: $(basename "${ARCHIVE}")" 1>&2
|
||||||
tar -xzf "${ARCHIVE}"
|
tar -xzf "${ARCHIVE}"
|
||||||
echo '--> Removing tests due to licensing issues' 1>&2
|
echo '--> Removing tests due to licensing issues' 1>&2
|
||||||
TARDIR="$(basename "${ARCHIVE}" '.tar.gz')"
|
rm -rvf */tests/
|
||||||
MTIME="$(stat -c '%Y' "${TARDIR}")"
|
FILTERED="$(basename "${ARCHIVE}" .tar.gz)-filtered.tar.xz"
|
||||||
rm -rvf "${TARDIR}/tests/"
|
|
||||||
# Restore the original mtime even though we modified the base directory by
|
|
||||||
# removing the tests.
|
|
||||||
touch -d @"${MTIME}" "${TARDIR}"
|
|
||||||
FILTERED="$(basename "${ARCHIVE}" .tar.gz)-filtered.tar.zst"
|
|
||||||
echo "--> Re-archiving: ${FILTERED}" 1>&2
|
echo "--> Re-archiving: ${FILTERED}" 1>&2
|
||||||
# https://www.gnu.org/software/tar/manual/html_section/Reproducibility.html
|
tar -c "${FILTERED}" */ | xz -9e > "${FILTERED}"
|
||||||
TZ=UTC LC_ALL=C tar \
|
|
||||||
--create --verbose \
|
|
||||||
--sort=name \
|
|
||||||
--format=posix \
|
|
||||||
--numeric-owner --owner=0 --group=0 \
|
|
||||||
--mode=go+u,go-w \
|
|
||||||
--pax-option='delete=atime,delete=ctime' \
|
|
||||||
"${TARDIR}/" |
|
|
||||||
zstdmt --ultra -22 > "${FILTERED}"
|
|
||||||
mv -v "${FILTERED}" "${OUTDIR}"
|
mv -v "${FILTERED}" "${OUTDIR}"
|
||||||
echo 'Done.' 1>&2
|
echo 'Done.' 1>&2
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
# Not a real spelling error:
|
|
||||||
addFilter(r" spelling-error \('([Pp]rober)s?',")
|
|
||||||
# This Source cannot be a URL because we must filter out certain files.
|
|
||||||
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$")
|
|
||||||
# Update LGPLv2.1 license text and notices for remote-only FSF
|
|
||||||
# https://github.com/chardet/chardet/pull/307
|
|
||||||
addFilter(r" incorrect-fsf-address ")
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
# 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.
|
||||||
|
%bcond doc 1
|
||||||
|
|
||||||
Name: python-chardet
|
Name: python-chardet
|
||||||
Version: 5.2.0
|
Version: 5.2.0
|
||||||
Release: %autorelease
|
Release: %autorelease
|
||||||
|
|
@ -16,16 +22,25 @@ URL: https://github.com/chardet/chardet
|
||||||
#
|
#
|
||||||
# problematic licensing of /tests?
|
# problematic licensing of /tests?
|
||||||
# https://github.com/chardet/chardet/issues/231
|
# https://github.com/chardet/chardet/issues/231
|
||||||
Source0: chardet-%{version}-filtered.tar.zst
|
Source0: chardet-%{version}-filtered.tar.xz
|
||||||
Source1: get_source
|
Source1: get_source
|
||||||
# Hand-written for Fedora in groff_man(7) format based on --help output
|
# Hand-written for Fedora in groff_man(7) format based on --help output
|
||||||
Source2: chardetect.1
|
Source2: chardetect.1
|
||||||
|
|
||||||
BuildSystem: pyproject
|
|
||||||
BuildOption(install): -l chardet
|
|
||||||
|
|
||||||
BuildArch: noarch
|
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:
|
%global common_description %{expand:
|
||||||
Chardet: The Universal Character Encoding Detector
|
Chardet: The Universal Character Encoding Detector
|
||||||
|
|
||||||
|
|
@ -53,26 +68,65 @@ disabled.}
|
||||||
%package -n python3-chardet
|
%package -n python3-chardet
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
|
|
||||||
# Removed in F41:
|
|
||||||
Obsoletes: python-chardet-doc < 5.2.0-12
|
|
||||||
|
|
||||||
%description -n python3-chardet
|
%description -n python3-chardet
|
||||||
%{common_description}
|
%{common_description}
|
||||||
|
|
||||||
|
|
||||||
%install -a
|
%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
|
||||||
|
|
||||||
|
|
||||||
|
%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
|
||||||
|
%pyproject_save_files chardet
|
||||||
install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 '%{SOURCE2}'
|
install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 '%{SOURCE2}'
|
||||||
|
|
||||||
|
|
||||||
|
%check
|
||||||
# We cannot run the upstream tests because they would require data files with
|
# We cannot run the upstream tests because they would require data files with
|
||||||
# problematic license status.
|
# problematic license status.
|
||||||
|
%pyproject_check_import
|
||||||
|
|
||||||
|
|
||||||
%files -n python3-chardet -f %{pyproject_files}
|
%files -n python3-chardet -f %{pyproject_files}
|
||||||
|
%if %{without doc}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
|
%endif
|
||||||
%{_bindir}/chardetect
|
%{_bindir}/chardetect
|
||||||
%{_mandir}/man1/chardetect.1*
|
%{_mandir}/man1/chardetect.1*
|
||||||
|
|
||||||
|
|
||||||
|
%if %{with doc}
|
||||||
|
%files doc
|
||||||
|
%license LICENSE
|
||||||
|
%doc README.rst
|
||||||
|
%doc docs/_build/latex/chardet.pdf
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
%autochangelog
|
%autochangelog
|
||||||
|
|
|
||||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
||||||
SHA512 (chardet-5.2.0-filtered.tar.zst) = 410b2d62c54781f9b848ee78c659d4607bbb7f94f6117d7fa7cd5f82a50dfaf10d6e4c6dfaefa9b9a721b846c167aa12eae029debbaa66b0d830875c8ce5749c
|
SHA512 (chardet-5.2.0-filtered.tar.xz) = 4f865b958503596cdaf690d0cb586c7c477419ca528b4701d93577c34764fcbab2246d79b82fe25a06246c59cedb9344ec332540efb76cc02d49158fb4903974
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue