SHA256
1
0
forked from pool/python-kiwi

Accepting request 1164990 from Virtualization:Appliances:Builder

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/1164990
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-kiwi?expand=0&rev=112
This commit is contained in:
Ana Guerrero 2024-04-14 09:53:32 +00:00 committed by Git OBS Bridge
commit 8e45216ec9
4 changed files with 1287 additions and 79 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')
arch=(x86_64)
pkgver=9.25.22
pkgver=10.0.10
pkgrel=0
pkgdesc="KIWI - Appliance Builder Next Generation"
url="https://github.com/SUSE/kiwi/tarball/master"
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)
source=("${pkgname}.tar.gz")
changelog="${pkgname}.changes"
md5sums=('6d27e95ce4889db4a6cd1bef7ef1284f')
md5sums=('e4843b51475af492c4e38e49a1de8cb1')
build() {
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
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(){
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')
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"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

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
%{!?_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_pkgversion:%global python3_pkgversion 3}
%endif
%if %{undefined python3_sitelib}
%global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%endif
%if 0%{?el7}
%global python3_pkgversion 36
%else
%{!?python3_pkgversion:%global python3_pkgversion 3}
%endif
%if 0%{?debian} || 0%{?ubuntu}
%global is_deb 1
%global pygroup python
@ -43,8 +44,8 @@
%endif
Name: python-kiwi
Version: 9.25.22
Provides: kiwi-schema = 7.5
Version: 10.0.10
Provides: kiwi-schema = 8.1
Release: 0
Url: https://github.com/OSInside/kiwi
Summary: KIWI - Appliance Builder Next Generation
@ -57,9 +58,6 @@ Group: %{pygroup}
Source: %{name}.tar.gz
Source1: %{name}-rpmlintrc
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}
BuildRequires: fdupes
%endif
@ -69,6 +67,32 @@ BuildRequires: shadow
%if 0%{?debian} || 0%{?ubuntu}
BuildRequires: passwd
%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
BuildRequires: python%{python3_pkgversion}-docopt >= 0.6.2
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
The KIWI Image System provides an operating system image builder
@ -124,7 +148,6 @@ Requires: dpkg
Requires: gnupg
%endif
# tools required by kiwi
Requires: kiwi-tools
Requires: mtools
Requires: rsync
Requires: tar >= 1.2.7
@ -186,9 +209,6 @@ Provides: kiwi-image:iso
Requires: checkmedia
%endif
Requires: xorriso
%ifarch %{ix86} x86_64
Requires: syslinux
%endif
Requires: kiwi-systemdeps-core = %{version}-%{release}
Requires: kiwi-systemdeps-filesystems = %{version}-%{release}
Requires: kiwi-systemdeps-bootloaders = %{version}-%{release}
@ -212,9 +232,6 @@ Recommends: gfxboot
Requires: grub2-efi-x64
%endif
%endif
%if ! (0%{?debian} || 0%{?ubuntu})
Requires: grub2
%endif
%ifarch %arm aarch64
%if 0%{?fedora} || 0%{?rhel}
Requires: uboot-tools
@ -224,7 +241,14 @@ Requires: u-boot-tools
%endif
%endif
%ifarch s390 s390x
%if 0%{?fedora} || 0%{?rhel}
Requires: s390utils
%else
Requires: s390-tools
%if ! (0%{?debian} || 0%{?ubuntu})
Requires: grub2
%endif
%endif
%endif
Requires: kiwi-systemdeps-core = %{version}-%{release}
@ -363,10 +387,9 @@ Obsoletes: python2-kiwi
Conflicts: python2-kiwi
Conflicts: kiwi-man-pages < %{version}
Requires: screen
Requires: python%{python3_pkgversion} >= 3.6
Requires: python%{python3_pkgversion} >= 3.9
%if 0%{?ubuntu} || 0%{?debian}
Requires: python%{python3_pkgversion}-yaml
Requires: python%{python3_pkgversion}-typing-extensions
%else
Requires: python%{python3_pkgversion}-PyYAML
%endif
@ -375,12 +398,7 @@ Requires: python%{python3_pkgversion}-docopt
Requires: python%{python3_pkgversion}-lxml
Requires: python%{python3_pkgversion}-requests
Requires: python%{python3_pkgversion}-setuptools
%if 0%{?rhel} || 0%{?fedora}
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
Requires: python%{python3_pkgversion}-xmltodict
%if ! (0%{?rhel} && 0%{?rhel} < 8)
Recommends: kiwi-man-pages
%endif
@ -401,17 +419,6 @@ Python 3 library of 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.
%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"
%ifarch %{ix86} x86_64
%package -n kiwi-pxeboot
@ -483,7 +490,11 @@ Requires: xz
Requires: device-mapper
%endif
%ifarch s390 s390x
%if 0%{?fedora} || 0%{?rhel}
Requires: s390utils
%else
Requires: s390-tools
%endif
Requires: parted
%endif
License: GPL-3.0-or-later
@ -615,33 +626,46 @@ Group: %{sysgroup}
Provides manual pages to describe the kiwi commands
%prep
%setup -q -n kiwi-%{version}
%autosetup -n kiwi-%{version}
# 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
# as an independent script
sed -e "s|#!/usr/bin/env python||" -i kiwi/xml_parse.py
%build
# Build C-Tools
make CFLAGS="${RPM_OPT_FLAGS}" tools
# Build documentation
make -C doc man
# Build application wheel
%{__python3} -m build --no-isolation --wheel
%install
# Install Python 3 version
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} %{?is_deb:--install-layout=deb}
# Install application
%{__python3} -m installer --destdir %{buildroot} %{?is_deb:--no-compile-bytecode} dist/*.whl
# Install C-Tools, man-pages, completion and kiwi default configuration
make buildroot=%{buildroot}/ install
%if 0%{?is_deb}
# 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
make buildroot=%{buildroot}/ install_dracut
make buildroot=%{buildroot}/ python=%{__python3} install_dracut
# Install documentation in PDF format
make buildroot=%{buildroot}/ docdir=%{_defaultdocdir}/ install_package_docs
# Install documentation README / LICENSE
make buildroot=%{buildroot}/ docdir=%{_defaultdocdir}/ python=%{__python3} install_package_docs
# Create symlinks for correct binaries
ln -sr %{buildroot}%{_bindir}/kiwi-ng %{buildroot}%{_bindir}/kiwi
ln -sr %{buildroot}%{_bindir}/kiwi-ng %{buildroot}%{_bindir}/kiwi-ng-3
ln -sr %{buildroot}%{_bindir}/kiwicompat %{buildroot}%{_bindir}/kiwicompat-3
%if "%{_vendor}" != "debbuild"
# kiwi pxeboot directory structure to be packed in kiwi-pxeboot
@ -702,24 +726,16 @@ fi
%dir %{_defaultdocdir}/python-kiwi
%{_bindir}/kiwi
%{_bindir}/kiwi-ng
%{_bindir}/kiwicompat
%{_bindir}/kiwi-ng-3*
%{_bindir}/kiwicompat-3*
%{python3_sitelib}/kiwi*
%{_usr}/share/bash-completion/completions/kiwi-ng
%{_defaultdocdir}/python-kiwi/LICENSE
%{_defaultdocdir}/python-kiwi/README
%files -n kiwi-man-pages
%{_defaultdocdir}/python-kiwi/kiwi.pdf
%config %_sysconfdir/kiwi.yml
%doc %{_mandir}/man8/*
%files -n kiwi-tools
%{_bindir}/dcounter
%{_bindir}/isconsole
%{_bindir}/utimer
%files -n dracut-kiwi-lib
%{_usr}/lib/dracut/modules.d/99kiwi-lib

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

Binary file not shown.