14
0
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:
2018-09-10 21:28:39 +00:00
committed by Git OBS Bridge
parent 409100f1c0
commit 84540e8381
3 changed files with 36 additions and 4 deletions

3
_multibuild Normal file
View File

@@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Sep 6 12:53:06 UTC 2018 - Matěj Cepl <mcepl@suse.com>
- Switch to multibuild, so that we don't need testing BuildRequires
always.
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Aug 30 12:36:12 UTC 2018 - Tomáš Chvátal <tchvatal@suse.com> Thu Aug 30 12:36:12 UTC 2018 - Tomáš Chvátal <tchvatal@suse.com>

View File

@@ -18,7 +18,19 @@
%define oldpython python %define oldpython python
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!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 Name: python-pycurl
%endif
Version: 7.43.0.2 Version: 7.43.0.2
Release: 0 Release: 0
Summary: PycURL -- cURL library module Summary: PycURL -- cURL library module
@@ -32,14 +44,16 @@ Patch0: increase_test_timeout.diff
Patch1: pycurl-libssh.patch Patch1: pycurl-libssh.patch
# PATCH-FIX-OPENSUSE python-pycurl-7.43.0-tls-backend.patch -- do not run runtime tests to compare linked libs # 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 Patch2: python-pycurl-7.43.0-tls-backend.patch
BuildRequires: %{python_module bottle}
BuildRequires: %{python_module devel} BuildRequires: %{python_module devel}
BuildRequires: %{python_module flaky}
BuildRequires: %{python_module nose}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: libcurl-devel >= 7.19.0 BuildRequires: libcurl-devel >= 7.19.0
BuildRequires: openssl-devel BuildRequires: openssl-devel
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
%if %{with test}
BuildRequires: %{python_module bottle}
BuildRequires: %{python_module flaky}
BuildRequires: %{python_module nose}
%endif
%ifpython2 %ifpython2
Provides: %{oldpython}-curl = %{version} Provides: %{oldpython}-curl = %{version}
Obsoletes: %{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 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 %check
%if %{with test}
export PYCURL_SSL_LIBRARY=openssl export PYCURL_SSL_LIBRARY=openssl
# taken from "make test" because we only need to run nosetests, # taken from "make test" because we only need to run nosetests,
# not the rest of the mess in the upstream runner # not the rest of the mess in the upstream runner
@@ -97,11 +116,15 @@ fi
%{python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} \ %{python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} \
nosetests-%$python_bin_suffix -v --with-flaky -a "$test_flags" nosetests-%$python_bin_suffix -v --with-flaky -a "$test_flags"
} }
rm -rf %{buildroot}%{_libexecdir}/debug %{buildroot}%{_libdir}/python*
%endif # test
%files %{python_files} %files %{python_files}
%license COPYING-LGPL COPYING-MIT %license COPYING-LGPL COPYING-MIT
%doc AUTHORS ChangeLog README.rst %doc AUTHORS ChangeLog README.rst
%if ! %{with test}
%{python_sitearch}/* %{python_sitearch}/*
%endif
%files -n %{name}-doc %files -n %{name}-doc
%doc examples doc/*.rst %doc examples doc/*.rst