Sync from SUSE:SLFO:Main python-kiwi revision 23011a2156956466466f0be5dd163708

This commit is contained in:
Adrian Schröter 2024-07-03 10:54:15 +02:00
parent 5c339ed66c
commit 3d51d177aa
5 changed files with 1791 additions and 87 deletions

View File

@ -3,28 +3,34 @@
pkgname=('python-kiwi' 'kiwi-man-pages' 'dracut-kiwi-lib' 'dracut-kiwi-oem-repart' 'dracut-kiwi-oem-dump' 'dracut-kiwi-live' 'dracut-kiwi-overlay') pkgname=('python-kiwi' 'kiwi-man-pages' 'dracut-kiwi-lib' 'dracut-kiwi-oem-repart' 'dracut-kiwi-oem-dump' 'dracut-kiwi-live' 'dracut-kiwi-overlay')
arch=(x86_64) arch=(x86_64)
pkgver=9.25.22 pkgver=10.0.21
pkgrel=0 pkgrel=0
pkgdesc="KIWI - Appliance Builder Next Generation" pkgdesc="KIWI - Appliance Builder Next Generation"
url="https://github.com/SUSE/kiwi/tarball/master" url="https://github.com/SUSE/kiwi/tarball/master"
license=('GPL3') license=('GPL3')
makedepends=(python-setuptools gcc shadow grep) makedepends=(make gcc python-build python-docopt python-installer python-lxml python-poetry-core python-requests python-setuptools python-simplejson python-sphinx python-sphinx_rtd_theme python-wheel python-yaml shadow grep)
provides=(kiwi-ng kiwi) provides=(kiwi-ng kiwi)
source=("${pkgname}.tar.gz") source=("${pkgname}.tar.gz")
changelog="${pkgname}.changes" changelog="${pkgname}.changes"
md5sums=('2e88d62046b49112f55ca259b41ebece') md5sums=('7a57fc01393c8e62449d1899cb185642')
build() { build() {
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
cd kiwi-${pkgver} cd kiwi-${pkgver}
python setup.py build # Temporarily switch things back to docopt
# FIXME: Drop this hack as soon as we can...
sed -e 's/docopt-ng.*/docopt = ">=0.6.2"/' -i pyproject.toml
make -C doc man
python3 -m build --no-isolation --wheel
} }
package_python-kiwi(){ package_python-kiwi(){
depends=(python-docopt python-simplejson python-lxml python-requests python-setuptools python-yaml grub qemu squashfs-tools gptfdisk pacman e2fsprogs xfsprogs btrfs-progs libisoburn lvm2 mtools parted multipath-tools rsync tar shadow screen kiwi-man-pages) depends=(python-docopt python-simplejson python-lxml python-requests python-setuptools python-yaml grub qemu squashfs-tools gptfdisk pacman e2fsprogs xfsprogs btrfs-progs libisoburn lvm2 mtools parted multipath-tools rsync tar shadow screen kiwi-man-pages)
optdepends=('gnupg: keyring creation for APT package manager') optdepends=('gnupg: keyring creation for APT package manager')
cd kiwi-${pkgver} cd kiwi-${pkgver}
python setup.py install --root="${pkgdir}/" --optimize=1 --skip-build python3 -m installer --destdir "${pkgdir}/" dist/*.whl
ln -sr "${pkgdir}/usr/bin/kiwi-ng" "${pkgdir}/usr/bin/kiwi" ln -sr "${pkgdir}/usr/bin/kiwi-ng" "${pkgdir}/usr/bin/kiwi"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
} }

View File

@ -0,0 +1,67 @@
From b0d850842b0c8d4c98f0486f66ffd7c6e8f1a685 Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa@opensuse.org>
Date: Thu, 2 May 2024 06:23:45 -0400
Subject: [PATCH] Revert "kiwi/bootloader: restore backward compatibility for
grub2 with bls"
For the time being, SUSE distributions cannot handle KIWI's default to use
BLS with GRUB2. Until they catch up, revert this.
This reverts commit 155d969d7752d92c90c69044bdd69be70f0a1c24.
---
kiwi/xml_state.py | 2 +-
test/unit/bootloader/config/grub2_test.py | 4 ----
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/kiwi/xml_state.py b/kiwi/xml_state.py
index eb39163cd..8c3fd45f3 100644
--- a/kiwi/xml_state.py
+++ b/kiwi/xml_state.py
@@ -1009,7 +1009,7 @@ class XMLState:
bootloader = self.get_build_type_bootloader_section()
if bootloader:
return bootloader.get_bls()
- return True
+ return False
def get_build_type_bootloader_console(self) -> List[str]:
"""
diff --git a/test/unit/bootloader/config/grub2_test.py b/test/unit/bootloader/config/grub2_test.py
index e9189a609..d81d76ec7 100644
--- a/test/unit/bootloader/config/grub2_test.py
+++ b/test/unit/bootloader/config/grub2_test.py
@@ -600,7 +600,6 @@ class TestBootLoaderConfigGrub2:
'GRUB_BACKGROUND': '/boot/grub2/themes/openSUSE/background.png',
'GRUB_CMDLINE_LINUX_DEFAULT': '"some-cmdline"',
'GRUB_DISTRIBUTOR': '"Bob"',
- 'GRUB_ENABLE_BLSCFG': 'true',
'GRUB_ENABLE_CRYPTODISK': 'y',
'GRUB_GFXMODE': '800x600',
'GRUB_SERIAL_COMMAND': '"serial --speed=38400"',
@@ -643,7 +642,6 @@ class TestBootLoaderConfigGrub2:
call('GRUB_CMDLINE_LINUX', '"root=LABEL=some-label"'),
call('GRUB_DISABLE_LINUX_UUID', 'true'),
call('GRUB_DISTRIBUTOR', '"Bob"'),
- call('GRUB_ENABLE_BLSCFG', 'true'),
call('GRUB_ENABLE_CRYPTODISK', 'y'),
call('GRUB_ENABLE_LINUX_LABEL', 'true'),
call('GRUB_GFXMODE', '800x600'),
@@ -688,7 +686,6 @@ class TestBootLoaderConfigGrub2:
call('GRUB_DISABLE_LINUX_PARTUUID', 'false'),
call('GRUB_DISABLE_LINUX_UUID', 'true'),
call('GRUB_DISTRIBUTOR', '"Bob"'),
- call('GRUB_ENABLE_BLSCFG', 'true'),
call('GRUB_ENABLE_CRYPTODISK', 'y'),
call('GRUB_GFXMODE', '800x600'),
call(
@@ -732,7 +729,6 @@ class TestBootLoaderConfigGrub2:
call('GRUB_CMDLINE_LINUX_DEFAULT', '"abcd console=tty0"'),
call('GRUB_DISABLE_LINUX_UUID', 'true'),
call('GRUB_DISTRIBUTOR', '"Bob"'),
- call('GRUB_ENABLE_BLSCFG', 'true'),
call('GRUB_ENABLE_CRYPTODISK', 'y'),
call('GRUB_ENABLE_LINUX_LABEL', 'true'),
call('GRUB_GFXMODE', '800x600'),
--
2.44.0

File diff suppressed because it is too large Load Diff

View File

@ -19,18 +19,19 @@
# If they aren't provided by a system installed macro, define them # If they aren't provided by a system installed macro, define them
%{!?_defaultdocdir: %global _defaultdocdir %{_datadir}/doc} %{!?_defaultdocdir: %global _defaultdocdir %{_datadir}/doc}
%if 0%{?suse_version} && 0%{?suse_version} < 1600
%global __python3 /usr/bin/python3.11
%global python3_pkgversion 311
%else
%{!?__python3: %global __python3 /usr/bin/python3} %{!?__python3: %global __python3 /usr/bin/python3}
%{!?python3_pkgversion:%global python3_pkgversion 3}
%endif
%if %{undefined python3_sitelib} %if %{undefined python3_sitelib}
%global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") %global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%endif %endif
%if 0%{?el7}
%global python3_pkgversion 36
%else
%{!?python3_pkgversion:%global python3_pkgversion 3}
%endif
%if 0%{?debian} || 0%{?ubuntu} %if 0%{?debian} || 0%{?ubuntu}
%global is_deb 1 %global is_deb 1
%global pygroup python %global pygroup python
@ -43,8 +44,8 @@
%endif %endif
Name: python-kiwi Name: python-kiwi
Version: 9.25.22 Version: 10.0.21
Provides: kiwi-schema = 7.5 Provides: kiwi-schema = 8.1
Release: 0 Release: 0
Url: https://github.com/OSInside/kiwi Url: https://github.com/OSInside/kiwi
Summary: KIWI - Appliance Builder Next Generation Summary: KIWI - Appliance Builder Next Generation
@ -54,12 +55,12 @@ License: GPL-3.0-or-later
Packager: Marcus Schaefer <marcus.schaefer@suse.com> Packager: Marcus Schaefer <marcus.schaefer@suse.com>
%endif %endif
Group: %{pygroup} Group: %{pygroup}
Source: %{name}.tar.gz Source0: %{name}.tar.gz
Source1: %{name}-rpmlintrc Source1: %{name}-rpmlintrc
# SUSE-specific patches (1001+)
## PATCH-FIX-OPENSUSE kiwi-revert-bls-default-for-suse.patch -- temporary until opensuse has bls
Patch1001: kiwi-revert-bls-default-for-suse.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gcc
BuildRequires: python%{python3_pkgversion}-%{develsuffix} >= 3.6
BuildRequires: python%{python3_pkgversion}-setuptools
%if 0%{?fedora} || 0%{?suse_version} %if 0%{?fedora} || 0%{?suse_version}
BuildRequires: fdupes BuildRequires: fdupes
%endif %endif
@ -69,6 +70,36 @@ BuildRequires: shadow
%if 0%{?debian} || 0%{?ubuntu} %if 0%{?debian} || 0%{?ubuntu}
BuildRequires: passwd BuildRequires: passwd
%endif %endif
# Main build requirements
BuildRequires: gcc
BuildRequires: make
BuildRequires: python%{python3_pkgversion}-%{develsuffix} >= 3.9
BuildRequires: python%{python3_pkgversion}-build
BuildRequires: python%{python3_pkgversion}-installer
BuildRequires: python%{python3_pkgversion}-poetry-core >= 1.2.0
BuildRequires: python%{python3_pkgversion}-wheel
# doc build requirements
%if ! (0%{?fedora} >= 41 || 0%{?rhel} >= 10)
BuildRequires: python%{python3_pkgversion}-docopt >= 0.6.2
%else
BuildRequires: python%{python3_pkgversion}-docopt-ng
%endif
BuildRequires: python%{python3_pkgversion}-lxml
BuildRequires: python%{python3_pkgversion}-requests
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-simplejson
%if 0%{?suse_version}
BuildRequires: python%{python3_pkgversion}-Sphinx
%else
BuildRequires: python%{python3_pkgversion}-sphinx
%endif
%if 0%{?debian} || 0%{?ubuntu}
BuildRequires: python%{python3_pkgversion}-sphinx-rtd-theme
BuildRequires: python%{python3_pkgversion}-yaml
%else
BuildRequires: python%{python3_pkgversion}-sphinx_rtd_theme
BuildRequires: python%{python3_pkgversion}-PyYAML
%endif
%description %description
The KIWI Image System provides an operating system image builder The KIWI Image System provides an operating system image builder
@ -124,7 +155,6 @@ Requires: dpkg
Requires: gnupg Requires: gnupg
%endif %endif
# tools required by kiwi # tools required by kiwi
Requires: kiwi-tools
Requires: mtools Requires: mtools
Requires: rsync Requires: rsync
Requires: tar >= 1.2.7 Requires: tar >= 1.2.7
@ -186,9 +216,6 @@ Provides: kiwi-image:iso
Requires: checkmedia Requires: checkmedia
%endif %endif
Requires: xorriso Requires: xorriso
%ifarch %{ix86} x86_64
Requires: syslinux
%endif
Requires: kiwi-systemdeps-core = %{version}-%{release} Requires: kiwi-systemdeps-core = %{version}-%{release}
Requires: kiwi-systemdeps-filesystems = %{version}-%{release} Requires: kiwi-systemdeps-filesystems = %{version}-%{release}
Requires: kiwi-systemdeps-bootloaders = %{version}-%{release} Requires: kiwi-systemdeps-bootloaders = %{version}-%{release}
@ -212,9 +239,6 @@ Recommends: gfxboot
Requires: grub2-efi-x64 Requires: grub2-efi-x64
%endif %endif
%endif %endif
%if ! (0%{?debian} || 0%{?ubuntu})
Requires: grub2
%endif
%ifarch %arm aarch64 %ifarch %arm aarch64
%if 0%{?fedora} || 0%{?rhel} %if 0%{?fedora} || 0%{?rhel}
Requires: uboot-tools Requires: uboot-tools
@ -224,7 +248,14 @@ Requires: u-boot-tools
%endif %endif
%endif %endif
%ifarch s390 s390x %ifarch s390 s390x
%if 0%{?fedora} || 0%{?rhel}
Requires: s390utils
%else
Requires: s390-tools Requires: s390-tools
%if ! (0%{?debian} || 0%{?ubuntu})
Requires: grub2
%endif
%endif
%endif %endif
Requires: kiwi-systemdeps-core = %{version}-%{release} Requires: kiwi-systemdeps-core = %{version}-%{release}
@ -365,24 +396,22 @@ Conflicts: kiwi-man-pages < %{version}
Requires: screen Requires: screen
Requires: file Requires: file
Requires: sed Requires: sed
Requires: python%{python3_pkgversion} >= 3.6 Requires: python%{python3_pkgversion} >= 3.9
%if 0%{?ubuntu} || 0%{?debian} %if 0%{?ubuntu} || 0%{?debian}
Requires: python%{python3_pkgversion}-yaml Requires: python%{python3_pkgversion}-yaml
Requires: python%{python3_pkgversion}-typing-extensions
%else %else
Requires: python%{python3_pkgversion}-PyYAML Requires: python%{python3_pkgversion}-PyYAML
%endif %endif
Requires: python%{python3_pkgversion}-simplejson Requires: python%{python3_pkgversion}-simplejson
%if ! (0%{?fedora} >= 41 || 0%{?rhel} >= 10)
Requires: python%{python3_pkgversion}-docopt Requires: python%{python3_pkgversion}-docopt
%else
Requires: python%{python3_pkgversion}-docopt-ng
%endif
Requires: python%{python3_pkgversion}-lxml Requires: python%{python3_pkgversion}-lxml
Requires: python%{python3_pkgversion}-requests Requires: python%{python3_pkgversion}-requests
Requires: python%{python3_pkgversion}-setuptools Requires: python%{python3_pkgversion}-setuptools
%if 0%{?rhel} || 0%{?fedora} Requires: python%{python3_pkgversion}-xmltodict
Requires: (python%{python3_pkgversion}-typing-extensions if python%{python3_pkgversion} < 3.8)
%endif
%if 0%{?suse_version}
Requires: (python%{python3_pkgversion}-typing_extensions if python%{python3_pkgversion} < 3.8)
%endif
%if ! (0%{?rhel} && 0%{?rhel} < 8) %if ! (0%{?rhel} && 0%{?rhel} < 8)
Recommends: kiwi-man-pages Recommends: kiwi-man-pages
%endif %endif
@ -403,17 +432,6 @@ Python 3 library of the KIWI Image System. Provides an operating system
image builder for Linux supported hardware platforms as well as for image builder for Linux supported hardware platforms as well as for
virtualization and cloud systems like Xen, KVM, VMware, EC2 and more. virtualization and cloud systems like Xen, KVM, VMware, EC2 and more.
%package -n kiwi-tools
Summary: KIWI - Collection of Boot Helper Tools
License: GPL-3.0-or-later
Group: %{sysgroup}
%description -n kiwi-tools
This package contains a small set of helper tools used for the
kiwi created initial ramdisk which is used to control the very
first boot of an appliance. The tools are not meant to be used
outside of the scope of kiwi appliance building.
%if "%{_vendor}" != "debbuild" %if "%{_vendor}" != "debbuild"
%ifarch %{ix86} x86_64 %ifarch %{ix86} x86_64
%package -n kiwi-pxeboot %package -n kiwi-pxeboot
@ -485,7 +503,11 @@ Requires: xz
Requires: device-mapper Requires: device-mapper
%endif %endif
%ifarch s390 s390x %ifarch s390 s390x
%if 0%{?fedora} || 0%{?rhel}
Requires: s390utils
%else
Requires: s390-tools Requires: s390-tools
%endif
Requires: parted Requires: parted
%endif %endif
License: GPL-3.0-or-later License: GPL-3.0-or-later
@ -619,31 +641,49 @@ Provides manual pages to describe the kiwi commands
%prep %prep
%setup -q -n kiwi-%{version} %setup -q -n kiwi-%{version}
%if 0%{?suse_version}
# Temporarily revert grub-bls default to false for SUSE distributions
%patch -P 1001 -p1
%endif
# Temporarily switch things back to docopt for everything but Fedora 41+
# FIXME: Drop this hack as soon as we can...
%if ! (0%{?fedora} >= 41 || 0%{?rhel} >= 10)
sed -e 's/docopt-ng.*/docopt = ">=0.6.2"/' -i pyproject.toml
%endif
# Drop shebang for kiwi/xml_parse.py, as we don't intend to use it # Drop shebang for kiwi/xml_parse.py, as we don't intend to use it
# as an independent script # as an independent script
sed -e "s|#!/usr/bin/env python||" -i kiwi/xml_parse.py sed -e "s|#!/usr/bin/env python||" -i kiwi/xml_parse.py
%build # Build documentation
# Build C-Tools make -C doc man
make CFLAGS="${RPM_OPT_FLAGS}" tools
# Build application wheel
%{__python3} -m build --no-isolation --wheel
%install %install
# Install Python 3 version # Install application
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} %{?is_deb:--install-layout=deb} %{__python3} -m installer --destdir %{buildroot} %{?is_deb:--no-compile-bytecode} dist/*.whl
# Install C-Tools, man-pages, completion and kiwi default configuration %if 0%{?is_deb}
make buildroot=%{buildroot}/ install # Fix where files were installed
mv %{buildroot}%{_prefix}/local/* %{buildroot}%{_prefix}
mv %{buildroot}%{_prefix}/lib/python3* %{buildroot}%{_prefix}/lib/python3
%endif
# Install man-pages, completion and kiwi default configuration
make buildroot=%{buildroot}/ python=%{__python3} install
# Install dracut modules # Install dracut modules
make buildroot=%{buildroot}/ install_dracut make buildroot=%{buildroot}/ python=%{__python3} install_dracut
# Install documentation in PDF format # Install documentation README / LICENSE
make buildroot=%{buildroot}/ docdir=%{_defaultdocdir}/ install_package_docs make buildroot=%{buildroot}/ docdir=%{_defaultdocdir}/ python=%{__python3} install_package_docs
# Create symlinks for correct binaries # Create symlinks for correct binaries
ln -sr %{buildroot}%{_bindir}/kiwi-ng %{buildroot}%{_bindir}/kiwi ln -sr %{buildroot}%{_bindir}/kiwi-ng %{buildroot}%{_bindir}/kiwi
ln -sr %{buildroot}%{_bindir}/kiwi-ng %{buildroot}%{_bindir}/kiwi-ng-3 ln -sr %{buildroot}%{_bindir}/kiwi-ng %{buildroot}%{_bindir}/kiwi-ng-3
ln -sr %{buildroot}%{_bindir}/kiwicompat %{buildroot}%{_bindir}/kiwicompat-3
%if "%{_vendor}" != "debbuild" %if "%{_vendor}" != "debbuild"
# kiwi pxeboot directory structure to be packed in kiwi-pxeboot # kiwi pxeboot directory structure to be packed in kiwi-pxeboot
@ -702,26 +742,20 @@ fi
%files -n python%{python3_pkgversion}-kiwi %files -n python%{python3_pkgversion}-kiwi
%dir %{_defaultdocdir}/python-kiwi %dir %{_defaultdocdir}/python-kiwi
%dir %{_usr}/share/kiwi
%{_bindir}/kiwi %{_bindir}/kiwi
%{_bindir}/kiwi-ng %{_bindir}/kiwi-ng
%{_bindir}/kiwicompat
%{_bindir}/kiwi-ng-3* %{_bindir}/kiwi-ng-3*
%{_bindir}/kiwicompat-3*
%{python3_sitelib}/kiwi* %{python3_sitelib}/kiwi*
%{_usr}/share/bash-completion/completions/kiwi-ng %{_usr}/share/bash-completion/completions/kiwi-ng
%{_usr}/share/kiwi/xsl_to_v74/
%{_defaultdocdir}/python-kiwi/LICENSE %{_defaultdocdir}/python-kiwi/LICENSE
%{_defaultdocdir}/python-kiwi/README %{_defaultdocdir}/python-kiwi/README
%files -n kiwi-man-pages %files -n kiwi-man-pages
%{_defaultdocdir}/python-kiwi/kiwi.pdf
%config %_sysconfdir/kiwi.yml %config %_sysconfdir/kiwi.yml
%doc %{_mandir}/man8/* %doc %{_mandir}/man8/*
%files -n kiwi-tools
%{_bindir}/dcounter
%{_bindir}/isconsole
%{_bindir}/utimer
%files -n dracut-kiwi-lib %files -n dracut-kiwi-lib
%{_usr}/lib/dracut/modules.d/99kiwi-lib %{_usr}/lib/dracut/modules.d/99kiwi-lib

BIN
python-kiwi.tar.gz (Stored with Git LFS)

Binary file not shown.