2011-07-18 16:59:43 +00:00
|
|
|
%global modulename html5lib
|
2012-02-21 17:09:29 +00:00
|
|
|
%global with_python3 1
|
2011-07-18 16:59:43 +00:00
|
|
|
|
|
|
|
Name: python-%{modulename}
|
|
|
|
Summary: A python based HTML parser/tokenizer
|
2012-02-21 17:09:29 +00:00
|
|
|
Version: 0.95
|
|
|
|
Release: 1%{?dist}
|
2011-07-18 16:59:43 +00:00
|
|
|
Group: Development/Libraries
|
|
|
|
License: MIT
|
|
|
|
URL: http://code.google.com/p/%{modulename}/
|
|
|
|
|
2012-02-21 17:09:29 +00:00
|
|
|
Source0: http://html5lib.googlecode.com/files/%{modulename}-%{version}.tar.gz
|
2011-07-18 16:59:43 +00:00
|
|
|
|
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: python-setuptools
|
2012-02-21 17:09:29 +00:00
|
|
|
BuildRequires: python2-devel
|
|
|
|
|
|
|
|
%if 1%{?with_python3}
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
BuildRequires: python-tools
|
|
|
|
BuildRequires: python3-setuptools
|
|
|
|
%endif
|
2011-07-18 16:59:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
A python based HTML parser/tokenizer based on the WHATWG HTML5
|
|
|
|
specification for maximum compatibility with major desktop web browsers.
|
|
|
|
|
2012-02-21 17:09:29 +00:00
|
|
|
%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
|
|
|
|
|
|
|
|
|
2011-07-18 16:59:43 +00:00
|
|
|
%prep
|
|
|
|
%setup -q -n %{modulename}-%{version}
|
|
|
|
|
2012-02-21 17:09:29 +00:00
|
|
|
%if 0%{?with_python3}
|
|
|
|
rm -rf %{py3dir}
|
|
|
|
cp -a . %{py3dir}
|
|
|
|
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
|
|
|
2to3 --write --nobackups %{py3dir}
|
|
|
|
%endif
|
|
|
|
|
2011-07-18 16:59:43 +00:00
|
|
|
%build
|
|
|
|
%{__python} setup.py build
|
|
|
|
|
2012-02-21 17:09:29 +00:00
|
|
|
%if 0%{?with_python3}
|
|
|
|
pushd %{py3dir}
|
|
|
|
%{__python3} setup.py build
|
|
|
|
popd
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
2011-07-18 16:59:43 +00:00
|
|
|
%install
|
2012-02-21 17:09:29 +00:00
|
|
|
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
pushd %{py3dir}
|
|
|
|
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
|
|
|
|
popd
|
|
|
|
%endif
|
|
|
|
|
2011-07-18 16:59:43 +00:00
|
|
|
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
|
|
|
|
|
|
|
|
%check
|
|
|
|
%{__python} setup.py test
|
|
|
|
|
2012-02-21 17:09:29 +00:00
|
|
|
%if 0%{?with_python3}
|
|
|
|
pushd %{py3dir}
|
|
|
|
%{__python3} setup.py test
|
|
|
|
popd
|
|
|
|
%endif
|
|
|
|
|
2011-07-18 16:59:43 +00:00
|
|
|
%files
|
2012-02-21 17:09:29 +00:00
|
|
|
%doc README
|
2011-07-18 16:59:43 +00:00
|
|
|
%{python_sitelib}/%{modulename}-*.egg-info
|
|
|
|
%{python_sitelib}/%{modulename}
|
|
|
|
|
2012-02-21 17:09:29 +00:00
|
|
|
%if 0%{?with_python3}
|
|
|
|
%files -n python3-%{modulename}
|
|
|
|
%doc README
|
|
|
|
%{python3_sitelib}/%{modulename}-*.egg-info
|
|
|
|
%{python3_sitelib}/%{modulename}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
2011-07-18 16:59:43 +00:00
|
|
|
%changelog
|
2012-02-21 17:09:29 +00:00
|
|
|
* Tue Feb 21 2012 Praveen Kumar <kumarpraveen.nitdgp@gmail.com> - 0.95-1
|
|
|
|
- Added python3 spec and updated new source
|
2012-01-14 01:46:55 +00:00
|
|
|
|
2011-07-18 16:59:43 +00:00
|
|
|
* Mon Jul 18 2011 Praveen Kumar <kumarpraveen.nitdgp@gmail.com> - 0.90-1
|
|
|
|
- Initial spec
|