File saltbundlepy-distro.spec of Package saltbundlepy-distro

# spec file for package saltbundlepy-distro
# 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

%{!?license: %global license %doc}

%bcond_with     test

Name:           saltbundlepy-distro
Version:        1.5.0
Release:        0
Summary:        Linux Distribution - a Linux OS platform information API
License:        Apache-2.0
Group:          Development/Languages/Python
Patch0:         assert_locale.patch
BuildRequires:  %{saltbundlepy_module setuptools}
BuildRequires:  saltbundlepy-rpm-macros
Requires:       saltbundlepy-base
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch:      noarch
# SECTION test
%if %{with test}
BuildRequires:  %{saltbundlepy_module pytest-runner}
BuildRequires:  %{saltbundlepy_module pytest}

distro (for: Linux Distribution) provides information about the Linux distribution it runs on, such as a reliable machine-readable ID, or version information.

It is a renewed alternative implementation for Python's original platform.linux_distribution function, but it also provides much more functionality which isn't necessarily Python bound like a command-line interface.

%setup -q -n distro-%{version}
%patch0 -p1


%python_clone -a %{buildroot}%{_bindir}/distro

%if %{with test}
# Explicit settings of locale is necessary gh#nir0s/distro#223
LANG=en_US.utf8 %python_exec pytest

%python_install_alternative distro

%python_uninstall_alternative distro

%files %{python_files}
%python_alternative %{_bindir}/distro
%%license LICENSE

openSUSE Build Service is sponsored by