]>
Commit | Line | Data |
---|---|---|
18a06ec7 MK |
1 | # TODO: |
2 | # Seems on 64bit selenium looks for wrong arch webdriver | |
3 | # Seems to be fixed by ugly hack: | |
98e064fc AM |
4 | # [root@appserver4 /usr/share/python2.7/site-packages/selenium/webdriver/firefox]# ln -s ./amd64 x86 |
5 | ||
6 | %bcond_without python2 # CPython 2.x module | |
7 | %bcond_without python3 # CPython 3.x module | |
9b5ae0dd | 8 | |
9 | %define no_install_post_chrpath 1 | |
10 | ||
e2e55d88 | 11 | %define _rc %{nil} |
7a614ba8 | 12 | %define module selenium |
8343e994 | 13 | Summary: Python bindings for selenium |
fdc86502 | 14 | Name: python-%{module} |
98e064fc | 15 | Version: 2.47.1 |
2555f344 | 16 | Release: 5 |
fdc86502 | 17 | License: BSD-like |
18 | Group: Development/Languages/Python | |
7b47a048 | 19 | Source0: http://pypi.python.org/packages/source/s/%{module}/%{module}-%{version}%{_rc}.tar.gz |
98e064fc | 20 | # Source0-md5: 7a2e267e8ef5c221bfd6387c2ad5f3bc |
fdc86502 | 21 | URL: http://pypi.python.org/pypi/selenium/ |
98e064fc | 22 | %if %{with python2} |
fdc86502 | 23 | BuildRequires: python-distribute |
98e064fc AM |
24 | %endif |
25 | %if %{with python3} | |
26 | BuildRequires: python3-distribute | |
27 | %endif | |
fdc86502 | 28 | BuildRequires: rpm-pythonprov |
2492db2a | 29 | BuildRequires: rpmbuild(macros) >= 1.710 |
d25eb6bd | 30 | BuildRequires: unzip |
8343e994 | 31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
fdc86502 | 32 | |
33 | %description | |
8343e994 | 34 | Selenium Python Client Driver is a Python language binding for |
35 | Selenium Remote Control (version 1.0 and 2.0). | |
36 | ||
37 | Currently the remote protocol, Firefox and Chrome for Selenium 2.0 are | |
38 | supported, as well as the Selenium 1.0 bindings. As work will | |
39 | progresses we'll add more "native" drivers. | |
fdc86502 | 40 | |
98e064fc | 41 | %package -n python3-%{module} |
e63aeb73 | 42 | Summary: Python bindings for selenium |
98e064fc AM |
43 | Group: Development/Languages/Python |
44 | ||
45 | %description -n python3-%{module} | |
46 | Selenium Python Client Driver is a Python language binding for | |
47 | Selenium Remote Control (version 1.0 and 2.0). | |
48 | ||
49 | Currently the remote protocol, Firefox and Chrome for Selenium 2.0 are | |
50 | supported, as well as the Selenium 1.0 bindings. As work will | |
51 | progresses we'll add more "native" drivers. | |
52 | ||
2555f344 JR |
53 | %package -n firefox-addon-%{module} |
54 | Summary: Firefox add-on for python selenium | |
bc68d90e | 55 | Group: X11/Applications/Networking |
2555f344 | 56 | Requires: firefox >= 24.0 |
9b5ae0dd | 57 | |
2555f344 | 58 | %description -n firefox-addon-%{module} |
9b5ae0dd | 59 | Driver for python selenium. |
fdc86502 | 60 | |
61 | %prep | |
7b47a048 | 62 | %setup -q -n %{module}-%{version}%{_rc} |
fdc86502 | 63 | |
64 | %build | |
98e064fc | 65 | %if %{with python2} |
3b3909a7 | 66 | %py_build %{?with_tests:test} |
98e064fc AM |
67 | %endif |
68 | ||
69 | %if %{with python3} | |
3b3909a7 | 70 | %py3_build %{?with_tests:test} |
98e064fc | 71 | %endif |
fdc86502 | 72 | |
73 | %install | |
74 | rm -rf $RPM_BUILD_ROOT | |
98e064fc AM |
75 | |
76 | %if %{with python2} | |
3b3909a7 | 77 | %py_install |
fdc86502 | 78 | |
79 | %py_postclean | |
98e064fc AM |
80 | %endif |
81 | ||
82 | %if %{with python3} | |
3b3909a7 | 83 | %py3_install |
98e064fc | 84 | %endif |
fdc86502 | 85 | |
2555f344 JR |
86 | install -d $RPM_BUILD_ROOT%{_datadir}/firefox/browser/extensions/fxdriver@googlecode.com |
87 | unzip $RPM_BUILD_DIR/%{module}-%{version}%{_rc}/py/selenium/webdriver/firefox/webdriver.xpi -d $RPM_BUILD_ROOT%{_datadir}/firefox/browser/extensions/fxdriver@googlecode.com | |
9b5ae0dd | 88 | |
de91504e | 89 | # remove windows binaries |
2555f344 | 90 | %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/firefox/browser/extensions/fxdriver@googlecode.com/platform/WINNT_x86-msvc |
de91504e JR |
91 | # remove binaries for incorrect arch |
92 | %ifnarch %{x8664} | |
2555f344 | 93 | %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/firefox/browser/extensions/fxdriver@googlecode.com/platform/Linux_x86_64-gcc3 |
4a2fc600 | 94 | %if %{with python2} |
de91504e JR |
95 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/webdriver/firefox/amd64 |
96 | %endif | |
4a2fc600 JR |
97 | %if %{with python3} |
98 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/webdriver/firefox/amd64 | |
99 | %endif | |
100 | %endif | |
de91504e | 101 | %ifnarch %{ix86} |
2555f344 | 102 | %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/firefox/browser/extensions/fxdriver@googlecode.com/platform/Linux_x86-gcc3 |
4a2fc600 | 103 | %if %{with python2} |
de91504e JR |
104 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/webdriver/firefox/x86 |
105 | %endif | |
4a2fc600 JR |
106 | %if %{with python3} |
107 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/webdriver/firefox/x86 | |
108 | %endif | |
109 | %endif | |
de91504e | 110 | |
fdc86502 | 111 | %clean |
112 | rm -rf $RPM_BUILD_ROOT | |
113 | ||
98e064fc | 114 | %if %{with python2} |
fdc86502 | 115 | %files |
116 | %defattr(644,root,root,755) | |
c6dc03ff | 117 | #%%doc README* |
fdc86502 | 118 | %{py_sitescriptdir}/%{module} |
119 | %if "%{py_ver}" > "2.4" | |
120 | %{py_sitescriptdir}/%{module}-*.egg-info | |
121 | %endif | |
98e064fc AM |
122 | %endif |
123 | ||
124 | %if %{with python3} | |
125 | %files -n python3-%{module} | |
126 | %defattr(644,root,root,755) | |
127 | %{py3_sitescriptdir}/%{module} | |
128 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
129 | %endif | |
9b5ae0dd | 130 | |
2555f344 | 131 | %files -n firefox-addon-%{module} |
9b5ae0dd | 132 | %defattr(644,root,root,755) |
2555f344 | 133 | %{_datadir}/firefox/browser/extensions/fxdriver@googlecode.com |