867340
%bcond_without python3
867340
%global pypi_name chardet
867340
Name:           python-%{pypi_name}
867340
Version:        3.0.4
867340
Release:        10%{?dist}
867340
Summary:        Character encoding auto-detection in Python
867340
867340
Group:          Development/Languages
867340
License:        LGPLv2
867340
URL:            https://github.com/%{pypi_name}/%{pypi_name}
867340
Source0:        https://files.pythonhosted.org/packages/source/c/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
867340
867340
BuildArch:      noarch
867340
BuildRequires:  python2-devel, python2-setuptools
867340
867340
%if %{with python3}
867340
BuildRequires:  python3-devel, python3-setuptools
867340
%endif # with python3
867340
867340
%global _description\
867340
Character encoding auto-detection in Python. As\
867340
smart as your browser. Open source.
867340
867340
%description %_description
867340
867340
%package -n python2-%{pypi_name}
867340
Summary: %summary
867340
%{?python_provide:%python_provide python2-%{pypi_name}}
867340
867340
%description -n python2-%{pypi_name} %_description
867340
867340
%if %{with python3}
867340
%package -n python3-%{pypi_name}
867340
Summary:        Character encoding auto-detection in Python 3
867340
867340
%description -n python3-%{pypi_name}
867340
Character encoding auto-detection in Python. As 
867340
smart as your browser. Open source.
867340
867340
Python 3 version.
867340
%endif # with python3
867340
867340
%prep
867340
%setup -q -n %{pypi_name}-%{version}
867340
sed -ie '1d' %{pypi_name}/cli/chardetect.py
867340
867340
%if %{with python3}
867340
rm -rf %{py3dir}
867340
cp -a . %{py3dir}
867340
%endif # with python3
867340
867340
%build
867340
%{__python2} setup.py build
867340
867340
%if %{with python3}
867340
pushd %{py3dir}
867340
%{__python3} setup.py build
867340
popd
867340
%endif # with python3
867340
867340
867340
%install
867340
# Do Python 3 first not to overwrite the entrypoint
867340
%if %{with python3}
867340
pushd %{py3dir}
867340
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
867340
mv $RPM_BUILD_ROOT%{_bindir}/{,python3-}chardetect
867340
popd
867340
%endif # with python3
867340
867340
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
867340
mv $RPM_BUILD_ROOT%{_bindir}/chardetect{,-%{python2_version}}
867340
ln -s chardetect-%{python2_version} $RPM_BUILD_ROOT%{_bindir}/chardetect-2
867340
867340
%files -n python2-%{pypi_name}
867340
%{!?_licensedir:%global license %%doc}
867340
%license LICENSE
867340
%doc README.rst
867340
%{python2_sitelib}/*
867340
%{_bindir}/chardetect-2
867340
%{_bindir}/chardetect-%{python2_version}
867340
867340
%if %{with python3}
867340
%files -n python3-%{pypi_name}
867340
%{!?_licensedir:%global license %%doc}
867340
%license LICENSE
867340
%doc README.rst
867340
%{python3_sitelib}/*
867340
%{_bindir}/python3-chardetect
867340
%endif # with python3
867340
867340
867340
%changelog
867340
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 3.0.4-10
867340
- Bumping due to problems with modular RPM upgrade path
867340
- Resolves: rhbz#1695587
867340
867340
* Wed Aug 08 2018 Lumír Balhar <lbalhar@redhat.com> - 3.0.4-9
867340
- Remove unversioned binaries from python2 subpackage
867340
- Resolves: rhbz#1613343
867340
867340
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 3.0.4-8
867340
- Switch python3 conditions to bcond
867340
867340
* Mon Jul 16 2018 Lumír Balhar <lbalhar@redhat.com> - 3.0.4-7
867340
- First version for python27 module