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