Compare commits

..

4 commits

Author SHA1 Message Date
Benjamin A. Beasley
33616ead2e Correct License to LGPL-2.1-or-later 2026-02-22 10:54:42 +00:00
Benjamin A. Beasley
b2d3b9d65a Improve the man page: complete SYNOPSIS, better formatting 2026-02-22 08:09:26 +00:00
Benjamin A. Beasley
bf115efe89 Remove Obsoletes for Fedora-only upgrade path 2026-02-22 08:09:17 +00:00
Benjamin A. Beasley
29d8b20693 Update .rpmlintrc file for current rpmlint 2026-02-22 08:08:48 +00:00
6 changed files with 41 additions and 47 deletions

3
.gitignore vendored
View file

@ -5,6 +5,3 @@
/chardet-5.1.0-filtered.tar.xz
/chardet-5.2.0-filtered.tar.xz
/chardet-5.2.0-filtered.tar.zst
/chardet-6.0.0-filtered.tar.zst
/chardet-2fa72d84fdb9cb926eb1e7e40230a33b1dd81bb8-filtered.tar.zst
/chardet-6.0.0.post1-filtered.tar.zst

View file

@ -7,7 +7,6 @@
.RB [ \-h ]
.RB [ \-\-minimal ]
.RB [ \-l ]
.RB [ \-e\ \fIENCODING_ERA ]
.RB [ \-\-version ]
.RI [ input \ ...]
.SH OPTIONS
@ -28,18 +27,5 @@ Print only the encoding to standard output.
.B \-l\fR, \fB\-\-legacy
Rename legacy encodings to more modern ones.
.TP
.B \-e\fR, \fB\-\-encoding\-era\ \fIENCODING_ERA
Which era of encodings to consider
(default:
.BR MODERN_WEB ).
Choices:
.BR MODERN_WEB ,
.BR LEGACY_ISO ,
.BR LEGACY_MAC ,
.BR LEGACY_REGIONAL ,
.BR DOS ,
.BR MAINFRAME ,
.BR ALL
.TP
.B \-\-version
Show program\(cqs version number and exit.

View file

@ -18,7 +18,7 @@ TMPDIR="$(mktemp -d)"
trap "rm -rf '${TMPDIR}'" INT TERM EXIT
cd "${TMPDIR}"
URL="https://github.com/chardet/chardet/archive/${VERSION}/chardet-${VERSION}.tar.gz"
URL="$(rpm -E "%{pypi_source chardet ${VERSION}}")"
echo "--> Downloading: ${URL}" 1>&2
curl -L -O "${URL}"

View file

@ -1,4 +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,7 +1,5 @@
#global commit xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Name: python-chardet
Version: 6.0.0.post1
Version: 5.2.0
Release: %autorelease
Summary: Python character encoding detector
@ -12,41 +10,40 @@ URL: https://github.com/chardet/chardet
# A filtered source tarball, obtained by (see Source1):
#
# ./get_source %%{version}
# or
# ./get_source %%{commit}
#
# is required because the contents of tests/ are under various undocumented
# licenses and are, for the most part, not freely redistributable. See:
#
# problematic licensing of /tests?
# https://github.com/chardet/chardet/issues/231
%if %{undefined commit}
Source0: chardet-%{version}-filtered.tar.zst
%else
Source0: chardet-%{commit}-filtered.tar.zst
%endif
Source1: get_source
# Hand-written for Fedora in groff_man(7) format based on --help output
Source2: chardetect.1
BuildSystem: pyproject
BuildOption(install): --assert-license chardet
BuildArch: noarch
BuildRequires: python3-devel
%global common_description %{expand:
Chardet: The Universal Character Encoding Detector
Detects over 70 character encodings including:
Detects:
• All major Unicode encodings (UTF-8, UTF-16, UTF-32)
• Windows code pages (Windows-1250 through Windows-1258)
• ISO-8859 family (ISO-8859-1 through ISO-8859-16)
• CJK encodings (Big5, GB18030, EUC-JP, EUC-KR, Shift-JIS, and more)
• Cyrillic encodings (KOI8-R, KOI8-U, IBM866, and more)
• Mac encodings (MacRoman, MacCyrillic, and more)
• DOS/OEM code pages (CP437, CP850, CP866, and more)
• EBCDIC variants (CP037, CP500)}
• ASCII, UTF-8, UTF-16 (2 variants), UTF-32 (4 variants)
• Big5, GB2312, EUC-TW, HZ-GB-2312, ISO-2022-CN (Traditional and Simplified
Chinese)
• EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP (Japanese)
• EUC-KR, ISO-2022-KR, Johab (Korean)
• KOI8-R, MacCyrillic, IBM855, IBM866, ISO-8859-5, windows-1251 (Cyrillic)
• ISO-8859-5, windows-1251 (Bulgarian)
• ISO-8859-1, windows-1252 (Western European languages)
• ISO-8859-7, windows-1253 (Greek)
• ISO-8859-8, windows-1255 (Visual and Logical Hebrew)
• TIS-620 (Thai)
ISO-8859-2 and windows-1250 (Hungarian) probers have been temporarily
disabled.}
%description
%{common_description}
@ -59,21 +56,28 @@ Summary: %{summary}
%{common_description}
%generate_buildrequires -p
export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}'
%prep
%autosetup -n chardet-%{version}
%build -p
export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}'
%generate_buildrequires
%pyproject_buildrequires
%install -a
install -D --preserve-timestamps --mode=0644 \
--target='%{buildroot}%{_mandir}/man1' '%{SOURCE2}'
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files -l chardet
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}

View file

@ -1 +1 @@
SHA512 (chardet-6.0.0.post1-filtered.tar.zst) = 6d40f1f19006555d8e6f7f0bea4fa1b2af7350c376d8a767a44266e1a7a501cde0fcac5408ee2ef808b626b1261dc9af774ddfe783cdc18617d2767d09cecfa6
SHA512 (chardet-5.2.0-filtered.tar.zst) = 410b2d62c54781f9b848ee78c659d4607bbb7f94f6117d7fa7cd5f82a50dfaf10d6e4c6dfaefa9b9a721b846c167aa12eae029debbaa66b0d830875c8ce5749c