You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1990 lines
61 KiB

  1. # -*- rpm-spec -*-
  2. # This spec file assumes you are building on a Fedora or RHEL version
  3. # that's still supported by the vendor. It may work on other distros
  4. # or versions, but no effort will be made to ensure that going forward.
  5. %define min_rhel 7
  6. %define min_fedora 31
  7. %if (0%{?fedora} && 0%{?fedora} >= %{min_fedora}) || (0%{?rhel} && 0%{?rhel} >= %{min_rhel})
  8. %define supported_platform 1
  9. %else
  10. %define supported_platform 0
  11. %endif
  12. # Default to skipping autoreconf. Distros can change just this one line
  13. # (or provide a command-line override) if they backport any patches that
  14. # touch configure.ac or Makefile.am.
  15. %{!?enable_autotools:%global enable_autotools 0}
  16. # The hypervisor drivers that run in libvirtd
  17. %define with_qemu 0%{!?_without_qemu:1}
  18. %define with_lxc 0%{!?_without_lxc:1}
  19. %define with_libxl 0%{!?_without_libxl:1}
  20. %define with_vbox 0%{!?_without_vbox:1}
  21. %define with_qemu_tcg %{with_qemu}
  22. %define qemu_kvm_arches %{ix86} x86_64
  23. %if 0%{?fedora}
  24. %define qemu_kvm_arches %{ix86} x86_64 %{power64} s390x %{arm} aarch64
  25. %endif
  26. %if 0%{?rhel}
  27. %define with_qemu_tcg 0
  28. %define qemu_kvm_arches x86_64 %{power64} aarch64 s390x
  29. %endif
  30. # On RHEL 7 and older macro _vpath_builddir is not defined.
  31. %if 0%{?rhel} <= 7
  32. %define _vpath_builddir %{_target_platform}
  33. %endif
  34. %ifarch %{qemu_kvm_arches}
  35. %define with_qemu_kvm %{with_qemu}
  36. %else
  37. %define with_qemu_kvm 0
  38. %endif
  39. %if ! %{with_qemu_tcg} && ! %{with_qemu_kvm}
  40. %define with_qemu 0
  41. %endif
  42. # Then the hypervisor drivers that run outside libvirtd, in libvirt.so
  43. %define with_openvz 0%{!?_without_openvz:1}
  44. %define with_vmware 0%{!?_without_vmware:1}
  45. %define with_esx 0%{!?_without_esx:1}
  46. %define with_hyperv 0%{!?_without_hyperv:1}
  47. # Then the secondary host drivers, which run inside libvirtd
  48. %define with_storage_rbd 0%{!?_without_storage_rbd:1}
  49. %if 0%{?fedora}
  50. %define with_storage_sheepdog 0%{!?_without_storage_sheepdog:1}
  51. %else
  52. %define with_storage_sheepdog 0
  53. %endif
  54. %define with_storage_gluster 0%{!?_without_storage_gluster:1}
  55. %ifnarch %{qemu_kvm_arches}
  56. # gluster is only built where qemu driver is enabled on RHEL 8
  57. %if 0%{?rhel} >= 8
  58. %define with_storage_gluster 0
  59. %endif
  60. %endif
  61. %define with_numactl 0%{!?_without_numactl:1}
  62. # F25+ has zfs-fuse
  63. %if 0%{?fedora}
  64. %define with_storage_zfs 0%{!?_without_storage_zfs:1}
  65. %else
  66. %define with_storage_zfs 0
  67. %endif
  68. # We need a recent enough libiscsi (>= 1.18.0)
  69. %if 0%{?fedora} || 0%{?rhel} > 7
  70. %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1}
  71. %else
  72. %define with_storage_iscsi_direct 0
  73. %endif
  74. # A few optional bits off by default, we enable later
  75. %define with_fuse 0%{!?_without_fuse:0}
  76. %define with_sanlock 0%{!?_without_sanlock:0}
  77. %define with_numad 0%{!?_without_numad:0}
  78. %define with_firewalld 0%{!?_without_firewalld:0}
  79. %define with_firewalld_zone 0%{!?_without_firewalld_zone:0}
  80. %define with_libssh2 0%{!?_without_libssh2:0}
  81. %define with_wireshark 0%{!?_without_wireshark:0}
  82. %define with_libssh 0%{!?_without_libssh:0}
  83. %define with_bash_completion 0%{!?_without_bash_completion:0}
  84. # Finally set the OS / architecture specific special cases
  85. # Xen is available only on i386 x86_64 ia64
  86. %ifnarch %{ix86} x86_64 ia64
  87. %define with_libxl 0
  88. %endif
  89. # vbox is available only on i386 x86_64
  90. %ifnarch %{ix86} x86_64
  91. %define with_vbox 0
  92. %endif
  93. # Numactl is not available on many non-x86 archs
  94. %ifarch s390 s390x %{arm} riscv64
  95. %define with_numactl 0
  96. %endif
  97. # zfs-fuse is not available on some architectures
  98. %ifarch s390 s390x aarch64 riscv64
  99. %define with_storage_zfs 0
  100. %endif
  101. # Ceph dropping support for 32-bit hosts
  102. %if 0%{?fedora} >= 30
  103. %ifarch %{arm} %{ix86}
  104. %define with_storage_rbd 0
  105. %endif
  106. %endif
  107. # RHEL doesn't ship OpenVZ, VBox, PowerHypervisor,
  108. # VMware, libxenlight (Xen 4.1 and newer),
  109. # or HyperV.
  110. %if 0%{?rhel}
  111. %define with_openvz 0
  112. %define with_vbox 0
  113. %define with_vmware 0
  114. %define with_libxl 0
  115. %define with_hyperv 0
  116. %define with_vz 0
  117. %if 0%{?rhel} > 7
  118. %define with_lxc 0
  119. %endif
  120. %endif
  121. %define with_firewalld 1
  122. %if 0%{?fedora} >= 31 || 0%{?rhel} > 7
  123. %define with_firewalld_zone 0%{!?_without_firewalld_zone:1}
  124. %endif
  125. # fuse is used to provide virtualized /proc for LXC
  126. %if %{with_lxc}
  127. %define with_fuse 0%{!?_without_fuse:1}
  128. %endif
  129. # Enable sanlock library for lock management with QEMU
  130. # Sanlock is available only on arches where kvm is available for RHEL
  131. %if 0%{?fedora}
  132. %define with_sanlock 0%{!?_without_sanlock:1}
  133. %endif
  134. %if 0%{?rhel}
  135. %ifarch %{qemu_kvm_arches}
  136. %define with_sanlock 0%{!?_without_sanlock:1}
  137. %endif
  138. %endif
  139. # Enable libssh2 transport for new enough distros
  140. %if 0%{?fedora}
  141. %define with_libssh2 0%{!?_without_libssh2:1}
  142. %endif
  143. # Enable wireshark plugins for all distros shipping libvirt 1.2.2 or newer
  144. %if 0%{?fedora}
  145. %define with_wireshark 0%{!?_without_wireshark:1}
  146. %define wireshark_plugindir %(pkg-config --variable plugindir wireshark)/epan
  147. %endif
  148. # Enable libssh transport for new enough distros
  149. %if 0%{?fedora} || 0%{?rhel} > 7
  150. %define with_libssh 0%{!?_without_libssh:1}
  151. %endif
  152. %define with_bash_completion 0%{!?_without_bash_completion:1}
  153. %if %{with_qemu} || %{with_lxc}
  154. # numad is used to manage the CPU and memory placement dynamically,
  155. # it's not available on many non-x86 architectures.
  156. %ifnarch s390 s390x %{arm} riscv64
  157. %define with_numad 0%{!?_without_numad:1}
  158. %endif
  159. %endif
  160. # Force QEMU to run as non-root
  161. %define qemu_user qemu
  162. %define qemu_group qemu
  163. # RHEL releases provide stable tool chains and so it is safe to turn
  164. # compiler warning into errors without being worried about frequent
  165. # changes in reported warnings
  166. %if 0%{?rhel}
  167. %define enable_werror --enable-werror
  168. %else
  169. %define enable_werror --disable-werror
  170. %endif
  171. %if 0%{?rhel} == 7
  172. %define tls_priority "NORMAL"
  173. %else
  174. %define tls_priority "@LIBVIRT,SYSTEM"
  175. %endif
  176. Summary: Library providing a simple virtualization API
  177. Name: libvirt
  178. Version: @VERSION@
  179. Release: 1%{?dist}
  180. License: LGPLv2+
  181. URL: https://libvirt.org/
  182. %if %(echo %{version} | grep -q "\.0$"; echo $?) == 1
  183. %define mainturl stable_updates/
  184. %endif
  185. Source: https://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.xz
  186. Requires: libvirt-daemon = %{version}-%{release}
  187. Requires: libvirt-daemon-config-network = %{version}-%{release}
  188. Requires: libvirt-daemon-config-nwfilter = %{version}-%{release}
  189. %if %{with_libxl}
  190. Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
  191. %endif
  192. %if %{with_lxc}
  193. Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
  194. %endif
  195. %if %{with_qemu}
  196. Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
  197. %endif
  198. # We had UML driver, but we've removed it.
  199. Obsoletes: libvirt-daemon-driver-uml <= 5.0.0
  200. Obsoletes: libvirt-daemon-uml <= 5.0.0
  201. %if %{with_vbox}
  202. Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
  203. %endif
  204. Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
  205. Requires: libvirt-daemon-driver-interface = %{version}-%{release}
  206. Requires: libvirt-daemon-driver-secret = %{version}-%{release}
  207. Requires: libvirt-daemon-driver-storage = %{version}-%{release}
  208. Requires: libvirt-daemon-driver-network = %{version}-%{release}
  209. Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
  210. Requires: libvirt-client = %{version}-%{release}
  211. Requires: libvirt-libs = %{version}-%{release}
  212. # All build-time requirements. Run-time requirements are
  213. # listed against each sub-RPM
  214. %if 0%{?enable_autotools}
  215. BuildRequires: autoconf
  216. BuildRequires: automake
  217. BuildRequires: gettext-devel
  218. BuildRequires: libtool
  219. %endif
  220. %if 0%{?rhel} == 7
  221. BuildRequires: python36-docutils
  222. %else
  223. BuildRequires: python3-docutils
  224. %endif
  225. BuildRequires: gcc
  226. BuildRequires: make
  227. BuildRequires: git
  228. %if 0%{?fedora} || 0%{?rhel} > 7
  229. BuildRequires: perl-interpreter
  230. %else
  231. BuildRequires: perl
  232. %endif
  233. BuildRequires: python3
  234. BuildRequires: systemd-units
  235. %if %{with_libxl}
  236. BuildRequires: xen-devel
  237. %endif
  238. BuildRequires: glib2-devel >= 2.48
  239. BuildRequires: libxml2-devel
  240. BuildRequires: libxslt
  241. BuildRequires: readline-devel
  242. %if %{with_bash_completion}
  243. BuildRequires: bash-completion >= 2.0
  244. %endif
  245. BuildRequires: ncurses-devel
  246. BuildRequires: gettext
  247. BuildRequires: libtasn1-devel
  248. BuildRequires: gnutls-devel
  249. BuildRequires: libattr-devel
  250. # For pool-build probing for existing pools
  251. BuildRequires: libblkid-devel >= 2.17
  252. # for augparse, optionally used in testing
  253. BuildRequires: augeas
  254. BuildRequires: systemd-devel >= 185
  255. BuildRequires: libpciaccess-devel >= 0.10.9
  256. BuildRequires: yajl-devel
  257. %if %{with_sanlock}
  258. BuildRequires: sanlock-devel >= 2.4
  259. %endif
  260. BuildRequires: libpcap-devel >= 1.5.0
  261. BuildRequires: libnl3-devel
  262. BuildRequires: libselinux-devel
  263. BuildRequires: dnsmasq >= 2.41
  264. BuildRequires: iptables
  265. BuildRequires: radvd
  266. BuildRequires: ebtables
  267. BuildRequires: module-init-tools
  268. BuildRequires: cyrus-sasl-devel
  269. BuildRequires: polkit >= 0.112
  270. # For mount/umount in FS driver
  271. BuildRequires: util-linux
  272. %if %{with_qemu}
  273. # For managing ACLs
  274. BuildRequires: libacl-devel
  275. # From QEMU RPMs
  276. BuildRequires: /usr/bin/qemu-img
  277. %endif
  278. # For LVM drivers
  279. BuildRequires: lvm2
  280. # For pool type=iscsi
  281. BuildRequires: iscsi-initiator-utils
  282. %if %{with_storage_iscsi_direct}
  283. # For pool type=iscsi-direct
  284. BuildRequires: libiscsi-devel
  285. %endif
  286. # For disk driver
  287. BuildRequires: parted-devel
  288. # For Multipath support
  289. BuildRequires: device-mapper-devel
  290. # For XFS reflink clone support
  291. BuildRequires: xfsprogs-devel
  292. %if %{with_storage_rbd}
  293. %if 0%{?fedora} || 0%{?rhel} > 7
  294. BuildRequires: librados-devel
  295. BuildRequires: librbd-devel
  296. %else
  297. BuildRequires: librados2-devel
  298. BuildRequires: librbd1-devel
  299. %endif
  300. %endif
  301. %if %{with_storage_gluster}
  302. BuildRequires: glusterfs-api-devel >= 3.4.1
  303. BuildRequires: glusterfs-devel >= 3.4.1
  304. %endif
  305. %if %{with_storage_sheepdog}
  306. BuildRequires: sheepdog
  307. %endif
  308. %if %{with_storage_zfs}
  309. # Support any conforming implementation of zfs. On stock Fedora
  310. # this is zfs-fuse, but could be zfsonlinux upstream RPMs
  311. BuildRequires: /sbin/zfs
  312. BuildRequires: /sbin/zpool
  313. %endif
  314. %if %{with_numactl}
  315. # For QEMU/LXC numa info
  316. BuildRequires: numactl-devel
  317. %endif
  318. BuildRequires: libcap-ng-devel >= 0.5.0
  319. %if %{with_fuse}
  320. BuildRequires: fuse-devel >= 2.8.6
  321. %endif
  322. %if %{with_libssh2}
  323. BuildRequires: libssh2-devel >= 1.3.0
  324. %endif
  325. BuildRequires: netcf-devel >= 0.2.2
  326. %if %{with_esx}
  327. BuildRequires: libcurl-devel
  328. %endif
  329. %if %{with_hyperv}
  330. BuildRequires: libwsman-devel >= 2.2.3
  331. %endif
  332. BuildRequires: audit-libs-devel
  333. # we need /usr/sbin/dtrace
  334. BuildRequires: systemtap-sdt-devel
  335. # For mount/umount in FS driver
  336. BuildRequires: util-linux
  337. # For showmount in FS driver (netfs discovery)
  338. BuildRequires: nfs-utils
  339. # Communication with the firewall and polkit daemons use DBus
  340. BuildRequires: dbus-devel
  341. # Fedora build root suckage
  342. BuildRequires: gawk
  343. # For storage wiping with different algorithms
  344. BuildRequires: scrub
  345. %if %{with_numad}
  346. BuildRequires: numad
  347. %endif
  348. %if %{with_wireshark}
  349. BuildRequires: wireshark-devel >= 2.4.0
  350. %endif
  351. %if %{with_libssh}
  352. BuildRequires: libssh-devel >= 0.7.0
  353. %endif
  354. %if 0%{?fedora} || 0%{?rhel} > 7
  355. BuildRequires: rpcgen
  356. BuildRequires: libtirpc-devel
  357. %endif
  358. %if %{with_firewalld_zone}
  359. BuildRequires: firewalld-filesystem
  360. %endif
  361. %description
  362. Libvirt is a C toolkit to interact with the virtualization capabilities
  363. of recent versions of Linux (and other OSes). The main package includes
  364. the libvirtd server exporting the virtualization support.
  365. %package docs
  366. Summary: API reference and website documentation
  367. %description docs
  368. Includes the API reference for the libvirt C library, and a complete
  369. copy of the libvirt.org website documentation.
  370. %package daemon
  371. Summary: Server side daemon and supporting files for libvirt library
  372. # All runtime requirements for the libvirt package (runtime requrements
  373. # for subpackages are listed later in those subpackages)
  374. # The client side, i.e. shared libs are in a subpackage
  375. Requires: %{name}-libs = %{version}-%{release}
  376. # (client invokes 'nc' against the UNIX socket on the server)
  377. Requires: /usr/bin/nc
  378. # for modprobe of pci devices
  379. Requires: module-init-tools
  380. # for /sbin/ip & /sbin/tc
  381. Requires: iproute
  382. # tc is provided by iproute-tc since at least Fedora 26
  383. %if 0%{?fedora} || 0%{?rhel} > 7
  384. Requires: iproute-tc
  385. %endif
  386. Requires: polkit >= 0.112
  387. %ifarch %{ix86} x86_64 ia64
  388. # For virConnectGetSysinfo
  389. Requires: dmidecode
  390. %endif
  391. # For service management
  392. Requires(post): systemd-units
  393. Requires(post): systemd-sysv
  394. Requires(preun): systemd-units
  395. Requires(postun): systemd-units
  396. %if %{with_numad}
  397. Requires: numad
  398. %endif
  399. # libvirtd depends on 'messagebus' service
  400. Requires: dbus
  401. # For uid creation during pre
  402. Requires(pre): shadow-utils
  403. %description daemon
  404. Server side daemon required to manage the virtualization capabilities
  405. of recent versions of Linux. Requires a hypervisor specific sub-RPM
  406. for specific drivers.
  407. %package daemon-config-network
  408. Summary: Default configuration files for the libvirtd daemon
  409. Requires: libvirt-daemon = %{version}-%{release}
  410. Requires: libvirt-daemon-driver-network = %{version}-%{release}
  411. %description daemon-config-network
  412. Default configuration files for setting up NAT based networking
  413. %package daemon-config-nwfilter
  414. Summary: Network filter configuration files for the libvirtd daemon
  415. Requires: libvirt-daemon = %{version}-%{release}
  416. Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
  417. %description daemon-config-nwfilter
  418. Network filter configuration files for cleaning guest traffic
  419. %package daemon-driver-network
  420. Summary: Network driver plugin for the libvirtd daemon
  421. Requires: libvirt-daemon = %{version}-%{release}
  422. Requires: libvirt-libs = %{version}-%{release}
  423. Requires: dnsmasq >= 2.41
  424. Requires: radvd
  425. Requires: iptables
  426. %description daemon-driver-network
  427. The network driver plugin for the libvirtd daemon, providing
  428. an implementation of the virtual network APIs using the Linux
  429. bridge capabilities.
  430. %package daemon-driver-nwfilter
  431. Summary: Nwfilter driver plugin for the libvirtd daemon
  432. Requires: libvirt-daemon = %{version}-%{release}
  433. Requires: libvirt-libs = %{version}-%{release}
  434. Requires: iptables
  435. Requires: ebtables
  436. %description daemon-driver-nwfilter
  437. The nwfilter driver plugin for the libvirtd daemon, providing
  438. an implementation of the firewall APIs using the ebtables,
  439. iptables and ip6tables capabilities
  440. %package daemon-driver-nodedev
  441. Summary: Nodedev driver plugin for the libvirtd daemon
  442. Requires: libvirt-daemon = %{version}-%{release}
  443. Requires: libvirt-libs = %{version}-%{release}
  444. # needed for device enumeration
  445. Requires: systemd >= 185
  446. # For managing persistent mediated devices
  447. Requires: mdevctl
  448. %description daemon-driver-nodedev
  449. The nodedev driver plugin for the libvirtd daemon, providing
  450. an implementation of the node device APIs using the udev
  451. capabilities.
  452. %package daemon-driver-interface
  453. Summary: Interface driver plugin for the libvirtd daemon
  454. Requires: libvirt-daemon = %{version}-%{release}
  455. Requires: libvirt-libs = %{version}-%{release}
  456. Requires: netcf-libs >= 0.2.2
  457. %description daemon-driver-interface
  458. The interface driver plugin for the libvirtd daemon, providing
  459. an implementation of the network interface APIs using the
  460. netcf library
  461. %package daemon-driver-secret
  462. Summary: Secret driver plugin for the libvirtd daemon
  463. Requires: libvirt-daemon = %{version}-%{release}
  464. Requires: libvirt-libs = %{version}-%{release}
  465. %description daemon-driver-secret
  466. The secret driver plugin for the libvirtd daemon, providing
  467. an implementation of the secret key APIs.
  468. %package daemon-driver-storage-core
  469. Summary: Storage driver plugin including base backends for the libvirtd daemon
  470. Requires: libvirt-daemon = %{version}-%{release}
  471. Requires: libvirt-libs = %{version}-%{release}
  472. Requires: nfs-utils
  473. # For mkfs
  474. Requires: util-linux
  475. %if %{with_qemu}
  476. # From QEMU RPMs
  477. Requires: /usr/bin/qemu-img
  478. %endif
  479. %if !%{with_storage_rbd}
  480. Obsoletes: libvirt-daemon-driver-storage-rbd < %{version}-%{release}
  481. %endif
  482. %description daemon-driver-storage-core
  483. The storage driver plugin for the libvirtd daemon, providing
  484. an implementation of the storage APIs using files, local disks, LVM, SCSI,
  485. iSCSI, and multipath storage.
  486. %package daemon-driver-storage-logical
  487. Summary: Storage driver plugin for lvm volumes
  488. Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
  489. Requires: libvirt-libs = %{version}-%{release}
  490. Requires: lvm2
  491. %description daemon-driver-storage-logical
  492. The storage driver backend adding implementation of the storage APIs for block
  493. volumes using lvm.
  494. %package daemon-driver-storage-disk
  495. Summary: Storage driver plugin for disk
  496. Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
  497. Requires: libvirt-libs = %{version}-%{release}
  498. Requires: parted
  499. Requires: device-mapper
  500. %description daemon-driver-storage-disk
  501. The storage driver backend adding implementation of the storage APIs for block
  502. volumes using the host disks.
  503. %package daemon-driver-storage-scsi
  504. Summary: Storage driver plugin for local scsi devices
  505. Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
  506. Requires: libvirt-libs = %{version}-%{release}
  507. %description daemon-driver-storage-scsi
  508. The storage driver backend adding implementation of the storage APIs for scsi
  509. host devices.
  510. %package daemon-driver-storage-iscsi
  511. Summary: Storage driver plugin for iscsi
  512. Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
  513. Requires: libvirt-libs = %{version}-%{release}
  514. Requires: iscsi-initiator-utils
  515. %description daemon-driver-storage-iscsi
  516. The storage driver backend adding implementation of the storage APIs for iscsi
  517. volumes using the host iscsi stack.
  518. %if %{with_storage_iscsi_direct}
  519. %package daemon-driver-storage-iscsi-direct
  520. Summary: Storage driver plugin for iscsi-direct
  521. Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
  522. Requires: libvirt-libs = %{version}-%{release}
  523. Requires: libiscsi
  524. %description daemon-driver-storage-iscsi-direct
  525. The storage driver backend adding implementation of the storage APIs for iscsi
  526. volumes using libiscsi direct connection.
  527. %endif
  528. %package daemon-driver-storage-mpath
  529. Summary: Storage driver plugin for multipath volumes
  530. Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
  531. Requires: libvirt-libs = %{version}-%{release}
  532. Requires: device-mapper
  533. %description daemon-driver-storage-mpath
  534. The storage driver backend adding implementation of the storage APIs for
  535. multipath storage using device mapper.
  536. %if %{with_storage_gluster}
  537. %package daemon-driver-storage-gluster
  538. Summary: Storage driver plugin for gluster
  539. Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
  540. Requires: libvirt-libs = %{version}-%{release}
  541. %if 0%{?fedora}
  542. Requires: glusterfs-client >= 2.0.1
  543. %endif
  544. %if (0%{?fedora} || 0%{?with_storage_gluster})
  545. Requires: /usr/sbin/gluster
  546. %endif
  547. %description daemon-driver-storage-gluster
  548. The storage driver backend adding implementation of the storage APIs for gluster
  549. volumes using libgfapi.
  550. %endif
  551. %if %{with_storage_rbd}
  552. %package daemon-driver-storage-rbd
  553. Summary: Storage driver plugin for rbd
  554. Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
  555. Requires: libvirt-libs = %{version}-%{release}
  556. %description daemon-driver-storage-rbd
  557. The storage driver backend adding implementation of the storage APIs for rbd
  558. volumes using the ceph protocol.
  559. %endif
  560. %if %{with_storage_sheepdog}
  561. %package daemon-driver-storage-sheepdog
  562. Summary: Storage driver plugin for sheepdog
  563. Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
  564. Requires: libvirt-libs = %{version}-%{release}
  565. Requires: sheepdog
  566. %description daemon-driver-storage-sheepdog
  567. The storage driver backend adding implementation of the storage APIs for
  568. sheepdog volumes using.
  569. %endif
  570. %if %{with_storage_zfs}
  571. %package daemon-driver-storage-zfs
  572. Summary: Storage driver plugin for ZFS
  573. Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
  574. Requires: libvirt-libs = %{version}-%{release}
  575. # Support any conforming implementation of zfs
  576. Requires: /sbin/zfs
  577. Requires: /sbin/zpool
  578. %description daemon-driver-storage-zfs
  579. The storage driver backend adding implementation of the storage APIs for
  580. ZFS volumes.
  581. %endif
  582. %package daemon-driver-storage
  583. Summary: Storage driver plugin including all backends for the libvirtd daemon
  584. Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
  585. Requires: libvirt-daemon-driver-storage-disk = %{version}-%{release}
  586. Requires: libvirt-daemon-driver-storage-logical = %{version}-%{release}
  587. Requires: libvirt-daemon-driver-storage-scsi = %{version}-%{release}
  588. Requires: libvirt-daemon-driver-storage-iscsi = %{version}-%{release}
  589. Requires: libvirt-daemon-driver-storage-mpath = %{version}-%{release}
  590. %if %{with_storage_iscsi_direct}
  591. Requires: libvirt-daemon-driver-storage-iscsi-direct = %{version}-%{release}
  592. %endif
  593. %if %{with_storage_gluster}
  594. Requires: libvirt-daemon-driver-storage-gluster = %{version}-%{release}
  595. %endif
  596. %if %{with_storage_rbd}
  597. Requires: libvirt-daemon-driver-storage-rbd = %{version}-%{release}
  598. %endif
  599. %if %{with_storage_sheepdog}
  600. Requires: libvirt-daemon-driver-storage-sheepdog = %{version}-%{release}
  601. %endif
  602. %if %{with_storage_zfs}
  603. Requires: libvirt-daemon-driver-storage-zfs = %{version}-%{release}
  604. %endif
  605. %description daemon-driver-storage
  606. The storage driver plugin for the libvirtd daemon, providing
  607. an implementation of the storage APIs using LVM, iSCSI,
  608. parted and more.
  609. %if %{with_qemu}
  610. %package daemon-driver-qemu
  611. Summary: QEMU driver plugin for the libvirtd daemon
  612. Requires: libvirt-daemon = %{version}-%{release}
  613. Requires: libvirt-libs = %{version}-%{release}
  614. Requires: /usr/bin/qemu-img
  615. # For image compression
  616. Requires: gzip
  617. Requires: bzip2
  618. Requires: lzop
  619. Requires: xz
  620. %if 0%{?fedora} || 0%{?rhel} > 7
  621. Requires: systemd-container
  622. %endif
  623. %description daemon-driver-qemu
  624. The qemu driver plugin for the libvirtd daemon, providing
  625. an implementation of the hypervisor driver APIs using
  626. QEMU
  627. %endif
  628. %if %{with_lxc}
  629. %package daemon-driver-lxc
  630. Summary: LXC driver plugin for the libvirtd daemon
  631. Requires: libvirt-daemon = %{version}-%{release}
  632. Requires: libvirt-libs = %{version}-%{release}
  633. # There really is a hard cross-driver dependency here
  634. Requires: libvirt-daemon-driver-network = %{version}-%{release}
  635. %if 0%{?fedora} || 0%{?rhel} > 7
  636. Requires: systemd-container
  637. %endif
  638. %description daemon-driver-lxc
  639. The LXC driver plugin for the libvirtd daemon, providing
  640. an implementation of the hypervisor driver APIs using
  641. the Linux kernel
  642. %endif
  643. %if %{with_vbox}
  644. %package daemon-driver-vbox
  645. Summary: VirtualBox driver plugin for the libvirtd daemon
  646. Requires: libvirt-daemon = %{version}-%{release}
  647. Requires: libvirt-libs = %{version}-%{release}
  648. %description daemon-driver-vbox
  649. The vbox driver plugin for the libvirtd daemon, providing
  650. an implementation of the hypervisor driver APIs using
  651. VirtualBox
  652. %endif
  653. %if %{with_libxl}
  654. %package daemon-driver-libxl
  655. Summary: Libxl driver plugin for the libvirtd daemon
  656. Requires: libvirt-daemon = %{version}-%{release}
  657. Requires: libvirt-libs = %{version}-%{release}
  658. Obsoletes: libvirt-daemon-driver-xen < 4.3.0
  659. %description daemon-driver-libxl
  660. The Libxl driver plugin for the libvirtd daemon, providing
  661. an implementation of the hypervisor driver APIs using
  662. Libxl
  663. %endif
  664. %if %{with_qemu_tcg}
  665. %package daemon-qemu
  666. Summary: Server side daemon & driver required to run QEMU guests
  667. Requires: libvirt-daemon = %{version}-%{release}
  668. Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
  669. Requires: libvirt-daemon-driver-interface = %{version}-%{release}
  670. Requires: libvirt-daemon-driver-network = %{version}-%{release}
  671. Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
  672. Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
  673. Requires: libvirt-daemon-driver-secret = %{version}-%{release}
  674. Requires: libvirt-daemon-driver-storage = %{version}-%{release}
  675. Requires: qemu
  676. %description daemon-qemu
  677. Server side daemon and driver required to manage the virtualization
  678. capabilities of the QEMU TCG emulators
  679. %endif
  680. %if %{with_qemu_kvm}
  681. %package daemon-kvm
  682. Summary: Server side daemon & driver required to run KVM guests
  683. Requires: libvirt-daemon = %{version}-%{release}
  684. Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
  685. Requires: libvirt-daemon-driver-interface = %{version}-%{release}
  686. Requires: libvirt-daemon-driver-network = %{version}-%{release}
  687. Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
  688. Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
  689. Requires: libvirt-daemon-driver-secret = %{version}-%{release}
  690. Requires: libvirt-daemon-driver-storage = %{version}-%{release}
  691. Requires: qemu-kvm
  692. %description daemon-kvm
  693. Server side daemon and driver required to manage the virtualization
  694. capabilities of the KVM hypervisor
  695. %endif
  696. %if %{with_lxc}
  697. %package daemon-lxc
  698. Summary: Server side daemon & driver required to run LXC guests
  699. Requires: libvirt-daemon = %{version}-%{release}
  700. Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
  701. Requires: libvirt-daemon-driver-interface = %{version}-%{release}
  702. Requires: libvirt-daemon-driver-network = %{version}-%{release}
  703. Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
  704. Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
  705. Requires: libvirt-daemon-driver-secret = %{version}-%{release}
  706. Requires: libvirt-daemon-driver-storage = %{version}-%{release}
  707. %description daemon-lxc
  708. Server side daemon and driver required to manage the virtualization
  709. capabilities of LXC
  710. %endif
  711. %if %{with_libxl}
  712. %package daemon-xen
  713. Summary: Server side daemon & driver required to run XEN guests
  714. Requires: libvirt-daemon = %{version}-%{release}
  715. %if %{with_libxl}
  716. Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
  717. %endif
  718. Requires: libvirt-daemon-driver-interface = %{version}-%{release}
  719. Requires: libvirt-daemon-driver-network = %{version}-%{release}
  720. Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
  721. Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
  722. Requires: libvirt-daemon-driver-secret = %{version}-%{release}
  723. Requires: libvirt-daemon-driver-storage = %{version}-%{release}
  724. Requires: xen
  725. %description daemon-xen
  726. Server side daemon and driver required to manage the virtualization
  727. capabilities of XEN
  728. %endif
  729. %if %{with_vbox}
  730. %package daemon-vbox
  731. Summary: Server side daemon & driver required to run VirtualBox guests
  732. Requires: libvirt-daemon = %{version}-%{release}
  733. Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
  734. Requires: libvirt-daemon-driver-interface = %{version}-%{release}
  735. Requires: libvirt-daemon-driver-network = %{version}-%{release}
  736. Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
  737. Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
  738. Requires: libvirt-daemon-driver-secret = %{version}-%{release}
  739. Requires: libvirt-daemon-driver-storage = %{version}-%{release}
  740. %description daemon-vbox
  741. Server side daemon and driver required to manage the virtualization
  742. capabilities of VirtualBox
  743. %endif
  744. %package client
  745. Summary: Client side utilities of the libvirt library
  746. Requires: %{name}-libs = %{version}-%{release}
  747. Requires: readline
  748. Requires: ncurses
  749. # Needed by /usr/libexec/libvirt-guests.sh script.
  750. Requires: gettext
  751. # Needed by virt-pki-validate script.
  752. Requires: gnutls-utils
  753. %if %{with_bash_completion}
  754. Requires: %{name}-bash-completion = %{version}-%{release}
  755. %endif
  756. %description client
  757. The client binaries needed to access the virtualization
  758. capabilities of recent versions of Linux (and other OSes).
  759. %package libs
  760. Summary: Client side libraries
  761. # So remote clients can access libvirt over SSH tunnel
  762. Requires: cyrus-sasl
  763. # Needed by default sasl.conf - no onerous extra deps, since
  764. # 100's of other things on a system already pull in krb5-libs
  765. Requires: cyrus-sasl-gssapi
  766. %description libs
  767. Shared libraries for accessing the libvirt daemon.
  768. %package admin
  769. Summary: Set of tools to control libvirt daemon
  770. Requires: %{name}-libs = %{version}-%{release}
  771. Requires: readline
  772. %if %{with_bash_completion}
  773. Requires: %{name}-bash-completion = %{version}-%{release}
  774. %endif
  775. %description admin
  776. The client side utilities to control the libvirt daemon.
  777. %if %{with_bash_completion}
  778. %package bash-completion
  779. Summary: Bash completion script
  780. %description bash-completion
  781. Bash completion script stub.
  782. %endif
  783. %if %{with_wireshark}
  784. %package wireshark
  785. Summary: Wireshark dissector plugin for libvirt RPC transactions
  786. Requires: wireshark >= 2.4.0
  787. Requires: %{name}-libs = %{version}-%{release}
  788. %description wireshark
  789. Wireshark dissector plugin for better analysis of libvirt RPC traffic.
  790. %endif
  791. %if %{with_lxc}
  792. %package login-shell
  793. Summary: Login shell for connecting users to an LXC container
  794. Requires: %{name}-libs = %{version}-%{release}
  795. %description login-shell
  796. Provides the set-uid virt-login-shell binary that is used to
  797. connect a user to an LXC container when they login, by switching
  798. namespaces.
  799. %endif
  800. %package devel
  801. Summary: Libraries, includes, etc. to compile with the libvirt library
  802. Requires: %{name}-libs = %{version}-%{release}
  803. Requires: pkgconfig
  804. %description devel
  805. Include header files & development libraries for the libvirt C library.
  806. %if %{with_sanlock}
  807. %package lock-sanlock
  808. Summary: Sanlock lock manager plugin for QEMU driver
  809. Requires: sanlock >= 2.4
  810. #for virt-sanlock-cleanup require augeas
  811. Requires: augeas
  812. Requires: %{name}-daemon = %{version}-%{release}
  813. Requires: %{name}-libs = %{version}-%{release}
  814. %description lock-sanlock
  815. Includes the Sanlock lock manager plugin for the QEMU
  816. driver
  817. %endif
  818. %package nss
  819. Summary: Libvirt plugin for Name Service Switch
  820. Requires: libvirt-daemon-driver-network = %{version}-%{release}
  821. %description nss
  822. Libvirt plugin for NSS for translating domain names into IP addresses.
  823. %prep
  824. %autosetup -S git_am
  825. %build
  826. %if ! %{supported_platform}
  827. echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
  828. exit 1
  829. %endif
  830. %if %{with_qemu}
  831. %define arg_qemu --with-qemu
  832. %else
  833. %define arg_qemu --without-qemu
  834. %endif
  835. %if %{with_openvz}
  836. %define arg_openvz --with-openvz
  837. %else
  838. %define arg_openvz --without-openvz
  839. %endif
  840. %if %{with_lxc}
  841. %define arg_lxc --with-lxc
  842. %define arg_login_shell --with-login-shell
  843. %else
  844. %define arg_lxc --without-lxc
  845. %define arg_login_shell --without-login-shell
  846. %endif
  847. %if %{with_vbox}
  848. %define arg_vbox --with-vbox
  849. %else
  850. %define arg_vbox --without-vbox
  851. %endif
  852. %if %{with_libxl}
  853. %define arg_libxl --with-libxl
  854. %else
  855. %define arg_libxl --without-libxl
  856. %endif
  857. %if %{with_esx}
  858. %define arg_esx --with-esx
  859. %else
  860. %define arg_esx --without-esx
  861. %endif
  862. %if %{with_hyperv}
  863. %define arg_hyperv --with-hyperv
  864. %else
  865. %define arg_hyperv --without-hyperv
  866. %endif
  867. %if %{with_vmware}
  868. %define arg_vmware --with-vmware
  869. %else
  870. %define arg_vmware --without-vmware
  871. %endif
  872. %if %{with_storage_rbd}
  873. %define arg_storage_rbd --with-storage-rbd
  874. %else
  875. %define arg_storage_rbd --without-storage-rbd
  876. %endif
  877. %if %{with_storage_sheepdog}
  878. %define arg_storage_sheepdog --with-storage-sheepdog
  879. %else
  880. %define arg_storage_sheepdog --without-storage-sheepdog
  881. %endif
  882. %if %{with_storage_gluster}
  883. %define arg_storage_gluster --with-storage-gluster
  884. %else
  885. %define arg_storage_gluster --without-storage-gluster
  886. %endif
  887. %if %{with_storage_zfs}
  888. %define arg_storage_zfs --with-storage-zfs
  889. %else
  890. %define arg_storage_zfs --without-storage-zfs
  891. %endif
  892. %if %{with_numactl}
  893. %define arg_numactl --with-numactl
  894. %else
  895. %define arg_numactl --without-numactl
  896. %endif
  897. %if %{with_numad}
  898. %define arg_numad --with-numad
  899. %else
  900. %define arg_numad --without-numad
  901. %endif
  902. %if %{with_fuse}
  903. %define arg_fuse --with-fuse
  904. %else
  905. %define arg_fuse --without-fuse
  906. %endif
  907. %if %{with_sanlock}
  908. %define arg_sanlock --with-sanlock
  909. %else
  910. %define arg_sanlock --without-sanlock
  911. %endif
  912. %if %{with_firewalld}
  913. %define arg_firewalld --with-firewalld
  914. %else
  915. %define arg_firewalld --without-firewalld
  916. %endif
  917. %if %{with_firewalld_zone}
  918. %define arg_firewalld_zone --with-firewalld-zone
  919. %else
  920. %define arg_firewalld_zone --without-firewalld-zone
  921. %endif
  922. %if %{with_wireshark}
  923. %define arg_wireshark --with-wireshark-dissector
  924. %else
  925. %define arg_wireshark --without-wireshark-dissector
  926. %endif
  927. %if %{with_storage_iscsi_direct}
  928. %define arg_storage_iscsi_direct --with-storage-iscsi-direct
  929. %else
  930. %define arg_storage_iscsi_direct --without-storage-iscsi-direct
  931. %endif
  932. %define when %(date +"%%F-%%T")
  933. %define where %(hostname)
  934. %define who %{?packager}%{!?packager:Unknown}
  935. %define arg_packager --with-packager="%{who}, %{when}, %{where}"
  936. %define arg_packager_version --with-packager-version="%{release}"
  937. %define arg_selinux_mount --with-selinux-mount="/sys/fs/selinux"
  938. # place macros above and build commands below this comment
  939. export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
  940. %if 0%{?enable_autotools}
  941. autoreconf -if
  942. %endif
  943. rm -f po/stamp-po
  944. %define _configure ../configure
  945. mkdir %{_vpath_builddir}
  946. cd %{_vpath_builddir}
  947. %configure --enable-dependency-tracking \
  948. --with-runstatedir=%{_rundir} \
  949. %{?arg_qemu} \
  950. %{?arg_openvz} \
  951. %{?arg_lxc} \
  952. %{?arg_vbox} \
  953. %{?arg_libxl} \
  954. --with-sasl \
  955. --with-polkit \
  956. --with-libvirtd \
  957. %{?arg_esx} \
  958. %{?arg_hyperv} \
  959. %{?arg_vmware} \
  960. --without-vz \
  961. --without-bhyve \
  962. --with-remote-default-mode=legacy \
  963. --with-interface \
  964. --with-network \
  965. --with-storage-fs \
  966. --with-storage-lvm \
  967. --with-storage-iscsi \
  968. %{?arg_storage_iscsi_direct} \
  969. --with-storage-scsi \
  970. --with-storage-disk \
  971. --with-storage-mpath \
  972. %{?arg_storage_rbd} \
  973. %{?arg_storage_sheepdog} \
  974. %{?arg_storage_gluster} \
  975. %{?arg_storage_zfs} \
  976. --without-storage-vstorage \
  977. %{?arg_numactl} \
  978. %{?arg_numad} \
  979. --with-capng \
  980. %{?arg_fuse} \
  981. --with-netcf \
  982. --with-selinux \
  983. %{?arg_selinux_mount} \
  984. --without-apparmor \
  985. --without-hal \
  986. --with-udev \
  987. --with-yajl \
  988. %{?arg_sanlock} \
  989. --with-libpcap \
  990. --with-macvtap \
  991. --with-audit \
  992. --with-dtrace \
  993. --with-driver-modules \
  994. %{?arg_firewalld} \
  995. %{?arg_firewalld_zone} \
  996. %{?arg_wireshark} \
  997. --without-pm-utils \
  998. --with-nss-plugin \
  999. %{arg_packager} \
  1000. %{arg_packager_version} \
  1001. --with-qemu-user=%{qemu_user} \
  1002. --with-qemu-group=%{qemu_group} \
  1003. --with-tls-priority=%{tls_priority} \
  1004. %{?enable_werror} \
  1005. --enable-expensive-tests \
  1006. --with-init-script=systemd \
  1007. %{?arg_login_shell}
  1008. make %{?_smp_mflags} V=1
  1009. %install
  1010. rm -fr %{buildroot}
  1011. export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
  1012. cd %{_vpath_builddir}
  1013. %make_install %{?_smp_mflags} SYSTEMD_UNIT_DIR=%{_unitdir} V=1
  1014. rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
  1015. rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
  1016. rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.la
  1017. rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.a
  1018. rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.la
  1019. rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.a
  1020. rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/storage-backend/*.la
  1021. rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/storage-backend/*.a
  1022. rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/storage-file/*.la
  1023. rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/storage-file/*.a
  1024. %if %{with_wireshark}
  1025. rm -f $RPM_BUILD_ROOT%{wireshark_plugindir}/libvirt.la
  1026. %endif
  1027. install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/lib/libvirt/dnsmasq/
  1028. # We don't want to install /etc/libvirt/qemu/networks in the main %files list
  1029. # because if the admin wants to delete the default network completely, we don't
  1030. # want to end up re-incarnating it on every RPM upgrade.
  1031. install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/
  1032. cp $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml \
  1033. $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
  1034. # libvirt saves this file with mode 0600
  1035. chmod 0600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml
  1036. # nwfilter files are installed in /usr/share/libvirt and copied to /etc in %post
  1037. # to avoid verification errors on changed files in /etc
  1038. install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/libvirt/nwfilter/
  1039. cp -a $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml \
  1040. $RPM_BUILD_ROOT%{_datadir}/libvirt/nwfilter/
  1041. # libvirt saves these files with mode 600
  1042. chmod 600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml
  1043. # Strip auto-generated UUID - we need it generated per-install
  1044. sed -i -e "/<uuid>/d" $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
  1045. %if ! %{with_qemu}
  1046. rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
  1047. rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
  1048. %endif
  1049. %find_lang %{name}
  1050. %if ! %{with_sanlock}
  1051. rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirt_sanlock.aug
  1052. rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
  1053. %endif
  1054. %if ! %{with_lxc}
  1055. rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_lxc.aug
  1056. rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
  1057. %endif
  1058. %if ! %{with_qemu}
  1059. rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf
  1060. rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu
  1061. %endif
  1062. %if ! %{with_lxc}
  1063. rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/lxc.conf
  1064. rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
  1065. %endif
  1066. %if ! %{with_libxl}
  1067. rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/libxl.conf
  1068. rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.libxl
  1069. rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_libxl.aug
  1070. rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
  1071. %endif
  1072. # Copied into libvirt-docs subpackage eventually
  1073. mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt libvirt-docs
  1074. %ifarch %{power64} s390x x86_64 ia64 alpha sparc64
  1075. mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes.stp \
  1076. $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes-64.stp
  1077. %if %{with_qemu}
  1078. mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \
  1079. $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes-64.stp
  1080. %endif
  1081. %endif
  1082. %check
  1083. cd %{_vpath_builddir}
  1084. if ! make %{?_smp_mflags} check VIR_TEST_DEBUG=1
  1085. then
  1086. cat tests/test-suite.log || true
  1087. exit 1
  1088. fi
  1089. %post libs
  1090. %if 0%{?rhel} == 7
  1091. /sbin/ldconfig
  1092. %endif
  1093. %postun libs
  1094. %if 0%{?rhel} == 7
  1095. /sbin/ldconfig
  1096. %endif
  1097. %pre daemon
  1098. # 'libvirt' group is just to allow password-less polkit access to
  1099. # libvirtd. The uid number is irrelevant, so we use dynamic allocation
  1100. # described at the above link.
  1101. getent group libvirt >/dev/null || groupadd -r libvirt
  1102. exit 0
  1103. %post daemon
  1104. %systemd_post virtlockd.socket virtlockd-admin.socket
  1105. %systemd_post virtlogd.socket virtlogd-admin.socket
  1106. %systemd_post libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket
  1107. %systemd_post libvirtd-tcp.socket libvirtd-tls.socket
  1108. %systemd_post libvirtd.service
  1109. # request daemon restart in posttrans
  1110. mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || :
  1111. touch %{_localstatedir}/lib/rpm-state/libvirt/restart || :
  1112. %preun daemon
  1113. %systemd_preun libvirtd.service
  1114. %systemd_preun libvirtd-tcp.socket libvirtd-tls.socket
  1115. %systemd_preun libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket
  1116. %systemd_preun virtlogd.socket virtlogd-admin.socket virtlogd.service
  1117. %systemd_preun virtlockd.socket virtlockd-admin.socket virtlockd.service
  1118. %postun daemon
  1119. /bin/systemctl daemon-reload >/dev/null 2>&1 || :
  1120. if [ $1 -ge 1 ] ; then
  1121. /bin/systemctl reload-or-try-restart virtlockd.service >/dev/null 2>&1 || :
  1122. /bin/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || :
  1123. fi
  1124. # In upgrade scenario we must explicitly enable virtlockd/virtlogd
  1125. # sockets, if libvirtd is already enabled and start them if
  1126. # libvirtd is running, otherwise you'll get failures to start
  1127. # guests
  1128. %triggerpostun daemon -- libvirt-daemon < 1.3.0
  1129. if [ $1 -ge 1 ] ; then
  1130. /bin/systemctl is-enabled libvirtd.service 1>/dev/null 2>&1 &&
  1131. /bin/systemctl enable virtlogd.socket virtlogd-admin.socket || :
  1132. /bin/systemctl is-active libvirtd.service 1>/dev/null 2>&1 &&
  1133. /bin/systemctl start virtlogd.socket virtlogd-admin.socket || :
  1134. fi
  1135. %posttrans daemon
  1136. if [ -f %{_localstatedir}/lib/rpm-state/libvirt/restart ]; then
  1137. # See if user has previously modified their install to
  1138. # tell libvirtd to use --listen
  1139. grep -E '^LIBVIRTD_ARGS=.*--listen' /etc/sysconfig/libvirtd 1>/dev/null 2>&1
  1140. if test $? = 0
  1141. then
  1142. # Then lets keep honouring --listen and *not* use
  1143. # systemd socket activation, because switching things
  1144. # might confuse mgmt tool like puppet/ansible that
  1145. # expect the old style libvirtd
  1146. /bin/systemctl mask libvirtd.socket >/dev/null 2>&1 || :
  1147. /bin/systemctl mask libvirtd-ro.socket >/dev/null 2>&1 || :
  1148. /bin/systemctl mask libvirtd-admin.socket >/dev/null 2>&1 || :
  1149. /bin/systemctl mask libvirtd-tls.socket >/dev/null 2>&1 || :
  1150. /bin/systemctl mask libvirtd-tcp.socket >/dev/null 2>&1 || :
  1151. else
  1152. # Old libvirtd owns the sockets and will delete them on
  1153. # shutdown. Can't use a try-restart as libvirtd will simply
  1154. # own the sockets again when it comes back up. Thus we must
  1155. # do this particular ordering, so that we get libvirtd
  1156. # running with socket activation in use
  1157. /bin/systemctl is-active libvirtd.service 1>/dev/null 2>&1
  1158. if test $? = 0
  1159. then
  1160. /bin/systemctl stop libvirtd.service >/dev/null 2>&1 || :
  1161. /bin/systemctl try-restart libvirtd.socket >/dev/null 2>&1 || :
  1162. /bin/systemctl try-restart libvirtd-ro.socket >/dev/null 2>&1 || :
  1163. /bin/systemctl try-restart libvirtd-admin.socket >/dev/null 2>&1 || :
  1164. /bin/systemctl start libvirtd.service >/dev/null 2>&1 || :
  1165. fi
  1166. fi
  1167. fi
  1168. rm -rf %{_localstatedir}/lib/rpm-state/libvirt || :
  1169. %post daemon-driver-network
  1170. %if %{with_firewalld_zone}
  1171. %firewalld_reload
  1172. %endif
  1173. %postun daemon-driver-network
  1174. %if %{with_firewalld_zone}
  1175. %firewalld_reload
  1176. %endif
  1177. %post daemon-config-network
  1178. if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; then
  1179. # see if the network used by default network creates a conflict,
  1180. # and try to resolve it
  1181. # NB: 192.168.122.0/24 is used in the default.xml template file;
  1182. # do not modify any of those values here without also modifying
  1183. # them in the template.
  1184. orig_sub=122
  1185. sub=${orig_sub}
  1186. nl='
  1187. '
  1188. routes="${nl}$(ip route show | cut -d' ' -f1)${nl}"
  1189. case ${routes} in
  1190. *"${nl}192.168.${orig_sub}.0/24${nl}"*)
  1191. # there was a match, so we need to look for an unused subnet
  1192. for new_sub in $(seq 124 254); do
  1193. case ${routes} in
  1194. *"${nl}192.168.${new_sub}.0/24${nl}"*)
  1195. ;;
  1196. *)
  1197. sub=$new_sub
  1198. break;
  1199. ;;
  1200. esac
  1201. done
  1202. ;;
  1203. *)
  1204. ;;
  1205. esac
  1206. UUID=`/usr/bin/uuidgen`
  1207. sed -e "s/${orig_sub}/${sub}/g" \
  1208. -e "s,</name>,</name>\n <uuid>$UUID</uuid>," \
  1209. < %{_datadir}/libvirt/networks/default.xml \
  1210. > %{_sysconfdir}/libvirt/qemu/networks/default.xml
  1211. ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
  1212. # libvirt saves this file with mode 0600
  1213. chmod 0600 %{_sysconfdir}/libvirt/qemu/networks/default.xml
  1214. # Make sure libvirt picks up the new network defininiton
  1215. mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || :
  1216. touch %{_localstatedir}/lib/rpm-state/libvirt/restart || :
  1217. fi
  1218. %posttrans daemon-config-network
  1219. if [ -f %{_localstatedir}/lib/rpm-state/libvirt/restart ]; then
  1220. /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
  1221. fi
  1222. rm -rf %{_localstatedir}/lib/rpm-state/libvirt || :
  1223. %post daemon-config-nwfilter
  1224. cp %{_datadir}/libvirt/nwfilter/*.xml %{_sysconfdir}/libvirt/nwfilter/
  1225. # libvirt saves these files with mode 600
  1226. chmod 600 %{_sysconfdir}/libvirt/nwfilter/*.xml
  1227. # Make sure libvirt picks up the new nwfilter defininitons
  1228. mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || :
  1229. touch %{_localstatedir}/lib/rpm-state/libvirt/restart || :
  1230. %posttrans daemon-config-nwfilter
  1231. if [ -f %{_localstatedir}/lib/rpm-state/libvirt/restart ]; then
  1232. /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
  1233. fi
  1234. rm -rf %{_localstatedir}/lib/rpm-state/libvirt || :
  1235. %if %{with_qemu}
  1236. %pre daemon-driver-qemu
  1237. # We want soft static allocation of well-known ids, as disk images
  1238. # are commonly shared across NFS mounts by id rather than name; see
  1239. # https://fedoraproject.org/wiki/Packaging:UsersAndGroups
  1240. getent group kvm >/dev/null || groupadd -f -g 36 -r kvm
  1241. getent group qemu >/dev/null || groupadd -f -g 107 -r qemu
  1242. if ! getent passwd qemu >/dev/null; then
  1243. if ! getent passwd 107 >/dev/null; then
  1244. useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
  1245. else
  1246. useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
  1247. fi
  1248. fi
  1249. exit 0
  1250. %endif
  1251. %preun client
  1252. %systemd_preun libvirt-guests.service
  1253. %post client
  1254. %systemd_post libvirt-guests.service
  1255. %postun client
  1256. %systemd_postun libvirt-guests.service
  1257. %if %{with_lxc}
  1258. %pre login-shell
  1259. getent group virtlogin >/dev/null || groupadd -r virtlogin
  1260. exit 0
  1261. %endif
  1262. %files
  1263. %files docs
  1264. %doc AUTHORS ChangeLog NEWS.rst README README.rst
  1265. %doc %{_vpath_builddir}/libvirt-docs/*
  1266. %files daemon
  1267. %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
  1268. %{_unitdir}/libvirtd.service
  1269. %{_unitdir}/libvirtd.socket
  1270. %{_unitdir}/libvirtd-ro.socket
  1271. %{_unitdir}/libvirtd-admin.socket
  1272. %{_unitdir}/libvirtd-tcp.socket
  1273. %{_unitdir}/libvirtd-tls.socket
  1274. %{_unitdir}/virtproxyd.service
  1275. %{_unitdir}/virtproxyd.socket
  1276. %{_unitdir}/virtproxyd-ro.socket
  1277. %{_unitdir}/virtproxyd-admin.socket
  1278. %{_unitdir}/virtproxyd-tcp.socket
  1279. %{_unitdir}/virtproxyd-tls.socket
  1280. %{_unitdir}/virt-guest-shutdown.target
  1281. %{_unitdir}/virtlogd.service
  1282. %{_unitdir}/virtlogd.socket
  1283. %{_unitdir}/virtlogd-admin.socket
  1284. %{_unitdir}/virtlockd.service
  1285. %{_unitdir}/virtlockd.socket
  1286. %{_unitdir}/virtlockd-admin.socket
  1287. %config(noreplace) %{_sysconfdir}/sysconfig/libvirtd
  1288. %config(noreplace) %{_sysconfdir}/sysconfig/virtproxyd
  1289. %config(noreplace) %{_sysconfdir}/sysconfig/virtlogd
  1290. %config(noreplace) %{_sysconfdir}/sysconfig/virtlockd
  1291. %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
  1292. %config(noreplace) %{_sysconfdir}/libvirt/virtproxyd.conf
  1293. %config(noreplace) %{_sysconfdir}/libvirt/virtlogd.conf
  1294. %config(noreplace) %{_sysconfdir}/libvirt/virtlockd.conf
  1295. %config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
  1296. %config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf
  1297. %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd
  1298. %dir %{_datadir}/libvirt/
  1299. %ghost %dir %{_rundir}/libvirt/
  1300. %dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/
  1301. %dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/filesystems/
  1302. %dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/
  1303. %dir %attr(0711, root, root) %{_localstatedir}/cache/libvirt/
  1304. %dir %attr(0755, root, root) %{_libdir}/libvirt/
  1305. %dir %attr(0755, root, root) %{_libdir}/libvirt/connection-driver/
  1306. %dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver
  1307. %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so
  1308. %{_datadir}/augeas/lenses/libvirtd.aug
  1309. %{_datadir}/augeas/lenses/tests/test_libvirtd.aug
  1310. %{_datadir}/augeas/lenses/virtlogd.aug
  1311. %{_datadir}/augeas/lenses/tests/test_virtlogd.aug
  1312. %{_datadir}/augeas/lenses/virtlockd.aug
  1313. %{_datadir}/augeas/lenses/tests/test_virtlockd.aug
  1314. %{_datadir}/augeas/lenses/virtproxyd.aug
  1315. %{_datadir}/augeas/lenses/tests/test_virtproxyd.aug
  1316. %{_datadir}/augeas/lenses/libvirt_lockd.aug
  1317. %if %{with_qemu}
  1318. %{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug
  1319. %endif
  1320. %{_datadir}/polkit-1/actions/org.libvirt.unix.policy
  1321. %{_datadir}/polkit-1/actions/org.libvirt.api.policy
  1322. %{_datadir}/polkit-1/rules.d/50-libvirt.rules
  1323. %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/
  1324. %attr(0755, root, root) %{_libexecdir}/libvirt_iohelper
  1325. %attr(0755, root, root) %{_sbindir}/libvirtd
  1326. %attr(0755, root, root) %{_sbindir}/virtproxyd
  1327. %attr(0755, root, root) %{_sbindir}/virtlogd
  1328. %attr(0755, root, root) %{_sbindir}/virtlockd
  1329. %{_mandir}/man8/libvirtd.8*
  1330. %{_mandir}/man8/virtlogd.8*
  1331. %{_mandir}/man8/virtlockd.8*
  1332. %{_mandir}/man7/virkey*.7*
  1333. %files daemon-config-network
  1334. %dir %{_datadir}/libvirt/networks/
  1335. %{_datadir}/libvirt/networks/default.xml
  1336. %ghost %{_sysconfdir}/libvirt/qemu/networks/default.xml
  1337. %ghost %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
  1338. %files daemon-config-nwfilter
  1339. %dir %{_datadir}/libvirt/nwfilter/
  1340. %{_datadir}/libvirt/nwfilter/*.xml
  1341. %ghost %{_sysconfdir}/libvirt/nwfilter/*.xml
  1342. %files daemon-driver-interface
  1343. %config(noreplace) %{_sysconfdir}/sysconfig/virtinterfaced
  1344. %config(noreplace) %{_sysconfdir}/libvirt/virtinterfaced.conf
  1345. %{_datadir}/augeas/lenses/virtinterfaced.aug
  1346. %{_datadir}/augeas/lenses/tests/test_virtinterfaced.aug
  1347. %{_unitdir}/virtinterfaced.service
  1348. %{_unitdir}/virtinterfaced.socket
  1349. %{_unitdir}/virtinterfaced-ro.socket
  1350. %{_unitdir}/virtinterfaced-admin.socket
  1351. %attr(0755, root, root) %{_sbindir}/virtinterfaced
  1352. %{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so
  1353. %files daemon-driver-network
  1354. %config(noreplace) %{_sysconfdir}/sysconfig/virtnetworkd
  1355. %config(noreplace) %{_sysconfdir}/libvirt/virtnetworkd.conf
  1356. %{_datadir}/augeas/lenses/virtnetworkd.aug
  1357. %{_datadir}/augeas/lenses/tests/test_virtnetworkd.aug
  1358. %{_unitdir}/virtnetworkd.service
  1359. %{_unitdir}/virtnetworkd.socket
  1360. %{_unitdir}/virtnetworkd-ro.socket
  1361. %{_unitdir}/virtnetworkd-admin.socket
  1362. %attr(0755, root, root) %{_sbindir}/virtnetworkd
  1363. %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
  1364. %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
  1365. %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
  1366. %ghost %dir %{_rundir}/libvirt/network/
  1367. %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
  1368. %dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/
  1369. %attr(0755, root, root) %{_libexecdir}/libvirt_leaseshelper
  1370. %{_libdir}/%{name}/connection-driver/libvirt_driver_network.so
  1371. %if %{with_firewalld_zone}
  1372. %{_prefix}/lib/firewalld/zones/libvirt.xml
  1373. %endif
  1374. %files daemon-driver-nodedev
  1375. %config(noreplace) %{_sysconfdir}/sysconfig/virtnodedevd
  1376. %config(noreplace) %{_sysconfdir}/libvirt/virtnodedevd.conf
  1377. %{_datadir}/augeas/lenses/virtnodedevd.aug
  1378. %{_datadir}/augeas/lenses/tests/test_virtnodedevd.aug
  1379. %{_unitdir}/virtnodedevd.service
  1380. %{_unitdir}/virtnodedevd.socket
  1381. %{_unitdir}/virtnodedevd-ro.socket
  1382. %{_unitdir}/virtnodedevd-admin.socket
  1383. %attr(0755, root, root) %{_sbindir}/virtnodedevd
  1384. %{_libdir}/%{name}/connection-driver/libvirt_driver_nodedev.so
  1385. %files daemon-driver-nwfilter
  1386. %config(noreplace) %{_sysconfdir}/sysconfig/virtnwfilterd
  1387. %config(noreplace) %{_sysconfdir}/libvirt/virtnwfilterd.conf
  1388. %{_datadir}/augeas/lenses/virtnwfilterd.aug
  1389. %{_datadir}/augeas/lenses/tests/test_virtnwfilterd.aug
  1390. %{_unitdir}/virtnwfilterd.service
  1391. %{_unitdir}/virtnwfilterd.socket
  1392. %{_unitdir}/virtnwfilterd-ro.socket
  1393. %{_unitdir}/virtnwfilterd-admin.socket
  1394. %attr(0755, root, root) %{_sbindir}/virtnwfilterd
  1395. %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
  1396. %ghost %dir %{_rundir}/libvirt/network/
  1397. %{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so
  1398. %files daemon-driver-secret
  1399. %config(noreplace) %{_sysconfdir}/sysconfig/virtsecretd
  1400. %config(noreplace) %{_sysconfdir}/libvirt/virtsecretd.conf
  1401. %{_datadir}/augeas/lenses/virtsecretd.aug
  1402. %{_datadir}/augeas/lenses/tests/test_virtsecretd.aug
  1403. %{_unitdir}/virtsecretd.service
  1404. %{_unitdir}/virtsecretd.socket
  1405. %{_unitdir}/virtsecretd-ro.socket
  1406. %{_unitdir}/virtsecretd-admin.socket
  1407. %attr(0755, root, root) %{_sbindir}/virtsecretd
  1408. %{_libdir}/%{name}/connection-driver/libvirt_driver_secret.so
  1409. %files daemon-driver-storage
  1410. %files daemon-driver-storage-core
  1411. %config(noreplace) %{_sysconfdir}/sysconfig/virtstoraged
  1412. %config(noreplace) %{_sysconfdir}/libvirt/virtstoraged.conf
  1413. %{_datadir}/augeas/lenses/virtstoraged.aug
  1414. %{_datadir}/augeas/lenses/tests/test_virtstoraged.aug
  1415. %{_unitdir}/virtstoraged.service
  1416. %{_unitdir}/virtstoraged.socket
  1417. %{_unitdir}/virtstoraged-ro.socket
  1418. %{_unitdir}/virtstoraged-admin.socket
  1419. %attr(0755, root, root) %{_sbindir}/virtstoraged
  1420. %attr(0755, root, root) %{_libexecdir}/libvirt_parthelper
  1421. %{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so
  1422. %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_fs.so
  1423. %{_libdir}/%{name}/storage-file/libvirt_storage_file_fs.so
  1424. %files daemon-driver-storage-disk
  1425. %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_disk.so
  1426. %files daemon-driver-storage-logical
  1427. %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_logical.so
  1428. %files daemon-driver-storage-scsi
  1429. %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_scsi.so
  1430. %files daemon-driver-storage-iscsi
  1431. %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_iscsi.so
  1432. %if %{with_storage_iscsi_direct}
  1433. %files daemon-driver-storage-iscsi-direct
  1434. %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_iscsi-direct.so
  1435. %endif
  1436. %files daemon-driver-storage-mpath
  1437. %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_mpath.so
  1438. %if %{with_storage_gluster}
  1439. %files daemon-driver-storage-gluster
  1440. %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_gluster.so
  1441. %{_libdir}/%{name}/storage-file/libvirt_storage_file_gluster.so
  1442. %endif
  1443. %if %{with_storage_rbd}
  1444. %files daemon-driver-storage-rbd
  1445. %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_rbd.so
  1446. %endif
  1447. %if %{with_storage_sheepdog}
  1448. %files daemon-driver-storage-sheepdog
  1449. %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_sheepdog.so
  1450. %endif
  1451. %if %{with_storage_zfs}
  1452. %files daemon-driver-storage-zfs
  1453. %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_zfs.so
  1454. %endif
  1455. %if %{with_qemu}
  1456. %files daemon-driver-qemu
  1457. %config(noreplace) %{_sysconfdir}/sysconfig/virtqemud
  1458. %config(noreplace) %{_sysconfdir}/libvirt/virtqemud.conf
  1459. %{_datadir}/augeas/lenses/virtqemud.aug
  1460. %{_datadir}/augeas/lenses/tests/test_virtqemud.aug
  1461. %{_unitdir}/virtqemud.service
  1462. %{_unitdir}/virtqemud.socket
  1463. %{_unitdir}/virtqemud-ro.socket
  1464. %{_unitdir}/virtqemud-admin.socket
  1465. %attr(0755, root, root) %{_sbindir}/virtqemud
  1466. %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
  1467. %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
  1468. %config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
  1469. %config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf
  1470. %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
  1471. %ghost %dir %{_rundir}/libvirt/qemu/
  1472. %dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
  1473. %dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/
  1474. %{_datadir}/augeas/lenses/libvirtd_qemu.aug
  1475. %{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
  1476. %{_libdir}/%{name}/connection-driver/libvirt_driver_qemu.so
  1477. %dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/swtpm/
  1478. %dir %attr(0711, root, root) %{_localstatedir}/log/swtpm/libvirt/qemu/
  1479. %{_bindir}/virt-qemu-run
  1480. %{_mandir}/man1/virt-qemu-run.1*
  1481. %endif
  1482. %if %{with_lxc}
  1483. %files daemon-driver-lxc
  1484. %config(noreplace) %{_sysconfdir}/sysconfig/virtlxcd
  1485. %config(noreplace) %{_sysconfdir}/libvirt/virtlxcd.conf
  1486. %{_datadir}/augeas/lenses/virtlxcd.aug
  1487. %{_datadir}/augeas/lenses/tests/test_virtlxcd.aug
  1488. %{_unitdir}/virtlxcd.service
  1489. %{_unitdir}/virtlxcd.socket
  1490. %{_unitdir}/virtlxcd-ro.socket
  1491. %{_unitdir}/virtlxcd-admin.socket
  1492. %attr(0755, root, root) %{_sbindir}/virtlxcd
  1493. %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
  1494. %config(noreplace) %{_sysconfdir}/libvirt/lxc.conf
  1495. %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc
  1496. %ghost %dir %{_rundir}/libvirt/lxc/
  1497. %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/lxc/
  1498. %{_datadir}/augeas/lenses/libvirtd_lxc.aug
  1499. %{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
  1500. %attr(0755, root, root) %{_libexecdir}/libvirt_lxc
  1501. %{_libdir}/%{name}/connection-driver/libvirt_driver_lxc.so
  1502. %endif
  1503. %if %{with_libxl}
  1504. %files daemon-driver-libxl
  1505. %config(noreplace) %{_sysconfdir}/sysconfig/virtxend
  1506. %config(noreplace) %{_sysconfdir}/libvirt/virtxend.conf
  1507. %{_datadir}/augeas/lenses/virtxend.aug
  1508. %{_datadir}/augeas/lenses/tests/test_virtxend.aug
  1509. %{_unitdir}/virtxend.service
  1510. %{_unitdir}/virtxend.socket
  1511. %{_unitdir}/virtxend-ro.socket
  1512. %{_unitdir}/virtxend-admin.socket
  1513. %attr(0755, root, root) %{_sbindir}/virtxend
  1514. %config(noreplace) %{_sysconfdir}/libvirt/libxl.conf
  1515. %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.libxl
  1516. %config(noreplace) %{_sysconfdir}/libvirt/libxl-lockd.conf
  1517. %{_datadir}/augeas/lenses/libvirtd_libxl.aug
  1518. %{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
  1519. %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/
  1520. %ghost %dir %{_rundir}/libvirt/libxl/
  1521. %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/
  1522. %{_libdir}/%{name}/connection-driver/libvirt_driver_libxl.so
  1523. %endif
  1524. %if %{with_vbox}
  1525. %files daemon-driver-vbox
  1526. %config(noreplace) %{_sysconfdir}/sysconfig/virtvboxd
  1527. %config(noreplace) %{_sysconfdir}/libvirt/virtvboxd.conf
  1528. %{_datadir}/augeas/lenses/virtvboxd.aug
  1529. %{_datadir}/augeas/lenses/tests/test_virtvboxd.aug
  1530. %{_unitdir}/virtvboxd.service
  1531. %{_unitdir}/virtvboxd.socket
  1532. %{_unitdir}/virtvboxd-ro.socket
  1533. %{_unitdir}/virtvboxd-admin.socket
  1534. %attr(0755, root, root) %{_sbindir}/virtvboxd
  1535. %{_libdir}/%{name}/connection-driver/libvirt_driver_vbox.so
  1536. %endif
  1537. %if %{with_qemu_tcg}
  1538. %files daemon-qemu
  1539. %endif
  1540. %if %{with_qemu_kvm}
  1541. %files daemon-kvm
  1542. %endif
  1543. %if %{with_lxc}
  1544. %files daemon-lxc
  1545. %endif
  1546. %if %{with_libxl}
  1547. %files daemon-xen
  1548. %endif
  1549. %if %{with_vbox}
  1550. %files daemon-vbox
  1551. %endif
  1552. %if %{with_sanlock}
  1553. %files lock-sanlock
  1554. %if %{with_qemu}
  1555. %config(noreplace) %{_sysconfdir}/libvirt/qemu-sanlock.conf
  1556. %endif
  1557. %if %{with_libxl}
  1558. %config(noreplace) %{_sysconfdir}/libvirt/libxl-sanlock.conf
  1559. %endif
  1560. %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/sanlock.so
  1561. %{_datadir}/augeas/lenses/libvirt_sanlock.aug
  1562. %{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
  1563. %dir %attr(0770, root, sanlock) %{_localstatedir}/lib/libvirt/sanlock
  1564. %{_sbindir}/virt-sanlock-cleanup
  1565. %{_mandir}/man8/virt-sanlock-cleanup.8*
  1566. %attr(0755, root, root) %{_libexecdir}/libvirt_sanlock_helper
  1567. %endif
  1568. %files client
  1569. %{_mandir}/man1/virsh.1*
  1570. %{_mandir}/man1/virt-xml-validate.1*
  1571. %{_mandir}/man1/virt-pki-validate.1*
  1572. %{_mandir}/man1/virt-host-validate.1*
  1573. %{_bindir}/virsh
  1574. %{_bindir}/virt-xml-validate
  1575. %{_bindir}/virt-pki-validate
  1576. %{_bindir}/virt-host-validate
  1577. %{_datadir}/systemtap/tapset/libvirt_probes*.stp
  1578. %{_datadir}/systemtap/tapset/libvirt_functions.stp
  1579. %if %{with_qemu}
  1580. %{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp
  1581. %endif
  1582. %if %{with_bash_completion}
  1583. %{_datadir}/bash-completion/completions/virsh
  1584. %endif
  1585. %{_unitdir}/libvirt-guests.service
  1586. %config(noreplace) %{_sysconfdir}/sysconfig/libvirt-guests
  1587. %attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh
  1588. %files libs -f %{_vpath_builddir}/%{name}.lang
  1589. %license COPYING COPYING.LESSER
  1590. %config(noreplace) %{_sysconfdir}/libvirt/libvirt.conf
  1591. %config(noreplace) %{_sysconfdir}/libvirt/libvirt-admin.conf
  1592. %{_libdir}/libvirt.so.*
  1593. %{_libdir}/libvirt-qemu.so.*
  1594. %{_libdir}/libvirt-lxc.so.*
  1595. %{_libdir}/libvirt-admin.so.*
  1596. %dir %{_datadir}/libvirt/
  1597. %dir %{_datadir}/libvirt/schemas/
  1598. %dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/
  1599. %{_datadir}/libvirt/schemas/basictypes.rng
  1600. %{_datadir}/libvirt/schemas/capability.rng
  1601. %{_datadir}/libvirt/schemas/cputypes.rng
  1602. %{_datadir}/libvirt/schemas/domain.rng
  1603. %{_datadir}/libvirt/schemas/domainbackup.rng
  1604. %{_datadir}/libvirt/schemas/domaincaps.rng
  1605. %{_datadir}/libvirt/schemas/domaincheckpoint.rng
  1606. %{_datadir}/libvirt/schemas/domaincommon.rng
  1607. %{_datadir}/libvirt/schemas/domainsnapshot.rng
  1608. %{_datadir}/libvirt/schemas/interface.rng
  1609. %{_datadir}/libvirt/schemas/network.rng
  1610. %{_datadir}/libvirt/schemas/networkcommon.rng
  1611. %{_datadir}/libvirt/schemas/networkport.rng
  1612. %{_datadir}/libvirt/schemas/nodedev.rng
  1613. %{_datadir}/libvirt/schemas/nwfilter.rng
  1614. %{_datadir}/libvirt/schemas/nwfilter_params.rng
  1615. %{_datadir}/libvirt/schemas/nwfilterbinding.rng
  1616. %{_datadir}/libvirt/schemas/secret.rng
  1617. %{_datadir}/libvirt/schemas/storagecommon.rng
  1618. %{_datadir}/libvirt/schemas/storagepool.rng
  1619. %{_datadir}/libvirt/schemas/storagepoolcaps.rng
  1620. %{_datadir}/libvirt/schemas/storagevol.rng
  1621. %{_datadir}/libvirt/cpu_map/*.xml
  1622. %{_datadir}/libvirt/test-screenshot.png
  1623. %files admin
  1624. %{_mandir}/man1/virt-admin.1*
  1625. %{_bindir}/virt-admin
  1626. %if %{with_bash_completion}
  1627. %{_datadir}/bash-completion/completions/virt-admin
  1628. %endif
  1629. %if %{with_bash_completion}
  1630. %files bash-completion
  1631. %{_datadir}/bash-completion/completions/vsh
  1632. %endif
  1633. %if %{with_wireshark}
  1634. %files wireshark
  1635. %{wireshark_plugindir}/libvirt.so
  1636. %endif
  1637. %files nss
  1638. %{_libdir}/libnss_libvirt.so.2
  1639. %{_libdir}/libnss_libvirt_guest.so.2
  1640. %if %{with_lxc}
  1641. %files login-shell
  1642. %attr(4750, root, virtlogin) %{_bindir}/virt-login-shell
  1643. %{_libexecdir}/virt-login-shell-helper
  1644. %config(noreplace) %{_sysconfdir}/libvirt/virt-login-shell.conf
  1645. %{_mandir}/man1/virt-login-shell.1*
  1646. %endif
  1647. %files devel
  1648. %{_libdir}/libvirt.so
  1649. %{_libdir}/libvirt-admin.so
  1650. %{_libdir}/libvirt-qemu.so
  1651. %{_libdir}/libvirt-lxc.so
  1652. %dir %{_includedir}/libvirt
  1653. %{_includedir}/libvirt/virterror.h
  1654. %{_includedir}/libvirt/libvirt.h
  1655. %{_includedir}/libvirt/libvirt-admin.h
  1656. %{_includedir}/libvirt/libvirt-common.h
  1657. %{_includedir}/libvirt/libvirt-domain.h
  1658. %{_includedir}/libvirt/libvirt-domain-checkpoint.h
  1659. %{_includedir}/libvirt/libvirt-domain-snapshot.h
  1660. %{_includedir}/libvirt/libvirt-event.h
  1661. %{_includedir}/libvirt/libvirt-host.h
  1662. %{_includedir}/libvirt/libvirt-interface.h
  1663. %{_includedir}/libvirt/libvirt-network.h
  1664. %{_includedir}/libvirt/libvirt-nodedev.h
  1665. %{_includedir}/libvirt/libvirt-nwfilter.h
  1666. %{_includedir}/libvirt/libvirt-secret.h
  1667. %{_includedir}/libvirt/libvirt-storage.h
  1668. %{_includedir}/libvirt/libvirt-stream.h
  1669. %{_includedir}/libvirt/libvirt-qemu.h
  1670. %{_includedir}/libvirt/libvirt-lxc.h
  1671. %{_libdir}/pkgconfig/libvirt.pc
  1672. %{_libdir}/pkgconfig/libvirt-admin.pc
  1673. %{_libdir}/pkgconfig/libvirt-qemu.pc
  1674. %{_libdir}/pkgconfig/libvirt-lxc.pc
  1675. %dir %{_datadir}/libvirt/api/
  1676. %{_datadir}/libvirt/api/libvirt-api.xml
  1677. %{_datadir}/libvirt/api/libvirt-admin-api.xml
  1678. %{_datadir}/libvirt/api/libvirt-qemu-api.xml
  1679. %{_datadir}/libvirt/api/libvirt-lxc-api.xml
  1680. %changelog