%global modulename html5lib %global with_python3 1 %global oversion 1.0b2 Name: python-%{modulename} Summary: A python based HTML parser/tokenizer Version: 1.0 Release: 0.b2.1%{?dist} Group: Development/Libraries License: MIT URL: https://github.com/html5lib Source0: https://pypi.python.org/packages/source/h/html5lib/html5lib-%{oversion}.tar.gz BuildArch: noarch BuildRequires: python-setuptools BuildRequires: python2-devel BuildRequires: python-nose %if 1%{?with_python3} BuildRequires: python3-setuptools BuildRequires: python3-devel BuildRequires: python3-nose BuildRequires: python-tools %endif %description A python based HTML parser/tokenizer based on the WHATWG HTML5 specification for maximum compatibility with major desktop web browsers. %if 0%{?with_python3} %package -n python3-%{modulename} Summary: A python based HTML parser/tokenizer Group: Development/Libraries %description -n python3-%{modulename} A python based HTML parser/tokenizer based on the WHATWG HTML5 specification for maximum compatibility with major desktop web browsers. %endif %prep %setup -q -n %{modulename}-%{oversion} %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} popd %endif %{__python} setup.py install -O1 --skip-build --root %{buildroot} %check nosetests %if 0%{?with_python3} pushd %{py3dir} nosetests-3.3 popd %endif %files %doc CHANGES.rst LICENSE README.rst %{python_sitelib}/%{modulename}-*.egg-info %{python_sitelib}/%{modulename} %if 0%{?with_python3} %files -n python3-%{modulename} %doc CHANGES.rst LICENSE README.rst %{python3_sitelib}/%{modulename}-*.egg-info %{python3_sitelib}/%{modulename} %endif %changelog * Sat Jun 29 2013 Terje Rosten - 1.0-0.b2.1 - 1.0b2 * Thu Feb 14 2013 Fedora Release Engineering - 0.95-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Sat Aug 04 2012 David Malcolm - 0.95-3 - rebuild for https://fedoraproject.org/wiki/Features/Python_3.3 * Sat Jul 21 2012 Fedora Release Engineering - 0.95-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Tue Feb 21 2012 Praveen Kumar - 0.95-1 - Added python3 spec and updated new source * Mon Jul 18 2011 Praveen Kumar - 0.90-1 - Initial spec