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