forked from pool/python-pycurl
Accepting request 634806 from home:mcepl:work
- Switch to multibuild, so that we don't need testing BuildRequires always. OBS-URL: https://build.opensuse.org/request/show/634806 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pycurl?expand=0&rev=46
This commit is contained in:
@@ -18,7 +18,19 @@
|
||||
|
||||
%define oldpython python
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
|
||||
%global flavor @BUILD_FLAVOR@%{nil}
|
||||
%if "%{flavor}" == "test"
|
||||
%define test 1
|
||||
%bcond_without test
|
||||
%else
|
||||
%bcond_with test
|
||||
%endif
|
||||
%if %{with test}
|
||||
Name: python-pycurl-%{flavor}
|
||||
%else
|
||||
Name: python-pycurl
|
||||
%endif
|
||||
Version: 7.43.0.2
|
||||
Release: 0
|
||||
Summary: PycURL -- cURL library module
|
||||
@@ -32,14 +44,16 @@ Patch0: increase_test_timeout.diff
|
||||
Patch1: pycurl-libssh.patch
|
||||
# PATCH-FIX-OPENSUSE python-pycurl-7.43.0-tls-backend.patch -- do not run runtime tests to compare linked libs
|
||||
Patch2: python-pycurl-7.43.0-tls-backend.patch
|
||||
BuildRequires: %{python_module bottle}
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module flaky}
|
||||
BuildRequires: %{python_module nose}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: libcurl-devel >= 7.19.0
|
||||
BuildRequires: openssl-devel
|
||||
BuildRequires: python-rpm-macros
|
||||
%if %{with test}
|
||||
BuildRequires: %{python_module bottle}
|
||||
BuildRequires: %{python_module flaky}
|
||||
BuildRequires: %{python_module nose}
|
||||
%endif
|
||||
%ifpython2
|
||||
Provides: %{oldpython}-curl = %{version}
|
||||
Obsoletes: %{oldpython}-curl < %{version}
|
||||
@@ -76,9 +90,14 @@ export PYCURL_SSL_LIBRARY=openssl
|
||||
|
||||
rm -rf %{buildroot}%{_datadir}/doc # Remove wrongly installed junk
|
||||
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
%{python_expand \
|
||||
$python -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}
|
||||
$python -O -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}
|
||||
%fdupes %{buildroot}%{$python_sitearch}
|
||||
}
|
||||
|
||||
%check
|
||||
%if %{with test}
|
||||
export PYCURL_SSL_LIBRARY=openssl
|
||||
# taken from "make test" because we only need to run nosetests,
|
||||
# not the rest of the mess in the upstream runner
|
||||
@@ -97,11 +116,15 @@ fi
|
||||
%{python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} \
|
||||
nosetests-%$python_bin_suffix -v --with-flaky -a "$test_flags"
|
||||
}
|
||||
rm -rf %{buildroot}%{_libexecdir}/debug %{buildroot}%{_libdir}/python*
|
||||
%endif # test
|
||||
|
||||
%files %{python_files}
|
||||
%license COPYING-LGPL COPYING-MIT
|
||||
%doc AUTHORS ChangeLog README.rst
|
||||
%if ! %{with test}
|
||||
%{python_sitearch}/*
|
||||
%endif
|
||||
|
||||
%files -n %{name}-doc
|
||||
%doc examples doc/*.rst
|
||||
|
Reference in New Issue
Block a user