]>
Commit | Line | Data |
---|---|---|
6b634dd0 JR |
1 | # TODO: |
2 | # - versions past 0.9999999 break chrome build and dependant libs (API change) | |
9ef7658b JB |
3 | # |
4 | # Conditional build: | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | %bcond_without tests # py.test tests | |
8 | # | |
f90d5fea PZ |
9 | %define module html5lib |
10 | Summary: HTML parser/tokenizer based on the WHATWG HTML5 specification | |
7d3ef1a6 | 11 | Summary(pl.UTF-8): Analizator i tokenizer HTML-a oparty na specyfikacji WHATWG HTML5 |
f90d5fea | 12 | Name: python-%{module} |
9ef7658b | 13 | Version: 0.999999999 |
6b634dd0 | 14 | Release: 0.1 |
f90d5fea PZ |
15 | License: MIT |
16 | Group: Libraries/Python | |
4b8ba435 JB |
17 | #Source0Download: https://github.com/html5lib/html5lib-python/releases |
18 | Source0: https://github.com/html5lib/html5lib-python/archive/%{version}/%{module}-%{version}.tar.gz | |
9ef7658b | 19 | # Source0-md5: a81446ef3ce3ef18f5e8e242b7072b83 |
4b8ba435 | 20 | URL: https://github.com/html5lib/ |
9ef7658b JB |
21 | %if %{with python2} |
22 | BuildRequires: python-devel >= 1:2.6 | |
23 | BuildRequires: python-setuptools >= 18.5 | |
24 | %if %{with tests} | |
25 | BuildRequires: python-flake8 | |
26 | BuildRequires: python-mock | |
27 | %if "%{py_ver}" < "2.7" | |
28 | BuildRequires: python-ordereddict | |
29 | %endif | |
30 | BuildRequires: python-pytest | |
31 | BuildRequires: python-pytest-expect >= 1.1 | |
32 | BuildRequires: python-pytest-expect < 2.0 | |
33 | BuildRequires: python-six | |
34 | BuildRequires: python-webencodings | |
35 | %endif | |
36 | %endif | |
37 | %if %{with python3} | |
38 | BuildRequires: python3-devel >= 1:3.3 | |
39 | BuildRequires: python3-setuptools >= 18.5 | |
40 | %if %{with tests} | |
41 | BuildRequires: python3-flake8 | |
42 | BuildRequires: python3-pytest | |
43 | BuildRequires: python3-pytest-expect >= 1.1 | |
44 | BuildRequires: python3-pytest-expect < 2.0 | |
45 | BuildRequires: python3-six | |
46 | BuildRequires: python3-webencodings | |
47 | %endif | |
48 | %endif | |
7d3ef1a6 | 49 | BuildRequires: rpm-pythonprov |
4b8ba435 | 50 | BuildRequires: rpmbuild(macros) >= 1.714 |
9ef7658b | 51 | Requires: python-modules >= 1:2.6 |
7d3ef1a6 | 52 | BuildArch: noarch |
f90d5fea PZ |
53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
54 | ||
55 | %description | |
7d3ef1a6 JB |
56 | HTML parser/tokenizer based on the WHATWG HTML5 specification. |
57 | ||
58 | %description -l pl.UTF-8 | |
59 | Analizator i tokenizer HTML-a oparty na specyfikacji WHATWG HTML5. | |
f90d5fea | 60 | |
9ef7658b JB |
61 | %package -n python3-%{module} |
62 | Summary: HTML parser/tokenizer based on the WHATWG HTML5 specification | |
63 | Summary(pl.UTF-8): Analizator i tokenizer HTML-a oparty na specyfikacji WHATWG HTML5 | |
64 | Group: Libraries/Python | |
65 | Requires: python3-modules >= 1:3.3 | |
66 | ||
67 | %description -n python3-%{module} | |
68 | HTML parser/tokenizer based on the WHATWG HTML5 specification. | |
69 | ||
70 | %description -n python3-%{module} -l pl.UTF-8 | |
71 | Analizator i tokenizer HTML-a oparty na specyfikacji WHATWG HTML5. | |
72 | ||
f90d5fea | 73 | %prep |
4b8ba435 | 74 | %setup -q -n %{module}-python-%{version} |
f90d5fea PZ |
75 | |
76 | %build | |
9ef7658b | 77 | %if %{with python2} |
90ae2c8f | 78 | %py_build |
9ef7658b JB |
79 | %endif |
80 | ||
81 | %if %{with python3} | |
82 | %py3_build | |
83 | %endif | |
f90d5fea PZ |
84 | |
85 | %install | |
86 | rm -rf $RPM_BUILD_ROOT | |
4b8ba435 | 87 | |
9ef7658b | 88 | %if %{with python2} |
90ae2c8f | 89 | %py_install |
f90d5fea | 90 | |
7d3ef1a6 | 91 | %py_postclean |
9ef7658b JB |
92 | %endif |
93 | ||
94 | %if %{with python3} | |
95 | %py3_install | |
96 | %endif | |
f90d5fea PZ |
97 | |
98 | %clean | |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | ||
9ef7658b | 101 | %if %{with python2} |
f90d5fea PZ |
102 | %files |
103 | %defattr(644,root,root,755) | |
9ef7658b JB |
104 | %doc AUTHORS.rst CHANGES.rst LICENSE README.rst |
105 | %{py_sitescriptdir}/html5lib-%{version}-py*.egg-info | |
106 | %{py_sitescriptdir}/html5lib | |
107 | %endif | |
108 | ||
109 | %if %{with python3} | |
110 | %files -n python3-%{module} | |
111 | %defattr(644,root,root,755) | |
112 | %doc AUTHORS.rst CHANGES.rst LICENSE README.rst | |
113 | %{py3_sitescriptdir}/html5lib-%{version}-py*.egg-info | |
114 | %{py3_sitescriptdir}/html5lib | |
115 | %endif |