forked from pool/python-pycurl
- exclude http2 and ssh tests if curl(-mini) doesn't support it See also bug 1042919 OBS-URL: https://build.opensuse.org/request/show/503384 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pycurl?expand=0&rev=27
107 lines
3.3 KiB
RPMSpec
107 lines
3.3 KiB
RPMSpec
#
|
|
# spec file for package python-pycurl
|
|
#
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%define oldpython python
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
Name: python-pycurl
|
|
Version: 7.43.0
|
|
Release: 0
|
|
Summary: PycURL -- cURL library module
|
|
License: LGPL-2.1+ and MIT
|
|
Group: Development/Languages/Python
|
|
Url: http://pycurl.sourceforge.net/
|
|
Source: https://files.pythonhosted.org/packages/source/p/pycurl/pycurl-%{version}.tar.gz
|
|
# PATCH-FIX-UPSTREAM remove __DATE__ and __TIME__
|
|
Patch0: pycurl-no-runtime-curlvercheck.patch
|
|
BuildRequires: %{python_module CherryPy}
|
|
BuildRequires: %{python_module bottle}
|
|
BuildRequires: %{python_module devel}
|
|
BuildRequires: %{python_module flaky}
|
|
BuildRequires: %{python_module nose}
|
|
BuildRequires: %{python_module pyflakes}
|
|
BuildRequires: %{python_module simplejson}
|
|
BuildRequires: libcurl-devel >= 7.19.0
|
|
BuildRequires: openssl-devel
|
|
BuildRequires: python-rpm-macros
|
|
Requires: python-CherryPy
|
|
Requires: python-bottle
|
|
Requires: python-simplejson
|
|
%ifpython2
|
|
Provides: %{oldpython}-curl = %{version}
|
|
Obsoletes: %{oldpython}-curl < %{version}
|
|
%endif
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
%python_subpackages
|
|
|
|
%description
|
|
This module provides bindings for the cURL library.
|
|
|
|
%package -n %{name}-doc
|
|
Summary: Documentation for python-curl
|
|
Group: Development/Libraries/Python
|
|
Requires: %{name} = %{version}
|
|
Provides: %{python_module pycurl-doc = %{version}}
|
|
BuildArch: noarch
|
|
|
|
%description -n %{name}-doc
|
|
This module provides bindings for the cURL library.
|
|
|
|
This package contains documentation and examples.
|
|
|
|
%prep
|
|
%setup -q -n pycurl-%{version}
|
|
%patch0 -p1
|
|
|
|
%build
|
|
export CFLAGS="%{optflags}"
|
|
%python_build --with-ssl
|
|
|
|
%install
|
|
%python_install
|
|
rm -rf %{buildroot}%{_datadir}/doc # Remove wrongly installed junk
|
|
|
|
%check
|
|
# taken from "make test" because we only need to run nosetests,
|
|
# not the rest of the mess in the upstream runner
|
|
pushd tests/fake-curl/libcurl
|
|
rm -f *.so
|
|
make
|
|
popd
|
|
# exclude certain tests
|
|
test_flags='!online'
|
|
if ! pkg-config --variable=supported_features libcurl|grep -qw HTTP2; then
|
|
test_flags="$test_flags,\!http2"
|
|
fi
|
|
if ! pkg-config --variable=supported_protocols libcurl|grep -qw SCP; then
|
|
test_flags="$test_flags,\!ssh"
|
|
fi
|
|
%{python_expand PYTHONPATH=$(ls -d build/lib.*) \
|
|
nosetests-%$python_bin_suffix --with-flaky -a "$test_flags"}
|
|
|
|
%files %{python_files}
|
|
%defattr(-,root,root,-)
|
|
%doc AUTHORS ChangeLog COPYING-LGPL COPYING-MIT README.rst
|
|
%{python_sitearch}/*
|
|
|
|
%files -n %{name}-doc
|
|
%defattr(-,root,root)
|
|
%doc examples doc/*.rst
|
|
|
|
%changelog
|