commit 9f54b26c4cae9a93422fcf54b11ad90118d8dfb6 Author: James Antill Date: Mon Aug 8 13:59:16 2022 -0400 Import rpm: 776bbd2cd4e94bceb523065bb57ce75f84767db0 diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..61255db --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/chardet-3.0.4.tar.gz diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..648918d --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/plans.fmf b/plans.fmf new file mode 100644 index 0000000..7a48c1a --- /dev/null +++ b/plans.fmf @@ -0,0 +1,11 @@ +discover: + - name: Smoke-tests + how: shell + tests: + - name: python-import-test + test: python3 -c 'import chardet' + require: + - python3-chardet + duration: 1m +execute: + how: tmt diff --git a/python-chardet.spec b/python-chardet.spec new file mode 100644 index 0000000..5277ed5 --- /dev/null +++ b/python-chardet.spec @@ -0,0 +1,106 @@ +%bcond_without python3 +%global pypi_name chardet +Name: python-%{pypi_name} +Version: 3.0.4 +Release: 10%{?dist} +Summary: Character encoding auto-detection in Python + +Group: Development/Languages +License: LGPLv2 +URL: https://github.com/%{pypi_name}/%{pypi_name} +Source0: https://files.pythonhosted.org/packages/source/c/%{pypi_name}/%{pypi_name}-%{version}.tar.gz + +BuildArch: noarch +BuildRequires: python2-devel, python2-setuptools + +%if %{with python3} +BuildRequires: python3-devel, python3-setuptools +%endif # with python3 + +%global _description\ +Character encoding auto-detection in Python. As\ +smart as your browser. Open source. + +%description %_description + +%package -n python2-%{pypi_name} +Summary: %summary +%{?python_provide:%python_provide python2-%{pypi_name}} + +%description -n python2-%{pypi_name} %_description + +%if %{with python3} +%package -n python3-%{pypi_name} +Summary: Character encoding auto-detection in Python 3 + +%description -n python3-%{pypi_name} +Character encoding auto-detection in Python. As +smart as your browser. Open source. + +Python 3 version. +%endif # with python3 + +%prep +%setup -q -n %{pypi_name}-%{version} +sed -ie '1d' %{pypi_name}/cli/chardetect.py + +%if %{with python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif # with python3 + +%build +%{__python2} setup.py build + +%if %{with python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif # with python3 + + +%install +# Do Python 3 first not to overwrite the entrypoint +%if %{with python3} +pushd %{py3dir} +%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +mv $RPM_BUILD_ROOT%{_bindir}/{,python3-}chardetect +popd +%endif # with python3 + +%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +mv $RPM_BUILD_ROOT%{_bindir}/chardetect{,-%{python2_version}} +ln -s chardetect-%{python2_version} $RPM_BUILD_ROOT%{_bindir}/chardetect-2 + +%files -n python2-%{pypi_name} +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc README.rst +%{python2_sitelib}/* +%{_bindir}/chardetect-2 +%{_bindir}/chardetect-%{python2_version} + +%if %{with python3} +%files -n python3-%{pypi_name} +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc README.rst +%{python3_sitelib}/* +%{_bindir}/python3-chardetect +%endif # with python3 + + +%changelog +* Thu Apr 25 2019 Tomas Orsava - 3.0.4-10 +- Bumping due to problems with modular RPM upgrade path +- Resolves: rhbz#1695587 + +* Wed Aug 08 2018 Lumír Balhar - 3.0.4-9 +- Remove unversioned binaries from python2 subpackage +- Resolves: rhbz#1613343 + +* Tue Jul 31 2018 Lumír Balhar - 3.0.4-8 +- Switch python3 conditions to bcond + +* Mon Jul 16 2018 Lumír Balhar - 3.0.4-7 +- First version for python27 module diff --git a/sources b/sources new file mode 100644 index 0000000..8329ccb --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA1 (chardet-3.0.4.tar.gz) = 4766fb07e700945a7085d073257f1f320d037ce8