mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 01:18:00 +03:00
meson: update spec file to use meson
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
parent
0c2aa5b513
commit
18c729d83f
205
libvirt.spec.in
205
libvirt.spec.in
@ -12,11 +12,6 @@
|
|||||||
%define supported_platform 0
|
%define supported_platform 0
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Default to skipping autoreconf. Distros can change just this one line
|
|
||||||
# (or provide a command-line override) if they backport any patches that
|
|
||||||
# touch configure.ac or Makefile.am.
|
|
||||||
%{!?enable_autotools:%global enable_autotools 0}
|
|
||||||
|
|
||||||
# The hypervisor drivers that run in libvirtd
|
# The hypervisor drivers that run in libvirtd
|
||||||
%define with_qemu 0%{!?_without_qemu:1}
|
%define with_qemu 0%{!?_without_qemu:1}
|
||||||
%define with_lxc 0%{!?_without_lxc:1}
|
%define with_lxc 0%{!?_without_lxc:1}
|
||||||
@ -203,9 +198,9 @@
|
|||||||
# compiler warning into errors without being worried about frequent
|
# compiler warning into errors without being worried about frequent
|
||||||
# changes in reported warnings
|
# changes in reported warnings
|
||||||
%if 0%{?rhel}
|
%if 0%{?rhel}
|
||||||
%define enable_werror --enable-werror
|
%define enable_werror -Dwerror=true
|
||||||
%else
|
%else
|
||||||
%define enable_werror --disable-werror
|
%define enable_werror -Dwerror=false
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?rhel} == 7
|
%if 0%{?rhel} == 7
|
||||||
@ -257,18 +252,15 @@ Requires: libvirt-libs = %{version}-%{release}
|
|||||||
|
|
||||||
# All build-time requirements. Run-time requirements are
|
# All build-time requirements. Run-time requirements are
|
||||||
# listed against each sub-RPM
|
# listed against each sub-RPM
|
||||||
%if 0%{?enable_autotools}
|
|
||||||
BuildRequires: autoconf
|
|
||||||
BuildRequires: automake
|
|
||||||
BuildRequires: gettext-devel
|
BuildRequires: gettext-devel
|
||||||
BuildRequires: libtool
|
|
||||||
%endif
|
|
||||||
%if 0%{?rhel} == 7
|
%if 0%{?rhel} == 7
|
||||||
BuildRequires: python36-docutils
|
BuildRequires: python36-docutils
|
||||||
%else
|
%else
|
||||||
BuildRequires: python3-docutils
|
BuildRequires: python3-docutils
|
||||||
%endif
|
%endif
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
|
BuildRequires: meson >= 0.54.0
|
||||||
|
BuildRequires: ninja-build
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
BuildRequires: git
|
BuildRequires: git
|
||||||
%if 0%{?fedora} || 0%{?rhel} > 7
|
%if 0%{?fedora} || 0%{?rhel} > 7
|
||||||
@ -1006,219 +998,209 @@ exit 1
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_qemu}
|
%if %{with_qemu}
|
||||||
%define arg_qemu --with-qemu
|
%define arg_qemu -Ddriver_qemu=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_qemu --without-qemu
|
%define arg_qemu -Ddriver_qemu=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_openvz}
|
%if %{with_openvz}
|
||||||
%define arg_openvz --with-openvz
|
%define arg_openvz -Ddriver_openvz=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_openvz --without-openvz
|
%define arg_openvz -Ddriver_openvz=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_lxc}
|
%if %{with_lxc}
|
||||||
%define arg_lxc --with-lxc
|
%define arg_lxc -Ddriver_lxc=enabled
|
||||||
%define arg_login_shell --with-login-shell
|
%define arg_login_shell -Dlogin_shell=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_lxc --without-lxc
|
%define arg_lxc -Ddriver_lxc=disabled
|
||||||
%define arg_login_shell --without-login-shell
|
%define arg_login_shell -Dlogin_shell=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_vbox}
|
%if %{with_vbox}
|
||||||
%define arg_vbox --with-vbox
|
%define arg_vbox -Ddriver_vbox=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_vbox --without-vbox
|
%define arg_vbox -Ddriver_vbox=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_libxl}
|
%if %{with_libxl}
|
||||||
%define arg_libxl --with-libxl
|
%define arg_libxl -Ddriver_libxl=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_libxl --without-libxl
|
%define arg_libxl -Ddriver_libxl=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_esx}
|
%if %{with_esx}
|
||||||
%define arg_esx --with-esx
|
%define arg_esx -Ddriver_esx=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_esx --without-esx
|
%define arg_esx -Ddriver_esx=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_hyperv}
|
%if %{with_hyperv}
|
||||||
%define arg_hyperv --with-hyperv
|
%define arg_hyperv -Ddriver_hyperv=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_hyperv --without-hyperv
|
%define arg_hyperv -Ddriver_hyperv=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_vmware}
|
%if %{with_vmware}
|
||||||
%define arg_vmware --with-vmware
|
%define arg_vmware -Ddriver_vmware=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_vmware --without-vmware
|
%define arg_vmware -Ddriver_vmware=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_storage_rbd}
|
%if %{with_storage_rbd}
|
||||||
%define arg_storage_rbd --with-storage-rbd
|
%define arg_storage_rbd -Dstorage_rbd=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_storage_rbd --without-storage-rbd
|
%define arg_storage_rbd -Dstorage_rbd=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_storage_sheepdog}
|
%if %{with_storage_sheepdog}
|
||||||
%define arg_storage_sheepdog --with-storage-sheepdog
|
%define arg_storage_sheepdog -Dstorage_sheepdog=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_storage_sheepdog --without-storage-sheepdog
|
%define arg_storage_sheepdog -Dstorage_sheepdog=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_storage_gluster}
|
%if %{with_storage_gluster}
|
||||||
%define arg_storage_gluster --with-storage-gluster
|
%define arg_storage_gluster -Dstorage_gluster=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_storage_gluster --without-storage-gluster
|
%define arg_storage_gluster -Dstorage_gluster=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_storage_zfs}
|
%if %{with_storage_zfs}
|
||||||
%define arg_storage_zfs --with-storage-zfs
|
%define arg_storage_zfs -Dstorage_zfs=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_storage_zfs --without-storage-zfs
|
%define arg_storage_zfs -Dstorage_zfs=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_numactl}
|
%if %{with_numactl}
|
||||||
%define arg_numactl --with-numactl
|
%define arg_numactl -Dnumactl=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_numactl --without-numactl
|
%define arg_numactl -Dnumactl=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_numad}
|
%if %{with_numad}
|
||||||
%define arg_numad --with-numad
|
%define arg_numad -Dnumad=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_numad --without-numad
|
%define arg_numad -Dnumad=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_fuse}
|
%if %{with_fuse}
|
||||||
%define arg_fuse --with-fuse
|
%define arg_fuse -Dfuse=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_fuse --without-fuse
|
%define arg_fuse -Dfuse=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_sanlock}
|
%if %{with_sanlock}
|
||||||
%define arg_sanlock --with-sanlock
|
%define arg_sanlock -Dsanlock=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_sanlock --without-sanlock
|
%define arg_sanlock -Dsanlock=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_firewalld}
|
%if %{with_firewalld}
|
||||||
%define arg_firewalld --with-firewalld
|
%define arg_firewalld -Dfirewalld=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_firewalld --without-firewalld
|
%define arg_firewalld -Dfirewalld=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_firewalld_zone}
|
%if %{with_firewalld_zone}
|
||||||
%define arg_firewalld_zone --with-firewalld-zone
|
%define arg_firewalld_zone -Dfirewalld_zone=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_firewalld_zone --without-firewalld-zone
|
%define arg_firewalld_zone -Dfirewalld_zone=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_wireshark}
|
%if %{with_wireshark}
|
||||||
%define arg_wireshark --with-wireshark-dissector
|
%define arg_wireshark -Dwireshark_dissector=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_wireshark --without-wireshark-dissector
|
%define arg_wireshark -Dwireshark_dissector=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with_storage_iscsi_direct}
|
%if %{with_storage_iscsi_direct}
|
||||||
%define arg_storage_iscsi_direct --with-storage-iscsi-direct
|
%define arg_storage_iscsi_direct -Dstorage_iscsi_direct=enabled
|
||||||
%else
|
%else
|
||||||
%define arg_storage_iscsi_direct --without-storage-iscsi-direct
|
%define arg_storage_iscsi_direct -Dstorage_iscsi_direct=disabled
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%define when %(date +"%%F-%%T")
|
%define when %(date +"%%F-%%T")
|
||||||
%define where %(hostname)
|
%define where %(hostname)
|
||||||
%define who %{?packager}%{!?packager:Unknown}
|
%define who %{?packager}%{!?packager:Unknown}
|
||||||
%define arg_packager --with-packager="%{who}, %{when}, %{where}"
|
%define arg_packager -Dpackager="%{who}, %{when}, %{where}"
|
||||||
%define arg_packager_version --with-packager-version="%{release}"
|
%define arg_packager_version -Dpackager_version="%{release}"
|
||||||
|
|
||||||
%define arg_selinux_mount --with-selinux-mount="/sys/fs/selinux"
|
%define arg_selinux_mount -Dselinux_mount="/sys/fs/selinux"
|
||||||
|
|
||||||
# place macros above and build commands below this comment
|
# place macros above and build commands below this comment
|
||||||
|
|
||||||
export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
|
export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
|
||||||
|
|
||||||
%if 0%{?enable_autotools}
|
%meson \
|
||||||
autoreconf -if
|
-Drunstatedir=%{_rundir} \
|
||||||
%endif
|
|
||||||
|
|
||||||
rm -f po/stamp-po
|
|
||||||
|
|
||||||
%define _configure ../configure
|
|
||||||
mkdir %{_vpath_builddir}
|
|
||||||
cd %{_vpath_builddir}
|
|
||||||
|
|
||||||
%configure --enable-dependency-tracking \
|
|
||||||
--with-runstatedir=%{_rundir} \
|
|
||||||
%{?arg_qemu} \
|
%{?arg_qemu} \
|
||||||
%{?arg_openvz} \
|
%{?arg_openvz} \
|
||||||
%{?arg_lxc} \
|
%{?arg_lxc} \
|
||||||
%{?arg_vbox} \
|
%{?arg_vbox} \
|
||||||
%{?arg_libxl} \
|
%{?arg_libxl} \
|
||||||
--with-sasl \
|
-Dsasl=enabled \
|
||||||
--with-polkit \
|
-Dpolkit=enabled \
|
||||||
--with-libvirtd \
|
-Ddriver_libvirtd=enabled \
|
||||||
%{?arg_esx} \
|
%{?arg_esx} \
|
||||||
%{?arg_hyperv} \
|
%{?arg_hyperv} \
|
||||||
%{?arg_vmware} \
|
%{?arg_vmware} \
|
||||||
--without-vz \
|
-Ddriver_vz=disabled \
|
||||||
--without-bhyve \
|
-Ddriver_bhyve=disabled \
|
||||||
--with-remote-default-mode=legacy \
|
-Dremote_default_mode=legacy \
|
||||||
--with-interface \
|
-Ddriver_interface=enabled \
|
||||||
--with-network \
|
-Ddriver_network=enabled \
|
||||||
--with-storage-fs \
|
-Dstorage_fs=enabled \
|
||||||
--with-storage-lvm \
|
-Dstorage_lvm=enabled \
|
||||||
--with-storage-iscsi \
|
-Dstorage_iscsi=enabled \
|
||||||
%{?arg_storage_iscsi_direct} \
|
%{?arg_storage_iscsi_direct} \
|
||||||
--with-storage-scsi \
|
-Dstorage_scsi=enabled \
|
||||||
--with-storage-disk \
|
-Dstorage_disk=enabled \
|
||||||
--with-storage-mpath \
|
-Dstorage_mpath=enabled \
|
||||||
%{?arg_storage_rbd} \
|
%{?arg_storage_rbd} \
|
||||||
%{?arg_storage_sheepdog} \
|
%{?arg_storage_sheepdog} \
|
||||||
%{?arg_storage_gluster} \
|
%{?arg_storage_gluster} \
|
||||||
%{?arg_storage_zfs} \
|
%{?arg_storage_zfs} \
|
||||||
--without-storage-vstorage \
|
-Dstorage_vstorage=disabled \
|
||||||
%{?arg_numactl} \
|
%{?arg_numactl} \
|
||||||
%{?arg_numad} \
|
%{?arg_numad} \
|
||||||
--with-capng \
|
-Dcapng=enabled \
|
||||||
%{?arg_fuse} \
|
%{?arg_fuse} \
|
||||||
--with-netcf \
|
-Dnetcf=enabled \
|
||||||
--with-selinux \
|
-Dselinux=enabled \
|
||||||
%{?arg_selinux_mount} \
|
%{?arg_selinux_mount} \
|
||||||
--without-apparmor \
|
-Dapparmor=disabled \
|
||||||
--without-hal \
|
-Dsecdriver_apparmor=disabled \
|
||||||
--with-udev \
|
-Dhal=disabled \
|
||||||
--with-yajl \
|
-Dudev=enabled \
|
||||||
|
-Dyajl=enabled \
|
||||||
%{?arg_sanlock} \
|
%{?arg_sanlock} \
|
||||||
--with-libpcap \
|
-Dlibpcap=enabled \
|
||||||
--with-macvtap \
|
-Dmacvtap=enabled \
|
||||||
--with-audit \
|
-Daudit=enabled \
|
||||||
--with-dtrace \
|
-Ddtrace=enabled \
|
||||||
--with-driver-modules \
|
|
||||||
%{?arg_firewalld} \
|
%{?arg_firewalld} \
|
||||||
%{?arg_firewalld_zone} \
|
%{?arg_firewalld_zone} \
|
||||||
%{?arg_wireshark} \
|
%{?arg_wireshark} \
|
||||||
--without-pm-utils \
|
-Dpm_utils=disabled \
|
||||||
--with-nss-plugin \
|
-Dnss=enabled \
|
||||||
%{arg_packager} \
|
%{arg_packager} \
|
||||||
%{arg_packager_version} \
|
%{arg_packager_version} \
|
||||||
--with-qemu-user=%{qemu_user} \
|
-Dqemu_user=%{qemu_user} \
|
||||||
--with-qemu-group=%{qemu_group} \
|
-Dqemu_group=%{qemu_group} \
|
||||||
--with-tls-priority=%{tls_priority} \
|
-Dtls_priority=%{tls_priority} \
|
||||||
%{?enable_werror} \
|
%{?enable_werror} \
|
||||||
--enable-expensive-tests \
|
-Dexpensive_tests=enabled \
|
||||||
--with-init-script=systemd \
|
-Dinit_script=systemd \
|
||||||
%{?arg_login_shell}
|
%{?arg_login_shell}
|
||||||
make %{?_smp_mflags} V=1
|
|
||||||
|
%meson_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -fr %{buildroot}
|
rm -fr %{buildroot}
|
||||||
|
|
||||||
export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
|
export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
|
||||||
|
|
||||||
cd %{_vpath_builddir}
|
%meson_install
|
||||||
%make_install %{?_smp_mflags} SYSTEMD_UNIT_DIR=%{_unitdir} V=1
|
|
||||||
|
|
||||||
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
|
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
|
||||||
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
|
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
|
||||||
@ -1299,12 +1281,7 @@ mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
cd %{_vpath_builddir}
|
VIR_TEST_DEBUG=1 %meson_test --no-suite syntax-check
|
||||||
if ! make %{?_smp_mflags} check VIR_TEST_DEBUG=1
|
|
||||||
then
|
|
||||||
cat tests/test-suite.log || true
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
%post libs
|
%post libs
|
||||||
%if 0%{?rhel} == 7
|
%if 0%{?rhel} == 7
|
||||||
@ -1511,7 +1488,7 @@ exit 0
|
|||||||
|
|
||||||
%files docs
|
%files docs
|
||||||
%doc AUTHORS ChangeLog NEWS.rst README README.rst
|
%doc AUTHORS ChangeLog NEWS.rst README README.rst
|
||||||
%doc %{_vpath_builddir}/libvirt-docs/*
|
%doc libvirt-docs/*
|
||||||
|
|
||||||
%files daemon
|
%files daemon
|
||||||
|
|
||||||
@ -1884,7 +1861,7 @@ exit 0
|
|||||||
%config(noreplace) %{_sysconfdir}/sysconfig/libvirt-guests
|
%config(noreplace) %{_sysconfdir}/sysconfig/libvirt-guests
|
||||||
%attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh
|
%attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh
|
||||||
|
|
||||||
%files libs -f %{_vpath_builddir}/%{name}.lang
|
%files libs -f %{name}.lang
|
||||||
%license COPYING COPYING.LESSER
|
%license COPYING COPYING.LESSER
|
||||||
%config(noreplace) %{_sysconfdir}/libvirt/libvirt.conf
|
%config(noreplace) %{_sysconfdir}/libvirt/libvirt.conf
|
||||||
%config(noreplace) %{_sysconfdir}/libvirt/libvirt-admin.conf
|
%config(noreplace) %{_sysconfdir}/libvirt/libvirt-admin.conf
|
||||||
|
@ -2300,7 +2300,6 @@ if git
|
|||||||
# Using return values from configure_file in add_dist_script is possible since 0.55.0
|
# Using return values from configure_file in add_dist_script is possible since 0.55.0
|
||||||
dist_files = [
|
dist_files = [
|
||||||
'libvirt.spec',
|
'libvirt.spec',
|
||||||
'mingw-libvirt.spec',
|
|
||||||
'AUTHORS',
|
'AUTHORS',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user