File saltbundlepy-packaging.spec of Package saltbundlepy-packaging

# spec file for package saltbundlepy-packaging
# Copyright (c) 2021 SUSE LLC
# 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

%{?!saltbundlepy_module:%define saltbundlepy_module() saltbundlepy-%{**}}
%define pythons saltbundlepy

%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%define psuffix %{nil}
%bcond_with test
Name:           saltbundlepy-packaging%{psuffix}
Version:        20.3
Release:        0
Summary:        Core utilities for Python packages
License:        Apache-2.0
BuildRequires:  %{saltbundlepy_module six}
BuildRequires:  fdupes
BuildRequires:  saltbundlepy-rpm-macros
#!BuildIgnore:  post-build-checks-malwarescan
Requires:       saltbundlepy-pyparsing >= 2.0.2
Requires:       saltbundlepy-six
BuildArch:      noarch
# do not add setuptools dependency, this is now a dependency
# of setuptools. Ensure that all dependencies also don't depend
# on setuptools
# (at the moment, six and pyparsing are ok)
%if %{with test}
BuildRequires:  %{saltbundlepy_module pretend}
BuildRequires:  %{saltbundlepy_module pyparsing >= 2.0.2}
BuildRequires:  %{saltbundlepy_module pytest}

Core utilities for Python packages

%setup -q -n packaging-%{version}
# sdist must provide a packaging.egg-info, used below in install phase
test -d packaging.egg-info


%if %{with test}
%endif # %%{with_test}

%if !%{with test}
# Replace distutils generated egg-info, which varies in metadata version and
# structure (single file vs directory) based on distutils, with the egg-info
# which is provided in the sdist and uses same metadata version as setuptools.
%{python_expand rm -r %{buildroot}%{$python_sitelib}/*.egg-info
cp -r packaging.egg-info %{buildroot}%{$python_sitelib}/packaging-%{version}-py%{$python_version}.egg-info
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%files %{python_files}

%endif # !%%{with_test}

openSUSE Build Service is sponsored by