spec: Move BuildRequires closer to RHEL formatting

This should not be any functional change, just some BuildRequires
movement and macro tweaking with the goal of sharing the first block
of deps with the RHEL/centos qemu-kvm spec

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2021-06-16 10:39:24 -04:00
parent 09badc27ce
commit 6c55704061

186
qemu.spec
View File

@ -1,3 +1,9 @@
%global libfdt_version 1.6.0
%global libseccomp_version 2.4.0
%global libusbx_version 1.0.23
%global meson_version 0.55.3-3
%global usbredir_version 0.7.1
%ifarch %{ix86} %ifarch %{ix86}
%global kvm_package system-x86 %global kvm_package system-x86
# need_qemu_kvm should only ever be used by x86 # need_qemu_kvm should only ever be used by x86
@ -79,6 +85,10 @@
%global have_jack 0 %global have_jack 0
%endif %endif
%global have_fdt 1
%global have_opengl 1
%global have_usbredir 1
# Matches edk2.spec ExclusiveArch # Matches edk2.spec ExclusiveArch
%global have_edk2 0 %global have_edk2 0
@ -117,29 +127,29 @@
%endif %endif
# All modules should be listed here. # All modules should be listed here.
%define have_block_rbd 1
%ifarch %{ix86} %{arm} %ifarch %{ix86} %{arm}
%define with_block_rbd 0 %define have_block_rbd 0
%else
%define with_block_rbd 1
%endif %endif
%global with_block_gluster 1
%define with_block_nfs 0 %global have_block_gluster 1
%define have_block_nfs 0
%if 0%{?fedora} %if 0%{?fedora}
%define with_block_nfs 1 %define have_block_nfs 1
%endif %endif
%define have_librdma 1
%ifarch %{arm} %ifarch %{arm}
%define with_rdma 0 %define have_librdma 0
%else
%define with_rdma 1
%endif %endif
%define evr %{epoch}:%{version}-%{release} %define evr %{epoch}:%{version}-%{release}
%define requires_block_curl Requires: %{name}-block-curl = %{evr} %define requires_block_curl Requires: %{name}-block-curl = %{evr}
%define requires_block_dmg Requires: %{name}-block-dmg = %{evr} %define requires_block_dmg Requires: %{name}-block-dmg = %{evr}
%if %{with_block_gluster} %if %{have_block_gluster}
%define requires_block_gluster Requires: %{name}-block-gluster = %{evr} %define requires_block_gluster Requires: %{name}-block-gluster = %{evr}
%define obsoletes_block_gluster %{nil} %define obsoletes_block_gluster %{nil}
%else %else
@ -147,14 +157,14 @@
%define obsoletes_block_gluster Obsoletes: %{name}-block-gluster < %{evr} %define obsoletes_block_gluster Obsoletes: %{name}-block-gluster < %{evr}
%endif %endif
%define requires_block_iscsi Requires: %{name}-block-iscsi = %{evr} %define requires_block_iscsi Requires: %{name}-block-iscsi = %{evr}
%if %{with_block_nfs} %if %{have_block_nfs}
%define requires_block_nfs Requires: %{name}-block-nfs = %{evr} %define requires_block_nfs Requires: %{name}-block-nfs = %{evr}
%define obsoletes_block_nfs %{nil} %define obsoletes_block_nfs %{nil}
%else %else
%define requires_block_nfs %{nil} %define requires_block_nfs %{nil}
%define obsoletes_block_nfs Obsoletes: %{name}-block-nfs < %{evr} %define obsoletes_block_nfs Obsoletes: %{name}-block-nfs < %{evr}
%endif %endif
%if %{with_block_rbd} %if %{have_block_rbd}
%define requires_block_rbd Requires: %{name}-block-rbd = %{evr} %define requires_block_rbd Requires: %{name}-block-rbd = %{evr}
%define obsoletes_block_rbd %{nil} %define obsoletes_block_rbd %{nil}
%else %else
@ -279,108 +289,113 @@ Patch0004: 0004-vl-plumb-keyval-based-options-into-readconfig.patch
Patch0005: 0005-vl-plug-object-back-into-readconfig.patch Patch0005: 0005-vl-plug-object-back-into-readconfig.patch
Patch0006: 0006-qemu-option-support-accept-any-QemuOptsList-in-qemu_.patch Patch0006: 0006-qemu-option-support-accept-any-QemuOptsList-in-qemu_.patch
BuildRequires: make BuildRequires: meson >= %{meson_version}
BuildRequires: meson BuildRequires: zlib-devel
BuildRequires: gcc BuildRequires: glib2-devel
# documentation deps BuildRequires: gnutls-devel
BuildRequires: cyrus-sasl-devel
BuildRequires: libaio-devel
BuildRequires: python3-devel
BuildRequires: libiscsi-devel
BuildRequires: libattr-devel
BuildRequires: libusbx-devel >= %{libusbx_version}
%if %{have_usbredir}
BuildRequires: usbredir-devel >= %{usbredir_version}
%endif
BuildRequires: texinfo BuildRequires: texinfo
BuildRequires: python3-sphinx
BuildRequires: libseccomp-devel >= %{libseccomp_version}
# For network block driver
BuildRequires: libcurl-devel
BuildRequires: libssh-devel
%if %{have_block_rbd}
BuildRequires: librbd-devel
%endif
# We need both because the 'stap' binary is probed for by configure
BuildRequires: systemtap
BuildRequires: systemtap-sdt-devel
# For VNC PNG support
BuildRequires: libpng-devel
# For virtiofs
BuildRequires: libcap-ng-devel
# Hard requirement for version >= 1.3
BuildRequires: pixman-devel
# For rdma
%if %{have_librdma}
BuildRequires: rdma-core-devel
%endif
%if %{have_fdt}
BuildRequires: libfdt-devel >= %{libfdt_version}
%endif
# For compressed guest memory dumps
BuildRequires: lzo-devel snappy-devel
# For NUMA memory binding
%if %{have_numactl}
BuildRequires: numactl-devel
%endif
BuildRequires: libgcrypt-devel
# qemu-pr-helper multipath support (requires libudev too)
BuildRequires: device-mapper-multipath-devel
BuildRequires: systemd-devel
%if %{have_pmem}
BuildRequires: libpmem-devel
%endif
# qemu-keymap
BuildRequires: pkgconfig(xkbcommon)
%if %{have_opengl}
BuildRequires: pkgconfig(epoxy)
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(gbm)
%endif
BuildRequires: perl-Test-Harness
BuildRequires: libslirp-devel
# Fedora specific
BuildRequires: make
BuildRequires: gcc
%if %{qemu_sanity_check} %if %{qemu_sanity_check}
BuildRequires: qemu-sanity-check-nodeps BuildRequires: qemu-sanity-check-nodeps
BuildRequires: kernel BuildRequires: kernel
%endif %endif
# chrpath calls in specfile # chrpath calls in specfile
BuildRequires: chrpath BuildRequires: chrpath
# -display sdl support # -display sdl support
BuildRequires: SDL2-devel BuildRequires: SDL2-devel
# used in various places for compression
BuildRequires: zlib-devel
# used in various places for crypto
BuildRequires: gnutls-devel
# VNC sasl auth support
BuildRequires: cyrus-sasl-devel
# aio implementation for block drivers
BuildRequires: libaio-devel
# pulseaudio audio output # pulseaudio audio output
BuildRequires: pulseaudio-libs-devel BuildRequires: pulseaudio-libs-devel
# alsa audio output # alsa audio output
BuildRequires: alsa-lib-devel BuildRequires: alsa-lib-devel
# qemu-pr-helper multipath support (requires libudev too)
BuildRequires: device-mapper-multipath-devel
BuildRequires: systemd-devel
# iscsi drive support
BuildRequires: libiscsi-devel
%if 0%{?fedora} %if 0%{?fedora}
# NFS drive support # NFS drive support
BuildRequires: libnfs-devel BuildRequires: libnfs-devel
%endif %endif
# snappy compression for memory dump
BuildRequires: snappy-devel
# lzo compression for memory dump
BuildRequires: lzo-devel
# curses display backend # curses display backend
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
# 9pfs filesystem
BuildRequires: libattr-devel
# qemu-bridge-helper, qemu-pr-helper and more
BuildRequires: libcap-ng-devel
# spice usb redirection support
BuildRequires: usbredir-devel
%if %{have_spice} %if %{have_spice}
# spice graphics support # spice graphics support
BuildRequires: spice-protocol BuildRequires: spice-protocol
BuildRequires: spice-server-devel BuildRequires: spice-server-devel
%endif %endif
# seccomp containment support
BuildRequires: libseccomp-devel
# network block driver
BuildRequires: libcurl-devel
%if %{with_block_rbd}
# RBD block driver
BuildRequires: librbd-devel
%endif
# We need both because the 'stap' binary is probed for by configure
BuildRequires: systemtap
BuildRequires: systemtap-sdt-devel
# VNC JPEG support # VNC JPEG support
BuildRequires: libjpeg-devel BuildRequires: libjpeg-devel
# VNC PNG support
BuildRequires: libpng-devel
# Braille device support # Braille device support
BuildRequires: brlapi-devel BuildRequires: brlapi-devel
# FDT device tree support %if %{have_block_gluster}
BuildRequires: libfdt-devel
# QEMU display pixel manipulation
BuildRequires: pixman-devel
%if %{with_block_gluster}
# gluster block driver # gluster block driver
BuildRequires: glusterfs-api-devel BuildRequires: glusterfs-api-devel
%endif %endif
# USB passthrough
BuildRequires: libusbx-devel
# SSH block driver
BuildRequires: libssh-devel
# GTK frontend # GTK frontend
BuildRequires: gtk3-devel BuildRequires: gtk3-devel
BuildRequires: vte291-devel BuildRequires: vte291-devel
# GTK translations # GTK translations
BuildRequires: gettext BuildRequires: gettext
# RDMA migration
%if %{with_rdma}
BuildRequires: rdma-core-devel
%endif
%if %{have_xen} %if %{have_xen}
# Xen support # Xen support
BuildRequires: xen-devel BuildRequires: xen-devel
%endif %endif
%if %{have_numactl}
# memdev hostmem backend
BuildRequires: numactl-devel
%endif
# reading bzip2 compressed dmg images # reading bzip2 compressed dmg images
BuildRequires: bzip2-devel BuildRequires: bzip2-devel
# opengl bits
BuildRequires: libepoxy-devel
# TLS test suite # TLS test suite
BuildRequires: libtasn1-devel BuildRequires: libtasn1-devel
# smartcard device # smartcard device
@ -389,31 +404,18 @@ BuildRequires: libcacard-devel
# virgl 3d support # virgl 3d support
BuildRequires: virglrenderer-devel BuildRequires: virglrenderer-devel
%endif %endif
# gtk GL support, vhost-user-gpu
BuildRequires: mesa-libgbm-devel
%if 0%{?fedora} %if 0%{?fedora}
# preferred disassembler for TCG # preferred disassembler for TCG
BuildRequires: capstone-devel BuildRequires: capstone-devel
%endif %endif
# parallels disk images require libxml2 # parallels disk images require libxml2
BuildRequires: libxml2-devel BuildRequires: libxml2-devel
%if %{have_pmem}
# nvdimm
BuildRequires: libpmem-devel
%endif
# qemu-ga # qemu-ga
BuildRequires: libudev-devel BuildRequires: libudev-devel
# qauth infrastructure # qauth infrastructure
BuildRequires: pam-devel BuildRequires: pam-devel
# user-mode networking
BuildRequires: libslirp-devel
# Documentation build
BuildRequires: python3-sphinx
# Test suite ./scripts/tap-driver.pl
BuildRequires: perl-Test-Harness
# For making python shebangs versioned # For making python shebangs versioned
BuildRequires: /usr/bin/pathfix.py BuildRequires: /usr/bin/pathfix.py
BuildRequires: python3-devel
%if %{have_liburing} %if %{have_liburing}
# liburing support. Library isn't built for arm # liburing support. Library isn't built for arm
BuildRequires: liburing-devel BuildRequires: liburing-devel
@ -424,8 +426,6 @@ BuildRequires: libzstd-devel
BuildRequires: hostname BuildRequires: hostname
# nvdimm dax # nvdimm dax
BuildRequires: daxctl-devel BuildRequires: daxctl-devel
# used by some linux user impls
BuildRequires: libdrm-devel
# fuse block device # fuse block device
BuildRequires: fuse-devel BuildRequires: fuse-devel
%if %{have_jack} %if %{have_jack}
@ -538,7 +538,7 @@ This package provides the additional DMG block driver for QEMU.
Install this package if you want to open '.dmg' files. Install this package if you want to open '.dmg' files.
%if %{with_block_gluster} %if %{have_block_gluster}
%package block-gluster %package block-gluster
Summary: QEMU Gluster block driver Summary: QEMU Gluster block driver
Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release}
@ -558,7 +558,7 @@ This package provides the additional iSCSI block driver for QEMU.
Install this package if you want to access iSCSI volumes. Install this package if you want to access iSCSI volumes.
%if %{with_block_nfs} %if %{have_block_nfs}
%package block-nfs %package block-nfs
Summary: QEMU NFS block driver Summary: QEMU NFS block driver
Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release}
@ -570,7 +570,7 @@ Install this package if you want to access remote NFS storage.
%endif %endif
%if %{with_block_rbd} %if %{have_block_rbd}
%package block-rbd %package block-rbd
Summary: QEMU Ceph/RBD block driver Summary: QEMU Ceph/RBD block driver
Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release}
@ -1564,19 +1564,19 @@ getent passwd qemu >/dev/null || \
%{_libdir}/qemu/block-curl.so %{_libdir}/qemu/block-curl.so
%files block-dmg %files block-dmg
%{_libdir}/qemu/block-dmg-bz2.so %{_libdir}/qemu/block-dmg-bz2.so
%if %{with_block_gluster} %if %{have_block_gluster}
%files block-gluster %files block-gluster
%{_libdir}/qemu/block-gluster.so %{_libdir}/qemu/block-gluster.so
%endif %endif
%files block-iscsi %files block-iscsi
%{_libdir}/qemu/block-iscsi.so %{_libdir}/qemu/block-iscsi.so
%if %{with_block_rbd} %if %{have_block_rbd}
%files block-rbd %files block-rbd
%{_libdir}/qemu/block-rbd.so %{_libdir}/qemu/block-rbd.so
%endif %endif
%files block-ssh %files block-ssh
%{_libdir}/qemu/block-ssh.so %{_libdir}/qemu/block-ssh.so
%if %{with_block_nfs} %if %{have_block_nfs}
%files block-nfs %files block-nfs
%{_libdir}/qemu/block-nfs.so %{_libdir}/qemu/block-nfs.so
%endif %endif