libvirt.spec.in 63.7 KB
Newer Older
1 2
# -*- rpm-spec -*-

3
# This spec file assumes you are building on a Fedora or RHEL version
4 5 6 7 8 9
# that's still supported by the vendor. It may work on other distros
# or versions, but no effort will be made to ensure that going forward.
%define min_rhel 6
%define min_fedora 26

%if (0%{?fedora} && 0%{?fedora} >= %{min_fedora}) || (0%{?rhel} && 0%{?rhel} >= %{min_rhel})
10
    %define supported_platform 1
11
%else
12
    %define supported_platform 0
13 14
%endif

15 16 17
# 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.
18
%{!?enable_autotools:%global enable_autotools 0}
19

20
# The hypervisor drivers that run in libvirtd
21 22 23 24 25 26
%define with_xen           0%{!?_without_xen:1}
%define with_qemu          0%{!?_without_qemu:1}
%define with_lxc           0%{!?_without_lxc:1}
%define with_uml           0%{!?_without_uml:1}
%define with_libxl         0%{!?_without_libxl:1}
%define with_vbox          0%{!?_without_vbox:1}
27

28
%define with_qemu_tcg      %{with_qemu}
29 30 31 32

%define qemu_kvm_arches %{ix86} x86_64

%if 0%{?fedora}
33
    %define qemu_kvm_arches %{ix86} x86_64 %{power64} s390x %{arm} aarch64
34 35 36 37 38
%endif

%if 0%{?rhel}
    %define with_qemu_tcg 0
    %define qemu_kvm_arches x86_64
39
    %if 0%{?rhel} >= 7
40
        %define qemu_kvm_arches x86_64 %{power64} aarch64 s390x
41
    %endif
42 43 44
%endif

%ifarch %{qemu_kvm_arches}
45
    %define with_qemu_kvm      %{with_qemu}
46
%else
47
    %define with_qemu_kvm      0
48 49
%endif

50 51 52 53
%if ! %{with_qemu_tcg} && ! %{with_qemu_kvm}
    %define with_qemu 0
%endif

54 55 56
# Then the hypervisor drivers that run outside libvirtd, in libvirt.so
%define with_openvz        0%{!?_without_openvz:1}
%define with_vmware        0%{!?_without_vmware:1}
57 58
%define with_phyp          0%{!?_without_phyp:1}
%define with_esx           0%{!?_without_esx:1}
59
%define with_hyperv        0%{!?_without_hyperv:1}
60

61
# Then the secondary host drivers, which run inside libvirtd
62
%if 0%{?fedora} || 0%{?rhel} >= 7
63
    %define with_storage_rbd      0%{!?_without_storage_rbd:1}
64
%else
65
    %define with_storage_rbd      0
66
%endif
67
%if 0%{?fedora}
68
    %define with_storage_sheepdog 0%{!?_without_storage_sheepdog:1}
69
%else
70
    %define with_storage_sheepdog 0
71
%endif
72 73
%define with_storage_gluster 0%{!?_without_storage_gluster:1}
%define with_numactl          0%{!?_without_numactl:1}
74

75
# F25+ has zfs-fuse
76
%if 0%{?fedora}
77 78 79 80 81
    %define with_storage_zfs      0%{!?_without_storage_zfs:1}
%else
    %define with_storage_zfs      0
%endif

82
# A few optional bits off by default, we enable later
83
%define with_fuse          0%{!?_without_fuse:0}
84
%define with_cgconfig      0%{!?_without_cgconfig:0}
85
%define with_sanlock       0%{!?_without_sanlock:0}
86
%define with_systemd       0%{!?_without_systemd:0}
87
%define with_numad         0%{!?_without_numad:0}
88
%define with_firewalld     0%{!?_without_firewalld:0}
89
%define with_libssh2       0%{!?_without_libssh2:0}
90
%define with_wireshark     0%{!?_without_wireshark:0}
91
%define with_libssh        0%{!?_without_libssh:0}
92
%define with_bash_completion  0%{!?_without_bash_completion:0}
93
%define with_pm_utils      1
94

95 96
# Finally set the OS / architecture specific special cases

97
# Xen is available only on i386 x86_64 ia64
P
Peter Robinson 已提交
98
%ifnarch %{ix86} x86_64 ia64
99 100
    %define with_xen 0
    %define with_libxl 0
101 102
%endif

103 104 105 106 107
# vbox is available only on i386 x86_64
%ifnarch %{ix86} x86_64
    %define with_vbox 0
%endif

108 109
# Numactl is not available on s390[x] and ARM
%ifarch s390 s390x %{arm}
110
    %define with_numactl 0
D
Daniel P. Berrange 已提交
111
%endif
112

113 114
# libgfapi is built only on x86_64 on rhel
%ifnarch x86_64
115
    %if 0%{?rhel}
116 117 118 119
        %define with_storage_gluster 0
    %endif
%endif

120 121 122 123 124 125 126
# librados and librbd are built only on x86_64 on rhel
%ifnarch x86_64
    %if 0%{?rhel} >= 7
        %define with_storage_rbd 0
    %endif
%endif

127 128 129 130 131 132
# zfs-fuse is not available on some architectures
%ifarch s390 s390x aarch64
    %define with_storage_zfs 0
%endif


133
# RHEL doesn't ship OpenVZ, VBox, UML, PowerHypervisor,
J
Ján Tomko 已提交
134
# VMware, libxenserver (xenapi), libxenlight (Xen 4.1 and newer),
135
# or HyperV.
136
%if 0%{?rhel}
137 138 139 140 141 142 143 144
    %define with_openvz 0
    %define with_vbox 0
    %define with_uml 0
    %define with_phyp 0
    %define with_vmware 0
    %define with_xenapi 0
    %define with_libxl 0
    %define with_hyperv 0
145
    %define with_vz 0
J
Jiri Denemark 已提交
146 147 148 149

    %if 0%{?rhel} > 7
        %define with_lxc 0
    %endif
150 151
%endif

152 153
# Fedora 17 / RHEL-7 are first where we use systemd. Although earlier
# Fedora has systemd, libvirt still used sysvinit there.
154
%if 0%{?fedora} || 0%{?rhel} >= 7
155
    %define with_systemd 1
156
    %define with_pm_utils 0
157 158
%endif

159
# Fedora 18 / RHEL-7 are first where firewalld support is enabled
160
%if 0%{?fedora} || 0%{?rhel} >= 7
161
    %define with_firewalld 1
162 163
%endif

164
# RHEL-6 stopped including Xen on all archs.
165
%if 0%{?rhel}
166
    %define with_xen 0
167 168
%endif

169
# fuse is used to provide virtualized /proc for LXC
170
%if %{with_lxc} && 0%{?rhel} != 6
171
    %define with_fuse      0%{!?_without_fuse:1}
172 173
%endif

174
# Enable sanlock library for lock management with QEMU
175
# Sanlock is available only on arches where kvm is available for RHEL
176
%if 0%{?fedora}
177
    %define with_sanlock 0%{!?_without_sanlock:1}
E
Eric Blake 已提交
178
%endif
179
%if 0%{?rhel}
180
    %ifarch %{qemu_kvm_arches}
181
        %define with_sanlock 0%{!?_without_sanlock:1}
182
    %endif
183 184
%endif

185
# Enable libssh2 transport for new enough distros
186
%if 0%{?fedora}
187
    %define with_libssh2 0%{!?_without_libssh2:1}
188 189
%endif

190
# Enable wireshark plugins for all distros shipping libvirt 1.2.2 or newer
191
%if 0%{?fedora}
192 193 194
    %define with_wireshark 0%{!?_without_wireshark:1}
%endif

195 196 197 198 199
# Enable libssh transport for new enough distros
%if 0%{?fedora}
    %define with_libssh 0%{!?_without_libssh:1}
%endif

200 201 202 203 204
# Enable bash-completion for new enough distros
%if 0%{?fedora} || 0%{?rhel} >= 7
    %define with_bash_completion  0%{!?_without_bash_completion:1}
%endif

205

206
%if %{with_qemu} || %{with_lxc} || %{with_uml}
207
# numad is used to manage the CPU and memory placement dynamically,
208
# it's not available on s390[x] and ARM.
209
    %ifnarch s390 s390x %{arm}
210
        %define with_numad    0%{!?_without_numad:1}
211
    %endif
212 213
%endif

214
# Pull in cgroups config system
215 216
%if %{with_qemu} || %{with_lxc}
    %define with_cgconfig 0%{!?_without_cgconfig:1}
217 218
%endif

219
# Force QEMU to run as non-root
220 221
%define qemu_user  qemu
%define qemu_group  qemu
222

223

224
%if 0%{?fedora} || 0%{?rhel} >= 7
225
    %define with_systemd_macros 1
226
%else
227
    %define with_systemd_macros 0
228 229 230
%endif


231 232 233 234 235
# RHEL releases provide stable tool chains and so it is safe to turn
# compiler warning into errors without being worried about frequent
# changes in reported warnings
%if 0%{?rhel}
    %define enable_werror --enable-werror
J
Jiri Denemark 已提交
236
%else
237
    %define enable_werror --disable-werror
238 239
%endif

240
%if 0%{?fedora}
241
    %define tls_priority "@LIBVIRT,SYSTEM"
242
%else
243
    %define tls_priority "NORMAL"
244 245
%endif

246

C
Cole Robinson 已提交
247
Summary: Library providing a simple virtualization API
248
Name: libvirt
249
Version: @VERSION@
250
Release: 1%{?dist}%{?extra_release}
251
License: LGPLv2+
252
Group: Development/Libraries
253
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
254
URL: https://libvirt.org/
255

256
%if %(echo %{version} | grep -q "\.0$"; echo $?) == 1
257
    %define mainturl stable_updates/
258
%endif
259
Source: https://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.xz
260

261 262 263
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-daemon-config-network = %{version}-%{release}
Requires: libvirt-daemon-config-nwfilter = %{version}-%{release}
264
%if %{with_libxl}
265
Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
266 267
%endif
%if %{with_lxc}
268
Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
269 270
%endif
%if %{with_qemu}
271
Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
272 273
%endif
%if %{with_uml}
274
Requires: libvirt-daemon-driver-uml = %{version}-%{release}
275 276
%endif
%if %{with_xen}
277
Requires: libvirt-daemon-driver-xen = %{version}-%{release}
278 279
%endif
%if %{with_vbox}
280
Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
281
%endif
282
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
283 284 285 286 287 288

Requires: libvirt-daemon-driver-interface = %{version}-%{release}
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
Requires: libvirt-daemon-driver-network = %{version}-%{release}
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
289
Requires: libvirt-client = %{version}-%{release}
M
Michal Privoznik 已提交
290
Requires: libvirt-libs = %{version}-%{release}
291

292 293
# All build-time requirements. Run-time requirements are
# listed against each sub-RPM
294 295 296 297 298
%if 0%{?enable_autotools}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
299
BuildRequires: /usr/bin/pod2man
300
%endif
301
BuildRequires: git
J
Jiri Denemark 已提交
302
%if 0%{?fedora} >= 27 || 0%{?rhel} > 7
303 304
BuildRequires: perl-interpreter
%else
305
BuildRequires: perl
306
%endif
D
Daniel P. Berrange 已提交
307
BuildRequires: python
308 309 310
%if %{with_systemd}
BuildRequires: systemd-units
%endif
311
%if %{with_xen} || %{with_libxl}
312
BuildRequires: xen-devel
313
%endif
314
BuildRequires: libxml2-devel
E
Eric Blake 已提交
315
BuildRequires: libxslt
316
BuildRequires: readline-devel
317
%if %{with_bash_completion}
318
BuildRequires: bash-completion >= 2.0
319
%endif
320
BuildRequires: ncurses-devel
321
BuildRequires: gettext
322
BuildRequires: libtasn1-devel
323
%if (0%{?rhel} && 0%{?rhel} < 7)
324
BuildRequires: libgcrypt-devel
325
%endif
R
Richard W.M. Jones 已提交
326
BuildRequires: gnutls-devel
327
BuildRequires: libattr-devel
328 329
# For pool-build probing for existing pools
BuildRequires: libblkid-devel >= 2.17
E
Eric Blake 已提交
330 331
# for augparse, optionally used in testing
BuildRequires: augeas
332
%if 0%{?fedora} || 0%{?rhel} >= 7
333
BuildRequires: systemd-devel >= 185
334
%else
335 336
BuildRequires: libudev-devel >= 145
%endif
337
BuildRequires: libpciaccess-devel >= 0.10.9
338
BuildRequires: yajl-devel
339
%if %{with_sanlock}
340 341
BuildRequires: sanlock-devel >= 2.4
%endif
342
BuildRequires: libpcap-devel
343 344 345
%if 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: libnl-devel
%else
346
BuildRequires: libnl3-devel
347
%endif
348
BuildRequires: avahi-devel
349
BuildRequires: libselinux-devel
350
BuildRequires: dnsmasq >= 2.41
E
Eric Blake 已提交
351
BuildRequires: iptables
352
%if 0%{?rhel} && 0%{?rhel} < 7
E
Eric Blake 已提交
353 354
BuildRequires: iptables-ipv6
%endif
355
BuildRequires: radvd
E
Eric Blake 已提交
356 357
BuildRequires: ebtables
BuildRequires: module-init-tools
358
BuildRequires: cyrus-sasl-devel
359
%if 0%{?fedora} || 0%{?rhel} >= 7
C
Cole Robinson 已提交
360 361
# F22 polkit-devel doesn't pull in polkit anymore, which we need for pkcheck
BuildRequires: polkit >= 0.112
362
BuildRequires: polkit-devel >= 0.112
363
%else
E
Eric Blake 已提交
364
BuildRequires: polkit-devel >= 0.93
365
%endif
366 367 368
# For mount/umount in FS driver
BuildRequires: util-linux
%if %{with_qemu}
369 370
# For managing ACLs
BuildRequires: libacl-devel
371 372 373
# From QEMU RPMs
BuildRequires: /usr/bin/qemu-img
%else
374
    %if %{with_xen}
375 376
# From Xen RPMs
BuildRequires: /usr/sbin/qcow-create
377
    %endif
378
%endif
379 380
# For LVM drivers
BuildRequires: lvm2
381 382
# For ISCSI driver
BuildRequires: iscsi-initiator-utils
383 384
# For disk driver
BuildRequires: parted-devel
385 386
# For Multipath support
BuildRequires: device-mapper-devel
387
%if %{with_storage_rbd}
388
    %if 0%{?fedora} || 0%{?rhel} >= 7
389 390 391
BuildRequires: librados2-devel
BuildRequires: librbd1-devel
    %else
392
BuildRequires: ceph-devel
393
    %endif
394
%endif
395 396 397 398
%if %{with_storage_gluster}
BuildRequires: glusterfs-api-devel >= 3.4.1
BuildRequires: glusterfs-devel >= 3.4.1
%endif
399 400 401
%if %{with_storage_sheepdog}
BuildRequires: sheepdog
%endif
402 403 404 405 406 407
%if %{with_storage_zfs}
# Support any conforming implementation of zfs. On stock Fedora
# this is zfs-fuse, but could be zfsonlinux upstream RPMs
BuildRequires: /sbin/zfs
BuildRequires: /sbin/zpool
%endif
408
%if %{with_numactl}
409 410
# For QEMU/LXC numa info
BuildRequires: numactl-devel
411
%endif
412
BuildRequires: libcap-ng-devel >= 0.5.0
413 414 415
%if %{with_fuse}
BuildRequires: fuse-devel >= 2.8.6
%endif
416
%if %{with_phyp} || %{with_libssh2}
417 418
BuildRequires: libssh2-devel >= 1.3.0
%endif
419

420
%if 0%{?fedora} || 0%{?rhel} >= 7
421
BuildRequires: netcf-devel >= 0.2.2
422
%else
423
BuildRequires: netcf-devel >= 0.1.8
424
%endif
425 426 427
%if %{with_esx}
BuildRequires: libcurl-devel
%endif
428 429 430
%if %{with_hyperv}
BuildRequires: libwsman-devel >= 2.2.3
%endif
431
BuildRequires: audit-libs-devel
D
Daniel Veillard 已提交
432 433 434
# we need /usr/sbin/dtrace
BuildRequires: systemtap-sdt-devel

435 436 437 438
# For mount/umount in FS driver
BuildRequires: util-linux
# For showmount in FS driver (netfs discovery)
BuildRequires: nfs-utils
439

440
# Communication with the firewall and polkit daemons use DBus
441 442
BuildRequires: dbus-devel

443 444
# Fedora build root suckage
BuildRequires: gawk
445

446 447 448
# For storage wiping with different algorithms
BuildRequires: scrub

449 450 451 452
%if %{with_numad}
BuildRequires: numad
%endif

453
%if %{with_wireshark}
454
BuildRequires: wireshark-devel >= 2.1.0
455 456
%endif

457 458 459 460
%if %{with_libssh}
BuildRequires: libssh-devel >= 0.7.0
%endif

461 462
Provides: bundled(gnulib)

463
%description
464
Libvirt is a C toolkit to interact with the virtualization capabilities
465 466 467
of recent versions of Linux (and other OSes). The main package includes
the libvirtd server exporting the virtualization support.

468 469 470 471 472 473 474 475
%package docs
Summary: API reference and website documentation
Group: Development/Libraries

%description docs
Includes the API reference for the libvirt C library, and a complete
copy of the libvirt.org website documentation.

476 477 478 479 480 481 482
%package daemon
Summary: Server side daemon and supporting files for libvirt library
Group: Development/Libraries

# All runtime requirements for the libvirt package (runtime requrements
# for subpackages are listed later in those subpackages)

M
Michal Privoznik 已提交
483 484
# The client side, i.e. shared libs are in a subpackage
Requires: %{name}-libs = %{version}-%{release}
485 486 487 488 489 490

# for modprobe of pci devices
Requires: module-init-tools
# for /sbin/ip & /sbin/tc
Requires: iproute
Requires: avahi-libs
491
%if 0%{?fedora} || 0%{?rhel} >= 7
492
Requires: polkit >= 0.112
493
%else
E
Eric Blake 已提交
494
Requires: polkit >= 0.93
495 496
%endif
%if %{with_cgconfig}
497
Requires: libcgroup
498 499
%endif
%ifarch %{ix86} x86_64 ia64
500 501
# For virConnectGetSysinfo
Requires: dmidecode
502
%endif
503
# For service management
504
%if %{with_systemd}
505 506 507 508
Requires(post): systemd-units
Requires(post): systemd-sysv
Requires(preun): systemd-units
Requires(postun): systemd-units
509 510
%endif
%if %{with_numad}
511
Requires: numad
512
%endif
513 514
# libvirtd depends on 'messagebus' service
Requires: dbus
515 516
# For uid creation during pre
Requires(pre): shadow-utils
517 518 519 520 521 522 523 524 525 526 527

%description daemon
Server side daemon required to manage the virtualization capabilities
of recent versions of Linux. Requires a hypervisor specific sub-RPM
for specific drivers.

%package daemon-config-network
Summary: Default configuration files for the libvirtd daemon
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
528
Requires: libvirt-daemon-driver-network = %{version}-%{release}
529 530 531 532 533 534 535 536 537

%description daemon-config-network
Default configuration files for setting up NAT based networking

%package daemon-config-nwfilter
Summary: Network filter configuration files for the libvirtd daemon
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
538
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
539 540 541

%description daemon-config-nwfilter
Network filter configuration files for cleaning guest traffic
542

543 544 545 546
%package daemon-driver-network
Summary: Network driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
547 548 549
Requires: dnsmasq >= 2.41
Requires: radvd
Requires: iptables
550
%if 0%{?rhel} && 0%{?rhel} < 7
551
Requires: iptables-ipv6
552
%endif
553 554 555 556 557 558 559 560 561 562 563

%description daemon-driver-network
The network driver plugin for the libvirtd daemon, providing
an implementation of the virtual network APIs using the Linux
bridge capabilities.


%package daemon-driver-nwfilter
Summary: Nwfilter driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
564
Requires: iptables
565
%if 0%{?rhel} && 0%{?rhel} < 7
566
Requires: iptables-ipv6
567
%endif
568
Requires: ebtables
569 570 571 572 573 574 575 576 577 578 579

%description daemon-driver-nwfilter
The nwfilter driver plugin for the libvirtd daemon, providing
an implementation of the firewall APIs using the ebtables,
iptables and ip6tables capabilities


%package daemon-driver-nodedev
Summary: Nodedev driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
580
# needed for device enumeration
581
%if 0%{?fedora} || 0%{?rhel} >= 7
582
Requires: systemd >= 185
583
%else
584
Requires: udev >= 145
585
%endif
586 587 588 589 590 591 592 593 594 595 596

%description daemon-driver-nodedev
The nodedev driver plugin for the libvirtd daemon, providing
an implementation of the node device APIs using the udev
capabilities.


%package daemon-driver-interface
Summary: Interface driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
597
%if (0%{?fedora} || 0%{?rhel} >= 7)
598
Requires: netcf-libs >= 0.2.2
599
%endif
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615

%description daemon-driver-interface
The interface driver plugin for the libvirtd daemon, providing
an implementation of the network interface APIs using the
netcf library


%package daemon-driver-secret
Summary: Secret driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}

%description daemon-driver-secret
The secret driver plugin for the libvirtd daemon, providing
an implementation of the secret key APIs.

616 617
%package daemon-driver-storage-core
Summary: Storage driver plugin including base backends for the libvirtd daemon
618 619
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
620 621 622
Requires: nfs-utils
# For mkfs
Requires: util-linux
623
%if %{with_qemu}
624 625
# From QEMU RPMs
Requires: /usr/bin/qemu-img
626 627
%else
    %if %{with_xen}
628 629
# From Xen RPMs
Requires: /usr/sbin/qcow-create
630
    %endif
631
%endif
632

633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735
%description daemon-driver-storage-core
The storage driver plugin for the libvirtd daemon, providing
an implementation of the storage APIs using files, local disks, LVM, SCSI,
iSCSI, and multipath storage.

%package daemon-driver-storage-logical
Summary: Storage driver plugin for lvm volumes
Group: Development/Libraries
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: lvm2

%description daemon-driver-storage-logical
The storage driver backend adding implementation of the storage APIs for block
volumes using lvm.


%package daemon-driver-storage-disk
Summary: Storage driver plugin for disk
Group: Development/Libraries
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: parted
Requires: device-mapper

%description daemon-driver-storage-disk
The storage driver backend adding implementation of the storage APIs for block
volumes using the host disks.


%package daemon-driver-storage-scsi
Summary: Storage driver plugin for local scsi devices
Group: Development/Libraries
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}

%description daemon-driver-storage-scsi
The storage driver backend adding implementation of the storage APIs for scsi
host devices.


%package daemon-driver-storage-iscsi
Summary: Storage driver plugin for iscsi
Group: Development/Libraries
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: iscsi-initiator-utils

%description daemon-driver-storage-iscsi
The storage driver backend adding implementation of the storage APIs for iscsi
volumes using the host iscsi stack.


%package daemon-driver-storage-mpath
Summary: Storage driver plugin for multipath volumes
Group: Development/Libraries
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: device-mapper

%description daemon-driver-storage-mpath
The storage driver backend adding implementation of the storage APIs for
multipath storage using device mapper.


%if %{with_storage_gluster}
%package daemon-driver-storage-gluster
Summary: Storage driver plugin for gluster
Group: Development/Libraries
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
    %if 0%{?fedora}
Requires: glusterfs-client >= 2.0.1
    %endif
    %if (0%{?fedora} || 0%{?with_storage_gluster})
Requires: /usr/sbin/gluster
    %endif

%description daemon-driver-storage-gluster
The storage driver backend adding implementation of the storage APIs for gluster
volumes using libgfapi.
%endif


%if %{with_storage_rbd}
%package daemon-driver-storage-rbd
Summary: Storage driver plugin for rbd
Group: Development/Libraries
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}

%description daemon-driver-storage-rbd
The storage driver backend adding implementation of the storage APIs for rbd
volumes using the ceph protocol.
%endif


%if %{with_storage_sheepdog}
%package daemon-driver-storage-sheepdog
Summary: Storage driver plugin for sheepdog
Group: Development/Libraries
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: sheepdog

%description daemon-driver-storage-sheepdog
The storage driver backend adding implementation of the storage APIs for
sheepdog volumes using.
%endif


736 737 738 739 740 741 742 743 744 745 746 747 748 749 750
%if %{with_storage_zfs}
%package daemon-driver-storage-zfs
Summary: Storage driver plugin for ZFS
Group: Development/Libraries
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
# Support any conforming implementation of zfs
Requires: /sbin/zfs
Requires: /sbin/zpool

%description daemon-driver-storage-zfs
The storage driver backend adding implementation of the storage APIs for
ZFS volumes.
%endif


751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768
%package daemon-driver-storage
Summary: Storage driver plugin including all backends for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: libvirt-daemon-driver-storage-disk = %{version}-%{release}
Requires: libvirt-daemon-driver-storage-logical = %{version}-%{release}
Requires: libvirt-daemon-driver-storage-scsi = %{version}-%{release}
Requires: libvirt-daemon-driver-storage-iscsi = %{version}-%{release}
Requires: libvirt-daemon-driver-storage-mpath = %{version}-%{release}
%if %{with_storage_gluster}
Requires: libvirt-daemon-driver-storage-gluster = %{version}-%{release}
%endif
%if %{with_storage_rbd}
Requires: libvirt-daemon-driver-storage-rbd = %{version}-%{release}
%endif
%if %{with_storage_sheepdog}
Requires: libvirt-daemon-driver-storage-sheepdog = %{version}-%{release}
%endif
769 770 771
%if %{with_storage_zfs}
Requires: libvirt-daemon-driver-storage-zfs = %{version}-%{release}
%endif
772

773 774 775 776 777 778
%description daemon-driver-storage
The storage driver plugin for the libvirtd daemon, providing
an implementation of the storage APIs using LVM, iSCSI,
parted and more.


779
%if %{with_qemu}
780
%package daemon-driver-qemu
P
Philipp Hahn 已提交
781
Summary: QEMU driver plugin for the libvirtd daemon
782 783 784
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
# There really is a hard cross-driver dependency here
785
Requires: libvirt-daemon-driver-network = %{version}-%{release}
786
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
787 788 789 790 791 792
Requires: /usr/bin/qemu-img
# For image compression
Requires: gzip
Requires: bzip2
Requires: lzop
Requires: xz
J
Jiri Denemark 已提交
793
    %if 0%{?fedora} || 0%{?rhel} > 7
794
Requires: systemd-container
A
Andrea Bolognani 已提交
795
    %endif
796 797 798 799 800

%description daemon-driver-qemu
The qemu driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
QEMU
801
%endif
802 803


804
%if %{with_lxc}
805 806 807 808 809
%package daemon-driver-lxc
Summary: LXC driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
# There really is a hard cross-driver dependency here
810
Requires: libvirt-daemon-driver-network = %{version}-%{release}
J
Jiri Denemark 已提交
811
    %if 0%{?fedora} || 0%{?rhel} > 7
812
Requires: systemd-container
A
Andrea Bolognani 已提交
813
    %endif
814 815 816 817 818

%description daemon-driver-lxc
The LXC driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
the Linux kernel
819
%endif
820 821


822
%if %{with_uml}
823 824 825 826 827 828 829 830 831
%package daemon-driver-uml
Summary: Uml driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}

%description daemon-driver-uml
The UML driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
User Mode Linux
832
%endif
833 834


835
%if %{with_xen}
836 837 838 839 840 841 842 843 844
%package daemon-driver-xen
Summary: Xen driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}

%description daemon-driver-xen
The Xen driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
Xen
845
%endif
846 847


848
%if %{with_vbox}
849 850 851 852 853 854 855 856 857
%package daemon-driver-vbox
Summary: VirtualBox driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}

%description daemon-driver-vbox
The vbox driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
VirtualBox
858
%endif
859 860


861
%if %{with_libxl}
862 863 864 865 866 867 868 869 870
%package daemon-driver-libxl
Summary: Libxl driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}

%description daemon-driver-libxl
The Libxl driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
Libxl
871
%endif
872 873


874

875
%if %{with_qemu_tcg}
876 877 878 879 880
%package daemon-qemu
Summary: Server side daemon & driver required to run QEMU guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
881 882 883 884
Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
Requires: libvirt-daemon-driver-network = %{version}-%{release}
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
885
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
886 887
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
888 889 890 891 892
Requires: qemu

%description daemon-qemu
Server side daemon and driver required to manage the virtualization
capabilities of the QEMU TCG emulators
893
%endif
894 895


896
%if %{with_qemu_kvm}
897 898 899 900 901
%package daemon-kvm
Summary: Server side daemon & driver required to run KVM guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
902 903 904 905
Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
Requires: libvirt-daemon-driver-network = %{version}-%{release}
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
906
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
907 908
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
909 910 911 912 913
Requires: qemu-kvm

%description daemon-kvm
Server side daemon and driver required to manage the virtualization
capabilities of the KVM hypervisor
914
%endif
915 916


917
%if %{with_lxc}
918 919 920 921 922
%package daemon-lxc
Summary: Server side daemon & driver required to run LXC guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
923 924 925 926
Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
Requires: libvirt-daemon-driver-network = %{version}-%{release}
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
927
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
928 929
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
930 931 932 933

%description daemon-lxc
Server side daemon and driver required to manage the virtualization
capabilities of LXC
934
%endif
935 936


937
%if %{with_uml}
938 939 940 941 942
%package daemon-uml
Summary: Server side daemon & driver required to run UML guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
943 944 945 946
Requires: libvirt-daemon-driver-uml = %{version}-%{release}
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
Requires: libvirt-daemon-driver-network = %{version}-%{release}
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
947
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
948 949
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
950 951 952 953 954
# There are no UML kernel RPMs in Fedora/RHEL to depend on.

%description daemon-uml
Server side daemon and driver required to manage the virtualization
capabilities of UML
955
%endif
956 957


958
%if %{with_xen} || %{with_libxl}
959 960 961 962 963
%package daemon-xen
Summary: Server side daemon & driver required to run XEN guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
964
    %if %{with_xen}
965
Requires: libvirt-daemon-driver-xen = %{version}-%{release}
966 967
    %endif
    %if %{with_libxl}
968
Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
969
    %endif
970 971 972
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
Requires: libvirt-daemon-driver-network = %{version}-%{release}
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
973
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
974 975
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
976 977 978 979 980
Requires: xen

%description daemon-xen
Server side daemon and driver required to manage the virtualization
capabilities of XEN
981
%endif
982

983
%if %{with_vbox}
984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999
%package daemon-vbox
Summary: Server side daemon & driver required to run VirtualBox guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
Requires: libvirt-daemon-driver-network = %{version}-%{release}
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}

%description daemon-vbox
Server side daemon and driver required to manage the virtualization
capabilities of VirtualBox
1000
%endif
1001

1002
%package client
M
Michal Privoznik 已提交
1003
Summary: Client side utilities of the libvirt library
1004
Group: Development/Libraries
M
Michal Privoznik 已提交
1005
Requires: %{name}-libs = %{version}-%{release}
1006 1007
Requires: readline
Requires: ncurses
E
Eric Blake 已提交
1008
# Needed by /usr/libexec/libvirt-guests.sh script.
O
Osier Yang 已提交
1009
Requires: gettext
1010 1011
# Needed by virt-pki-validate script.
Requires: gnutls-utils
1012
%if %{with_pm_utils}
1013 1014
# Needed for probing the power management features of the host.
Requires: pm-utils
1015
%endif
1016 1017 1018
%if %{with_bash_completion}
Requires: %{name}-bash-completion = %{version}-%{release}
%endif
M
Michal Privoznik 已提交
1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029

%description client
The client binaries needed to access the virtualization
capabilities of recent versions of Linux (and other OSes).

%package libs
Summary: Client side libraries
Group: Development/Libraries
# So remote clients can access libvirt over SSH tunnel
# (client invokes 'nc' against the UNIX socket on the server)
Requires: nc
1030
Requires: cyrus-sasl
1031 1032 1033
# Needed by default sasl.conf - no onerous extra deps, since
# 100's of other things on a system already pull in krb5-libs
Requires: cyrus-sasl-gssapi
1034

M
Michal Privoznik 已提交
1035 1036
%description libs
Shared libraries for accessing the libvirt daemon.
1037

1038 1039 1040 1041 1042
%package admin
Summary: Set of tools to control libvirt daemon
Group: Development/Libraries
Requires: %{name}-libs = %{version}-%{release}
Requires: readline
1043 1044 1045
%if %{with_bash_completion}
Requires: %{name}-bash-completion = %{version}-%{release}
%endif
1046 1047 1048 1049

%description admin
The client side utilities to control the libvirt daemon.

1050 1051 1052 1053 1054 1055 1056 1057 1058
%if %{with_bash_completion}
%package bash-completion
Summary: Bash completion script
Group: Development/Libraries

%description bash-completion
Bash completion script stub.
%endif

1059 1060 1061 1062
%if %{with_wireshark}
%package wireshark
Summary: Wireshark dissector plugin for libvirt RPC transactions
Group: Development/Libraries
1063
Requires: wireshark >= 1.12.6-4
M
Michal Privoznik 已提交
1064
Requires: %{name}-libs = %{version}-%{release}
1065 1066 1067 1068 1069

%description wireshark
Wireshark dissector plugin for better analysis of libvirt RPC traffic.
%endif

1070 1071 1072 1073
%if %{with_lxc}
%package login-shell
Summary: Login shell for connecting users to an LXC container
Group: Development/Libraries
M
Michal Privoznik 已提交
1074
Requires: %{name}-libs = %{version}-%{release}
1075 1076 1077 1078 1079 1080 1081

%description login-shell
Provides the set-uid virt-login-shell binary that is used to
connect a user to an LXC container when they login, by switching
namespaces.
%endif

1082
%package devel
1083
Summary: Libraries, includes, etc. to compile with the libvirt library
1084
Group: Development/Libraries
M
Michal Privoznik 已提交
1085
Requires: %{name}-libs = %{version}-%{release}
1086
Requires: pkgconfig
1087 1088

%description devel
1089
Include header files & development libraries for the libvirt C library.
1090

1091 1092 1093 1094
%if %{with_sanlock}
%package lock-sanlock
Summary: Sanlock lock manager plugin for QEMU driver
Group: Development/Libraries
1095
Requires: sanlock >= 2.4
1096 1097
#for virt-sanlock-cleanup require augeas
Requires: augeas
1098
Requires: %{name}-daemon = %{version}-%{release}
M
Michal Privoznik 已提交
1099
Requires: %{name}-libs = %{version}-%{release}
1100 1101 1102 1103 1104 1105

%description lock-sanlock
Includes the Sanlock lock manager plugin for the QEMU
driver
%endif

1106 1107 1108 1109 1110 1111 1112 1113
%package nss
Summary: Libvirt plugin for Name Service Switch
Group: Development/Libraries
Requires: libvirt-daemon-driver-network = %{version}-%{release}

%description nss
Libvirt plugin for NSS for translating domain names into IP addresses.

M
Martin Kletzander 已提交
1114

1115
%prep
1116

1117 1118
%setup -q

1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152
# Patches have to be stored in a temporary file because RPM has
# a limit on the length of the result of any macro expansion;
# if the string is longer, it's silently cropped
%{lua:
    tmp = os.tmpname();
    f = io.open(tmp, "w+");
    count = 0;
    for i, p in ipairs(patches) do
        f:write(p.."\n");
        count = count + 1;
    end;
    f:close();
    print("PATCHCOUNT="..count.."\n")
    print("PATCHLIST="..tmp.."\n")
}

git init -q
git config user.name rpm-build
git config user.email rpm-build
git config gc.auto 0
git add .
git commit -q -a --author 'rpm-build <rpm-build>' \
           -m '%{name}-%{version} base'

COUNT=$(grep '\.patch$' $PATCHLIST | wc -l)
if [ $COUNT -ne $PATCHCOUNT ]; then
    echo "Found $COUNT patches in $PATCHLIST, expected $PATCHCOUNT"
    exit 1
fi
if [ $COUNT -gt 0 ]; then
    xargs git am <$PATCHLIST || exit 1
fi
echo "Applied $COUNT patches"
rm -f $PATCHLIST
1153
rm -rf .git
1154

1155
%build
1156
%if ! %{supported_platform}
1157
echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
1158 1159 1160
exit 1
%endif

1161 1162 1163 1164
%if %{with_xen}
    %define arg_xen --with-xen
%else
    %define arg_xen --without-xen
1165 1166
%endif

1167 1168 1169 1170
%if %{with_qemu}
    %define arg_qemu --with-qemu
%else
    %define arg_qemu --without-qemu
1171 1172
%endif

1173 1174 1175 1176
%if %{with_openvz}
    %define arg_openvz --with-openvz
%else
    %define arg_openvz --without-openvz
1177 1178
%endif

1179 1180
%if %{with_lxc}
    %define arg_lxc --with-lxc
1181
    %define arg_login_shell --with-login-shell
1182 1183
%else
    %define arg_lxc --without-lxc
1184
    %define arg_login_shell --without-login-shell
1185 1186
%endif

1187 1188 1189 1190
%if %{with_vbox}
    %define arg_vbox --with-vbox
%else
    %define arg_vbox --without-vbox
M
Mark McLoughlin 已提交
1191 1192
%endif

1193 1194 1195 1196
%if %{with_libxl}
    %define arg_libxl --with-libxl
%else
    %define arg_libxl --without-libxl
J
Jim Fehlig 已提交
1197 1198
%endif

1199 1200 1201 1202
%if %{with_phyp}
    %define arg_phyp --with-phyp
%else
    %define arg_phyp --without-phyp
1203 1204
%endif

1205 1206 1207 1208
%if %{with_esx}
    %define arg_esx --with-esx
%else
    %define arg_esx --without-esx
1209 1210
%endif

1211 1212 1213 1214
%if %{with_hyperv}
    %define arg_hyperv --with-hyperv
%else
    %define arg_hyperv --without-hyperv
1215 1216
%endif

1217 1218 1219 1220
%if %{with_vmware}
    %define arg_vmware --with-vmware
%else
    %define arg_vmware --without-vmware
1221 1222
%endif

1223 1224 1225 1226
%if %{with_uml}
    %define arg_uml --with-uml
%else
    %define arg_uml --without-uml
1227 1228
%endif

1229 1230 1231 1232
%if %{with_storage_rbd}
    %define arg_storage_rbd --with-storage-rbd
%else
    %define arg_storage_rbd --without-storage-rbd
1233 1234
%endif

1235 1236 1237 1238
%if %{with_storage_sheepdog}
    %define arg_storage_sheepdog --with-storage-sheepdog
%else
    %define arg_storage_sheepdog --without-storage-sheepdog
1239 1240
%endif

1241 1242 1243 1244
%if %{with_storage_gluster}
    %define arg_storage_gluster --with-storage-gluster
%else
    %define arg_storage_gluster --without-storage-gluster
1245 1246
%endif

1247 1248 1249 1250 1251 1252
%if %{with_storage_zfs}
    %define arg_storage_zfs --with-storage-zfs
%else
    %define arg_storage_zfs --without-storage-zfs
%endif

1253 1254 1255 1256
%if %{with_numactl}
    %define arg_numactl --with-numactl
%else
    %define arg_numactl --without-numactl
1257 1258
%endif

1259 1260 1261 1262
%if %{with_numad}
    %define arg_numad --with-numad
%else
    %define arg_numad --without-numad
1263 1264
%endif

1265 1266 1267 1268
%if %{with_fuse}
    %define arg_fuse --with-fuse
%else
    %define arg_fuse --without-fuse
1269 1270
%endif

1271 1272 1273 1274
%if %{with_sanlock}
    %define arg_sanlock --with-sanlock
%else
    %define arg_sanlock --without-sanlock
1275 1276
%endif

1277
%if %{with_firewalld}
1278 1279 1280
    %define arg_firewalld --with-firewalld
%else
    %define arg_firewalld --without-firewalld
1281 1282
%endif

1283 1284 1285 1286
%if %{with_wireshark}
    %define arg_wireshark --with-wireshark-dissector
%else
    %define arg_wireshark --without-wireshark-dissector
1287 1288
%endif

1289 1290 1291 1292
%if %{with_pm_utils}
    %define arg_pm_utils --with-pm-utils
%else
    %define arg_pm_utils --without-pm-utils
1293 1294
%endif

1295 1296 1297
%define when  %(date +"%%F-%%T")
%define where %(hostname)
%define who   %{?packager}%{!?packager:Unknown}
1298 1299
%define arg_packager --with-packager="%{who}, %{when}, %{where}"
%define arg_packager_version --with-packager-version="%{release}"
1300

1301
%if %{with_systemd}
1302
    %define arg_init_script --with-init-script=systemd
1303
%else
1304
    %define arg_init_script --with-init-script=redhat
1305
%endif
1306

1307
%if 0%{?fedora} || 0%{?rhel} >= 7
1308
    %define arg_selinux_mount --with-selinux-mount="/sys/fs/selinux"
1309
%else
1310
    %define arg_selinux_mount --with-selinux-mount="/selinux"
1311 1312
%endif

1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324
%if 0%{?fedora}
    # Nightly firmware repo x86/OVMF
    LOADERS="/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd:/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd"
    # Nightly firmware repo aarch64/AAVMF
    LOADERS="$LOADERS:/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2.git/aarch64/vars-template-pflash.raw"
    # Fedora official x86/OVMF
    LOADERS="$LOADERS:/usr/share/edk2/ovmf/OVMF_CODE.fd:/usr/share/edk2/ovmf/OVMF_VARS.fd"
    # Fedora official aarch64/AAVMF
    LOADERS="$LOADERS:/usr/share/edk2/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2/aarch64/vars-template-pflash.raw"
    %define arg_loader_nvram --with-loader-nvram="$LOADERS"
%endif

1325 1326
# place macros above and build commands below this comment

J
Jiri Denemark 已提交
1327 1328
export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)

1329 1330 1331 1332
%if 0%{?enable_autotools}
 autoreconf -if
%endif

1333
rm -f po/stamp-po
1334 1335 1336 1337 1338 1339
%configure %{?arg_xen} \
           %{?arg_qemu} \
           %{?arg_openvz} \
           %{?arg_lxc} \
           %{?arg_vbox} \
           %{?arg_libxl} \
1340
           --with-sasl \
1341
           --with-avahi \
1342
           --with-polkit \
1343
           --with-libvirtd \
1344 1345 1346 1347 1348
           %{?arg_uml} \
           %{?arg_phyp} \
           %{?arg_esx} \
           %{?arg_hyperv} \
           %{?arg_vmware} \
1349 1350
           --without-xenapi \
           --without-vz \
1351
           --without-bhyve \
1352
           --with-interface \
1353
           --with-network \
1354 1355 1356
           --with-storage-fs \
           --with-storage-lvm \
           --with-storage-iscsi \
1357
           --with-storage-scsi \
1358 1359
           --with-storage-disk \
           --with-storage-mpath \
1360 1361 1362
           %{?arg_storage_rbd} \
           %{?arg_storage_sheepdog} \
           %{?arg_storage_gluster} \
1363
           %{?arg_storage_zfs} \
1364
           --without-storage-vstorage \
1365 1366
           %{?arg_numactl} \
           %{?arg_numad} \
1367
           --with-capng \
1368
           %{?arg_fuse} \
1369
           --with-netcf \
1370
           --with-selinux \
1371
           %{?arg_selinux_mount} \
1372
           --without-apparmor \
1373
           --without-hal \
1374
           --with-udev \
1375
           --with-yajl \
1376
           %{?arg_sanlock} \
1377
           --with-libpcap \
1378
           --with-macvtap \
1379
           --with-audit \
1380
           --with-dtrace \
1381
           --with-driver-modules \
1382 1383 1384
           %{?arg_firewalld} \
           %{?arg_wireshark} \
           %{?arg_pm_utils} \
1385
           --with-nss-plugin \
1386 1387
           %{arg_packager} \
           %{arg_packager_version} \
1388 1389
           --with-qemu-user=%{qemu_user} \
           --with-qemu-group=%{qemu_group} \
1390
           --with-tls-priority=%{tls_priority} \
1391
           %{?arg_loader_nvram} \
1392
           %{?enable_werror} \
1393
           --enable-expensive-tests \
1394 1395
           %{arg_init_script} \
           %{?arg_login_shell}
J
Jiri Denemark 已提交
1396
make %{?_smp_mflags} V=1
1397
gzip -9 ChangeLog
1398 1399 1400 1401

%install
rm -fr %{buildroot}

J
Jiri Denemark 已提交
1402 1403
export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)

1404 1405 1406
# Avoid using makeinstall macro as it changes prefixes rather than setting
# DESTDIR. Newer make_install macro would be better but it's not available
# on RHEL 5, thus we need to expand it here.
J
Jiri Denemark 已提交
1407
make %{?_smp_mflags} install DESTDIR=%{?buildroot} SYSTEMD_UNIT_DIR=%{_unitdir} V=1
1408

J
Jiri Denemark 已提交
1409
make %{?_smp_mflags} -C examples distclean V=1
1410

1411
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
1412
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
1413 1414
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.a
1415 1416
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.a
1417 1418
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/storage-backend/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/storage-backend/*.a
1419
%if %{with_wireshark}
1420
rm -f $RPM_BUILD_ROOT%{_libdir}/wireshark/plugins/libvirt.la
1421
%endif
1422

1423
install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/lib/libvirt/dnsmasq/
1424 1425 1426 1427 1428 1429 1430 1431
# We don't want to install /etc/libvirt/qemu/networks in the main %files list
# because if the admin wants to delete the default network completely, we don't
# want to end up re-incarnating it on every RPM upgrade.
install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/
cp $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml \
   $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
1432 1433 1434 1435 1436 1437 1438

# nwfilter files are installed in /usr/share/libvirt and copied to /etc in %post
# to avoid verification errors on changed files in /etc
install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/libvirt/nwfilter/
cp -a $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml \
    $RPM_BUILD_ROOT%{_datadir}/libvirt/nwfilter/

1439
# Strip auto-generated UUID - we need it generated per-install
1440
sed -i -e "/<uuid>/d" $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
1441
%if ! %{with_qemu}
1442 1443
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
1444
%endif
1445
%find_lang %{name}
1446

1447 1448 1449 1450 1451
%if ! %{with_sanlock}
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirt_sanlock.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
%endif

1452 1453 1454
%if ! %{with_lxc}
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_lxc.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
1455
%endif
1456

1457 1458
%if ! %{with_qemu}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf
1459
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu
1460
%endif
A
Amy Griffis 已提交
1461 1462
%if ! %{with_lxc}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/lxc.conf
1463
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
1464
%endif
1465 1466
%if ! %{with_libxl}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/libxl.conf
J
Jim Fehlig 已提交
1467
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.libxl
1468 1469 1470
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_libxl.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
%endif
1471 1472
%if ! %{with_uml}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
A
Amy Griffis 已提交
1473
%endif
1474

1475 1476
# Copied into libvirt-docs subpackage eventually
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} libvirt-docs
1477

1478
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
1479 1480 1481 1482 1483 1484
mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes.stp \
   $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes-64.stp
mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \
   $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes-64.stp
%endif

1485 1486 1487
%clean
rm -fr %{buildroot}

1488 1489
%check
cd tests
D
Daniel Veillard 已提交
1490 1491
# These tests don't current work in a mock build root
for i in nodeinfotest seclabeltest
1492 1493
do
  rm -f $i
1494
  printf 'int main(void) { return 0; }' > $i.c
D
Daniel Veillard 已提交
1495
  printf '#!/bin/sh\nexit 0\n' > $i
1496 1497
  chmod +x $i
done
1498
if ! make %{?_smp_mflags} check VIR_TEST_DEBUG=1
1499 1500 1501 1502
then
  cat test-suite.log || true
  exit 1
fi
1503

1504 1505 1506 1507 1508 1509 1510 1511
%pre daemon
# 'libvirt' group is just to allow password-less polkit access to
# libvirtd. The uid number is irrelevant, so we use dynamic allocation
# described at the above link.
getent group libvirt >/dev/null || groupadd -r libvirt

exit 0

1512
%post daemon
1513

1514 1515
%if %{with_systemd}
    %if %{with_systemd_macros}
J
John Ferlan 已提交
1516
        %systemd_post virtlockd.socket virtlockd-admin.socket \
J
John Ferlan 已提交
1517 1518
            virtlogd.socket virtlogd-admin.socket \
            libvirtd.service
1519
    %else
1520 1521
if [ $1 -eq 1 ] ; then
    # Initial installation
1522 1523
    /bin/systemctl enable \
        virtlockd.socket \
J
John Ferlan 已提交
1524
        virtlockd-admin.socket \
1525
        virtlogd.socket \
J
John Ferlan 已提交
1526
        virtlogd-admin.socket \
1527
        libvirtd.service >/dev/null 2>&1 || :
1528
fi
1529 1530 1531
    %endif
%else
    %if %{with_cgconfig}
1532 1533
# Starting with Fedora 16/RHEL-7, systemd automounts all cgroups,
# and cgconfig is no longer a necessary service.
1534
        %if 0%{?rhel} && 0%{?rhel} < 7
1535 1536 1537
if [ "$1" -eq "1" ]; then
/sbin/chkconfig cgconfig on
fi
1538
        %endif
1539
    %endif
1540

1541
/sbin/chkconfig --add libvirtd
1542
/sbin/chkconfig --add virtlogd
1543
/sbin/chkconfig --add virtlockd
1544
%endif
1545

1546 1547 1548 1549
# request daemon restart in posttrans
mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || :
touch %{_localstatedir}/lib/rpm-state/libvirt/restart || :

1550
%preun daemon
1551 1552
%if %{with_systemd}
    %if %{with_systemd_macros}
J
John Ferlan 已提交
1553 1554
        %systemd_preun libvirtd.service \
            virtlogd.socket virtlogd-admin.socket virtlogd.service \
J
John Ferlan 已提交
1555
            virtlockd.socket virtlockd-admin.socket virtlockd.service
1556
    %else
1557 1558
if [ $1 -eq 0 ] ; then
    # Package removal, not upgrade
1559 1560
    /bin/systemctl --no-reload disable \
        libvirtd.service \
1561
        virtlogd.socket \
J
John Ferlan 已提交
1562
        virtlogd-admin.socket \
1563
        virtlogd.service \
1564
        virtlockd.socket \
J
John Ferlan 已提交
1565
        virtlockd-admin.socket \
1566 1567 1568
        virtlockd.service > /dev/null 2>&1 || :
    /bin/systemctl stop \
        libvirtd.service \
1569
        virtlogd.socket \
J
John Ferlan 已提交
1570
        virtlogd-admin.socket \
1571
        virtlogd.service \
1572
        virtlockd.socket \
J
John Ferlan 已提交
1573
        virtlockd-admin.socket \
1574
        virtlockd.service > /dev/null 2>&1 || :
1575
fi
1576 1577
    %endif
%else
1578 1579 1580
if [ $1 = 0 ]; then
    /sbin/service libvirtd stop 1>/dev/null 2>&1
    /sbin/chkconfig --del libvirtd
1581 1582
    /sbin/service virtlogd stop 1>/dev/null 2>&1
    /sbin/chkconfig --del virtlogd
1583 1584
    /sbin/service virtlockd stop 1>/dev/null 2>&1
    /sbin/chkconfig --del virtlockd
1585
fi
1586
%endif
1587

1588
%postun daemon
1589
%if %{with_systemd}
1590 1591
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
1592
    /bin/systemctl reload-or-try-restart virtlockd.service >/dev/null 2>&1 || :
1593
    /bin/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || :
1594
fi
1595
%else
1596 1597
if [ $1 -ge 1 ]; then
    /sbin/service virtlockd reload > /dev/null 2>&1 || :
1598
    /sbin/service virtlogd reload > /dev/null 2>&1 || :
1599
fi
1600
%endif
1601

1602 1603 1604 1605 1606 1607
# In upgrade scenario we must explicitly enable virtlockd/virtlogd
# sockets, if libvirtd is already enabled and start them if
# libvirtd is running, otherwise you'll get failures to start
# guests
%triggerpostun daemon -- libvirt-daemon < 1.3.0
if [ $1 -ge 1 ] ; then
1608
%if %{with_systemd}
1609 1610 1611 1612
    /bin/systemctl is-enabled libvirtd.service 1>/dev/null 2>&1 &&
        /bin/systemctl enable virtlogd.socket virtlogd-admin.socket || :
    /bin/systemctl is-active libvirtd.service 1>/dev/null 2>&1 &&
        /bin/systemctl start virtlogd.socket virtlogd-admin.socket || :
1613
%else
1614 1615 1616 1617
    /sbin/chkconfig libvirtd 1>/dev/null 2>&1 &&
        /sbin/chkconfig virtlogd on || :
    /sbin/service libvirtd status 1>/dev/null 2>&1 &&
        /sbin/service virtlogd start || :
J
Jiri Denemark 已提交
1618 1619
    /sbin/service virtlockd reload > /dev/null 2>&1 || :
    /sbin/service virtlogd reload > /dev/null 2>&1 || :
1620
%endif
1621 1622
fi

1623 1624 1625 1626 1627 1628 1629 1630 1631 1632
%posttrans daemon
if [ -f %{_localstatedir}/lib/rpm-state/libvirt/restart ]; then
%if %{with_systemd}
    /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
%else
    /sbin/service libvirtd condrestart > /dev/null 2>&1 || :
%endif
fi
rm -rf %{_localstatedir}/lib/rpm-state/libvirt || :

1633 1634
%post daemon-config-network
if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; then
1635 1636 1637 1638 1639 1640 1641 1642 1643
    # see if the network used by default network creates a conflict,
    # and try to resolve it
    # NB: 192.168.122.0/24 is used in the default.xml template file;
    # do not modify any of those values here without also modifying
    # them in the template.
    orig_sub=122
    sub=${orig_sub}
    nl='
'
1644
    routes="${nl}$(ip route show | cut -d' ' -f1)${nl}"
1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662
    case ${routes} in
      *"${nl}192.168.${orig_sub}.0/24${nl}"*)
        # there was a match, so we need to look for an unused subnet
        for new_sub in $(seq 124 254); do
          case ${routes} in
          *"${nl}192.168.${new_sub}.0/24${nl}"*)
            ;;
          *)
            sub=$new_sub
            break;
            ;;
          esac
        done
        ;;
      *)
        ;;
    esac

1663
    UUID=`/usr/bin/uuidgen`
1664 1665
    sed -e "s/${orig_sub}/${sub}/g" \
        -e "s,</name>,</name>\n  <uuid>$UUID</uuid>," \
1666 1667 1668
         < %{_datadir}/libvirt/networks/default.xml \
         > %{_sysconfdir}/libvirt/qemu/networks/default.xml
    ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
1669 1670

    # Make sure libvirt picks up the new network defininiton
1671 1672 1673 1674 1675 1676
    mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || :
    touch %{_localstatedir}/lib/rpm-state/libvirt/restart || :
fi

%posttrans daemon-config-network
if [ -f %{_localstatedir}/lib/rpm-state/libvirt/restart ]; then
1677
%if %{with_systemd}
1678
    /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
1679
%else
1680
    /sbin/service libvirtd condrestart > /dev/null 2>&1 || :
1681
%endif
1682
fi
1683
rm -rf %{_localstatedir}/lib/rpm-state/libvirt || :
1684 1685 1686 1687

%post daemon-config-nwfilter
cp %{_datadir}/libvirt/nwfilter/*.xml %{_sysconfdir}/libvirt/nwfilter/
# Make sure libvirt picks up the new nwfilter defininitons
1688 1689 1690 1691 1692
mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || :
touch %{_localstatedir}/lib/rpm-state/libvirt/restart || :

%posttrans daemon-config-nwfilter
if [ -f %{_localstatedir}/lib/rpm-state/libvirt/restart ]; then
1693
%if %{with_systemd}
1694
    /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
1695 1696 1697
%else
    /sbin/service libvirtd condrestart > /dev/null 2>&1 || :
%endif
1698 1699
fi
rm -rf %{_localstatedir}/lib/rpm-state/libvirt || :
1700 1701


1702
%if %{with_systemd}
1703 1704 1705 1706 1707 1708 1709 1710 1711
%triggerun -- libvirt < 0.9.4
%{_bindir}/systemd-sysv-convert --save libvirtd >/dev/null 2>&1 ||:

# If the package is allowed to autostart:
/bin/systemctl --no-reload enable libvirtd.service >/dev/null 2>&1 ||:

# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del libvirtd >/dev/null 2>&1 || :
/bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
1712
%endif
1713

1714
%if %{with_qemu}
1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728
%pre daemon-driver-qemu
# We want soft static allocation of well-known ids, as disk images
# are commonly shared across NFS mounts by id rather than name; see
# https://fedoraproject.org/wiki/Packaging:UsersAndGroups
getent group kvm >/dev/null || groupadd -f -g 36 -r kvm
getent group qemu >/dev/null || groupadd -f -g 107 -r qemu
if ! getent passwd qemu >/dev/null; then
  if ! getent passwd 107 >/dev/null; then
    useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
  else
    useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
  fi
fi
exit 0
1729
%endif
1730

J
Jiri Denemark 已提交
1731 1732
%preun client

1733
%if %{with_systemd}
1734 1735 1736
    %if %{with_systemd_macros}
        %systemd_preun libvirt-guests.service
    %endif
1737
%else
J
Jiri Denemark 已提交
1738 1739 1740 1741
if [ $1 = 0 ]; then
    /sbin/chkconfig --del libvirt-guests
    rm -f /var/lib/libvirt/libvirt-guests
fi
1742
%endif
J
Jiri Denemark 已提交
1743 1744 1745 1746

%post client

/sbin/ldconfig
1747
%if %{with_systemd}
1748 1749 1750
    %if %{with_systemd_macros}
        %systemd_post libvirt-guests.service
    %endif
1751
%else
J
Jiri Denemark 已提交
1752
/sbin/chkconfig --add libvirt-guests
1753
%endif
1754

1755
%postun client
1756

1757
/sbin/ldconfig
1758
%if %{with_systemd}
1759
    %if %{with_systemd_macros}
1760
        %systemd_postun libvirt-guests.service
1761
    %endif
1762 1763 1764 1765 1766 1767
%triggerun client -- libvirt < 0.9.4
%{_bindir}/systemd-sysv-convert --save libvirt-guests >/dev/null 2>&1 ||:

# If the package is allowed to autostart:
/bin/systemctl --no-reload enable libvirt-guests.service >/dev/null 2>&1 ||:

1768
# Run this because the SysV package being removed won't do them
1769 1770 1771
/sbin/chkconfig --del libvirt-guests >/dev/null 2>&1 || :
%endif

1772
%if %{with_sanlock}
1773 1774 1775 1776 1777
%post lock-sanlock
if getent group sanlock > /dev/null ; then
    chmod 0770 %{_localstatedir}/lib/libvirt/sanlock
    chown root:sanlock %{_localstatedir}/lib/libvirt/sanlock
fi
1778
%endif
1779

1780 1781 1782 1783 1784 1785
%if %{with_lxc}
%pre login-shell
getent group virtlogin >/dev/null || groupadd -r virtlogin
exit 0
%endif

1786
%files
1787

1788
%files docs
D
Daniel P. Berrange 已提交
1789
%doc AUTHORS ChangeLog.gz NEWS README README.md
1790
%doc libvirt-docs/*
1791 1792 1793 1794 1795 1796 1797

# API docs
%dir %{_datadir}/gtk-doc/html/libvirt/
%doc %{_datadir}/gtk-doc/html/libvirt/*.devhelp
%doc %{_datadir}/gtk-doc/html/libvirt/*.html
%doc %{_datadir}/gtk-doc/html/libvirt/*.png
%doc %{_datadir}/gtk-doc/html/libvirt/*.css
1798 1799 1800 1801 1802 1803 1804 1805 1806
%doc examples/hellolibvirt
%doc examples/object-events
%doc examples/dominfo
%doc examples/domsuspend
%doc examples/dommigrate
%doc examples/openauth
%doc examples/xml
%doc examples/rename
%doc examples/systemtap
1807
%doc examples/admin
1808

1809 1810 1811

%files daemon

1812
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
1813

1814
%if %{with_systemd}
1815
%{_unitdir}/libvirtd.service
1816
%{_unitdir}/virt-guest-shutdown.target
1817 1818
%{_unitdir}/virtlogd.service
%{_unitdir}/virtlogd.socket
J
John Ferlan 已提交
1819
%{_unitdir}/virtlogd-admin.socket
1820 1821
%{_unitdir}/virtlockd.service
%{_unitdir}/virtlockd.socket
J
John Ferlan 已提交
1822
%{_unitdir}/virtlockd-admin.socket
1823
%else
D
Daniel Veillard 已提交
1824
%{_sysconfdir}/rc.d/init.d/libvirtd
1825
%{_sysconfdir}/rc.d/init.d/virtlogd
1826
%{_sysconfdir}/rc.d/init.d/virtlockd
1827
%endif
A
Alan Pevec 已提交
1828
%doc daemon/libvirtd.upstart
1829
%config(noreplace) %{_sysconfdir}/sysconfig/libvirtd
1830
%config(noreplace) %{_sysconfdir}/sysconfig/virtlogd
1831
%config(noreplace) %{_sysconfdir}/sysconfig/virtlockd
1832
%config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
1833
%config(noreplace) %{_sysconfdir}/libvirt/virtlogd.conf
1834
%config(noreplace) %{_sysconfdir}/libvirt/virtlockd.conf
1835
%config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf
1836

1837
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd
1838
%dir %{_datadir}/libvirt/
1839

1840
%ghost %dir %{_localstatedir}/run/libvirt/
1841

1842
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/
1843
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/filesystems/
1844
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/
1845
%dir %attr(0711, root, root) %{_localstatedir}/cache/libvirt/
1846

1847

1848 1849
%dir %attr(0755, root, root) %{_libdir}/libvirt/
%dir %attr(0755, root, root) %{_libdir}/libvirt/connection-driver/
1850
%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver
1851
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so
1852

1853 1854
%{_datadir}/augeas/lenses/libvirtd.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd.aug
1855 1856
%{_datadir}/augeas/lenses/virtlogd.aug
%{_datadir}/augeas/lenses/tests/test_virtlogd.aug
1857 1858
%{_datadir}/augeas/lenses/virtlockd.aug
%{_datadir}/augeas/lenses/tests/test_virtlockd.aug
1859
%{_datadir}/augeas/lenses/libvirt_lockd.aug
1860
%if %{with_qemu}
1861
%{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug
1862
%endif
1863

1864
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
1865
%{_datadir}/polkit-1/actions/org.libvirt.api.policy
1866
%{_datadir}/polkit-1/rules.d/50-libvirt.rules
1867

M
Mark McLoughlin 已提交
1868
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/
1869

1870
%attr(0755, root, root) %{_libexecdir}/libvirt_iohelper
1871

1872
%attr(0755, root, root) %{_sbindir}/libvirtd
1873
%attr(0755, root, root) %{_sbindir}/virtlogd
1874
%attr(0755, root, root) %{_sbindir}/virtlockd
1875

1876
%{_mandir}/man8/libvirtd.8*
1877
%{_mandir}/man8/virtlogd.8*
1878
%{_mandir}/man8/virtlockd.8*
1879
%{_mandir}/man7/virkey*.7*
1880

1881 1882
%doc examples/polkit/*.rules

1883
%files daemon-config-network
1884 1885
%dir %{_datadir}/libvirt/networks/
%{_datadir}/libvirt/networks/default.xml
1886

1887
%files daemon-config-nwfilter
1888 1889 1890
%dir %{_datadir}/libvirt/nwfilter/
%{_datadir}/libvirt/nwfilter/*.xml
%ghost %{_sysconfdir}/libvirt/nwfilter/*.xml
1891

1892 1893 1894 1895
%files daemon-driver-interface
%{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so

%files daemon-driver-network
1896 1897 1898 1899 1900 1901
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
%ghost %dir %{_localstatedir}/run/libvirt/network/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/
1902
%attr(0755, root, root) %{_libexecdir}/libvirt_leaseshelper
1903 1904 1905 1906 1907 1908
%{_libdir}/%{name}/connection-driver/libvirt_driver_network.so

%files daemon-driver-nodedev
%{_libdir}/%{name}/connection-driver/libvirt_driver_nodedev.so

%files daemon-driver-nwfilter
1909 1910
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
%ghost %dir %{_localstatedir}/run/libvirt/network/
1911 1912 1913 1914 1915 1916
%{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so

%files daemon-driver-secret
%{_libdir}/%{name}/connection-driver/libvirt_driver_secret.so

%files daemon-driver-storage
1917 1918

%files daemon-driver-storage-core
1919
%attr(0755, root, root) %{_libexecdir}/libvirt_parthelper
1920
%{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so
1921
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_fs.so
1922 1923

%files daemon-driver-storage-disk
1924
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_disk.so
1925 1926

%files daemon-driver-storage-logical
1927
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_logical.so
1928 1929

%files daemon-driver-storage-scsi
1930
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_scsi.so
1931 1932

%files daemon-driver-storage-iscsi
1933
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_iscsi.so
1934 1935

%files daemon-driver-storage-mpath
1936
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_mpath.so
1937

1938
%if %{with_storage_gluster}
1939
%files daemon-driver-storage-gluster
1940 1941
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_gluster.so
%endif
1942

1943
%if %{with_storage_rbd}
1944
%files daemon-driver-storage-rbd
1945 1946
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_rbd.so
%endif
1947

1948
%if %{with_storage_sheepdog}
1949
%files daemon-driver-storage-sheepdog
1950 1951
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_sheepdog.so
%endif
1952

1953 1954 1955 1956 1957
%if %{with_storage_zfs}
%files daemon-driver-storage-zfs
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_zfs.so
%endif

1958
%if %{with_qemu}
1959
%files daemon-driver-qemu
1960
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
1961 1962 1963 1964 1965
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
%config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
%ghost %dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/qemu/
1966
%dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
1967 1968 1969
%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/
%{_datadir}/augeas/lenses/libvirtd_qemu.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
1970
%{_libdir}/%{name}/connection-driver/libvirt_driver_qemu.so
1971
%endif
1972

1973
%if %{with_lxc}
1974
%files daemon-driver-lxc
1975 1976 1977 1978 1979 1980 1981 1982
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
%config(noreplace) %{_sysconfdir}/libvirt/lxc.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc
%ghost %dir %{_localstatedir}/run/libvirt/lxc/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/lxc/
%{_datadir}/augeas/lenses/libvirtd_lxc.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
%attr(0755, root, root) %{_libexecdir}/libvirt_lxc
1983
%{_libdir}/%{name}/connection-driver/libvirt_driver_lxc.so
1984
%endif
1985

1986
%if %{with_uml}
1987
%files daemon-driver-uml
1988 1989 1990 1991
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml
%ghost %dir %{_localstatedir}/run/libvirt/uml/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/
1992
%{_libdir}/%{name}/connection-driver/libvirt_driver_uml.so
1993
%endif
1994

1995
%if %{with_xen}
1996
%files daemon-driver-xen
1997
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/xen/
1998
%{_libdir}/%{name}/connection-driver/libvirt_driver_xen.so
1999
%endif
2000

2001
%if %{with_libxl}
2002
%files daemon-driver-libxl
2003
%config(noreplace) %{_sysconfdir}/libvirt/libxl.conf
J
Jim Fehlig 已提交
2004
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.libxl
2005
%config(noreplace) %{_sysconfdir}/libvirt/libxl-lockd.conf
2006 2007
%{_datadir}/augeas/lenses/libvirtd_libxl.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
2008 2009 2010
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/
%ghost %dir %{_localstatedir}/run/libvirt/libxl/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/
2011
%{_libdir}/%{name}/connection-driver/libvirt_driver_libxl.so
2012
%endif
2013

2014
%if %{with_vbox}
2015 2016
%files daemon-driver-vbox
%{_libdir}/%{name}/connection-driver/libvirt_driver_vbox.so
2017
%endif
2018

2019
%if %{with_qemu_tcg}
2020
%files daemon-qemu
2021
%endif
2022

2023
%if %{with_qemu_kvm}
2024
%files daemon-kvm
2025
%endif
2026

2027
%if %{with_lxc}
2028
%files daemon-lxc
2029
%endif
2030

2031
%if %{with_uml}
2032
%files daemon-uml
2033
%endif
2034

2035
%if %{with_xen} || %{with_libxl}
2036
%files daemon-xen
2037
%endif
2038

2039
%if %{with_vbox}
2040
%files daemon-vbox
2041
%endif
2042

2043 2044
%if %{with_sanlock}
%files lock-sanlock
2045
    %if %{with_qemu}
2046
%config(noreplace) %{_sysconfdir}/libvirt/qemu-sanlock.conf
2047
    %endif
2048 2049 2050
    %if %{with_libxl}
%config(noreplace) %{_sysconfdir}/libvirt/libxl-sanlock.conf
    %endif
2051
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/sanlock.so
2052 2053
%{_datadir}/augeas/lenses/libvirt_sanlock.aug
%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
2054
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/sanlock
2055 2056
%{_sbindir}/virt-sanlock-cleanup
%{_mandir}/man8/virt-sanlock-cleanup.8*
2057
%attr(0755, root, root) %{_libexecdir}/libvirt_sanlock_helper
2058 2059
%endif

M
Michal Privoznik 已提交
2060
%files client
2061 2062
%{_mandir}/man1/virsh.1*
%{_mandir}/man1/virt-xml-validate.1*
2063
%{_mandir}/man1/virt-pki-validate.1*
2064
%{_mandir}/man1/virt-host-validate.1*
2065 2066
%{_bindir}/virsh
%{_bindir}/virt-xml-validate
2067
%{_bindir}/virt-pki-validate
2068
%{_bindir}/virt-host-validate
2069

2070 2071
%{_datadir}/systemtap/tapset/libvirt_probes*.stp
%{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp
2072 2073
%{_datadir}/systemtap/tapset/libvirt_functions.stp

2074
%if %{with_bash_completion}
2075
%{_datadir}/bash-completion/completions/virsh
2076
%endif
2077

M
Michal Privoznik 已提交
2078 2079 2080 2081 2082 2083 2084 2085 2086 2087

%if %{with_systemd}
%{_unitdir}/libvirt-guests.service
%else
%{_sysconfdir}/rc.d/init.d/libvirt-guests
%endif
%config(noreplace) %{_sysconfdir}/sysconfig/libvirt-guests
%attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh

%files libs -f %{name}.lang
2088 2089
# RHEL6 doesn't have 'license' macro
%{!?_licensedir:%global license %%doc}
2090
%license COPYING COPYING.LESSER
M
Michal Privoznik 已提交
2091 2092 2093 2094 2095 2096
%config(noreplace) %{_sysconfdir}/libvirt/libvirt.conf
%config(noreplace) %{_sysconfdir}/libvirt/libvirt-admin.conf
%{_libdir}/libvirt.so.*
%{_libdir}/libvirt-qemu.so.*
%{_libdir}/libvirt-lxc.so.*
%{_libdir}/libvirt-admin.so.*
2097 2098
%dir %{_datadir}/libvirt/
%dir %{_datadir}/libvirt/schemas/
M
Michal Privoznik 已提交
2099
%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/
2100

2101 2102
%{_datadir}/libvirt/schemas/basictypes.rng
%{_datadir}/libvirt/schemas/capability.rng
J
Jiri Denemark 已提交
2103
%{_datadir}/libvirt/schemas/cputypes.rng
2104
%{_datadir}/libvirt/schemas/domain.rng
M
Michal Privoznik 已提交
2105
%{_datadir}/libvirt/schemas/domaincaps.rng
2106
%{_datadir}/libvirt/schemas/domaincommon.rng
2107
%{_datadir}/libvirt/schemas/domainsnapshot.rng
2108
%{_datadir}/libvirt/schemas/interface.rng
2109
%{_datadir}/libvirt/schemas/network.rng
2110
%{_datadir}/libvirt/schemas/networkcommon.rng
2111
%{_datadir}/libvirt/schemas/nodedev.rng
2112
%{_datadir}/libvirt/schemas/nwfilter.rng
M
Miloslav Trmač 已提交
2113
%{_datadir}/libvirt/schemas/secret.rng
2114
%{_datadir}/libvirt/schemas/storagecommon.rng
2115 2116
%{_datadir}/libvirt/schemas/storagepool.rng
%{_datadir}/libvirt/schemas/storagevol.rng
2117

J
Jiri Denemark 已提交
2118 2119
%{_datadir}/libvirt/cpu_map.xml

D
Daniel P. Berrange 已提交
2120 2121
%{_datadir}/libvirt/test-screenshot.png

2122 2123
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf

2124 2125 2126
%files admin
%{_mandir}/man1/virt-admin.1*
%{_bindir}/virt-admin
2127 2128 2129
%if %{with_bash_completion}
%{_datadir}/bash-completion/completions/virt-admin
%endif
2130

2131 2132 2133 2134
%if %{with_bash_completion}
%files bash-completion
%{_datadir}/bash-completion/completions/vsh
%endif
2135

2136 2137
%if %{with_wireshark}
%files wireshark
2138
%{_libdir}/wireshark/plugins/libvirt.so
2139 2140
%endif

2141 2142
%files nss
%{_libdir}/libnss_libvirt.so.2
2143
%{_libdir}/libnss_libvirt_guest.so.2
2144

2145 2146
%if %{with_lxc}
%files login-shell
2147
%attr(4750, root, virtlogin) %{_bindir}/virt-login-shell
2148 2149 2150 2151
%config(noreplace) %{_sysconfdir}/libvirt/virt-login-shell.conf
%{_mandir}/man1/virt-login-shell.1*
%endif

2152
%files devel
2153
%{_libdir}/libvirt.so
2154
%{_libdir}/libvirt-admin.so
2155 2156
%{_libdir}/libvirt-qemu.so
%{_libdir}/libvirt-lxc.so
2157
%dir %{_includedir}/libvirt
2158 2159
%{_includedir}/libvirt/virterror.h
%{_includedir}/libvirt/libvirt.h
2160
%{_includedir}/libvirt/libvirt-admin.h
2161
%{_includedir}/libvirt/libvirt-common.h
2162
%{_includedir}/libvirt/libvirt-domain.h
2163
%{_includedir}/libvirt/libvirt-domain-snapshot.h
2164
%{_includedir}/libvirt/libvirt-event.h
2165
%{_includedir}/libvirt/libvirt-host.h
2166
%{_includedir}/libvirt/libvirt-interface.h
2167
%{_includedir}/libvirt/libvirt-network.h
2168
%{_includedir}/libvirt/libvirt-nodedev.h
2169
%{_includedir}/libvirt/libvirt-nwfilter.h
2170
%{_includedir}/libvirt/libvirt-secret.h
2171
%{_includedir}/libvirt/libvirt-storage.h
2172
%{_includedir}/libvirt/libvirt-stream.h
2173 2174
%{_includedir}/libvirt/libvirt-qemu.h
%{_includedir}/libvirt/libvirt-lxc.h
2175
%{_libdir}/pkgconfig/libvirt.pc
2176
%{_libdir}/pkgconfig/libvirt-admin.pc
2177 2178
%{_libdir}/pkgconfig/libvirt-qemu.pc
%{_libdir}/pkgconfig/libvirt-lxc.pc
2179

2180 2181
%dir %{_datadir}/libvirt/api/
%{_datadir}/libvirt/api/libvirt-api.xml
2182
%{_datadir}/libvirt/api/libvirt-admin-api.xml
2183
%{_datadir}/libvirt/api/libvirt-qemu-api.xml
2184
%{_datadir}/libvirt/api/libvirt-lxc-api.xml
2185
# Needed building python bindings
2186
%doc docs/libvirt-api.xml
2187

2188

2189
%changelog