From 3e1f14a8c84346b3b05696d360457d467dc877e3 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Apr 14 2016 08:15:20 +0000 Subject: Follow new packaging guidelines Signed-off-by: Igor Gnatenko https://bugzilla.redhat.com/show_bug.cgi?id=1327033 --- diff --git a/python-pycurl.spec b/python-pycurl.spec index a2aece0..f6a83af 100644 --- a/python-pycurl.spec +++ b/python-pycurl.spec @@ -1,26 +1,16 @@ -%{!?py3dir: %global py3dir %{_builddir}/python3-%{name}-%{version}-%{release}} -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +%global modname pycurl -Name: python-pycurl +Name: python-%{modname} Version: 7.43.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Python interface to libcurl -Group: Development/Languages License: LGPLv2+ or MIT URL: http://pycurl.sourceforge.net/ Source0: https://dl.bintray.com/pycurl/pycurl/pycurl-%{version}.tar.gz -BuildRequires: python-devel -BuildRequires: python3-devel BuildRequires: curl-devel >= 7.21.5 BuildRequires: openssl-devel -BuildRequires: pyflakes -BuildRequires: python-bottle -BuildRequires: python-nose -BuildRequires: python3-bottle -BuildRequires: python3-nose -BuildRequires: python3-pyflakes BuildRequires: vsftpd # During its initialization, PycURL checks that the actual libcurl version @@ -31,27 +21,51 @@ BuildRequires: vsftpd %global libcurl_sed '/^#define LIBCURL_VERSION "/!d;s/"[^"]*$//;s/.*"//;q' %global curlver_h /usr/include/curl/curlver.h %global libcurl_ver %(sed %{libcurl_sed} %{curlver_h} 2>/dev/null || echo 0) + +%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. + +%package -n python2-%{modname} +Summary: Python interface to libcurl for Python 2 +%{?python_provide:%python_provide python2-%{modname}} +BuildRequires: python2-devel +BuildRequires: python-bottle +BuildRequires: python2-nose +BuildRequires: python-pyflakes Requires: libcurl%{?_isa} >= %{libcurl_ver} -Provides: pycurl = %{version}-%{release} +Provides: %{modname} = %{version}-%{release} -%description +%description -n python2-%{modname} 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. -%package -n python3-pycurl -Summary: A Python interface to libcurl for Python 3 +Python 2 version. + +%package -n python3-%{modname} +Summary: Python interface to libcurl for Python 3 +%{?python_provide:%python_provide python3-%{modname}} +BuildRequires: python3-devel +BuildRequires: python3-bottle +BuildRequires: python3-nose +BuildRequires: python3-pyflakes +Requires: libcurl%{?_isa} >= %{libcurl_ver} -%description -n python3-pycurl +%description -n python3-%{modname} 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. +Python 3 version. + %prep -%setup0 -q -n pycurl-%{version} +%autosetup -n %{modname}-%{version} # remove binaries packaged by upstream rm -f tests/fake-curl/libcurl/*.so @@ -67,48 +81,42 @@ sed -e 's/ --show-skipped//' \ -e 's/ --with-flaky//' \ -i tests/run.sh -# copy the whole directory for the python3 build -rm -rf %{py3dir} -cp -a . %{py3dir} - %build -export CFLAGS="$RPM_OPT_FLAGS" -%{__python} setup.py build --with-nss -pushd %{py3dir} -%{__python3} setup.py build --with-nss -popd +%py2_build -- --with-nss +%py3_build -- --with-nss + +%install +%py2_install +%py3_install +rm -rf %{buildroot}%{_datadir}/doc/pycurl %check -export PYTHONPATH=$RPM_BUILD_ROOT%{python_sitearch} -make test PYTHON=%{__python} +export PYTHONPATH=%{buildroot}%{python2_sitearch} +make test PYTHON=%{__python2} NOSETESTS="nosetests-%{python2_version} -v" rm -fv tests/fake-curl/libcurl/*.so -pushd %{py3dir} -export PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitearch} + +export PYTHONPATH=%{buildroot}%{python3_sitearch} make test PYTHON=%{__python3} NOSETESTS="nosetests-%{python3_version} -v" rm -fv tests/fake-curl/libcurl/*.so -popd - -%install -%{__python} setup.py install -O1 --skip-build --root %{buildroot} -pushd %{py3dir} -%{__python3} setup.py install -O1 --skip-build --root %{buildroot} -popd -rm -rf %{buildroot}%{_datadir}/doc/pycurl %files -%{!?_licensedir:%global license %%doc} %license COPYING-LGPL COPYING-MIT %doc ChangeLog README.rst examples doc tests -%{python_sitearch}/* +%{python2_sitearch}/curl/ +%{python2_sitearch}/%{modname}.so +%{python2_sitearch}/%{modname}-%{version}-*.egg-info %files -n python3-pycurl -# TODO: find the lost COPYING file -%{!?_licensedir:%global license %%doc} %license COPYING-LGPL COPYING-MIT %doc ChangeLog README.rst examples doc tests -%{python3_sitearch}/* +%{python3_sitearch}/curl/ +%{python3_sitearch}/%{modname}.*.so +%{python3_sitearch}/%{modname}-%{version}-*.egg-info %changelog +* Thu Apr 14 2016 Igor Gnatenko - 7.43.0-3 +- Follow new packaging guidelines + * Fri Feb 26 2016 Kamil Dudka - 7.43.0-2 - require libcurl of the same architecture as python-pycurl