File saltbundlepy-kiwi.spec of Package saltbundlepy-kiwi

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

# Disable python bytecompile for all distros
# It's called explicitly in the spec
%global __brp_python_bytecompile %{nil}

# If they aren't provided by a system installed macro, define them
%{!?_defaultdocdir: %global _defaultdocdir %{_datadir}/doc}

Name:           saltbundlepy-kiwi
Version:        9.23.20
Release:        0
Summary:        KIWI - Appliance Builder Next Generation
License:        GPL-3.0-or-later
Group:          Development/Languages/Python
Source:         python-kiwi.tar.gz
Source1:        %{name}-rpmlintrc
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  %{saltbundlepy_module setuptools}
BuildRequires:  fdupes
BuildRequires:  saltbundlepy-rpm-macros
Requires:       saltbundlepy-docopt
Requires:       saltbundlepy-lxml
Requires:       saltbundlepy-pyxattr
Requires:       saltbundlepy-pyyaml
Requires:       saltbundlepy-requests
Requires:       saltbundlepy-setuptools
BuildArch:      noarch

The KIWI Image System provides an operating system image builder
for Linux supported hardware platforms as well as for virtualization
and cloud systems like Xen, KVM, VMware, EC2 and more.

%setup -q -n kiwi-%{version}

# Drop shebang for kiwi/, as we don't intend to use it
# as an independent script
sed -e "s|#!/usr/bin/env python||" -i kiwi/

# Build C-Tools
make CFLAGS="${RPM_OPT_FLAGS}" tools

# Install Python 3 version
%{python_expand \
$python install --prefix=%{_prefix} --root=%{buildroot}
$python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}
$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}
%fdupes -s %{buildroot}%{$python_sitelib}

%python_clone -a %{buildroot}%{_bindir}/kiwi-ng
%python_clone -a %{buildroot}%{_bindir}/kiwicompat

%python_install_alternative kiwi-ng
%python_install_alternative kiwicompat

%python_uninstall_alternative kiwi-ng
%python_uninstall_alternative kiwicompat

%files %{python_files}
%ghost %_sysconfdir/alternatives/kiwi-ng
%ghost %_sysconfdir/alternatives/kiwicompat

openSUSE Build Service is sponsored by