SHA256
1
0
forked from pool/qemu

Accepting request 733514 from home:bfrogers:branches:Virtualization

Some more tweaks to the spec file for readability, size and "flow"

OBS-URL: https://build.opensuse.org/request/show/733514
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=489
This commit is contained in:
Bruce Rogers 2019-09-26 19:33:33 +00:00 committed by Git OBS Bridge
parent 3ab58a2291
commit a4c16cb1ad
2 changed files with 298 additions and 364 deletions

331
qemu.spec
View File

@ -71,8 +71,6 @@
%define with_rbd 1
%endif
%define _udevrulesdir /usr/lib/udev/rules.d
# qemu, qemu-linux-user, and qemu-testsuite "flavors" enabled via OBS Multibuild
%define flavor @BUILD_FLAVOR@%{nil}
%if "%flavor" == ""
@ -99,7 +97,7 @@ Version: %qemuver
Release: 0
Source: https://wiki.qemu.org/download/%{srcname}-%{srcver}.tar.xz
Source100: %{srcname}.keyring
%if "%{name}" != "qemu-linux-user"
%if "%{name}" == "qemu"
Source1: 80-kvm.rules
Source2: kvm.conf
Source3: qemu-ifup
@ -115,7 +113,7 @@ Source12: supported.x86.txt
Source13: supported.s390.txt
# this is to make lint happy
Source300: qemu-rpmlintrc
%endif # ! qemu-linux-user
%endif # qemu
Source400: update_git.sh
# Upstream First -- https://wiki.qemu.org/Contribute/SubmitAPatch
# This patch queue is auto-generated - see README.PACKAGING for process
@ -192,9 +190,9 @@ Patch08000: Make-keycode-gen-output-reproducible-use.patch
# Please do not add patches manually here.
ExcludeArch: s390
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# ========================================================================
%if "%{name}" == "qemu-linux-user"
BuildRequires: e2fsprogs-devel
BuildRequires: fdupes
@ -209,6 +207,13 @@ BuildRequires: zlib-devel-static
%if 0%{?qemu_user_space_build:1}
#!BuildIgnore: post-build-checks
%endif
%description
QEMU provides CPU emulation along with other related capabilities. This package
provides programs to run user space binaries and libraries meant for another
architecture. The syscall interface is intercepted and execution below the
syscall layer occurs on the native hardware and operating system.
# ------------------------------------------------------------------------
%else # ! qemu-linux-user
%if %{build_x86_firmware_from_source}
@ -453,103 +458,15 @@ Suggests: qemu-vhost-user-gpu
Provides: qemu-audio-oss = %{qemuver}
Obsoletes: qemu-audio-oss < %{qemuver}
# for the record, this set of firmware files is installed, but we don't
# build (yet): bamboo.dtb canyonlands.dtb hppa-firmware.img openbios-ppc openbios-sparc32
# openbios-sparc64 palcode-clipper petalogix-ml605.dtb petalogix-s3adsp1800.dtb ppc_rom.bin
# QEMU,cgthree.bin QEMU,tcx.bin qemu_vga.ndrv u-boot.e500 u-boot-sam460-20100605.bin
# opensbi-riscv32-virt-fw_jump.bin
# This first list group isn't specific to what this instance builds
%define ppc_default_firmware {%nil}
%define ppc_extra_firmware {skiboot.lid slof.bin}
%define ppc64_only_default_firmware {spapr-rtas.bin}
%define ppc64_only_extra_firmware {%nil}
%define riscv64_default_firmware {opensbi-riscv64-sifive_u-fw_jump.bin opensbi-riscv64-virt-fw_jump.bin}
%define riscv64_extra_firmware {%nil}
%define s390x_default_firmware {s390-ccw.img s390-netboot.img}
%define s390x_extra_firmware {%nil}
%define x86_default_firmware {linuxboot.bin linuxboot_dma.bin multiboot.bin \
kvmvapic.bin pvh.bin}
%define x86_extra_firmware {bios.bin bios-256k.bin pxe-e1000.rom \
pxe-eepro100.rom pxe-ne2k_pci.rom pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
sgabios.bin vgabios-ati.bin vgabios-bochs-display.bin vgabios.bin \
vgabios-cirrus.bin vgabios-qxl.bin vgabios-ramfb.bin vgabios-stdvga.bin \
vgabios-virtio.bin vgabios-vmware.bin}
%define x86_64_only_default_firmware {%nil}
%define x86_64_only_extra_firmware {edk2-aarch64-code.fd.bz2 \
edk2-arm-code.fd.bz2 edk2-arm-vars.fd.bz2 edk2-i386-code.fd.bz2 \
edk2-i386-secure-code.fd.bz2 edk2-i386-vars.fd.bz2 edk2-x86_64-code.fd.bz2 \
edk2-x86_64-secure-code.fd.bz2 efi-e1000.rom efi-e1000e.rom efi-eepro100.rom \
efi-ne2k_pci.rom efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom efi-vmxnet3.rom}
%define firmware { \
%{?ppc_default_firmware} %{?ppc_extra_firmware} \
%{?ppc64_only_default_firmware} %{?ppc64_only_extra_firmware} \
%{?riscv64_default_firmware} %{?riscv64_extra_firmware} \
%{?s390x_default_firmware} %{?s390x_extra_firmware} \
%{?x86_default_firmware} %{?x86_extra_firmware} \
%{?x86_64_only_default_firmware} %{?x86_64_only_extra_firmware} }
# This second list group is specific to what this instance builds
%define ppc_default_built_firmware %{ppc_default_firmware}
%if %{build_skiboot_from_source} && %{build_slof_from_source}
%define ppc_extra_built_firmware %{ppc_extra_firmware}
%else
%if %{build_skiboot_from_source}
%define ppc_extra_built_firmware {skiboot.lid}
%endif
%if %{build_slof_from_source}
%define ppc_extra_built_firmware {slof.bin}
%endif
%endif
%ifarch ppc64
%define ppc64_only_default_built_firmware %{ppc64_only_default_firmware}
%define ppc64_only_extra_built_firmware %{ppc64_only_extra_firmware}
%endif
%ifarch riscv64
%define riscv64_default_built_firmware %{riscv64_default_firmware}
%define riscv64_extra_built_firmware %{riscv64_extra_firmware}
%endif
%ifarch s390x
%define s390x_default_built_firmware %{s390x_default_firmware}
%define s390x_extra_built_firmware %{s390x_extra_firmware}
%endif
%ifarch %ix86 x86_64
%define x86_default_built_firmware %{x86_default_firmware}
%ifarch x86_64
%define x86_64_only_default_built_firmware %{x86_64_only_default_firmware}
%endif
%endif
%if %{build_x86_firmware_from_source}
%define x86_extra_built_firmware %{x86_extra_firmware}
%ifarch x86_64
%define x86_64_only_extra_built_firmware %{x86_64_only_extra_firmware}
%endif
%endif
%define built_firmware { \
%{?ppc_default_built_firmware} %{?ppc_extra_built_firmware} \
%{?ppc64_only_default_built_firmware} %{?ppc64_only_extra_built_firmware} \
%{?riscv64_default_built_firmware} %{?riscv64_extra_built_firmware} \
%{?s390x_default_built_firmware} %{?s390x_extra_built_firmware} \
%{?x86_default_built_firmware} %{?x86_extra_built_firmware} \
%{?x86_64_only_default_built_firmware} %{?x86_64_only_extra_built_firmware} }
%endif # ! qemu-linux-user
# ------------------------------------------------------------------------
%if "%{name}" != "qemu-linux-user"
%define generic_qemu_description QEMU provides full machine emulation and cross architecture usage. It closely\
integrates with KVM and Xen virtualization, allowing for excellent performance.\
Many options are available for defining the emulated environment, including\
traditional devices, direct host device access, and interfaces specific to\
virtualization.
%description
QEMU provides full machine emulation and cross architecture usage. It closely
integrates with KVM and Xen virtualization, allowing for excellent performance.
Many options are available for defining the emulated environment, including
traditional devices, direct host device access, and interfaces specific to
virtualization.
%{generic_qemu_description}
This package acts as an umbrella package to the other QEMU sub-packages.
@ -569,11 +486,7 @@ Recommends: ovmf
Recommends: qemu-ovmf-x86_64
%description x86
QEMU provides full machine emulation and cross architecture usage. It closely
integrates with KVM and Xen virtualization, allowing for excellent performance.
Many options are available for defining the emulated environment, including
traditional devices, direct host device access, and interfaces specific to
virtualization.
%{generic_qemu_description}
This package provides i386 and x86_64 emulation.
@ -587,11 +500,7 @@ Recommends: qemu-ipxe
Recommends: qemu-vgabios
%description ppc
QEMU provides full machine emulation and cross architecture usage. It closely
integrates with KVM and Xen virtualization, allowing for excellent performance.
Many options are available for defining the emulated environment, including
traditional devices, direct host device access, and interfaces specific to
virtualization.
%{generic_qemu_description}
This package provides ppc and ppc64 emulation.
@ -603,11 +512,7 @@ Release: 0
Requires: %name = %{qemuver}
%description s390
QEMU provides full machine emulation and cross architecture usage. It closely
integrates with KVM and Xen virtualization, allowing for excellent performance.
Many options are available for defining the emulated environment, including
traditional devices, direct host device access, and interfaces specific to
virtualization.
%{generic_qemu_description}
This package provides s390x emulation.
@ -623,11 +528,7 @@ Recommends: ovmf
Recommends: qemu-uefi-aarch64
%description arm
QEMU provides full machine emulation and cross architecture usage. It closely
integrates with KVM and Xen virtualization, allowing for excellent performance.
Many options are available for defining the emulated environment, including
traditional devices, direct host device access, and interfaces specific to
virtualization.
%{generic_qemu_description}
This package provides arm emulation.
@ -641,11 +542,7 @@ Recommends: qemu-ipxe
Recommends: qemu-vgabios
%description extra
QEMU provides full machine emulation and cross architecture usage. It closely
integrates with KVM and Xen virtualization, allowing for excellent performance.
Many options are available for defining the emulated environment, including
traditional devices, direct host device access, and interfaces specific to
virtualization.
%{generic_qemu_description}
This package provides some lesser used emulations, including alpha, m68k,
mips, moxie, sparc, and xtensa. (The term "extra" is juxtapositioned against
@ -667,11 +564,7 @@ Provides: kvm = %{qemuver}
Obsoletes: kvm < %{qemuver}
%description kvm
QEMU provides full machine emulation and cross architecture usage. It closely
integrates with KVM and Xen virtualization, allowing for excellent performance.
Many options are available for defining the emulated environment, including
traditional devices, direct host device access, and interfaces specific to
virtualization.
%{generic_qemu_description}
This package simply provides a shell script wrapper for the QEMU program which
does the actual machine emulation and virtualization for this architecture. The
@ -973,17 +866,7 @@ This package provides a service file for starting and stopping KSM.
%endif
%endif # ! qemu-testsuite
# ------------------------------------------------------------------------
%else # qemu-linux-user
%description
QEMU provides CPU emulation along with other related capabilities. This package
provides programs to run user space binaries and libraries meant for another
architecture. The syscall interface is intercepted and execution below the
syscall layer occurs on the native hardware and operating system.
%endif # qemu-linux-user
%endif # ! qemu-linux-user
# ========================================================================
%prep
@ -1057,6 +940,93 @@ syscall layer occurs on the native hardware and operating system.
%patch08000 -p1
%if "%{name}" != "qemu-linux-user"
# for the record, this set of firmware files is installed, but we don't
# build (yet): bamboo.dtb canyonlands.dtb hppa-firmware.img openbios-ppc openbios-sparc32
# openbios-sparc64 palcode-clipper petalogix-ml605.dtb petalogix-s3adsp1800.dtb ppc_rom.bin
# QEMU,cgthree.bin QEMU,tcx.bin qemu_vga.ndrv u-boot.e500 u-boot-sam460-20100605.bin
# opensbi-riscv32-virt-fw_jump.bin
# This first list group isn't specific to what this instance builds
%define ppc_default_firmware {%nil}
%define ppc_extra_firmware {skiboot.lid slof.bin}
%define ppc64_only_default_firmware {spapr-rtas.bin}
%define ppc64_only_extra_firmware {%nil}
%define riscv64_default_firmware {opensbi-riscv64-sifive_u-fw_jump.bin opensbi-riscv64-virt-fw_jump.bin}
%define riscv64_extra_firmware {%nil}
%define s390x_default_firmware {s390-ccw.img s390-netboot.img}
%define s390x_extra_firmware {%nil}
%define x86_default_firmware {linuxboot.bin linuxboot_dma.bin multiboot.bin \
kvmvapic.bin pvh.bin}
%define x86_extra_firmware {bios.bin bios-256k.bin pxe-e1000.rom \
pxe-eepro100.rom pxe-ne2k_pci.rom pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
sgabios.bin vgabios-ati.bin vgabios-bochs-display.bin vgabios.bin \
vgabios-cirrus.bin vgabios-qxl.bin vgabios-ramfb.bin vgabios-stdvga.bin \
vgabios-virtio.bin vgabios-vmware.bin}
%define x86_64_only_default_firmware {%nil}
%define x86_64_only_extra_firmware {edk2-aarch64-code.fd.bz2 \
edk2-arm-code.fd.bz2 edk2-arm-vars.fd.bz2 edk2-i386-code.fd.bz2 \
edk2-i386-secure-code.fd.bz2 edk2-i386-vars.fd.bz2 edk2-x86_64-code.fd.bz2 \
edk2-x86_64-secure-code.fd.bz2 efi-e1000.rom efi-e1000e.rom efi-eepro100.rom \
efi-ne2k_pci.rom efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom efi-vmxnet3.rom}
%define firmware { \
%{?ppc_default_firmware} %{?ppc_extra_firmware} \
%{?ppc64_only_default_firmware} %{?ppc64_only_extra_firmware} \
%{?riscv64_default_firmware} %{?riscv64_extra_firmware} \
%{?s390x_default_firmware} %{?s390x_extra_firmware} \
%{?x86_default_firmware} %{?x86_extra_firmware} \
%{?x86_64_only_default_firmware} %{?x86_64_only_extra_firmware} }
# This second list group is specific to what this instance builds
%define ppc_default_built_firmware %{ppc_default_firmware}
%if %{build_skiboot_from_source} && %{build_slof_from_source}
%define ppc_extra_built_firmware %{ppc_extra_firmware}
%else
%if %{build_skiboot_from_source}
%define ppc_extra_built_firmware {skiboot.lid}
%endif
%if %{build_slof_from_source}
%define ppc_extra_built_firmware {slof.bin}
%endif
%endif
%ifarch ppc64
%define ppc64_only_default_built_firmware %{ppc64_only_default_firmware}
%define ppc64_only_extra_built_firmware %{ppc64_only_extra_firmware}
%endif
%ifarch riscv64
%define riscv64_default_built_firmware %{riscv64_default_firmware}
%define riscv64_extra_built_firmware %{riscv64_extra_firmware}
%endif
%ifarch s390x
%define s390x_default_built_firmware %{s390x_default_firmware}
%define s390x_extra_built_firmware %{s390x_extra_firmware}
%endif
%ifarch %ix86 x86_64
%define x86_default_built_firmware %{x86_default_firmware}
%ifarch x86_64
%define x86_64_only_default_built_firmware %{x86_64_only_default_firmware}
%endif
%endif
%if %{build_x86_firmware_from_source}
%define x86_extra_built_firmware %{x86_extra_firmware}
%ifarch x86_64
%define x86_64_only_extra_built_firmware %{x86_64_only_extra_firmware}
%endif
%endif
%define built_firmware { \
%{?ppc_default_built_firmware} %{?ppc_extra_built_firmware} \
%{?ppc64_only_default_built_firmware} %{?ppc64_only_extra_built_firmware} \
%{?riscv64_default_built_firmware} %{?riscv64_extra_built_firmware} \
%{?s390x_default_built_firmware} %{?s390x_extra_built_firmware} \
%{?x86_default_built_firmware} %{?x86_extra_built_firmware} \
%{?x86_64_only_default_built_firmware} %{?x86_64_only_extra_built_firmware} }
%if "%{name}" != "qemu-testsuite"
# delete the firmware files that we intend to build
@ -1488,9 +1458,27 @@ make %{?_smp_mflags} check-softfloat
%endif # qemu-linux-user
# ========================================================================
%install
cd %mybuilddir
%if "%{name}" == "qemu-testsuite"
install -D -m 0644 check-report.tap %{buildroot}%_datadir/qemu/check-report.tap
%endif # qemu-testsuite
# ------------------------------------------------------------------------
%if "%{name}" == "qemu-linux-user"
make %{?_smp_mflags} install DESTDIR=%{buildroot}
rm -rf %{buildroot}%_datadir/qemu/keymaps
unlink %{buildroot}%_datadir/qemu/trace-events-all
install -d -m 755 %{buildroot}%_sbindir
install -m 755 scripts/qemu-binfmt-conf.sh %{buildroot}%_sbindir
%fdupes -s %{buildroot}
%endif # qemu-linux-user
# ------------------------------------------------------------------------
%if "%{name}" == "qemu"
make %{?_smp_mflags} install DESTDIR=%{buildroot}
@ -1528,7 +1516,7 @@ install -d -m 0755 %{buildroot}%_libexecdir/supportconfig/plugins
install -d -m 0755 %{buildroot}%_sysconfdir/%name/firmware
install -D -m 0644 %{SOURCE4} %{buildroot}%_sysconfdir/%name/bridge.conf
install -D -m 0755 %{SOURCE3} %{buildroot}%_datadir/%name/qemu-ifup
install -D -p -m 0644 %{SOURCE8} %{buildroot}%{_udevrulesdir}/80-qemu-ga.rules
install -D -p -m 0644 %{SOURCE8} %{buildroot}/usr/lib/udev/rules.d/80-qemu-ga.rules
install -D -m 0755 scripts/analyze-migration.py %{buildroot}%_bindir/analyze-migration.py
install -D -m 0755 scripts/vmstate-static-checker.py %{buildroot}%_bindir/vmstate-static-checker.py
install -D -m 0755 %{SOURCE9} %{buildroot}%_libexecdir/supportconfig/plugins/%name
@ -1560,7 +1548,7 @@ ln -s ../qemu-x86/supported.txt %{buildroot}%_docdir/qemu-kvm/kvm-supported.txt
%endif
%endif
%if %{kvm_available}
install -D -m 0644 %{SOURCE1} %{buildroot}%{_udevrulesdir}/80-kvm.rules
install -D -m 0644 %{SOURCE1} %{buildroot}/usr/lib/udev/rules.d/80-kvm.rules
%endif
install -D -p -m 0644 %{SOURCE7} %{buildroot}%{_unitdir}/qemu-ga@.service
%if 0%{?is_opensuse}
@ -1571,27 +1559,8 @@ install -D -m 0644 %{SOURCE2} %{buildroot}%_libexecdir/modules-load.d/kvm.conf
%endif
%fdupes -s %{buildroot}
%endif # qemu
# ------------------------------------------------------------------------
%if "%{name}" == "qemu-testsuite"
install -D -m 0644 check-report.tap %{buildroot}%_datadir/qemu/check-report.tap
%endif # qemu-testsuite
# ------------------------------------------------------------------------
%if "%{name}" == "qemu-linux-user"
make %{?_smp_mflags} install DESTDIR=%{buildroot}
rm -rf %{buildroot}%_datadir/qemu/keymaps
unlink %{buildroot}%_datadir/qemu/trace-events-all
install -d -m 755 %{buildroot}%_sbindir
install -m 755 scripts/qemu-binfmt-conf.sh %{buildroot}%_sbindir
%fdupes -s %{buildroot}
%endif # qemu-linux-user
# ========================================================================
%if "%{name}" == "qemu"
# (qemu alone has pre* and post* sections for itself and subpackages):
%pre
%_bindir/getent group kvm >/dev/null || %_sbindir/groupadd -r kvm
@ -1664,9 +1633,10 @@ fi
# ========================================================================
%files
%defattr(-, root, root)
%if "%{name}" == "qemu"
%doc Changelog README VERSION
%license COPYING COPYING.LIB LICENSE
%if "%{name}" == "qemu"
%dir %_docdir/%name/interop
%dir %_docdir/%name/interop/_static
%dir %_docdir/%name/specs
@ -1682,7 +1652,6 @@ fi
%_docdir/%name/interop/search.html
%_docdir/%name/interop/searchindex.js
%_docdir/%name/interop/vhost-user.html
%_docdir/%name/interop/.buildinfo
%_docdir/%name/specs/.buildinfo
%_docdir/%name/specs/_static/*
%_docdir/%name/specs/genindex.html
@ -1715,7 +1684,7 @@ fi
%dir %_libexecdir/supportconfig/plugins
%_libexecdir/supportconfig/plugins/%name
%if %{kvm_available}
%{_udevrulesdir}/80-kvm.rules
/usr/lib/udev/rules.d/80-kvm.rules
%ifarch s390x
%_libexecdir/modules-load.d/kvm.conf
%endif
@ -1945,12 +1914,6 @@ fi
%files ipxe
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/pxe-e1000.rom
%_datadir/%name/pxe-eepro100.rom
%_datadir/%name/pxe-ne2k_pci.rom
%_datadir/%name/pxe-pcnet.rom
%_datadir/%name/pxe-rtl8139.rom
%_datadir/%name/pxe-virtio.rom
%_datadir/%name/efi-e1000.rom
%_datadir/%name/efi-e1000e.rom
%_datadir/%name/efi-eepro100.rom
@ -1959,6 +1922,12 @@ fi
%_datadir/%name/efi-rtl8139.rom
%_datadir/%name/efi-virtio.rom
%_datadir/%name/efi-vmxnet3.rom
%_datadir/%name/pxe-e1000.rom
%_datadir/%name/pxe-eepro100.rom
%_datadir/%name/pxe-ne2k_pci.rom
%_datadir/%name/pxe-pcnet.rom
%_datadir/%name/pxe-rtl8139.rom
%_datadir/%name/pxe-virtio.rom
%if %{provide_edk2_firmware}
@ -1999,8 +1968,8 @@ fi
%_bindir/ivshmem-client
%_bindir/ivshmem-server
%_bindir/qemu-edid
%_bindir/qemu-io
%_bindir/qemu-img
%_bindir/qemu-io
%_bindir/qemu-keymap
%_bindir/qemu-nbd
%_bindir/qemu-pr-helper
@ -2016,7 +1985,7 @@ fi
%_mandir/man8/qemu-ga.8.gz
%attr(0755,root,kvm) %_bindir/qemu-ga
%{_unitdir}/qemu-ga@.service
%{_udevrulesdir}/80-qemu-ga.rules
/usr/lib/udev/rules.d/80-qemu-ga.rules
%if 0%{?is_opensuse}
%files ksm
@ -2026,16 +1995,8 @@ fi
%endif # qemu
# ------------------------------------------------------------------------
%if "%{name}" == "qemu-testsuite"
%_datadir/qemu/check-report.tap
%endif # qemu-testsuite
# ------------------------------------------------------------------------
%if "%{name}" == "qemu-linux-user"
%doc Changelog README VERSION
%license COPYING COPYING.LIB LICENSE
%_bindir/qemu-aarch64
%_bindir/qemu-aarch64_be
%_bindir/qemu-alpha
@ -2055,8 +2016,8 @@ fi
%_bindir/qemu-mips64el
%_bindir/qemu-nios2
%_bindir/qemu-or1k
%_bindir/qemu-ppc64abi32
%_bindir/qemu-ppc64
%_bindir/qemu-ppc64abi32
%_bindir/qemu-ppc64le
%_bindir/qemu-ppc
%_bindir/qemu-riscv32
@ -2075,5 +2036,11 @@ fi
%_sbindir/qemu-binfmt-conf.sh
%endif # qemu-linux-user
# ------------------------------------------------------------------------
%if "%{name}" == "qemu-testsuite"
%_datadir/qemu/check-report.tap
%endif # qemu-testsuite
%changelog

View File

@ -71,8 +71,6 @@
%define with_rbd 1
%endif
%define _udevrulesdir /usr/lib/udev/rules.d
# qemu, qemu-linux-user, and qemu-testsuite "flavors" enabled via OBS Multibuild
%define flavor @BUILD_FLAVOR@%{nil}
%if "%flavor" == ""
@ -97,7 +95,7 @@ QEMU_VERSION
Release: 0
Source: https://wiki.qemu.org/download/%{srcname}-%{srcver}.tar.xz
Source100: %{srcname}.keyring
%if "%{name}" != "qemu-linux-user"
%if "%{name}" == "qemu"
Source1: 80-kvm.rules
Source2: kvm.conf
Source3: qemu-ifup
@ -113,7 +111,7 @@ Source12: supported.x86.txt
Source13: supported.s390.txt
# this is to make lint happy
Source300: qemu-rpmlintrc
%endif # ! qemu-linux-user
%endif # qemu
Source400: update_git.sh
# Upstream First -- https://wiki.qemu.org/Contribute/SubmitAPatch
# This patch queue is auto-generated - see README.PACKAGING for process
@ -122,9 +120,9 @@ PATCH_FILES
# Please do not add patches manually here.
ExcludeArch: s390
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# ========================================================================
%if "%{name}" == "qemu-linux-user"
BuildRequires: e2fsprogs-devel
BuildRequires: fdupes
@ -139,6 +137,13 @@ BuildRequires: zlib-devel-static
%if 0%{?qemu_user_space_build:1}
#!BuildIgnore: post-build-checks
%endif
%description
QEMU provides CPU emulation along with other related capabilities. This package
provides programs to run user space binaries and libraries meant for another
architecture. The syscall interface is intercepted and execution below the
syscall layer occurs on the native hardware and operating system.
# ------------------------------------------------------------------------
%else # ! qemu-linux-user
%if %{build_x86_firmware_from_source}
@ -383,103 +388,15 @@ Suggests: qemu-vhost-user-gpu
Provides: qemu-audio-oss = %{qemuver}
Obsoletes: qemu-audio-oss < %{qemuver}
# for the record, this set of firmware files is installed, but we don't
# build (yet): bamboo.dtb canyonlands.dtb hppa-firmware.img openbios-ppc openbios-sparc32
# openbios-sparc64 palcode-clipper petalogix-ml605.dtb petalogix-s3adsp1800.dtb ppc_rom.bin
# QEMU,cgthree.bin QEMU,tcx.bin qemu_vga.ndrv u-boot.e500 u-boot-sam460-20100605.bin
# opensbi-riscv32-virt-fw_jump.bin
# This first list group isn't specific to what this instance builds
%define ppc_default_firmware {%nil}
%define ppc_extra_firmware {skiboot.lid slof.bin}
%define ppc64_only_default_firmware {spapr-rtas.bin}
%define ppc64_only_extra_firmware {%nil}
%define riscv64_default_firmware {opensbi-riscv64-sifive_u-fw_jump.bin opensbi-riscv64-virt-fw_jump.bin}
%define riscv64_extra_firmware {%nil}
%define s390x_default_firmware {s390-ccw.img s390-netboot.img}
%define s390x_extra_firmware {%nil}
%define x86_default_firmware {linuxboot.bin linuxboot_dma.bin multiboot.bin \
kvmvapic.bin pvh.bin}
%define x86_extra_firmware {bios.bin bios-256k.bin pxe-e1000.rom \
pxe-eepro100.rom pxe-ne2k_pci.rom pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
sgabios.bin vgabios-ati.bin vgabios-bochs-display.bin vgabios.bin \
vgabios-cirrus.bin vgabios-qxl.bin vgabios-ramfb.bin vgabios-stdvga.bin \
vgabios-virtio.bin vgabios-vmware.bin}
%define x86_64_only_default_firmware {%nil}
%define x86_64_only_extra_firmware {edk2-aarch64-code.fd.bz2 \
edk2-arm-code.fd.bz2 edk2-arm-vars.fd.bz2 edk2-i386-code.fd.bz2 \
edk2-i386-secure-code.fd.bz2 edk2-i386-vars.fd.bz2 edk2-x86_64-code.fd.bz2 \
edk2-x86_64-secure-code.fd.bz2 efi-e1000.rom efi-e1000e.rom efi-eepro100.rom \
efi-ne2k_pci.rom efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom efi-vmxnet3.rom}
%define firmware { \
%{?ppc_default_firmware} %{?ppc_extra_firmware} \
%{?ppc64_only_default_firmware} %{?ppc64_only_extra_firmware} \
%{?riscv64_default_firmware} %{?riscv64_extra_firmware} \
%{?s390x_default_firmware} %{?s390x_extra_firmware} \
%{?x86_default_firmware} %{?x86_extra_firmware} \
%{?x86_64_only_default_firmware} %{?x86_64_only_extra_firmware} }
# This second list group is specific to what this instance builds
%define ppc_default_built_firmware %{ppc_default_firmware}
%if %{build_skiboot_from_source} && %{build_slof_from_source}
%define ppc_extra_built_firmware %{ppc_extra_firmware}
%else
%if %{build_skiboot_from_source}
%define ppc_extra_built_firmware {skiboot.lid}
%endif
%if %{build_slof_from_source}
%define ppc_extra_built_firmware {slof.bin}
%endif
%endif
%ifarch ppc64
%define ppc64_only_default_built_firmware %{ppc64_only_default_firmware}
%define ppc64_only_extra_built_firmware %{ppc64_only_extra_firmware}
%endif
%ifarch riscv64
%define riscv64_default_built_firmware %{riscv64_default_firmware}
%define riscv64_extra_built_firmware %{riscv64_extra_firmware}
%endif
%ifarch s390x
%define s390x_default_built_firmware %{s390x_default_firmware}
%define s390x_extra_built_firmware %{s390x_extra_firmware}
%endif
%ifarch %ix86 x86_64
%define x86_default_built_firmware %{x86_default_firmware}
%ifarch x86_64
%define x86_64_only_default_built_firmware %{x86_64_only_default_firmware}
%endif
%endif
%if %{build_x86_firmware_from_source}
%define x86_extra_built_firmware %{x86_extra_firmware}
%ifarch x86_64
%define x86_64_only_extra_built_firmware %{x86_64_only_extra_firmware}
%endif
%endif
%define built_firmware { \
%{?ppc_default_built_firmware} %{?ppc_extra_built_firmware} \
%{?ppc64_only_default_built_firmware} %{?ppc64_only_extra_built_firmware} \
%{?riscv64_default_built_firmware} %{?riscv64_extra_built_firmware} \
%{?s390x_default_built_firmware} %{?s390x_extra_built_firmware} \
%{?x86_default_built_firmware} %{?x86_extra_built_firmware} \
%{?x86_64_only_default_built_firmware} %{?x86_64_only_extra_built_firmware} }
%endif # ! qemu-linux-user
# ------------------------------------------------------------------------
%if "%{name}" != "qemu-linux-user"
%define generic_qemu_description QEMU provides full machine emulation and cross architecture usage. It closely\
integrates with KVM and Xen virtualization, allowing for excellent performance.\
Many options are available for defining the emulated environment, including\
traditional devices, direct host device access, and interfaces specific to\
virtualization.
%description
QEMU provides full machine emulation and cross architecture usage. It closely
integrates with KVM and Xen virtualization, allowing for excellent performance.
Many options are available for defining the emulated environment, including
traditional devices, direct host device access, and interfaces specific to
virtualization.
%{generic_qemu_description}
This package acts as an umbrella package to the other QEMU sub-packages.
@ -499,11 +416,7 @@ Recommends: ovmf
Recommends: qemu-ovmf-x86_64
%description x86
QEMU provides full machine emulation and cross architecture usage. It closely
integrates with KVM and Xen virtualization, allowing for excellent performance.
Many options are available for defining the emulated environment, including
traditional devices, direct host device access, and interfaces specific to
virtualization.
%{generic_qemu_description}
This package provides i386 and x86_64 emulation.
@ -517,11 +430,7 @@ Recommends: qemu-ipxe
Recommends: qemu-vgabios
%description ppc
QEMU provides full machine emulation and cross architecture usage. It closely
integrates with KVM and Xen virtualization, allowing for excellent performance.
Many options are available for defining the emulated environment, including
traditional devices, direct host device access, and interfaces specific to
virtualization.
%{generic_qemu_description}
This package provides ppc and ppc64 emulation.
@ -533,11 +442,7 @@ Release: 0
Requires: %name = %{qemuver}
%description s390
QEMU provides full machine emulation and cross architecture usage. It closely
integrates with KVM and Xen virtualization, allowing for excellent performance.
Many options are available for defining the emulated environment, including
traditional devices, direct host device access, and interfaces specific to
virtualization.
%{generic_qemu_description}
This package provides s390x emulation.
@ -553,11 +458,7 @@ Recommends: ovmf
Recommends: qemu-uefi-aarch64
%description arm
QEMU provides full machine emulation and cross architecture usage. It closely
integrates with KVM and Xen virtualization, allowing for excellent performance.
Many options are available for defining the emulated environment, including
traditional devices, direct host device access, and interfaces specific to
virtualization.
%{generic_qemu_description}
This package provides arm emulation.
@ -571,11 +472,7 @@ Recommends: qemu-ipxe
Recommends: qemu-vgabios
%description extra
QEMU provides full machine emulation and cross architecture usage. It closely
integrates with KVM and Xen virtualization, allowing for excellent performance.
Many options are available for defining the emulated environment, including
traditional devices, direct host device access, and interfaces specific to
virtualization.
%{generic_qemu_description}
This package provides some lesser used emulations, including alpha, m68k,
mips, moxie, sparc, and xtensa. (The term "extra" is juxtapositioned against
@ -597,11 +494,7 @@ Provides: kvm = %{qemuver}
Obsoletes: kvm < %{qemuver}
%description kvm
QEMU provides full machine emulation and cross architecture usage. It closely
integrates with KVM and Xen virtualization, allowing for excellent performance.
Many options are available for defining the emulated environment, including
traditional devices, direct host device access, and interfaces specific to
virtualization.
%{generic_qemu_description}
This package simply provides a shell script wrapper for the QEMU program which
does the actual machine emulation and virtualization for this architecture. The
@ -903,17 +796,7 @@ This package provides a service file for starting and stopping KSM.
%endif
%endif # ! qemu-testsuite
# ------------------------------------------------------------------------
%else # qemu-linux-user
%description
QEMU provides CPU emulation along with other related capabilities. This package
provides programs to run user space binaries and libraries meant for another
architecture. The syscall interface is intercepted and execution below the
syscall layer occurs on the native hardware and operating system.
%endif # qemu-linux-user
%endif # ! qemu-linux-user
# ========================================================================
%prep
@ -921,6 +804,93 @@ syscall layer occurs on the native hardware and operating system.
PATCH_EXEC
%if "%{name}" != "qemu-linux-user"
# for the record, this set of firmware files is installed, but we don't
# build (yet): bamboo.dtb canyonlands.dtb hppa-firmware.img openbios-ppc openbios-sparc32
# openbios-sparc64 palcode-clipper petalogix-ml605.dtb petalogix-s3adsp1800.dtb ppc_rom.bin
# QEMU,cgthree.bin QEMU,tcx.bin qemu_vga.ndrv u-boot.e500 u-boot-sam460-20100605.bin
# opensbi-riscv32-virt-fw_jump.bin
# This first list group isn't specific to what this instance builds
%define ppc_default_firmware {%nil}
%define ppc_extra_firmware {skiboot.lid slof.bin}
%define ppc64_only_default_firmware {spapr-rtas.bin}
%define ppc64_only_extra_firmware {%nil}
%define riscv64_default_firmware {opensbi-riscv64-sifive_u-fw_jump.bin opensbi-riscv64-virt-fw_jump.bin}
%define riscv64_extra_firmware {%nil}
%define s390x_default_firmware {s390-ccw.img s390-netboot.img}
%define s390x_extra_firmware {%nil}
%define x86_default_firmware {linuxboot.bin linuxboot_dma.bin multiboot.bin \
kvmvapic.bin pvh.bin}
%define x86_extra_firmware {bios.bin bios-256k.bin pxe-e1000.rom \
pxe-eepro100.rom pxe-ne2k_pci.rom pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
sgabios.bin vgabios-ati.bin vgabios-bochs-display.bin vgabios.bin \
vgabios-cirrus.bin vgabios-qxl.bin vgabios-ramfb.bin vgabios-stdvga.bin \
vgabios-virtio.bin vgabios-vmware.bin}
%define x86_64_only_default_firmware {%nil}
%define x86_64_only_extra_firmware {edk2-aarch64-code.fd.bz2 \
edk2-arm-code.fd.bz2 edk2-arm-vars.fd.bz2 edk2-i386-code.fd.bz2 \
edk2-i386-secure-code.fd.bz2 edk2-i386-vars.fd.bz2 edk2-x86_64-code.fd.bz2 \
edk2-x86_64-secure-code.fd.bz2 efi-e1000.rom efi-e1000e.rom efi-eepro100.rom \
efi-ne2k_pci.rom efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom efi-vmxnet3.rom}
%define firmware { \
%{?ppc_default_firmware} %{?ppc_extra_firmware} \
%{?ppc64_only_default_firmware} %{?ppc64_only_extra_firmware} \
%{?riscv64_default_firmware} %{?riscv64_extra_firmware} \
%{?s390x_default_firmware} %{?s390x_extra_firmware} \
%{?x86_default_firmware} %{?x86_extra_firmware} \
%{?x86_64_only_default_firmware} %{?x86_64_only_extra_firmware} }
# This second list group is specific to what this instance builds
%define ppc_default_built_firmware %{ppc_default_firmware}
%if %{build_skiboot_from_source} && %{build_slof_from_source}
%define ppc_extra_built_firmware %{ppc_extra_firmware}
%else
%if %{build_skiboot_from_source}
%define ppc_extra_built_firmware {skiboot.lid}
%endif
%if %{build_slof_from_source}
%define ppc_extra_built_firmware {slof.bin}
%endif
%endif
%ifarch ppc64
%define ppc64_only_default_built_firmware %{ppc64_only_default_firmware}
%define ppc64_only_extra_built_firmware %{ppc64_only_extra_firmware}
%endif
%ifarch riscv64
%define riscv64_default_built_firmware %{riscv64_default_firmware}
%define riscv64_extra_built_firmware %{riscv64_extra_firmware}
%endif
%ifarch s390x
%define s390x_default_built_firmware %{s390x_default_firmware}
%define s390x_extra_built_firmware %{s390x_extra_firmware}
%endif
%ifarch %ix86 x86_64
%define x86_default_built_firmware %{x86_default_firmware}
%ifarch x86_64
%define x86_64_only_default_built_firmware %{x86_64_only_default_firmware}
%endif
%endif
%if %{build_x86_firmware_from_source}
%define x86_extra_built_firmware %{x86_extra_firmware}
%ifarch x86_64
%define x86_64_only_extra_built_firmware %{x86_64_only_extra_firmware}
%endif
%endif
%define built_firmware { \
%{?ppc_default_built_firmware} %{?ppc_extra_built_firmware} \
%{?ppc64_only_default_built_firmware} %{?ppc64_only_extra_built_firmware} \
%{?riscv64_default_built_firmware} %{?riscv64_extra_built_firmware} \
%{?s390x_default_built_firmware} %{?s390x_extra_built_firmware} \
%{?x86_default_built_firmware} %{?x86_extra_built_firmware} \
%{?x86_64_only_default_built_firmware} %{?x86_64_only_extra_built_firmware} }
%if "%{name}" != "qemu-testsuite"
# delete the firmware files that we intend to build
@ -1352,9 +1322,27 @@ make %{?_smp_mflags} check-softfloat
%endif # qemu-linux-user
# ========================================================================
%install
cd %mybuilddir
%if "%{name}" == "qemu-testsuite"
install -D -m 0644 check-report.tap %{buildroot}%_datadir/qemu/check-report.tap
%endif # qemu-testsuite
# ------------------------------------------------------------------------
%if "%{name}" == "qemu-linux-user"
make %{?_smp_mflags} install DESTDIR=%{buildroot}
rm -rf %{buildroot}%_datadir/qemu/keymaps
unlink %{buildroot}%_datadir/qemu/trace-events-all
install -d -m 755 %{buildroot}%_sbindir
install -m 755 scripts/qemu-binfmt-conf.sh %{buildroot}%_sbindir
%fdupes -s %{buildroot}
%endif # qemu-linux-user
# ------------------------------------------------------------------------
%if "%{name}" == "qemu"
make %{?_smp_mflags} install DESTDIR=%{buildroot}
@ -1392,7 +1380,7 @@ install -d -m 0755 %{buildroot}%_libexecdir/supportconfig/plugins
install -d -m 0755 %{buildroot}%_sysconfdir/%name/firmware
install -D -m 0644 %{SOURCE4} %{buildroot}%_sysconfdir/%name/bridge.conf
install -D -m 0755 %{SOURCE3} %{buildroot}%_datadir/%name/qemu-ifup
install -D -p -m 0644 %{SOURCE8} %{buildroot}%{_udevrulesdir}/80-qemu-ga.rules
install -D -p -m 0644 %{SOURCE8} %{buildroot}/usr/lib/udev/rules.d/80-qemu-ga.rules
install -D -m 0755 scripts/analyze-migration.py %{buildroot}%_bindir/analyze-migration.py
install -D -m 0755 scripts/vmstate-static-checker.py %{buildroot}%_bindir/vmstate-static-checker.py
install -D -m 0755 %{SOURCE9} %{buildroot}%_libexecdir/supportconfig/plugins/%name
@ -1424,7 +1412,7 @@ ln -s ../qemu-x86/supported.txt %{buildroot}%_docdir/qemu-kvm/kvm-supported.txt
%endif
%endif
%if %{kvm_available}
install -D -m 0644 %{SOURCE1} %{buildroot}%{_udevrulesdir}/80-kvm.rules
install -D -m 0644 %{SOURCE1} %{buildroot}/usr/lib/udev/rules.d/80-kvm.rules
%endif
install -D -p -m 0644 %{SOURCE7} %{buildroot}%{_unitdir}/qemu-ga@.service
%if 0%{?is_opensuse}
@ -1435,27 +1423,8 @@ install -D -m 0644 %{SOURCE2} %{buildroot}%_libexecdir/modules-load.d/kvm.conf
%endif
%fdupes -s %{buildroot}
%endif # qemu
# ------------------------------------------------------------------------
%if "%{name}" == "qemu-testsuite"
install -D -m 0644 check-report.tap %{buildroot}%_datadir/qemu/check-report.tap
%endif # qemu-testsuite
# ------------------------------------------------------------------------
%if "%{name}" == "qemu-linux-user"
make %{?_smp_mflags} install DESTDIR=%{buildroot}
rm -rf %{buildroot}%_datadir/qemu/keymaps
unlink %{buildroot}%_datadir/qemu/trace-events-all
install -d -m 755 %{buildroot}%_sbindir
install -m 755 scripts/qemu-binfmt-conf.sh %{buildroot}%_sbindir
%fdupes -s %{buildroot}
%endif # qemu-linux-user
# ========================================================================
%if "%{name}" == "qemu"
# (qemu alone has pre* and post* sections for itself and subpackages):
%pre
%_bindir/getent group kvm >/dev/null || %_sbindir/groupadd -r kvm
@ -1528,9 +1497,10 @@ fi
# ========================================================================
%files
%defattr(-, root, root)
%if "%{name}" == "qemu"
%doc Changelog README VERSION
%license COPYING COPYING.LIB LICENSE
%if "%{name}" == "qemu"
%dir %_docdir/%name/interop
%dir %_docdir/%name/interop/_static
%dir %_docdir/%name/specs
@ -1546,7 +1516,6 @@ fi
%_docdir/%name/interop/search.html
%_docdir/%name/interop/searchindex.js
%_docdir/%name/interop/vhost-user.html
%_docdir/%name/interop/.buildinfo
%_docdir/%name/specs/.buildinfo
%_docdir/%name/specs/_static/*
%_docdir/%name/specs/genindex.html
@ -1579,7 +1548,7 @@ fi
%dir %_libexecdir/supportconfig/plugins
%_libexecdir/supportconfig/plugins/%name
%if %{kvm_available}
%{_udevrulesdir}/80-kvm.rules
/usr/lib/udev/rules.d/80-kvm.rules
%ifarch s390x
%_libexecdir/modules-load.d/kvm.conf
%endif
@ -1809,12 +1778,6 @@ fi
%files ipxe
%defattr(-, root, root)
%dir %_datadir/%name
%_datadir/%name/pxe-e1000.rom
%_datadir/%name/pxe-eepro100.rom
%_datadir/%name/pxe-ne2k_pci.rom
%_datadir/%name/pxe-pcnet.rom
%_datadir/%name/pxe-rtl8139.rom
%_datadir/%name/pxe-virtio.rom
%_datadir/%name/efi-e1000.rom
%_datadir/%name/efi-e1000e.rom
%_datadir/%name/efi-eepro100.rom
@ -1823,6 +1786,12 @@ fi
%_datadir/%name/efi-rtl8139.rom
%_datadir/%name/efi-virtio.rom
%_datadir/%name/efi-vmxnet3.rom
%_datadir/%name/pxe-e1000.rom
%_datadir/%name/pxe-eepro100.rom
%_datadir/%name/pxe-ne2k_pci.rom
%_datadir/%name/pxe-pcnet.rom
%_datadir/%name/pxe-rtl8139.rom
%_datadir/%name/pxe-virtio.rom
%if %{provide_edk2_firmware}
@ -1863,8 +1832,8 @@ fi
%_bindir/ivshmem-client
%_bindir/ivshmem-server
%_bindir/qemu-edid
%_bindir/qemu-io
%_bindir/qemu-img
%_bindir/qemu-io
%_bindir/qemu-keymap
%_bindir/qemu-nbd
%_bindir/qemu-pr-helper
@ -1880,7 +1849,7 @@ fi
%_mandir/man8/qemu-ga.8.gz
%attr(0755,root,kvm) %_bindir/qemu-ga
%{_unitdir}/qemu-ga@.service
%{_udevrulesdir}/80-qemu-ga.rules
/usr/lib/udev/rules.d/80-qemu-ga.rules
%if 0%{?is_opensuse}
%files ksm
@ -1890,16 +1859,8 @@ fi
%endif # qemu
# ------------------------------------------------------------------------
%if "%{name}" == "qemu-testsuite"
%_datadir/qemu/check-report.tap
%endif # qemu-testsuite
# ------------------------------------------------------------------------
%if "%{name}" == "qemu-linux-user"
%doc Changelog README VERSION
%license COPYING COPYING.LIB LICENSE
%_bindir/qemu-aarch64
%_bindir/qemu-aarch64_be
%_bindir/qemu-alpha
@ -1919,8 +1880,8 @@ fi
%_bindir/qemu-mips64el
%_bindir/qemu-nios2
%_bindir/qemu-or1k
%_bindir/qemu-ppc64abi32
%_bindir/qemu-ppc64
%_bindir/qemu-ppc64abi32
%_bindir/qemu-ppc64le
%_bindir/qemu-ppc
%_bindir/qemu-riscv32
@ -1939,5 +1900,11 @@ fi
%_sbindir/qemu-binfmt-conf.sh
%endif # qemu-linux-user
# ------------------------------------------------------------------------
%if "%{name}" == "qemu-testsuite"
%_datadir/qemu/check-report.tap
%endif # qemu-testsuite
%changelog