# TODO:
-# libpmem (x86_64 only?)
-# plugins?
+# plugins? (probes)
#
# Conditional build:
%bcond_without sdl # SDL UI and audio support
%bcond_without iscsi # iscsi support
%bcond_without libnfs # NFS support
%bcond_without multipath # Multipath support
+%bcond_without pmem # libpmem (persistent memory) support
%bcond_without seccomp # seccomp support
%bcond_without usbredir # usb network redirection support
%bcond_without system_seabios # system seabios binary
%bcond_without snappy # snappy compression library
%bcond_without user_static # build linux-user static packages
%bcond_with lttng # lttng-ust trace backend support [needs update]
-%bcond_with systemtap # SystemTap/dtrace trace backend support
+%bcond_without systemtap # SystemTap/dtrace trace backend support
%bcond_without virgl # build virgl support
%bcond_with vxhs # Veritas HyperScale vDisk backend support (builtin; module not supported)
%bcond_without xkbcommon # xkbcommon support
%ifarch x32
%undefine with_xen
%endif
+%ifnarch %{x8664} aarch64
+%undefine with_pmem
+%endif
Summary: QEMU CPU Emulator
Summary(pl.UTF-8): QEMU - emulator procesora
Name: qemu
Version: 5.0.0
-Release: 1
+Release: 3
License: GPL v2, BSD (edk2 firmware files)
Group: Applications/Emulators
Source0: https://download.qemu.org/%{name}-%{version}.tar.xz
BuildRequires: perl-tools-pod
BuildRequires: pixman-devel >= 0.21.8
BuildRequires: pkgconfig
+%{?with_pmem:BuildRequires: pmdk-devel}
%{?with_pulseaudio:BuildRequires: pulseaudio-devel}
BuildRequires: python3 >= 1:3.5
BuildRequires: rpmbuild(macros) >= 1.644
BuildRequires: which
%{?with_virgl:BuildRequires: virglrenderer-devel}
%{?with_vte:BuildRequires: vte-devel >= 0.32.0}
-# xencontrol xenstore xenguest xenforeignmemory xengnttab xenevtchn xendevicemodel [xentoolcore for xen 4.10+]
-%{?with_xen:BuildRequires: xen-devel >= 4.2}
+# xencontrol xenstore xenguest xenforeignmemory xengnttab xenevtchn xendevicemodel; xentoolcore for xen 4.10+
+# min version is 4.2, more features up to 4.10
+%{?with_xen:BuildRequires: xen-devel >= 4.10}
BuildRequires: xfsprogs-devel
%{?with_xkbcommon:BuildRequires: xorg-lib-libxkbcommon-devel}
BuildRequires: xorg-lib-libX11-devel
%description module-ui-sdl -l pl.UTF-8
Sterownik interfejsu użytkownika i dźwięku SDL dla QEMU.
+%package -n systemtap-qemu
+Summary: systemtap/dtrace probes for QEMU
+Summary(pl.UTF-8): Sondy systemtap/dtrace dla QEMU
+Group: Development/Tools
+Requires: %{name}-common = %{version}-%{release}
+Requires: systemtap-client
+
+%description -n systemtap-qemu
+systemtap/dtrace probes for QEMU.
+
+%description -n systemtap-qemu -l pl.UTF-8
+Sondy systemtap/dtrace dla QEMU.
+
%prep
%setup -q
%patch0 -p1
%patch5 -p1
%patch6 -p1
-# workaround for conflict with alsa/error.h
-ln -s ../error.h qapi/error.h
+%{__sed} -i '1s,/usr/bin/env python3,%{__python3},' scripts/qemu-trace-stap
+%if %{with systemtap}
+# don't require stap binary during build
+%{__sed} -i -e "s/has 'stap'/true/" configure
+%endif
%build
build() {
%{!?with_gtk3:--disable-gtk} \
%{__enable_disable iscsi libiscsi} \
%{__enable_disable libnfs} \
+ %{__enable_disable pmem libpmem} \
--enable-lzo \
%{__enable_disable multipath mpath} \
--enable-modules \
--disable-guest-agent \
--disable-guest-agent-msi \
--disable-libnfs \
+ --disable-linux-io-uring \
--disable-mpath \
--disable-nettle \
--disable-pie \
--disable-vxhs \
--enable-user \
--disable-xkbcommon \
+ --disable-zstd \
--static
%endif
%attr(755,root,root) %{_bindir}/qemu-x86_64-static
%attr(755,root,root) %{_bindir}/qemu-xtensa-static
%attr(755,root,root) %{_bindir}/qemu-xtensaeb-static
+%attr(755,root,root) %{_bindir}/qemu-trace-stap-static
%endif
%files system-aarch64
%attr(755,root,root) %{_libdir}/%{name}/audio-sdl.so
%attr(755,root,root) %{_libdir}/%{name}/ui-sdl.so
%endif
+
+%if %{with systemtap}
+%files -n systemtap-qemu
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/qemu-trace-stap
+%{_datadir}/systemtap/tapset/qemu-*.stp
+%{_mandir}/man1/qemu-trace-stap.1*
+%endif