%define __python /opt/freeware/bin/python %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: python-pycurl Version: 7.19.3 Release: 1 Summary: A Python interface to libcurl Group: Development/Languages License: LGPLv2+ URL: http://pycurl.sourceforge.net/ Source0: http://pycurl.sourceforge.net/download/pycurl-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python BuildRequires: curl-devel >= 7.19.0 Requires: python >= 2.7 # During its initialization, PycURL checks that the actual libcurl version # is not lower than the one used when PycURL was built. # Yes, that should be handled by library versioning (which would then get # automatically reflected by rpm). # For now, we have to reflect that dependency. %define libcurl_sed '/^#define LIBCURL_VERSION "/!d;s/"[^"]*$//;s/.*"//;q' %define curlver_h /opt/freeware/include/curl/curlver.h %define libcurl_ver %(sed %{libcurl_sed} %{curlver_h} 2>/dev/null || echo 0) Requires: curl >= %{libcurl_ver} Provides: pycurl = %{version}-%{release} %description PycURL is a Python interface to libcurl. PycURL can be used to fetch objects identified by a URL from a Python program, similar to the urllib Python module. PycURL is mature, very fast, and supports a lot of features. %prep %setup0 -q -n pycurl-%{version} chmod a-x examples/* export PYTHONPATH=/opt/freeware/lib/python27.zip:/opt/freeware/lib/python2.7:/opt/freeware/lib/python2.7/plat-aix6:/opt/freeware/lib/python2.7/lib-tk:/opt/freeware/lib/python2.7/lib-old:/opt/freeware/lib/python2.7/lib-dynload:/opt/freeware/lib/python2.7/site-packages:/opt/freeware/lib/python2.7/config %build %{__python} setup.py build %install rm -rf %{buildroot} %{__python} setup.py install -O1 --skip-build --root %{buildroot} --curl-config=/opt/freeware/bin/curl-config rm -rf %{buildroot}%{_datadir}/doc/pycurl %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc COPYING-LGPL COPYING-MIT ChangeLog INSTALL PKG-INFO examples doc tests %{python_sitearch}/* %changelog *Mon Jun 13 2016 Sangamesh Mallayya 7.19.3-1 - Rebuild with python requires.