]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_without tests # unit tests | |
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 | |
10 | Summary(pl.UTF-8): beautifulsoup4 - biblioteka przechwytująca wyjście | |
11 | Name: python-%{module} | |
12 | Version: 4.6.0 | |
13 | Release: 4 | |
14 | License: MIT | |
15 | Group: Libraries/Python | |
16 | #Source0Download: https://pypi.org/simple/beautifulsoup4/ | |
17 | Source0: https://files.pythonhosted.org/packages/source/b/beautifulsoup4/beautifulsoup4-%{version}.tar.gz | |
18 | # Source0-md5: c17714d0f91a23b708a592cb3c697728 | |
19 | Patch0: test_suite.patch | |
20 | Patch1: %{name}-lxml.patch | |
21 | URL: https://www.crummy.com/software/BeautifulSoup/ | |
22 | BuildRequires: rpmbuild(macros) >= 1.714 | |
23 | BuildRequires: rpm-pythonprov | |
24 | %if %{with python2} | |
25 | BuildRequires: python-modules >= 1:2.7 | |
26 | BuildRequires: python-setuptools | |
27 | %endif | |
28 | %if %{with python3} | |
29 | BuildRequires: python3-modules >= 1:3.2 | |
30 | BuildRequires: python3-setuptools | |
31 | %endif | |
32 | %if %{with doc} | |
33 | BuildRequires: sphinx-pdg | |
34 | %endif | |
35 | Requires: python-modules >= 1:2.7 | |
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 | ||
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 | ||
48 | %package -n python3-%{module} | |
49 | Summary: beautifulsoup4 - Screen-scraping library | |
50 | Summary(pl.UTF-8): beautifulsoup4 - biblioteka przechwytująca wyjście | |
51 | Group: Libraries/Python | |
52 | Requires: python3-modules >= 1:3.2 | |
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 | ||
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 | ||
74 | %prep | |
75 | %setup -q -n beautifulsoup4-%{version} | |
76 | %patch0 -p1 | |
77 | %patch1 -p1 | |
78 | ||
79 | %build | |
80 | %if %{with python2} | |
81 | %py_build %{?with_tests:test} | |
82 | %endif | |
83 | ||
84 | %if %{with python3} | |
85 | %py3_build %{?with_tests:test} | |
86 | %endif | |
87 | ||
88 | %if %{with doc} | |
89 | %{__make} -C doc html | |
90 | %endif | |
91 | ||
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
95 | %if %{with python2} | |
96 | %py_install | |
97 | %endif | |
98 | ||
99 | %if %{with python3} | |
100 | %py3_install | |
101 | %endif | |
102 | ||
103 | %clean | |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
106 | %if %{with python2} | |
107 | %files | |
108 | %defattr(644,root,root,755) | |
109 | %doc {AUTHORS,COPYING,NEWS,README,TODO}.txt | |
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) | |
117 | %doc {AUTHORS,COPYING,NEWS,README,TODO}.txt | |
118 | %{py3_sitescriptdir}/bs4 | |
119 | %{py3_sitescriptdir}/beautifulsoup4-%{version}-py*.egg-info | |
120 | %endif | |
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 |