]>
Commit | Line | Data |
---|---|---|
0b3864af JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | %define module mechanicalsoup | |
7 | Summary: A Python library for automating interaction with websites | |
8 | Name: python-%{module} | |
63fa5940 | 9 | Version: 0.4.0 |
b9951bc6 | 10 | Release: 8 |
0b3864af JK |
11 | License: MIT |
12 | Group: Libraries/Python | |
13 | Source0: https://pypi.python.org/packages/source/M/MechanicalSoup/MechanicalSoup-%{version}.zip | |
63fa5940 | 14 | # Source0-md5: f6eb7d7fc69fb6ce434b64a3a92c7e48 |
0b3864af | 15 | URL: https://github.com/hickford/MechanicalSoup |
1f9b9e01 | 16 | BuildRequires: rpmbuild(macros) >= 1.710 |
0b3864af JK |
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-bs4 | |
25 | Requires: python-requests | |
26 | Requires: python-six | |
27 | BuildArch: noarch | |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
30 | %description | |
31 | A Python library for automating interaction with websites. | |
32 | MechanicalSoup automatically stores and sends cookies, follows | |
33 | redirects, and can follow links and submit forms. It doesn't do | |
34 | Javascript. | |
35 | ||
36 | %package -n python3-%{module} | |
37 | Summary: A Python library for automating interaction with websites | |
38 | Group: Libraries/Python | |
39 | Requires: python3-bs4 | |
40 | Requires: python3-requests | |
41 | Requires: python3-six | |
42 | ||
43 | %description -n python3-%{module} | |
44 | A Python library for automating interaction with websites. | |
45 | MechanicalSoup automatically stores and sends cookies, follows | |
46 | redirects, and can follow links and submit forms. It doesn't do | |
47 | Javascript. | |
48 | ||
49 | %prep | |
50 | %setup -q -n MechanicalSoup-%{version} | |
51 | ||
52 | %build | |
53 | %if %{with python2} | |
608a2915 | 54 | %py_build |
0b3864af JK |
55 | %endif |
56 | ||
57 | %if %{with python3} | |
608a2915 | 58 | %py3_build |
0b3864af JK |
59 | %endif |
60 | ||
61 | %install | |
62 | rm -rf $RPM_BUILD_ROOT | |
63 | ||
64 | %if %{with python2} | |
608a2915 | 65 | %py_install |
0b3864af JK |
66 | %endif |
67 | ||
68 | %if %{with python3} | |
608a2915 | 69 | %py3_install |
0b3864af 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 | %{py_sitescriptdir}/mechanicalsoup | |
79 | %{py_sitescriptdir}/MechanicalSoup-%{version}-py*.egg-info | |
80 | %endif | |
81 | ||
82 | %if %{with python3} | |
83 | %files -n python3-%{module} | |
84 | %defattr(644,root,root,755) | |
85 | %{py3_sitescriptdir}/mechanicalsoup | |
86 | %{py3_sitescriptdir}/MechanicalSoup-%{version}-py*.egg-info | |
87 | %endif |