| 1 | %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} | 
|---|
| 2 |  | 
|---|
| 3 | Name:           python-pycurl | 
|---|
| 4 | Version:        7.19.5.1 | 
|---|
| 5 | Release:        1%{?dist} | 
|---|
| 6 | Summary:        A Python interface to libcurl | 
|---|
| 7 |  | 
|---|
| 8 | Group:          Development/Languages | 
|---|
| 9 | License:        LGPLv2+ or MIT | 
|---|
| 10 | URL:            http://pycurl.sourceforge.net/ | 
|---|
| 11 | Source0:        http://pycurl.sourceforge.net/download/pycurl-%{version}.tar.gz | 
|---|
| 12 | Patch0:         pycurl-os2.patch | 
|---|
| 13 |  | 
|---|
| 14 | #Requires:       keyutils-libs | 
|---|
| 15 | BuildRequires:  python-devel | 
|---|
| 16 | #BuildRequires:  python3-devel | 
|---|
| 17 | BuildRequires:  curl-devel >= 7.19.0 | 
|---|
| 18 | BuildRequires:  openssl-devel | 
|---|
| 19 | #BuildRequires:  python-bottle | 
|---|
| 20 | #BuildRequires:  python-cherrypy | 
|---|
| 21 | #BuildRequires:  python-nose | 
|---|
| 22 | #BuildRequires:  python3-bottle | 
|---|
| 23 | #BuildRequires:  python3-cherrypy | 
|---|
| 24 | #BuildRequires:  python3-nose | 
|---|
| 25 | #BuildRequires:  vsftpd | 
|---|
| 26 |  | 
|---|
| 27 | Requires:       libcurl >= 7.37 | 
|---|
| 28 |  | 
|---|
| 29 | Provides:       pycurl = %{version}-%{release} | 
|---|
| 30 |  | 
|---|
| 31 | %description | 
|---|
| 32 | PycURL is a Python interface to libcurl. PycURL can be used to fetch | 
|---|
| 33 | objects identified by a URL from a Python program, similar to the | 
|---|
| 34 | urllib Python module. PycURL is mature, very fast, and supports a lot | 
|---|
| 35 | of features. | 
|---|
| 36 |  | 
|---|
| 37 | %package -n python3-pycurl | 
|---|
| 38 | Summary:        A Python interface to libcurl for Python 3 | 
|---|
| 39 |  | 
|---|
| 40 | %description -n python3-pycurl | 
|---|
| 41 | PycURL is a Python interface to libcurl. PycURL can be used to fetch | 
|---|
| 42 | objects identified by a URL from a Python program, similar to the | 
|---|
| 43 | urllib Python module. PycURL is mature, very fast, and supports a lot | 
|---|
| 44 | of features. | 
|---|
| 45 |  | 
|---|
| 46 | %prep | 
|---|
| 47 | %setup0 -q -n pycurl-%{version} | 
|---|
| 48 | %patch0 -p0 -b .os2~ | 
|---|
| 49 |  | 
|---|
| 50 | # temporarily exclude failing test-cases | 
|---|
| 51 | rm -f tests/{pycurl_object_test,share_test}.py | 
|---|
| 52 |  | 
|---|
| 53 | # fails with python3 on i686 | 
|---|
| 54 | rm -f tests/post_test.py | 
|---|
| 55 |  | 
|---|
| 56 | # copy the whole directory for the python3 build | 
|---|
| 57 | #cp -a . %{py3dir} | 
|---|
| 58 |  | 
|---|
| 59 | %build | 
|---|
| 60 | export CFLAGS="$RPM_OPT_FLAGS" | 
|---|
| 61 | %{__python} setup.py build | 
|---|
| 62 | # --with-nss // YD openssl required as in curl | 
|---|
| 63 | #pushd %{py3dir} | 
|---|
| 64 | #%{__python3} setup.py build --with-nss | 
|---|
| 65 | #popd | 
|---|
| 66 |  | 
|---|
| 67 | %check | 
|---|
| 68 | #export PYTHONPATH=$RPM_BUILD_ROOT%{python_sitearch} | 
|---|
| 69 | #make test PYTHON=%{__python} | 
|---|
| 70 | #pushd %{py3dir} | 
|---|
| 71 | #export PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitearch} | 
|---|
| 72 | #make test PYTHON=%{__python3} NOSETESTS="nosetests-%{python3_version} -v" | 
|---|
| 73 | #popd | 
|---|
| 74 |  | 
|---|
| 75 | %install | 
|---|
| 76 | %{__python} setup.py install -O1 --skip-build --root %{buildroot} | 
|---|
| 77 | #pushd %{py3dir} | 
|---|
| 78 | #%{__python3} setup.py install -O1 --skip-build --root %{buildroot} | 
|---|
| 79 | #popd | 
|---|
| 80 | rm -rf %{buildroot}%{_datadir}/doc/pycurl | 
|---|
| 81 |  | 
|---|
| 82 | %files | 
|---|
| 83 | %{!?_licensedir:%global license %%doc} | 
|---|
| 84 | %license COPYING-LGPL COPYING-MIT | 
|---|
| 85 | %doc ChangeLog README.rst examples doc tests | 
|---|
| 86 | %{python_sitearch}/* | 
|---|
| 87 |  | 
|---|
| 88 | #%files -n python3-pycurl | 
|---|
| 89 | # TODO: find the lost COPYING file | 
|---|
| 90 | #%{!?_licensedir:%global license %%doc} | 
|---|
| 91 | #%license COPYING-LGPL COPYING-MIT | 
|---|
| 92 | #%doc ChangeLog README.rst examples doc tests | 
|---|
| 93 | #%{python3_sitearch}/* | 
|---|
| 94 |  | 
|---|
| 95 | %changelog | 
|---|
| 96 | * Thu Feb 05 2015 yd <yd@os2power.com> 7.19.5.1-1 | 
|---|
| 97 | - initial build. | 
|---|