- Switch to multibuild

- Fix the sitelib/sitearch and all the dependencies

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-itemadapter?expand=0&rev=3
This commit is contained in:
Tomáš Chvátal 2020-07-08 06:54:46 +00:00 committed by Git OBS Bridge
parent c731871fc9
commit daaa1432ab
3 changed files with 30 additions and 9 deletions

3
_multibuild Normal file
View File

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

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jul 8 06:54:27 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Switch to multibuild
- Fix the sitelib/sitearch and all the dependencies
-------------------------------------------------------------------
Tue Jul 7 23:30:56 UTC 2020 - Jacob W <jacob@jacobwinski.com>

View File

@ -18,24 +18,31 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%define skip_python2 1
Name: python-itemadapter
Name: python-itemadapter%{psuffix}
Version: 0.1.0
Release: 0
Summary: Wrapper for data container objects
License: BSD-3-Clause
URL: https://github.com/scrapy/itemadapter
Source: https://github.com/scrapy/itemadapter/archive/v%{version}.tar.gz#/itemadapter-%{version}.tar.gz
BuildRequires: %{python_module Scrapy >= 2.2.0}
BuildRequires: %{python_module attrs}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools >= 40.5.0}
BuildRequires: fdupes
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: pkgconfig(libffi)
Requires: python-attrs
%if %{with test}
BuildRequires: %{python_module Scrapy >= 2.0}
BuildRequires: %{python_module attrs}
BuildRequires: %{python_module pytest >= 5.4}
%endif
%python_subpackages
%description
@ -47,20 +54,25 @@ manner, regardless of their underlying implementation.
%setup -q -n itemadapter-%{version}
%build
export CFLAGS="%{optflags}"
%python_build
%install
%if !%{with test}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%check
%if %{with test}
%pytest
%endif
%if !%{with test}
%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/itemadapter
%{python_sitelib}/itemadapter-%{version}-py*.egg-info
%endif
%changelog