From 47c1d48aefcfb141f15d9a957adc343e6bb2f979 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Aug 10 2023 12:24:57 +0000 Subject: Version 15.1 - dnf5 is recommended over dnf, because it is faster. Upstream changed the build method to pyproject, so %prep had to be adjusted. '%bcond tests' has been added to allow tests to be skipped. --- diff --git a/.gitignore b/.gitignore index a356d58..1105bd7 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ /mkosi-12.tar.gz /mkosi-13.tar.gz /mkosi-14.tar.gz +/mkosi-15.tar.gz +/mkosi-15.1.tar.gz diff --git a/mkosi.spec b/mkosi.spec index fcf91df..c44e8f0 100644 --- a/mkosi.spec +++ b/mkosi.spec @@ -1,22 +1,32 @@ Name: mkosi -Version: 14 +Version: 15.1 Release: %autorelease Summary: Create bespoke OS images -License: LGPLv2+ +License: LGPL-2.1-or-later URL: https://github.com/systemd/mkosi -Source0: https://github.com/systemd/mkosi/archive/v%{version}/%{name}-%{version}.tar.gz +Source: https://github.com/systemd/mkosi/archive/v%{version}/%{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel -BuildRequires: python3-setuptools +BuildRequires: pyproject-rpm-macros BuildRequires: python3-pytest BuildRequires: binutils BuildRequires: python3dist(pexpect) +BuildRequires: pandoc +# for tests +BuildRequires: systemd %global recoreq %{?el7:Requires}%{!?el7:Recommends} -%{recoreq}: dnf +%bcond tests 1 + +# mkosi wants the uncompressed man page to show via 'mkosi documentation' +%global __brp_compress true + +Requires: bubblewrap +Requires: systemd-repart + %{recoreq}: gnupg %{recoreq}: xz %{recoreq}: tar @@ -34,7 +44,9 @@ Recommends: cpio Recommends: zstd Recommends: python3dist(argcomplete) Recommends: python3dist(cryptography) -Recommends: python3dist(pexpect) +Recommends: (dnf5 or dnf) +%else +Recommends: dnf %endif %description @@ -42,34 +54,41 @@ A fancy wrapper around "dnf --installroot", "debootstrap", "pacman", "zypper", "emerge", and "swupd-extract" that may generate disk images with a number of bells and whistles. -Generated images are tailored to the purose. This means GPT disk labels are used -by default, though MBR disk labels are supported, and only systemd based images -may be generated. +Generated images are tailored to the purpose. This means GPT disk labels are +used and only systemd-based images may be generated. %prep %autosetup -p1 +%generate_buildrequires +%pyproject_buildrequires + %build -%py3_build +tools/make-man-page.sh + +%pyproject_wheel %install -%py3_install +%pyproject_install +%pyproject_save_files mkosi + +mkdir -p %{buildroot}%{_mandir}/man1 +ln -s -t %{buildroot}%{_mandir}/man1/ \ + ../../../..%{python3_sitelib}/mkosi/resources/mkosi.1 -%files +%files -f %pyproject_files %license LICENSE %doc README.md %_bindir/mkosi -%{python3_sitelib}/mkosi/ -%{python3_sitelib}/mkosi-%{version}-py*.egg-info/ %_mandir/man1/mkosi.1* %check -%pytest tests/ -v \ - --ignore=tests/test_config_parser.py \ - -k 'not test_copy_file' +%if %{with tests} +%pytest tests/ -v # just a smoke test for syntax or import errors -%buildroot/usr/bin/mkosi --help >/dev/null +%py3_test_envvars %{buildroot}%{_bindir}/mkosi --help >/dev/null +%endif %changelog %autochangelog diff --git a/sources b/sources index 76952bd..41249e4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (mkosi-14.tar.gz) = 33a387bda9bd74415719d9081373936ead331135fc5c17276bace1a999ec1b90e6caea37fb0fd832bc89ca75635f3dbd1ed19af7679a7d8a59c85a36120d737f +SHA512 (mkosi-15.1.tar.gz) = 3b65c6b964aa2bde12117b7b2c3e4be0ac72036a92a115f1e93e7be0b3b0aa0bd3adb753ee49865723a9bc677bc4492416caafff4fec3ffd942de78357c11608