]>
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 | |
16 | URL: http://www.crummy.com/software/BeautifulSoup/bs4/ | |
17 | BuildRequires: rpm-pythonprov | |
18 | %if %{with python2} | |
19 | BuildRequires: python-setuptools | |
20 | %endif | |
21 | %if %{with python3} | |
22 | BuildRequires: python3-setuptools | |
23 | %endif | |
24 | Requires: python-modules | |
25 | BuildArch: noarch | |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
27 | ||
28 | %description | |
29 | Beautiful Soup sits atop an HTML or XML parser, providing Pythonic | |
30 | idioms for iterating, searching, and modifying the parse tree. | |
31 | ||
32 | %package -n python3-%{module} | |
33 | Summary: beautifulsoup4 - Screen-scraping library | |
34 | Group: Libraries/Python | |
35 | Requires: python3-modules | |
36 | ||
37 | %description -n python3-%{module} | |
38 | Beautiful Soup sits atop an HTML or XML parser, providing Pythonic | |
39 | idioms for iterating, searching, and modifying the parse tree. | |
40 | ||
41 | %prep | |
42 | %setup -q -n beautifulsoup4-%{version} | |
43 | ||
44 | %build | |
45 | %if %{with python2} | |
46 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
47 | %endif | |
48 | ||
49 | %if %{with python3} | |
50 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
51 | %endif | |
52 | ||
53 | %if %{with doc} | |
54 | cd docs | |
55 | %{__make} -j1 html | |
56 | rm -rf _build/html/_sources | |
57 | %endif | |
58 | ||
59 | %install | |
60 | rm -rf $RPM_BUILD_ROOT | |
61 | ||
62 | %if %{with python2} | |
63 | %{__python} setup.py \ | |
64 | build --build-base build-2 \ | |
65 | install --skip-build \ | |
66 | --optimize=2 \ | |
67 | --root=$RPM_BUILD_ROOT | |
68 | %endif | |
69 | ||
70 | %if %{with python3} | |
71 | %{__python3} setup.py \ | |
72 | build --build-base build-3 \ | |
73 | install --skip-build \ | |
74 | --optimize=2 \ | |
75 | --root=$RPM_BUILD_ROOT | |
76 | %endif | |
77 | ||
78 | %clean | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %if %{with python2} | |
82 | %files | |
83 | %defattr(644,root,root,755) | |
84 | %doc {AUTHORS,NEWS,README,TODO}.txt | |
85 | %{py_sitescriptdir}/bs4 | |
86 | %{py_sitescriptdir}/beautifulsoup4-%{version}-py*.egg-info | |
87 | %endif | |
88 | ||
89 | %if %{with python3} | |
90 | %files -n python3-%{module} | |
91 | %defattr(644,root,root,755) | |
92 | %doc {AUTHORS,NEWS,README,TODO}.txt | |
93 | %{py3_sitescriptdir}/bs4 | |
94 | %{py3_sitescriptdir}/beautifulsoup4-%{version}-py*.egg-info | |
95 | %endif |