]>
Commit | Line | Data |
---|---|---|
39babf68 JK |
1 | # |
2 | # Conditional build: | |
6edb640d JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
39babf68 JK |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module bs4 | |
9 | Summary: beautifulsoup4 - Screen-scraping library | |
6edb640d | 10 | Summary(pl.UTF-8): beautifulsoup4 - biblioteka przechwytująca wyjście |
39babf68 | 11 | Name: python-%{module} |
f1083b46 | 12 | Version: 4.6.0 |
da6aeb57 | 13 | Release: 4 |
39babf68 JK |
14 | License: MIT |
15 | Group: Libraries/Python | |
6edb640d JB |
16 | #Source0Download: https://pypi.org/simple/beautifulsoup4/ |
17 | Source0: https://files.pythonhosted.org/packages/source/b/beautifulsoup4/beautifulsoup4-%{version}.tar.gz | |
f1083b46 | 18 | # Source0-md5: c17714d0f91a23b708a592cb3c697728 |
f3d1c76a | 19 | Patch0: test_suite.patch |
3352eb1c | 20 | Patch1: %{name}-lxml.patch |
6edb640d JB |
21 | URL: https://www.crummy.com/software/BeautifulSoup/ |
22 | BuildRequires: rpmbuild(macros) >= 1.714 | |
39babf68 JK |
23 | BuildRequires: rpm-pythonprov |
24 | %if %{with python2} | |
6edb640d | 25 | BuildRequires: python-modules >= 1:2.7 |
39babf68 JK |
26 | BuildRequires: python-setuptools |
27 | %endif | |
28 | %if %{with python3} | |
6edb640d | 29 | BuildRequires: python3-modules >= 1:3.2 |
39babf68 JK |
30 | BuildRequires: python3-setuptools |
31 | %endif | |
6edb640d JB |
32 | %if %{with doc} |
33 | BuildRequires: sphinx-pdg | |
34 | %endif | |
35 | Requires: python-modules >= 1:2.7 | |
39babf68 JK |
36 | BuildArch: noarch |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
38 | ||
39 | %description | |
40 | Beautiful Soup sits atop an HTML or XML parser, providing Pythonic | |
41 | idioms for iterating, searching, and modifying the parse tree. | |
42 | ||
6edb640d JB |
43 | %description -l pl.UTF-8 |
44 | Beautiful Soup rezyduje powyżej parsera HTML lub XML, zapewniając | |
45 | pythonowe idiomy do iterowania, wyszukiwania i modyfikowania drzewa | |
46 | analizy. | |
47 | ||
39babf68 JK |
48 | %package -n python3-%{module} |
49 | Summary: beautifulsoup4 - Screen-scraping library | |
6edb640d | 50 | Summary(pl.UTF-8): beautifulsoup4 - biblioteka przechwytująca wyjście |
39babf68 | 51 | Group: Libraries/Python |
6edb640d | 52 | Requires: python3-modules >= 1:3.2 |
39babf68 JK |
53 | |
54 | %description -n python3-%{module} | |
55 | Beautiful Soup sits atop an HTML or XML parser, providing Pythonic | |
56 | idioms for iterating, searching, and modifying the parse tree. | |
57 | ||
6edb640d JB |
58 | %description -n python3-%{module} -l pl.UTF-8 |
59 | Beautiful Soup rezyduje powyżej parsera HTML lub XML, zapewniając | |
60 | pythonowe idiomy do iterowania, wyszukiwania i modyfikowania drzewa | |
61 | analizy. | |
62 | ||
63 | %package apidocs | |
64 | Summary: API documentation for Python beautifulsoup4 module | |
65 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona beautifulsoup4 | |
66 | Group: Documentation | |
67 | ||
68 | %description apidocs | |
69 | API documentation for Python beautifulsoup4 module. | |
70 | ||
71 | %description apidocs -l pl.UTF-8 | |
72 | Dokumentacja API modułu Pythona beautifulsoup4. | |
73 | ||
39babf68 JK |
74 | %prep |
75 | %setup -q -n beautifulsoup4-%{version} | |
f3d1c76a | 76 | %patch0 -p1 |
3352eb1c | 77 | %patch1 -p1 |
39babf68 JK |
78 | |
79 | %build | |
80 | %if %{with python2} | |
f3d1c76a | 81 | %py_build %{?with_tests:test} |
39babf68 JK |
82 | %endif |
83 | ||
84 | %if %{with python3} | |
f3d1c76a | 85 | %py3_build %{?with_tests:test} |
39babf68 JK |
86 | %endif |
87 | ||
88 | %if %{with doc} | |
6edb640d | 89 | %{__make} -C doc html |
39babf68 JK |
90 | %endif |
91 | ||
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
95 | %if %{with python2} | |
f3d1c76a | 96 | %py_install |
39babf68 JK |
97 | %endif |
98 | ||
99 | %if %{with python3} | |
f3d1c76a | 100 | %py3_install |
39babf68 JK |
101 | %endif |
102 | ||
103 | %clean | |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
106 | %if %{with python2} | |
107 | %files | |
108 | %defattr(644,root,root,755) | |
6edb640d | 109 | %doc {AUTHORS,COPYING,NEWS,README,TODO}.txt |
39babf68 JK |
110 | %{py_sitescriptdir}/bs4 |
111 | %{py_sitescriptdir}/beautifulsoup4-%{version}-py*.egg-info | |
112 | %endif | |
113 | ||
114 | %if %{with python3} | |
115 | %files -n python3-%{module} | |
116 | %defattr(644,root,root,755) | |
6edb640d | 117 | %doc {AUTHORS,COPYING,NEWS,README,TODO}.txt |
39babf68 JK |
118 | %{py3_sitescriptdir}/bs4 |
119 | %{py3_sitescriptdir}/beautifulsoup4-%{version}-py*.egg-info | |
120 | %endif | |
6edb640d JB |
121 | |
122 | %if %{with doc} | |
123 | %files apidocs | |
124 | %defattr(644,root,root,755) | |
125 | %doc doc/build/html/{_images,_static,*.html,*.js} | |
126 | %endif |