File mkosi.spec of Package mkosi

#
# spec file for package mkosi
#
# 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 https://bugs.opensuse.org/
#


Name:           mkosi
Version:        21
Release:        0
Summary:        Build Legacy-Free OS Images
License:        LGPL-2.1-or-later
Group:          System/Management
URL:            https://github.com/systemd/mkosi
Source:         https://github.com/systemd/mkosi/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildArch:      noarch
ExclusiveArch:  x86_64 aarch64

Requires:       tar
Requires:       xz
Requires:       kmod
Requires:       udev
Requires:     cpio
Requires:     cryptsetup
Requires:     dosfstools
Requires:     mtools
Requires:     e2fsprogs
Requires:     erofs-utils
Requires:     gnupg
Requires:     veritysetup
Requires:     zstd
Recommends:     arch-install-scripts
Recommends:     binutils
Recommends:     edk2-ovmf
Recommends:     dnf >= 4.8.0

%if 0%{?suse_version}
%define pythons python3
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module wheel}
BuildRequires:  %{pythons}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python3 >= 3.9
Requires:       python3-pefile
Requires:       squashfs
Requires:       systemd-experimental
Requires:     btrfsprogs
Requires:     zypper
Recommends:     dpkg
Recommends:     pacman >= 6.0.1
%else
BuildRequires:  pyproject-rpm-macros
BuildRequires:  python3-devel
BuildRequires:  python3-pytest
BuildRequires:  python3dist(pexpect)
Recommends:     python3dist(argcomplete)
Requires:     python3dist(cryptography)
Requires:     python3dist(pefile)
Recommends:     python3dist(pexpect)

Requires:     systemd
Recommends:     systemd-container >= 254
Requires:     systemd-udev >= 254
Requires:     systemd-ukify >= 254
Requires:     systemd-repart >= 254
Requires:     acl
Requires:     openssl
Requires:     (dnf5 or dnf) 
Requires:     btrfs-progs
Requires:     xfsprogs
Requires:     squashfs-tools
%endif


%description
A fancy wrapper around dnf --installroot, debootstrap, pacstrap and zypper that
may generate disk images with a number of bells and whistles.

Generated images are "legacy-free". This means only GPT disk labels
(and no MBR disk labels) are supported, and only systemd based images
may be generated. Moreover, for bootable images only EFI systems are
supported (not plain MBR/BIOS).

%if 0%{?suse_version}
%prep
%setup -q

%build
%pyproject_wheel

%install
%pyproject_install
%python_expand %fdupes %{buildroot}/%{$python_sitelib}/mkosi
%else
%prep
%autosetup -p1

%generate_buildrequires
%pyproject_buildrequires
%build

%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files mkosi
%endif

%files
%doc README.md
%license LICENSES/LGPL-2.1-or-later.txt
%{_bindir}/%{name}*
%{python3_sitelib}/mkosi
%{python3_sitelib}/mkosi-*.dist-info

%changelog
openSUSE Build Service is sponsored by