%global pypi_name chardet Name: python-chardet Version: 3.0.4 Release: 1%{?_dist_release} Summary: Character encoding auto-detection in Python Summary(ja): Python で文字エンコーディングを自動検出 Group: Development/Languages License: LGPLv2 URL: https://pypi.python.org/pypi/chardet Source0: https://pypi.python.org/packages/source/c/chardet/chardet-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildArch: noarch BuildRequires: python-devel, python-setuptools, python-rpm-macros BuildRequires: python3-devel, python3-setuptools, python3-rpm-macros Vendor: Project Vine Distribution: Vine Linux %description Character encoding auto-detection in Python. As smart as your browser. Open source. %package -n python3-%{pypi_name} Summary: Character encoding auto-detection in Python 3 Summary(ja): Python で文字エンコーディングを自動検出 %description -n python3-%{pypi_name} Character encoding auto-detection in Python. As smart as your browser. Open source. %prep %setup -q -n chardet-%{version} sed -ie '1d' %{pypi_name}/cli/chardetect.py rm -rf %{py3dir} cp -a . %{py3dir} %build # Remove CFLAGS=... for noarch packages (unneeded) %{__python} setup.py build pushd %{py3dir} %{__python3} setup.py build popd %install rm -rf $RPM_BUILD_ROOT # Do Python 3 first not to overwrite the entrypoint pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT mv $RPM_BUILD_ROOT%{_bindir}/{,python3-}chardetect popd %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE %doc README.rst # For noarch packages: sitelib %{_bindir}/chardetect %{python_sitelib}/* %files -n python3-%{pypi_name} %{!?_licensedir:%global license %%doc} %license LICENSE %doc README.rst %{python3_sitelib}/* %{_bindir}/python3-chardetect %changelog * Wed Nov 28 2018 Tomohiro "Tomo-p" KATO 3.0.4-1 - new upstream release. - added python3 support. * Wed May 06 2015 Toshiharu Kudoh 2.3.0-1 - new upstream release * Sun Jan 12 2014 Yoji TOYODA 2.2.1-1 - new upstream release * Sun Apr 28 2013 Toshiharu Kudoh 2.1.1-1 - new upstream release - changed Source0 and URL * Sun Feb 19 2012 Yoji TOYODA 2.0.1-4 - rebuild with python-2.7.2 * Wed Sep 29 2010 Toshiharu Kudoh 2.0.1-3 - rebuilt with rpm-4.8.1 for pkg-config * Sat Feb 6 2010 Toshiharu Kudoh 2.0.1-2 - rebuilt with python-2.6.4 * Mon Nov 23 2009 Toshiharu Kudoh 2.0.1-1 - new upstream release - fixed Japanese summary * Mon Sep 21 2009 Toshiharu Kudoh 1.0.1-1 - initial build for VineSeed * Sun Jul 26 2009 Fedora Release Engineering - 1.0.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Mon Aug 04 2008 Kushal Das 1.0.1-1 - Initial release