]>
Commit | Line | Data |
---|---|---|
4beb96ea JB |
1 | # |
2 | # Conditional build: | |
98e064fc AM |
3 | %bcond_without python2 # CPython 2.x module |
4 | %bcond_without python3 # CPython 3.x module | |
9b5ae0dd | 5 | |
7a614ba8 | 6 | %define module selenium |
4beb96ea JB |
7 | Summary: Python bindings for Selenium |
8 | Summary(pl.UTF-8): Wiązania Pythona do Selenium | |
fdc86502 | 9 | Name: python-%{module} |
18ecbdd0 | 10 | # keep 3.x here for python2 support |
4beb96ea | 11 | Version: 3.141.0 |
5ef62748 | 12 | Release: 7 |
4beb96ea | 13 | License: Apache v2.0 |
fdc86502 | 14 | Group: Development/Languages/Python |
4beb96ea JB |
15 | #Source0Download: https://pypi.org/simple/selenium/ |
16 | Source0: https://files.pythonhosted.org/packages/source/s/selenium/%{module}-%{version}.tar.gz | |
17 | # Source0-md5: 274693e383ff507df7ee190359828c84 | |
18 | Patch0: xpi-path.patch | |
19 | Patch1: 0002-Pick-debian-location-of-chromedriver-from-chromium-d.patch | |
20 | URL: https://pypi.org/project/selenium/ | |
98e064fc | 21 | %if %{with python2} |
4beb96ea JB |
22 | BuildRequires: python-modules >= 1:2.7 |
23 | BuildRequires: python-setuptools | |
98e064fc AM |
24 | %endif |
25 | %if %{with python3} | |
4beb96ea JB |
26 | BuildRequires: python3-modules >= 1:3.4 |
27 | BuildRequires: python3-setuptools | |
98e064fc | 28 | %endif |
fdc86502 | 29 | BuildRequires: rpm-pythonprov |
4beb96ea | 30 | BuildRequires: rpmbuild(macros) >= 1.714 |
d25eb6bd | 31 | BuildRequires: unzip |
4beb96ea JB |
32 | Suggests: chromedriver |
33 | Suggests: selenium-firefoxdriver | |
bad90d2b | 34 | BuildArch: noarch |
8343e994 | 35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
fdc86502 | 36 | |
37 | %description | |
4beb96ea | 38 | Python language bindings for Selenium WebDriver. |
8343e994 | 39 | |
4beb96ea JB |
40 | The selenium package is used to automate web browser interaction from |
41 | Python. | |
42 | ||
43 | %description -l pl.UTF-8 | |
44 | Wiązania Pythona do sterownika Selenium WebDriver. | |
45 | ||
46 | Pakiet selenium służy automatyzacji interakcji z przeglądarką WWW z | |
47 | poziomu Pythona. | |
fdc86502 | 48 | |
98e064fc | 49 | %package -n python3-%{module} |
4beb96ea JB |
50 | Summary: Python bindings for Selenium |
51 | Summary(pl.UTF-8): Wiązania Pythona do Selenium | |
98e064fc | 52 | Group: Development/Languages/Python |
4beb96ea JB |
53 | Suggests: chromedriver |
54 | Suggests: selenium-firefoxdriver | |
98e064fc AM |
55 | |
56 | %description -n python3-%{module} | |
4beb96ea JB |
57 | Python language bindings for Selenium WebDriver. |
58 | ||
59 | The selenium package is used to automate web browser interaction from | |
60 | Python. | |
98e064fc | 61 | |
4beb96ea JB |
62 | %description -n python3-%{module} -l pl.UTF-8 |
63 | Wiązania Pythona do sterownika Selenium WebDriver. | |
64 | ||
65 | Pakiet selenium służy automatyzacji interakcji z przeglądarką WWW z | |
66 | poziomu Pythona. | |
98e064fc | 67 | |
fdc86502 | 68 | %prep |
4beb96ea | 69 | %setup -q -n %{module}-%{version} |
bad90d2b AM |
70 | %patch0 -p1 |
71 | %patch1 -p1 | |
fdc86502 | 72 | |
73 | %build | |
98e064fc | 74 | %if %{with python2} |
4beb96ea | 75 | %py_build |
98e064fc AM |
76 | %endif |
77 | ||
78 | %if %{with python3} | |
4beb96ea | 79 | %py3_build |
98e064fc | 80 | %endif |
fdc86502 | 81 | |
82 | %install | |
83 | rm -rf $RPM_BUILD_ROOT | |
98e064fc AM |
84 | |
85 | %if %{with python2} | |
3b3909a7 | 86 | %py_install |
fdc86502 | 87 | |
88 | %py_postclean | |
98e064fc AM |
89 | %endif |
90 | ||
91 | %if %{with python3} | |
3b3909a7 | 92 | %py3_install |
98e064fc | 93 | %endif |
fdc86502 | 94 | |
bad90d2b | 95 | # driver is in selenium-firefoxdriver.spec |
4a2fc600 | 96 | %if %{with python2} |
4beb96ea | 97 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/webdriver/firefox/webdriver.xpi |
ee516b86 | 98 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/webdriver/firefox/amd64 |
ee516b86 | 99 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/webdriver/firefox/x86 |
de91504e | 100 | %endif |
bad90d2b | 101 | |
4a2fc600 | 102 | %if %{with python3} |
4beb96ea | 103 | %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/webdriver/firefox/webdriver.xpi |
bad90d2b | 104 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/webdriver/firefox/amd64 |
ee516b86 | 105 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/webdriver/firefox/x86 |
4a2fc600 | 106 | %endif |
de91504e | 107 | |
fdc86502 | 108 | %clean |
109 | rm -rf $RPM_BUILD_ROOT | |
110 | ||
98e064fc | 111 | %if %{with python2} |
fdc86502 | 112 | %files |
113 | %defattr(644,root,root,755) | |
4beb96ea | 114 | %doc CHANGES README.rst |
fdc86502 | 115 | %{py_sitescriptdir}/%{module} |
4beb96ea | 116 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
98e064fc AM |
117 | %endif |
118 | ||
119 | %if %{with python3} | |
120 | %files -n python3-%{module} | |
121 | %defattr(644,root,root,755) | |
4beb96ea | 122 | %doc CHANGES README.rst |
98e064fc AM |
123 | %{py3_sitescriptdir}/%{module} |
124 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
125 | %endif |