## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 3; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec Name: mkosi Version: 25.3 Release: %autorelease Summary: Create bespoke OS images License: LGPL-2.1-or-later URL: https://github.com/systemd/mkosi Source: https://github.com/systemd/mkosi/archive/v%{version}/%{name}-%{version}.tar.gz BuildArch: noarch %bcond tests 1 # Build with OBS-specific quirks %bcond obs 0 # mkosi wants the uncompressed man page to show via 'mkosi documentation' %global __brp_compress true BuildRequires: pandoc %if %{undefined suse_version} BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros BuildRequires: python3-pytest Requires: python3 Requires: coreutils %else %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 %endif %if %{with obs} Requires: %{name}-system-deps = %{version}-%{release} %endif %if %{defined suse_version} %global bash_completions_dir %{_datadir}/bash-completion/completions %global fish_completions_dir %{_datadir}/fish/completions %global zsh_completions_dir %{_datadir}/zsh/site-functions %endif %description A fancy wrapper around "dnf --installroot", "apt", "pacman", and "zypper" that generates disk images with a number of bells and whistles. Generated images are tailored to the purpose: GPT partitions, systemd-boot or grub2, images for containers, VMs, initrd, and extensions. Mkosi can boot an image via QEMU or systemd-nspawn, or simply start a shell in chroot, burn the image to a device, connect to a running VM via ssh, extract logs and coredumps, serve an image over HTTP and more. See https://mkosi.systemd.io/ for documentation. %package initrd Summary: Build initrds locally using mkosi Requires: %{name} = %{version}-%{release} Requires: (dnf5 or dnf) %description initrd This package provides the CLI and the plugin for kernel-install to build initrds with mkosi locally. After the package is installed, the plugin can be enabled by writing 'initrd_generator=mkosi-initrd' to '/etc/kernel/install.conf'. %package addon Summary: Build PE addons locally using mkosi Requires: %{name} = %{version}-%{release} %description addon This package provides the CLI and the plugin for kernel-install to build PE addons for distribution-signed unified kernel images with mkosi locally. After the package is installed, the plugin can be enabled by adding configuration for the addon to `/etc/mkosi-addon` or `/run/mkosi-addon`. # TODO: once all supported SUSE builds can use RPM 4.20 drop this and rely # on the specpart logic %if %{defined suse_version} %package system-deps Summary: Pull in additional dependencies needed to build images Requires: %{name} = %{version}-%{release} Requires: python3-pefile Requires: tar Requires: xz Requires: zstd Requires: cpio Requires: kmod Requires: dosfstools Requires: mtools Requires: e2fsprogs Requires: erofs-utils Requires: pesign Requires: mozilla-nss-tools Requires: openssl Requires: jq Requires: createrepo Requires: distribution-gpg-keys Requires: squashfs Requires: systemd-experimental Requires: btrfsprogs Requires: zypper %description system-deps This package pulls in all the dependencies needed to build images with various filesystem types, contents and signing with mkosi. It is separate to allow the main package to be leaner. %endif %prep %autosetup -p1 -n %{name}-%{version} %if %{undefined suse_version} %generate_buildrequires %pyproject_buildrequires %endif %build tools/make-man-page.sh %pyproject_wheel bin/mkosi completion bash >mkosi.bash bin/mkosi completion fish >mkosi.fish bin/mkosi completion zsh >mkosi.zsh %install %pyproject_install %if %{undefined suse_version} %pyproject_save_files mkosi { bin/mkosi dependencies | sed -e 's/^/Recommends: /' echo "%package system-deps" echo "Summary: Pull in additional dependencies needed to build images" bin/mkosi dependencies | sed -e 's/^/Requires: /' echo "Requires: pesign" echo "%description system-deps" echo "This package pulls in all the dependencies needed to build images" echo "%files system-deps" } >%{specpartsdir}/mkosi.specpart %else # See comment about __brp_compress above export NO_BRP_STALE_LINK_ERROR=yes %python_expand %fdupes %{buildroot}/%{$python_sitelib}/mkosi %endif # Install man pages mkdir -p %{buildroot}%{_mandir}/man1 mkdir -p %{buildroot}%{_mandir}/man7 ln -s -t %{buildroot}%{_mandir}/man1/ \ ../../../..%{python3_sitelib}/mkosi/resources/man/mkosi.1 \ ../../../..%{python3_sitelib}/mkosi/resources/man/mkosi-sandbox.1 \ ../../../..%{python3_sitelib}/mkosi/resources/man/mkosi-initrd.1 \ ../../../..%{python3_sitelib}/mkosi/resources/man/mkosi-addon.1 ln -s -t %{buildroot}%{_mandir}/man7/ \ ../../../..%{python3_sitelib}/mkosi/resources/man/mkosi.news.7 # Install the kernel-install plugins install -Dt %{buildroot}%{_prefix}/lib/kernel/install.d/ \ kernel-install/50-mkosi.install mkdir -p %{buildroot}%{_prefix}/lib/mkosi-initrd mkdir -p %{buildroot}%{_sysconfdir}/mkosi-initrd install -Dt %{buildroot}%{_prefix}/lib/kernel/install.d/ \ kernel-install/51-mkosi-addon.install mkdir -p %{buildroot}%{_prefix}/lib/mkosi-addon mkdir -p %{buildroot}%{_sysconfdir}/mkosi-addon # Install shell completions install -m0644 -D mkosi.bash %{buildroot}%{bash_completions_dir}/mkosi install -m0644 -D mkosi.fish %{buildroot}%{fish_completions_dir}/mkosi.fish install -m0644 -D mkosi.zsh %{buildroot}%{zsh_completions_dir}/_mkosi %if %{undefined suse_version} %files -f %pyproject_files %else %files %{python3_sitelib}/mkosi %{python3_sitelib}/mkosi-*.dist-info %endif %license LICENSES/GPL-2.0-only.txt %license LICENSES/LGPL-2.1-or-later.txt %license LICENSES/OFL-1.1.txt %license LICENSES/PSF-2.0.txt %doc README.md %_bindir/mkosi %_bindir/mkosi-sandbox %_mandir/man1/mkosi.1* %_mandir/man7/mkosi.news.7* %_mandir/man1/mkosi-sandbox.1* %{bash_completions_dir}/mkosi %{fish_completions_dir}/mkosi.fish %{zsh_completions_dir}/_mkosi %if %{defined suse_version} %dir %{fish_completions_dir} %dir %{fish_completions_dir}/.. %dir %{zsh_completions_dir} %dir %{zsh_completions_dir}/.. %endif %files initrd %_bindir/mkosi-initrd %_mandir/man1/mkosi-initrd.1* %_prefix/lib/kernel/install.d/50-mkosi.install %ghost %dir %{_prefix}/lib/mkosi-initrd %ghost %dir %{_sysconfdir}/mkosi-initrd %if %{defined suse_version} %dir %_prefix/lib/kernel %dir %_prefix/lib/kernel/install.d %endif %files addon %_bindir/mkosi-addon %_mandir/man1/mkosi-addon.1* %_prefix/lib/kernel/install.d/51-mkosi-addon.install %ghost %dir %{_prefix}/lib/mkosi-addon %ghost %dir %{_sysconfdir}/mkosi-addon %if %{defined suse_version} %dir %_prefix/lib/kernel %dir %_prefix/lib/kernel/install.d %endif %if %{defined suse_version} %files system-deps %endif %check %if %{with tests} %pytest tests/ -v %if %{undefined suse_version} # just a smoke test for syntax or import errors %py3_test_envvars %{buildroot}%{_bindir}/mkosi --help >/dev/null %endif %endif %changelog ## START: Generated by rpmautospec * Fri Feb 14 2025 Luca Boccassi - 25.3-2 - Change spec file so that it can build on OBS for both SUSE and Fedora * Mon Feb 03 2025 Zbigniew Jędrzejewski-Szmek - 25.3-1 - Version 25.3 (rhbz#2343163) * Tue Jan 28 2025 Daan De Meyer - 25.2-2 - Generate recommended dependencies dynamically using mkosi dependencies * Fri Jan 24 2025 Daan De Meyer - 25.2-1 - Version 25.2 * Fri Jan 24 2025 Daan De Meyer - 25.1-1 - Version 25.1 - Upstream now has its own sandboxing tool mkosi-sandbox so we get rid of the dependency on bubblewrap - The Acl= option was dropped upstream so we remove the dependency on acl - depmod/modinfo are executed inside the target image now so we remove the dependency on kmod - The newly added mkosi-addon tool and kernel-install plugin are subpackaged just like mkosi-initrd. * Fri Jan 17 2025 Fedora Release Engineering - 24.3-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild * Sun Jan 05 2025 Yu Watanabe - 24.3-3 - Update comments in spec file * Sun Jan 05 2025 Yu Watanabe - 24.3-2 - Fix symlink to mkosi-initrd.1 man page * Tue Jul 30 2024 Zbigniew Jędrzejewski-Szmek - 24.3-1 - Version 24.3 * Tue Jul 30 2024 Zbigniew Jędrzejewski-Szmek - 24.2-1 - Update to 24.2 upstream release - Resolves: rhbz#2300574 - Install completion scripts * Fri Jul 26 2024 Packit - 24-1 - Update to 24 upstream release - Resolves: rhbz#2292334 * Fri Jul 26 2024 Daan De Meyer - 23.1-1 - Update to 23.1 upstream release - Resolves: rhbz#2292334 * Fri Jul 26 2024 Daan De Meyer - 22-5 - packit: Set create_sync_note to false * Thu Jul 18 2024 Fedora Release Engineering - 22-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Wed Jun 12 2024 Daan De Meyer - 22-3 - Add basic packit config * Fri Jun 07 2024 Python Maint - 22-2 - Rebuilt for Python 3.13 * Thu Mar 14 2024 Daan De Meyer - 22-1 - Version 22 * Thu Mar 07 2024 Daan De Meyer - 21-1 - Version 21 * Thu Mar 07 2024 Daan De Meyer - 20.1-8 - Remove kernel-install plugin from mkosi package * Tue Feb 20 2024 Zbigniew Jędrzejewski-Szmek - 20.1-7 - Link to the new website * Mon Feb 19 2024 Zbigniew Jędrzejewski-Szmek - 20.1-6 - Move the kernel-install plugin to a separate mkosi-initrd subpackage - This effectively replaces the standalone mkosi-initrd package. * Wed Jan 31 2024 Daan De Meyer - 20.1-4 - Install kernel-install plugin * Thu Jan 25 2024 Fedora Release Engineering - 20.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Jan 21 2024 Fedora Release Engineering - 20.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sat Jan 13 2024 Zbigniew Jędrzejewski-Szmek - 20.1-1 - Version 20.1 (rhbz#2258224) * Tue Jan 09 2024 Zbigniew Jędrzejewski-Szmek - 20-1 - Version 20 * Wed Nov 15 2023 Zbigniew Jędrzejewski-Szmek - 19-1 - Version 19 * Thu Oct 05 2023 Zbigniew Jędrzejewski-Szmek - 18-1 - Version 18 - We check if ukify is available early (rhbz#2240598) * Tue Sep 19 2023 Zbigniew Jędrzejewski-Szmek - 17.1-1 - Version 17.1 * Thu Sep 07 2023 Daan De Meyer - 16-2 - Update dependencies * Thu Sep 07 2023 Zbigniew Jędrzejewski-Szmek - 16-1 - Version 16 * Wed Aug 23 2023 Zbigniew Jędrzejewski-Szmek - 15.1-5 - Update the list of Requirements and Recommends * Sun Aug 13 2023 Leif Liddy - 15.1-2 - Require systemd version 254, recommend systemd-nspawn (rhbz#2232233) * Thu Aug 10 2023 Zbigniew Jędrzejewski-Szmek - 15.1-1 - Version 15.1 - dnf5 is recommended over dnf, because it is faster. * Thu Jul 20 2023 Fedora Release Engineering - 14-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Wed Jun 14 2023 Python Maint - 14-5 - Rebuilt for Python 3.12 * Thu Jan 19 2023 Fedora Release Engineering - 14-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Thu Oct 27 2022 Zbigniew Jędrzejewski-Szmek - 14-3 - Skip test file that fails in koji * Thu Oct 27 2022 Zbigniew Jędrzejewski-Szmek - 14-2 - Skip test that fails in koji * Thu Oct 27 2022 Zbigniew Jędrzejewski-Szmek - 14-1 - Version 14 * Thu Jul 21 2022 Fedora Release Engineering - 13-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Tue Jun 21 2022 Zbigniew Jędrzejewski-Szmek - 13-2 - Skip test that fails in koji * Tue Jun 21 2022 Zbigniew Jędrzejewski-Szmek - 13-1 - Version 13 * Mon Jun 13 2022 Python Maint - 12-4 - Rebuilt for Python 3.11 * Sun Apr 24 2022 Zbigniew Jędrzejewski-Szmek - 12-3 - Add patch to fix compatibility with python3.11-a7 (rhbz#2057363) * Thu Jan 20 2022 Fedora Release Engineering - 12-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Tue Nov 30 2021 Zbigniew Jędrzejewski-Szmek - 12-1 - Version 12 * Wed Nov 24 2021 Zbigniew Jędrzejewski-Szmek - 11-1 - Version 11 * Thu Oct 21 2021 Zbigniew Jędrzejewski-Szmek - 10-2 - Add Recommends for tools to build initrds * Fri Jul 30 2021 Zbigniew Jędrzejewski-Szmek - 10-1 - Version 10 * Thu Jul 22 2021 Fedora Release Engineering - 9-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Fri Jun 11 2021 Davide Cavalca - 9-4 - Only gate out Recommends on el7 * Fri Jun 04 2021 Python Maint - 9-3 - Rebuilt for Python 3.10 * Tue Jan 26 2021 Fedora Release Engineering - 9-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Sat Jan 2 2021 Zbigniew Jędrzejewski-Szmek - 9-1 - Update to latest version (#1903407) * Thu Dec 3 2020 Zbigniew Jędrzejewski-Szmek - 8-1 - Update to latest version (#1903407) * Sat Oct 3 2020 Zbigniew Jędrzejewski-Szmek - 6-1 - Update to latest version (#1884879) * Tue Jul 28 2020 Fedora Release Engineering - 5-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Wed Jan 29 2020 Fedora Release Engineering - 5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Thu Jul 25 2019 Fedora Release Engineering - 5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Tue Apr 30 2019 Zbigniew Jędrzejewski-Szmek - 5-1 - Update to latest version * Fri Feb 01 2019 Fedora Release Engineering - 4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Fri Jul 13 2018 Fedora Release Engineering - 4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Sat Feb 10 2018 Zbigniew Jędrzejewski-Szmek - 4-2 - Update to latest version (#1544123) * Thu Feb 08 2018 Fedora Release Engineering - 2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Wed Jul 26 2017 Fedora Release Engineering - 2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Fri Jun 23 2017 Zbigniew Jędrzejewski-Szmek - 2-1 - Update to latest version (#1464285) * Fri Feb 10 2017 Fedora Release Engineering - 1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Mon Dec 19 2016 Miro Hrončok - 1-2 - Rebuild for Python 3.6 * Thu Nov 3 2016 Zbigniew Jędrzejewski-Szmek - 1-1 - Initial version ## END: Generated by rpmautospec