%if 0%{?fedora} %global with_python3 1 %endif %global modname charade Name: python-charade Version: 1.0.3 Release: 1%{?dist} Summary: Universal encoding detector for python 2 and 3 Group: Development/Libraries License: LGPLv2 URL: http://pypi.python.org/pypi/charade Source0: http://pypi.python.org/packages/source/c/%{modname}/%{modname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel %if 0%{?with_python3} BuildRequires: python3-devel %endif %description Charade: The Universal character encoding detector Detects: - 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, ISO-2022-JP (Japanese) - EUC-KR, ISO-2022-KR (Korean) - KOI8-R, MacCyrillic, IBM855, IBM866, ISO-8859-5, windows-1251 (Cyrillic) - ISO-8859-2, windows-1250 (Hungarian) - ISO-8859-5, windows-1251 (Bulgarian) - windows-1252 (English) - ISO-8859-7, windows-1253 (Greek) - ISO-8859-8, windows-1255 (Visual and Logical Hebrew) - TIS-620 (Thai) %if 0%{?with_python3} %package -n python3-charade Summary: Universal encoding detector for python 2 and 3 Group: Development/Libraries %description -n python3-charade Charade: The Universal character encoding detector Detects: - 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, ISO-2022-JP (Japanese) - EUC-KR, ISO-2022-KR (Korean) - KOI8-R, MacCyrillic, IBM855, IBM866, ISO-8859-5, windows-1251 (Cyrillic) - ISO-8859-2, windows-1250 (Hungarian) - ISO-8859-5, windows-1251 (Bulgarian) - windows-1252 (English) - ISO-8859-7, windows-1253 (Greek) - ISO-8859-8, windows-1255 (Visual and Logical Hebrew) - TIS-620 (Thai) %endif %prep %setup -q -n %{modname}-%{version} # Remove bundled egg-info in case it exists rm -rf %{modname}.egg-info %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root=%{buildroot} cp %{buildroot}/%{_bindir}/charade %{buildroot}/%{_bindir}/python3-charade popd %endif %{__python} setup.py install -O1 --skip-build --root=%{buildroot} %check # Unfortunately, the tests can be run until upstream ships them. # https://github.com/sigmavirus24/charade/pull/14 #%{__python} test.py #%if 0%{?with_python3} #pushd %{py3dir} #%{__python3} test.py #popd #%endif %files %doc README.rst LICENSE HISTORY.rst # TODO -- include NOTES.rst in a future version %{python_sitelib}/%{modname}/ %{python_sitelib}/%{modname}-%{version}* %{_bindir}/charade %if 0%{?with_python3} %files -n python3-charade %doc README.rst LICENSE HISTORY.rst # TODO -- include NOTES.rst in a future version %{python3_sitelib}/%{modname}/ %{python3_sitelib}/%{modname}-%{version}-* %{_bindir}/python3-charade %endif %changelog * Mon Feb 11 2013 Ralph Bean - 1.0.3-1 - initial package for Fedora