Compare commits

..

44 commits

Author SHA1 Message Date
Python Maint
17642dfc17 Rebuilt for Python 3.14.0rc3 bytecode 2025-09-19 12:58:27 +02:00
Python Maint
2683a63371 Rebuilt for Python 3.14.0rc2 bytecode 2025-08-15 13:54:11 +02:00
Fedora Release Engineering
74eeca0894 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-25 07:09:54 +00:00
Python Maint
1b67fcd42b Rebuilt for Python 3.14 2025-06-02 20:12:11 +02:00
Benjamin A. Beasley
f3975537e1 F41+: Use the provisional pyproject declarative buildsystem 2025-05-03 08:03:22 -04:00
Benjamin A. Beasley
09b953d845 Update .rpmlintrc file for current rpmlint 2025-05-03 08:01:53 -04:00
Fedora Release Engineering
353a16c6dc Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-18 12:50:21 +00:00
Benjamin A. Beasley
de9115b8d0 Remove a debugging line from the get_source script
[skip changelog]
2024-08-06 17:32:36 -04:00
Benjamin A. Beasley
0216c447b6 Fix source archive, which was xz-compressed despite the .zst extension 2024-07-29 08:06:21 -04:00
Fedora Release Engineering
e544222c20 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-19 10:18:16 +00:00
Benjamin A. Beasley
e8ed5df38f F41+: Stop building PDF documentation; drop -doc subpackage 2024-07-05 16:37:52 -04:00
Miro Hrončok
b65093a110 Disable doc on RHEL
There is no /usr/bin/xindy in c9s, epel9, c10s.

This package might be needed in future epel10 for tox.

[skip changelog]
2024-07-04 23:07:41 +02:00
Python Maint
09dae8a7bb Rebuilt for Python 3.13 2024-06-07 20:41:48 +02:00
Python Maint
a2f928beb2 Bootstrap for Python 3.13 2024-06-07 08:39:31 +02:00
Benjamin A. Beasley
be25609845 Use zstd instead of xz for filtered source archive compression
This is based on the relative health of the upstream projects.
2024-04-04 22:48:39 -04:00
Benjamin A. Beasley
f5e5a80c16 Make the filtered source archive more reproducible 2024-04-04 22:48:23 -04:00
Benjamin A. Beasley
63ae951a91 Update rpmlintrc file
[skip changelog]
2024-04-04 22:48:21 -04:00
Benjamin A. Beasley
efdc312e8f Add an rpmlintrc file
[skip changelog]
2024-03-28 20:10:20 -04:00
Fedora Release Engineering
c079aef0ca Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-26 02:21:39 +00:00
Fedora Release Engineering
e1a31906fd Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-22 00:05:33 +00:00
Benjamin A. Beasley
b11aa7eefc Assert that %pyproject_files contains a license file 2023-12-17 13:40:37 -05:00
Benjamin A. Beasley
01a67c2e9d Update to 5.2.0 (close RHBZ#2228250) 2023-08-01 21:01:12 -04:00
Fedora Release Engineering
07aea33b15 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-21 08:19:39 +00:00
Benjamin A. Beasley
188cee849d When PDF docs are disabled, omit the -doc subpackage 2023-07-11 08:13:08 -04:00
Benjamin A. Beasley
94b3a06b76 Use new (rpm 4.17.1+) bcond style 2023-07-06 21:05:56 -04:00
Python Maint
ced676c2d7 Rebuilt for Python 3.12 2023-06-16 08:18:02 +02:00
Python Maint
1159f9bf7b Bootstrap for Python 3.12 2023-06-13 20:33:25 +02:00
Benjamin A. Beasley
70b1e7fa69 Don’t assume %_smp_mflags is -j%_smp_build_ncpus 2023-03-17 09:55:48 -04:00
Fedora Release Engineering
1bae21d579 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-20 12:03:12 +00:00
Benjamin A. Beasley
504995a382 Update to 5.1.0 (close RHBZ#2150154) 2022-12-01 18:01:02 -05:00
Benjamin A. Beasley
8d4593d9d9 Update License to SPDX 2022-10-21 09:18:15 -04:00
Fedora Release Engineering
7c2ef5edec Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-22 17:15:48 +00:00
Benjamin A. Beasley
4e6f753383 Update to 5.0.0 (close RHBZ#2101067) 2022-06-25 13:01:53 -04:00
Benjamin A. Beasley
54e08a90f3 Fix get_source_script 2022-06-25 12:59:37 -04:00
Benjamin A. Beasley
5ac8e73c24 Drop test data with problematic license status 2022-06-25 12:53:26 -04:00
Benjamin A. Beasley
47140811aa BR python3dist(hypothesis) to enable more tests 2022-06-25 10:56:55 -04:00
Benjamin A. Beasley
404157ecdc Package Sphinx-generated PDF in a -doc subpackage 2022-06-25 10:51:49 -04:00
Benjamin A. Beasley
e537507a1b Drop explicit pyproject-rpm-macros BR 2022-06-25 10:20:01 -04:00
Benjamin A. Beasley
4c620ca71a Update summary and description from upstream 2022-06-25 10:19:04 -04:00
Benjamin A. Beasley
f47b6c6309 Add a man page for the chardetect command 2022-06-25 10:08:20 -04:00
Benjamin A. Beasley
fd71cc4645 Correct License from LGPLv2 to LGPLv2+ 2022-06-25 10:01:11 -04:00
Benjamin A. Beasley
f6552e77b0 Opt in to rpmautospec 2022-06-25 09:07:01 -04:00
Python Maint
b660867530 Rebuilt for Python 3.11 2022-06-13 17:09:17 +02:00
Python Maint
c74715dc2b Bootstrap for Python 3.11 2022-06-13 14:58:50 +02:00
7 changed files with 58 additions and 77 deletions

4
.gitignore vendored
View file

@ -1,3 +1,7 @@
/chardet-*.tar.gz
/chardet-*/
/chardet-4.0.0-filtered.tar.xz
/chardet-5.0.0-filtered.tar.xz
/chardet-5.1.0-filtered.tar.xz
/chardet-5.2.0-filtered.tar.xz
/chardet-5.2.0-filtered.tar.zst

View file

@ -1,3 +1,9 @@
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 4.0.0-7
- Rebuilt for Python 3.11
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 4.0.0-6
- Bootstrap for Python 3.11
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

View file

@ -19,5 +19,11 @@ File whose encoding we would like to determine.
.B \-h\fR, \fB\-\-help
show a help message and exit
.TP
.B \-\-minimal
Print only the encoding to standard output
.TP
.B \-l\fR, \fB\-\-legacy
Rename legacy encodings to more modern ones.
.TP
.B \-\-version
show program\(cqs version number and exit

View file

@ -26,9 +26,23 @@ ARCHIVE="$(find . -mindepth 1 -maxdepth 1 -type f -name '*.tar.gz' -print -quit)
echo "--> Extracting: $(basename "${ARCHIVE}")" 1>&2
tar -xzf "${ARCHIVE}"
echo '--> Removing tests due to licensing issues' 1>&2
rm -rvf */tests/
FILTERED="$(basename "${ARCHIVE}" .tar.gz)-filtered.tar.xz"
TARDIR="$(basename "${ARCHIVE}" '.tar.gz')"
MTIME="$(stat -c '%Y' "${TARDIR}")"
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
tar -c "${FILTERED}" */ | xz -9e > "${FILTERED}"
# https://www.gnu.org/software/tar/manual/html_section/Reproducibility.html
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}"
echo 'Done.' 1>&2

11
python-chardet.rpmlintrc Normal file
View file

@ -0,0 +1,11 @@
# 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 ")

View file

@ -1,23 +1,11 @@
# 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_without doc_pdf
Name: python-chardet
Version: 4.0.0
Version: 5.2.0
Release: %autorelease
Summary: Python character encoding detector
# The entire source, after tests/ are filtered, is LGPLv2+. See the comment
# above Source0 for more details on tests/.
#
# See also:
# clarify Trove license classifier
# https://github.com/chardet/chardet/issues/162
# Clarify LGPL version in License trove classifier
# https://github.com/chardet/chardet/pull/255
License: LGPLv2+
# The entire source, after tests/ are filtered, is LGPL-2.0-or-later. See the
# comment above Source0 for more details on tests/.
License: LGPL-2.0-or-later
URL: https://github.com/chardet/chardet
# A filtered source tarball, obtained by (see Source1):
#
@ -28,25 +16,16 @@ URL: https://github.com/chardet/chardet
#
# problematic licensing of /tests?
# https://github.com/chardet/chardet/issues/231
Source0: chardet-%{version}-filtered.tar.xz
Source0: chardet-%{version}-filtered.tar.zst
Source1: get_source
# Hand-written for Fedora in groff_man(7) format based on --help output
Source2: chardetect.1
BuildSystem: pyproject
BuildOption(install): -l chardet
BuildArch: noarch
BuildRequires: python3-devel
%if %{with doc_pdf}
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
@ -74,65 +53,26 @@ 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 -p1 -n chardet-%{version}
# Remove useless shebangs
# https://github.com/chardet/chardet/commit/1e94b33329
grep -lr "^#\!/usr/bin/env python" chardet/ | xargs sed -i "1d"
# 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_pdf}
PYTHONPATH="${PWD}" %make_build -C docs latex SPHINXOPTS='%{?_smp_mflags}'
%make_build -C docs/_build/latex LATEXMKOPTS='-quiet'
%endif
%install
%pyproject_install
%pyproject_save_files chardet
%install -a
install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 '%{SOURCE2}'
%check
# We cannot run the upstream tests because they would require data files with
# problematic license status.
%pyproject_check_import
%files -n python3-chardet -f %{pyproject_files}
%doc README.rst
%{_bindir}/chardetect
%{_mandir}/man1/chardetect.1*
%files doc
%license LICENSE
%doc README.rst
%if %{with doc_pdf}
%doc docs/_build/latex/chardet.pdf
%endif
%changelog
%autochangelog

View file

@ -1 +1 @@
SHA512 (chardet-4.0.0-filtered.tar.xz) = 4c41d5f9311e6796a3270b5ecd63abc51e52962c97a7599e8756e82ba97998306e2e841e14da96441a63c446fa9142534bac7154579822b55882e621f3bbe2e0
SHA512 (chardet-5.2.0-filtered.tar.zst) = 410b2d62c54781f9b848ee78c659d4607bbb7f94f6117d7fa7cd5f82a50dfaf10d6e4c6dfaefa9b9a721b846c167aa12eae029debbaa66b0d830875c8ce5749c