]>
Commit | Line | Data |
---|---|---|
39babf68 JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without 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 bs4 | |
8 | Summary: beautifulsoup4 - Screen-scraping library | |
9 | Name: python-%{module} | |
10 | Version: 4.4.1 | |
11 | Release: 1 | |
12 | License: MIT | |
13 | Group: Libraries/Python | |
14 | Source0: https://pypi.python.org/packages/source/b/beautifulsoup4/beautifulsoup4-%{version}.tar.gz | |
15 | # Source0-md5: 8fbd9a7cac0704645fa20d1419036815 | |
f3d1c76a | 16 | Patch0: test_suite.patch |
39babf68 JK |
17 | URL: http://www.crummy.com/software/BeautifulSoup/bs4/ |
18 | BuildRequires: rpm-pythonprov | |
19 | %if %{with python2} | |
20 | BuildRequires: python-setuptools | |
21 | %endif | |
22 | %if %{with python3} | |
23 | BuildRequires: python3-setuptools | |
24 | %endif | |
25 | Requires: python-modules | |
26 | BuildArch: noarch | |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %description | |
30 | Beautiful Soup sits atop an HTML or XML parser, providing Pythonic | |
31 | idioms for iterating, searching, and modifying the parse tree. | |
32 | ||
33 | %package -n python3-%{module} | |
34 | Summary: beautifulsoup4 - Screen-scraping library | |
35 | Group: Libraries/Python | |
36 | Requires: python3-modules | |
37 | ||
38 | %description -n python3-%{module} | |
39 | Beautiful Soup sits atop an HTML or XML parser, providing Pythonic | |
40 | idioms for iterating, searching, and modifying the parse tree. | |
41 | ||
42 | %prep | |
43 | %setup -q -n beautifulsoup4-%{version} | |
f3d1c76a | 44 | %patch0 -p1 |
39babf68 JK |
45 | |
46 | %build | |
47 | %if %{with python2} | |
f3d1c76a | 48 | %py_build %{?with_tests:test} |
39babf68 JK |
49 | %endif |
50 | ||
51 | %if %{with python3} | |
f3d1c76a | 52 | %py3_build %{?with_tests:test} |
39babf68 JK |
53 | %endif |
54 | ||
55 | %if %{with doc} | |
56 | cd docs | |
57 | %{__make} -j1 html | |
58 | rm -rf _build/html/_sources | |
59 | %endif | |
60 | ||
61 | %install | |
62 | rm -rf $RPM_BUILD_ROOT | |
63 | ||
64 | %if %{with python2} | |
f3d1c76a | 65 | %py_install |
39babf68 JK |
66 | %endif |
67 | ||
68 | %if %{with python3} | |
f3d1c76a | 69 | %py3_install |
39babf68 JK |
70 | %endif |
71 | ||
72 | %clean | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %if %{with python2} | |
76 | %files | |
77 | %defattr(644,root,root,755) | |
78 | %doc {AUTHORS,NEWS,README,TODO}.txt | |
79 | %{py_sitescriptdir}/bs4 | |
80 | %{py_sitescriptdir}/beautifulsoup4-%{version}-py*.egg-info | |
81 | %endif | |
82 | ||
83 | %if %{with python3} | |
84 | %files -n python3-%{module} | |
85 | %defattr(644,root,root,755) | |
86 | %doc {AUTHORS,NEWS,README,TODO}.txt | |
87 | %{py3_sitescriptdir}/bs4 | |
88 | %{py3_sitescriptdir}/beautifulsoup4-%{version}-py*.egg-info | |
89 | %endif |