]> git.pld-linux.org Git - packages/python-html5-parser.git/blame - python-html5-parser.spec
rebuild with python 3.10
[packages/python-html5-parser.git] / python-html5-parser.spec
CommitLineData
baf02569
JR
1#
2# Conditional build:
3%bcond_with tests # do not perform "make test"
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6
7%define module html5-parser
8Summary: A fast, standards compliant, C based, HTML 5 parser for python
9Name: python-%{module}
95926d4a 10Version: 0.4.5
c47e636d 11Release: 7
baf02569
JR
12# html5-parser-0.4.4/gumbo/utf8.c is MIT
13License: ASL 2.0 and MIT
14Group: Libraries/Python
15Source0: https://files.pythonhosted.org/packages/source/h/%{module}/%{module}-%{version}.tar.gz
95926d4a 16# Source0-md5: 0d133a1f6d8251f5a786df5074423e29
baf02569
JR
17URL: https://pypi.python.org/pypi/%{module}
18BuildRequires: rpm-pythonprov
19BuildRequires: rpmbuild(macros) >= 1.714
20%if %{with python2}
21BuildRequires: python-modules
22BuildRequires: python-devel
23BuildRequires: python-setuptools
24BuildRequires: python-chardet
25BuildRequires: python-bs4
26BuildRequires: python-lxml >= 3.8.0
27%endif
28%if %{with python3}
29BuildRequires: python3-modules
30BuildRequires: python3-devel
31BuildRequires: python3-bs4
32BuildRequires: python3-setuptools
33BuildRequires: python3-chardet
34BuildRequires: python3-lxml >= 3.8.0
35%endif
36BuildRequires: sed >= 4.0
37# replace with other requires if defined in setup.py
38Requires: python-modules
39BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41%description
42A fast, standards compliant, C based, HTML 5 parser for python
43
44%package -n python3-%{module}
45Summary: A fast, standards compliant, C based, HTML 5 parser for python
46Group: Libraries/Python
47Requires: python3-modules
48
49%description -n python3-%{module}
50A fast, standards compliant, C based, HTML 5 parser for python
51
52%prep
53%setup -q -n %{module}-%{version}
54
55# remove shebangs from library files
56%{__sed} -i -e '/^#!\//, 1d' src/html5_parser/*.py
57
58%{__sed} -i -e '/extra_compile_args=cargs,/d' setup.py
59
60%build
61%if %{with python2}
62%py_build %{?with_tests:test}
63%endif
64
65%if %{with python3}
66%py3_build %{?with_tests:test}
67%endif
68
69%install
70rm -rf $RPM_BUILD_ROOT
71
72%if %{with python2}
73%py_install
74
75# when files are installed in other way that standard 'setup.py
76# they need to be (re-)compiled
77# change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
78%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
79%py_comp $RPM_BUILD_ROOT%{py_sitedir}
80
81%py_postclean
82%endif
83
84%if %{with python3}
85%py3_install
86%endif
87
88%clean
89rm -rf $RPM_BUILD_ROOT
90
91%if %{with python2}
92%files -n python-%{module}
93%defattr(644,root,root,755)
94%doc README.rst
95%dir %{py_sitedir}/html5_parser
96%{py_sitedir}/html5_parser/*.py[co]
97%attr(755,root,root) %{py_sitedir}/html5_parser/*.so
98%{py_sitedir}/html5_parser-%{version}-py*.egg-info
99%endif
100
101%if %{with python3}
102%files -n python3-%{module}
103%defattr(644,root,root,755)
104%doc README.rst
105%dir %{py3_sitedir}/html5_parser
106%{py3_sitedir}/html5_parser/*.py
107%attr(755,root,root) %{py3_sitedir}/html5_parser/*.so
108%{py3_sitedir}/html5_parser/__pycache__
109%{py3_sitedir}/html5_parser-%{version}-py*.egg-info
110%endif
This page took 0.167303 seconds and 4 git commands to generate.