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

3
# This spec file assumes you are building on a Fedora or RHEL version
4 5
# 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.
6
%define min_rhel 7
7
%define min_fedora 29
8 9

%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
%define with_qemu          0%{!?_without_qemu:1}
%define with_lxc           0%{!?_without_lxc:1}
%define with_libxl         0%{!?_without_libxl:1}
%define with_vbox          0%{!?_without_vbox:1}
25

26
%define with_qemu_tcg      %{with_qemu}
27 28 29 30

%define qemu_kvm_arches %{ix86} x86_64

%if 0%{?fedora}
31
    %define qemu_kvm_arches %{ix86} x86_64 %{power64} s390x %{arm} aarch64
32 33 34 35
%endif

%if 0%{?rhel}
    %define with_qemu_tcg 0
36
    %define qemu_kvm_arches x86_64 %{power64} aarch64 s390x
37 38 39
%endif

%ifarch %{qemu_kvm_arches}
40
    %define with_qemu_kvm      %{with_qemu}
41
%else
42
    %define with_qemu_kvm      0
43 44
%endif

45 46 47 48
%if ! %{with_qemu_tcg} && ! %{with_qemu_kvm}
    %define with_qemu 0
%endif

49 50 51
# 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}
52 53
%define with_phyp          0%{!?_without_phyp:1}
%define with_esx           0%{!?_without_esx:1}
54
%define with_hyperv        0%{!?_without_hyperv:1}
55

56
# Then the secondary host drivers, which run inside libvirtd
57
%define with_storage_rbd      0%{!?_without_storage_rbd:1}
58
%if 0%{?fedora}
59
    %define with_storage_sheepdog 0%{!?_without_storage_sheepdog:1}
60
%else
61
    %define with_storage_sheepdog 0
62
%endif
63 64
%define with_storage_gluster 0%{!?_without_storage_gluster:1}
%define with_numactl          0%{!?_without_numactl:1}
65

66
# F25+ has zfs-fuse
67
%if 0%{?fedora}
68 69 70 71 72
    %define with_storage_zfs      0%{!?_without_storage_zfs:1}
%else
    %define with_storage_zfs      0
%endif

73
# We need a recent enough libiscsi (>= 1.18.0)
74
%if 0%{?fedora} || 0%{?rhel} > 7
75 76 77 78 79
    %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1}
%else
    %define with_storage_iscsi_direct 0
%endif

80
# A few optional bits off by default, we enable later
81
%define with_fuse          0%{!?_without_fuse:0}
82
%define with_sanlock       0%{!?_without_sanlock:0}
83
%define with_numad         0%{!?_without_numad:0}
84
%define with_firewalld     0%{!?_without_firewalld:0}
85
%define with_firewalld_zone 0%{!?_without_firewalld_zone:0}
86
%define with_libssh2       0%{!?_without_libssh2:0}
87
%define with_wireshark     0%{!?_without_wireshark:0}
88
%define with_libssh        0%{!?_without_libssh:0}
89
%define with_bash_completion  0%{!?_without_bash_completion:0}
90

91 92
# Finally set the OS / architecture specific special cases

93
# Xen is available only on i386 x86_64 ia64
P
Peter Robinson 已提交
94
%ifnarch %{ix86} x86_64 ia64
95
    %define with_libxl 0
96 97
%endif

98 99 100 101 102
# vbox is available only on i386 x86_64
%ifnarch %{ix86} x86_64
    %define with_vbox 0
%endif

103 104
# Numactl is not available on many non-x86 archs
%ifarch s390 s390x %{arm} riscv64
105
    %define with_numactl 0
D
Daniel P. Berrange 已提交
106
%endif
107

108
# zfs-fuse is not available on some architectures
109
%ifarch s390 s390x aarch64 riscv64
110 111 112
    %define with_storage_zfs 0
%endif

113
# Ceph dropping support for 32-bit hosts
114
%if 0%{?fedora} >= 30
115 116 117 118
    %ifarch %{arm} %{ix86}
        %define with_storage_rbd 0
    %endif
%endif
119

M
Michal Privoznik 已提交
120
# RHEL doesn't ship OpenVZ, VBox, PowerHypervisor,
J
Ján Tomko 已提交
121
# VMware, libxenserver (xenapi), libxenlight (Xen 4.1 and newer),
122
# or HyperV.
123
%if 0%{?rhel}
124 125 126 127 128 129 130
    %define with_openvz 0
    %define with_vbox 0
    %define with_phyp 0
    %define with_vmware 0
    %define with_xenapi 0
    %define with_libxl 0
    %define with_hyperv 0
131
    %define with_vz 0
J
Jiri Denemark 已提交
132 133 134 135

    %if 0%{?rhel} > 7
        %define with_lxc 0
    %endif
136 137
%endif

138
%define with_firewalld 1
139

140
%if 0%{?fedora} >= 31 || 0%{?rhel} > 7
141 142 143 144
    %define with_firewalld_zone 0%{!?_without_firewalld_zone:1}
%endif


145
# fuse is used to provide virtualized /proc for LXC
146
%if %{with_lxc}
147
    %define with_fuse      0%{!?_without_fuse:1}
148 149
%endif

150
# Enable sanlock library for lock management with QEMU
151
# Sanlock is available only on arches where kvm is available for RHEL
152
%if 0%{?fedora}
153
    %define with_sanlock 0%{!?_without_sanlock:1}
E
Eric Blake 已提交
154
%endif
155
%if 0%{?rhel}
156
    %ifarch %{qemu_kvm_arches}
157
        %define with_sanlock 0%{!?_without_sanlock:1}
158
    %endif
159 160
%endif

161
# Enable libssh2 transport for new enough distros
162
%if 0%{?fedora}
163
    %define with_libssh2 0%{!?_without_libssh2:1}
164 165
%endif

166
# Enable wireshark plugins for all distros shipping libvirt 1.2.2 or newer
167
%if 0%{?fedora}
168
    %define with_wireshark 0%{!?_without_wireshark:1}
169
    %define wireshark_plugindir %(pkg-config --variable plugindir wireshark)/epan
170
%endif
171

172
# Enable libssh transport for new enough distros
173
%if 0%{?fedora} || 0%{?rhel} > 7
174 175 176
    %define with_libssh 0%{!?_without_libssh:1}
%endif

177
%define with_bash_completion  0%{!?_without_bash_completion:1}
178

179 180 181 182 183 184 185
# Use Python 3 when possible, Python 2 otherwise
%if 0%{?fedora} || 0%{?rhel} > 7
    %define python python3
%else
    %define python python2
%endif

186

M
Michal Privoznik 已提交
187
%if %{with_qemu} || %{with_lxc}
188
# numad is used to manage the CPU and memory placement dynamically,
189 190
# it's not available on many non-x86 architectures.
    %ifnarch s390 s390x %{arm} riscv64
191
        %define with_numad    0%{!?_without_numad:1}
192
    %endif
193 194
%endif

195
# Force QEMU to run as non-root
196 197
%define qemu_user  qemu
%define qemu_group  qemu
198

199

200 201 202 203 204
# 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 已提交
205
%else
206
    %define enable_werror --disable-werror
207 208
%endif

J
Jiri Denemark 已提交
209
%if 0%{?rhel} == 7
210
    %define tls_priority "NORMAL"
J
Jiri Denemark 已提交
211 212
%else
    %define tls_priority "@LIBVIRT,SYSTEM"
213 214
%endif

215

C
Cole Robinson 已提交
216
Summary: Library providing a simple virtualization API
217
Name: libvirt
218
Version: @VERSION@
219
Release: 1%{?dist}
220
License: LGPLv2+
221
URL: https://libvirt.org/
222

223
%if %(echo %{version} | grep -q "\.0$"; echo $?) == 1
224
    %define mainturl stable_updates/
225
%endif
226
Source: https://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.xz
227

228 229 230
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-daemon-config-network = %{version}-%{release}
Requires: libvirt-daemon-config-nwfilter = %{version}-%{release}
231
%if %{with_libxl}
232
Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
233 234
%endif
%if %{with_lxc}
235
Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
236 237
%endif
%if %{with_qemu}
238
Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
239
%endif
M
Michal Privoznik 已提交
240 241 242
# We had UML driver, but we've removed it.
Obsoletes: libvirt-daemon-driver-uml <= 5.0.0
Obsoletes: libvirt-daemon-uml <= 5.0.0
243
%if %{with_vbox}
244
Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
245
%endif
246
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
247 248 249 250 251 252

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}
253
Requires: libvirt-client = %{version}-%{release}
M
Michal Privoznik 已提交
254
Requires: libvirt-libs = %{version}-%{release}
255

256 257
# All build-time requirements. Run-time requirements are
# listed against each sub-RPM
258 259 260 261 262
%if 0%{?enable_autotools}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
263
BuildRequires: /usr/bin/pod2man
264
%endif
265
BuildRequires: gcc
266
BuildRequires: git
267
%if 0%{?fedora} || 0%{?rhel} > 7
268 269
BuildRequires: perl-interpreter
%else
270
BuildRequires: perl
271
%endif
272
BuildRequires: %{python}
273
BuildRequires: systemd-units
J
Jim Fehlig 已提交
274
%if %{with_libxl}
275
BuildRequires: xen-devel
276
%endif
277
BuildRequires: libxml2-devel
E
Eric Blake 已提交
278
BuildRequires: libxslt
279
BuildRequires: readline-devel
280
%if %{with_bash_completion}
281
BuildRequires: bash-completion >= 2.0
282
%endif
283
BuildRequires: ncurses-devel
284
BuildRequires: gettext
285
BuildRequires: libtasn1-devel
R
Richard W.M. Jones 已提交
286
BuildRequires: gnutls-devel
287
BuildRequires: libattr-devel
288 289
# For pool-build probing for existing pools
BuildRequires: libblkid-devel >= 2.17
E
Eric Blake 已提交
290 291
# for augparse, optionally used in testing
BuildRequires: augeas
292
BuildRequires: systemd-devel >= 185
293
BuildRequires: libpciaccess-devel >= 0.10.9
294
BuildRequires: yajl-devel
295
%if %{with_sanlock}
296 297
BuildRequires: sanlock-devel >= 2.4
%endif
298
BuildRequires: libpcap-devel
299
BuildRequires: libnl3-devel
300
BuildRequires: avahi-devel
301
BuildRequires: libselinux-devel
302
BuildRequires: dnsmasq >= 2.41
E
Eric Blake 已提交
303
BuildRequires: iptables
304
BuildRequires: radvd
E
Eric Blake 已提交
305 306
BuildRequires: ebtables
BuildRequires: module-init-tools
307
BuildRequires: cyrus-sasl-devel
C
Cole Robinson 已提交
308
BuildRequires: polkit >= 0.112
309 310 311
# For mount/umount in FS driver
BuildRequires: util-linux
%if %{with_qemu}
312 313
# For managing ACLs
BuildRequires: libacl-devel
314 315
# From QEMU RPMs
BuildRequires: /usr/bin/qemu-img
316
%endif
317 318
# For LVM drivers
BuildRequires: lvm2
319
# For pool type=iscsi
320
BuildRequires: iscsi-initiator-utils
321
%if %{with_storage_iscsi_direct}
322
# For pool type=iscsi-direct
323
BuildRequires: libiscsi-devel
324
%endif
325 326
# For disk driver
BuildRequires: parted-devel
327 328
# For Multipath support
BuildRequires: device-mapper-devel
329 330
# For XFS reflink clone support
BuildRequires: xfsprogs-devel
331
%if %{with_storage_rbd}
332 333
BuildRequires: librados2-devel
BuildRequires: librbd1-devel
334
%endif
335 336 337 338
%if %{with_storage_gluster}
BuildRequires: glusterfs-api-devel >= 3.4.1
BuildRequires: glusterfs-devel >= 3.4.1
%endif
339 340 341
%if %{with_storage_sheepdog}
BuildRequires: sheepdog
%endif
342 343 344 345 346 347
%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
348
%if %{with_numactl}
349 350
# For QEMU/LXC numa info
BuildRequires: numactl-devel
351
%endif
352
BuildRequires: libcap-ng-devel >= 0.5.0
353 354 355
%if %{with_fuse}
BuildRequires: fuse-devel >= 2.8.6
%endif
356
%if %{with_phyp} || %{with_libssh2}
357 358
BuildRequires: libssh2-devel >= 1.3.0
%endif
359 360

BuildRequires: netcf-devel >= 0.2.2
361 362 363
%if %{with_esx}
BuildRequires: libcurl-devel
%endif
364 365 366
%if %{with_hyperv}
BuildRequires: libwsman-devel >= 2.2.3
%endif
367
BuildRequires: audit-libs-devel
D
Daniel Veillard 已提交
368 369 370
# we need /usr/sbin/dtrace
BuildRequires: systemtap-sdt-devel

371 372 373 374
# For mount/umount in FS driver
BuildRequires: util-linux
# For showmount in FS driver (netfs discovery)
BuildRequires: nfs-utils
375

376
# Communication with the firewall and polkit daemons use DBus
377 378
BuildRequires: dbus-devel

379 380
# Fedora build root suckage
BuildRequires: gawk
381

382 383 384
# For storage wiping with different algorithms
BuildRequires: scrub

385 386 387 388
%if %{with_numad}
BuildRequires: numad
%endif

389
%if %{with_wireshark}
390
BuildRequires: wireshark-devel >= 2.4.0
391 392
%endif

393 394 395 396
%if %{with_libssh}
BuildRequires: libssh-devel >= 0.7.0
%endif

397
%if 0%{?fedora} || 0%{?rhel} > 7
398 399 400 401
BuildRequires: rpcgen
BuildRequires: libtirpc-devel
%endif

402 403 404 405
%if %{with_firewalld_zone}
BuildRequires: firewalld-filesystem
%endif

406 407
Provides: bundled(gnulib)

408
%description
409
Libvirt is a C toolkit to interact with the virtualization capabilities
410 411 412
of recent versions of Linux (and other OSes). The main package includes
the libvirtd server exporting the virtualization support.

413 414 415 416 417 418 419
%package docs
Summary: API reference and website documentation

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

420 421 422 423 424 425
%package daemon
Summary: Server side daemon and supporting files for libvirt library

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

M
Michal Privoznik 已提交
426 427
# The client side, i.e. shared libs are in a subpackage
Requires: %{name}-libs = %{version}-%{release}
428 429 430

# for modprobe of pci devices
Requires: module-init-tools
431

432 433
# for /sbin/ip & /sbin/tc
Requires: iproute
434 435 436 437 438
# tc is provided by iproute-tc since at least Fedora 26
%if 0%{?fedora} || 0%{?rhel} > 7
Requires: iproute-tc
%endif

439
Requires: avahi-libs
440
Requires: polkit >= 0.112
441
%ifarch %{ix86} x86_64 ia64
442 443
# For virConnectGetSysinfo
Requires: dmidecode
444
%endif
445 446 447 448 449
# For service management
Requires(post): systemd-units
Requires(post): systemd-sysv
Requires(preun): systemd-units
Requires(postun): systemd-units
450
%if %{with_numad}
451
Requires: numad
452
%endif
453 454
# libvirtd depends on 'messagebus' service
Requires: dbus
455 456
# For uid creation during pre
Requires(pre): shadow-utils
457 458 459 460 461 462 463 464 465 466

%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

Requires: libvirt-daemon = %{version}-%{release}
467
Requires: libvirt-daemon-driver-network = %{version}-%{release}
468 469 470 471 472 473 474 475

%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

Requires: libvirt-daemon = %{version}-%{release}
476
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
477 478 479

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

481 482 483
%package daemon-driver-network
Summary: Network driver plugin for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
484
Requires: libvirt-libs = %{version}-%{release}
485 486 487
Requires: dnsmasq >= 2.41
Requires: radvd
Requires: iptables
488 489 490 491 492 493 494 495 496 497

%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
Requires: libvirt-daemon = %{version}-%{release}
498
Requires: libvirt-libs = %{version}-%{release}
499 500
Requires: iptables
Requires: ebtables
501 502 503 504 505 506 507 508 509 510

%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
Requires: libvirt-daemon = %{version}-%{release}
511
Requires: libvirt-libs = %{version}-%{release}
512 513
# needed for device enumeration
Requires: systemd >= 185
514 515 516 517 518 519 520 521 522 523

%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
Requires: libvirt-daemon = %{version}-%{release}
524
Requires: libvirt-libs = %{version}-%{release}
525
Requires: netcf-libs >= 0.2.2
526 527 528 529 530 531 532 533 534 535

%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
Requires: libvirt-daemon = %{version}-%{release}
536
Requires: libvirt-libs = %{version}-%{release}
537 538 539 540 541

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

542 543
%package daemon-driver-storage-core
Summary: Storage driver plugin including base backends for the libvirtd daemon
544
Requires: libvirt-daemon = %{version}-%{release}
545
Requires: libvirt-libs = %{version}-%{release}
546 547 548
Requires: nfs-utils
# For mkfs
Requires: util-linux
549
%if %{with_qemu}
550 551
# From QEMU RPMs
Requires: /usr/bin/qemu-img
552
%endif
553 554 555
%if !%{with_storage_rbd}
Obsoletes: libvirt-daemon-driver-storage-rbd < %{version}-%{release}
%endif
556

557 558 559 560 561 562 563 564
%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
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
565
Requires: libvirt-libs = %{version}-%{release}
566 567 568 569 570 571 572 573 574 575
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
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
576
Requires: libvirt-libs = %{version}-%{release}
577 578 579 580 581 582 583 584 585 586 587
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
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
588
Requires: libvirt-libs = %{version}-%{release}
589 590 591 592 593 594 595 596 597

%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
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
598
Requires: libvirt-libs = %{version}-%{release}
599 600 601 602 603 604 605
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.


606
%if %{with_storage_iscsi_direct}
607 608 609 610
%package daemon-driver-storage-iscsi-direct
Summary: Storage driver plugin for iscsi-direct
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release}
611
Requires: libiscsi
612 613 614 615

%description daemon-driver-storage-iscsi-direct
The storage driver backend adding implementation of the storage APIs for iscsi
volumes using libiscsi direct connection.
616
%endif
617 618


619 620 621
%package daemon-driver-storage-mpath
Summary: Storage driver plugin for multipath volumes
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
622
Requires: libvirt-libs = %{version}-%{release}
623 624 625 626 627 628 629 630 631 632 633
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
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
634
Requires: libvirt-libs = %{version}-%{release}
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651
    %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
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
652
Requires: libvirt-libs = %{version}-%{release}
653 654 655 656 657 658 659 660 661 662 663

%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
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
664
Requires: libvirt-libs = %{version}-%{release}
665 666 667 668 669 670 671 672
Requires: sheepdog

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


673 674 675 676
%if %{with_storage_zfs}
%package daemon-driver-storage-zfs
Summary: Storage driver plugin for ZFS
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
677
Requires: libvirt-libs = %{version}-%{release}
678 679 680 681 682 683 684 685 686 687
# 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


688 689 690 691 692 693 694 695
%package daemon-driver-storage
Summary: Storage driver plugin including all backends for the libvirtd daemon
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}
696 697 698
%if %{with_storage_iscsi_direct}
Requires: libvirt-daemon-driver-storage-iscsi-direct = %{version}-%{release}
%endif
699 700 701 702 703 704 705 706 707
%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
708 709 710
%if %{with_storage_zfs}
Requires: libvirt-daemon-driver-storage-zfs = %{version}-%{release}
%endif
711

712 713 714 715 716 717
%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.


718
%if %{with_qemu}
719
%package daemon-driver-qemu
P
Philipp Hahn 已提交
720
Summary: QEMU driver plugin for the libvirtd daemon
721
Requires: libvirt-daemon = %{version}-%{release}
722
Requires: libvirt-libs = %{version}-%{release}
723 724 725 726 727 728
Requires: /usr/bin/qemu-img
# For image compression
Requires: gzip
Requires: bzip2
Requires: lzop
Requires: xz
J
Jiri Denemark 已提交
729
    %if 0%{?fedora} || 0%{?rhel} > 7
730
Requires: systemd-container
A
Andrea Bolognani 已提交
731
    %endif
732 733 734 735 736

%description daemon-driver-qemu
The qemu driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
QEMU
737
%endif
738 739


740
%if %{with_lxc}
741 742 743
%package daemon-driver-lxc
Summary: LXC driver plugin for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
744
Requires: libvirt-libs = %{version}-%{release}
745
# There really is a hard cross-driver dependency here
746
Requires: libvirt-daemon-driver-network = %{version}-%{release}
J
Jiri Denemark 已提交
747
    %if 0%{?fedora} || 0%{?rhel} > 7
748
Requires: systemd-container
A
Andrea Bolognani 已提交
749
    %endif
750 751 752 753 754

%description daemon-driver-lxc
The LXC driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
the Linux kernel
755
%endif
756 757


758
%if %{with_vbox}
759 760 761
%package daemon-driver-vbox
Summary: VirtualBox driver plugin for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
762
Requires: libvirt-libs = %{version}-%{release}
763 764 765 766 767

%description daemon-driver-vbox
The vbox driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
VirtualBox
768
%endif
769 770


771
%if %{with_libxl}
772 773 774
%package daemon-driver-libxl
Summary: Libxl driver plugin for the libvirtd daemon
Requires: libvirt-daemon = %{version}-%{release}
775
Requires: libvirt-libs = %{version}-%{release}
776
Obsoletes: libvirt-daemon-driver-xen < 4.3.0
777 778 779 780 781

%description daemon-driver-libxl
The Libxl driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
Libxl
782
%endif
783 784


785

786
%if %{with_qemu_tcg}
787 788 789 790
%package daemon-qemu
Summary: Server side daemon & driver required to run QEMU guests

Requires: libvirt-daemon = %{version}-%{release}
791 792 793 794
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}
795
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
796 797
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
798 799 800 801 802
Requires: qemu

%description daemon-qemu
Server side daemon and driver required to manage the virtualization
capabilities of the QEMU TCG emulators
803
%endif
804 805


806
%if %{with_qemu_kvm}
807 808 809 810
%package daemon-kvm
Summary: Server side daemon & driver required to run KVM guests

Requires: libvirt-daemon = %{version}-%{release}
811 812 813 814
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}
815
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
816 817
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
818 819 820 821 822
Requires: qemu-kvm

%description daemon-kvm
Server side daemon and driver required to manage the virtualization
capabilities of the KVM hypervisor
823
%endif
824 825


826
%if %{with_lxc}
827 828 829 830
%package daemon-lxc
Summary: Server side daemon & driver required to run LXC guests

Requires: libvirt-daemon = %{version}-%{release}
831 832 833 834
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}
835
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
836 837
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
838 839 840 841

%description daemon-lxc
Server side daemon and driver required to manage the virtualization
capabilities of LXC
842
%endif
843 844


J
Jim Fehlig 已提交
845
%if %{with_libxl}
846 847 848 849
%package daemon-xen
Summary: Server side daemon & driver required to run XEN guests

Requires: libvirt-daemon = %{version}-%{release}
850
    %if %{with_libxl}
851
Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
852
    %endif
853 854 855
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
Requires: libvirt-daemon-driver-network = %{version}-%{release}
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
856
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
857 858
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
859 860 861 862 863
Requires: xen

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

866
%if %{with_vbox}
867 868 869 870 871 872 873 874 875 876 877 878 879 880 881
%package daemon-vbox
Summary: Server side daemon & driver required to run VirtualBox guests

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
882
%endif
883

884
%package client
M
Michal Privoznik 已提交
885 886
Summary: Client side utilities of the libvirt library
Requires: %{name}-libs = %{version}-%{release}
887 888
Requires: readline
Requires: ncurses
E
Eric Blake 已提交
889
# Needed by /usr/libexec/libvirt-guests.sh script.
O
Osier Yang 已提交
890
Requires: gettext
891 892
# Needed by virt-pki-validate script.
Requires: gnutls-utils
893 894 895
%if %{with_bash_completion}
Requires: %{name}-bash-completion = %{version}-%{release}
%endif
M
Michal Privoznik 已提交
896 897 898 899 900 901 902 903 904 905

%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
# So remote clients can access libvirt over SSH tunnel
# (client invokes 'nc' against the UNIX socket on the server)
Requires: nc
906
Requires: cyrus-sasl
907 908 909
# 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
910

M
Michal Privoznik 已提交
911 912
%description libs
Shared libraries for accessing the libvirt daemon.
913

914 915 916 917
%package admin
Summary: Set of tools to control libvirt daemon
Requires: %{name}-libs = %{version}-%{release}
Requires: readline
918 919 920
%if %{with_bash_completion}
Requires: %{name}-bash-completion = %{version}-%{release}
%endif
921 922 923 924

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

925 926 927 928 929 930 931 932
%if %{with_bash_completion}
%package bash-completion
Summary: Bash completion script

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

933 934 935
%if %{with_wireshark}
%package wireshark
Summary: Wireshark dissector plugin for libvirt RPC transactions
936
Requires: wireshark >= 2.4.0
M
Michal Privoznik 已提交
937
Requires: %{name}-libs = %{version}-%{release}
938 939 940 941 942

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

943 944 945
%if %{with_lxc}
%package login-shell
Summary: Login shell for connecting users to an LXC container
M
Michal Privoznik 已提交
946
Requires: %{name}-libs = %{version}-%{release}
947 948 949 950 951 952 953

%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

954
%package devel
955
Summary: Libraries, includes, etc. to compile with the libvirt library
M
Michal Privoznik 已提交
956
Requires: %{name}-libs = %{version}-%{release}
957
Requires: pkgconfig
958 959

%description devel
960
Include header files & development libraries for the libvirt C library.
961

962 963 964
%if %{with_sanlock}
%package lock-sanlock
Summary: Sanlock lock manager plugin for QEMU driver
965
Requires: sanlock >= 2.4
966 967
#for virt-sanlock-cleanup require augeas
Requires: augeas
968
Requires: %{name}-daemon = %{version}-%{release}
M
Michal Privoznik 已提交
969
Requires: %{name}-libs = %{version}-%{release}
970 971 972 973 974 975

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

976 977 978 979 980 981 982
%package nss
Summary: Libvirt plugin for Name Service Switch
Requires: libvirt-daemon-driver-network = %{version}-%{release}

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

M
Martin Kletzander 已提交
983

984
%prep
985

986
%autosetup -S git_am
987

988
%build
989
%if ! %{supported_platform}
990
echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
991 992 993
exit 1
%endif

994 995 996 997
%if %{with_qemu}
    %define arg_qemu --with-qemu
%else
    %define arg_qemu --without-qemu
998 999
%endif

1000 1001 1002 1003
%if %{with_openvz}
    %define arg_openvz --with-openvz
%else
    %define arg_openvz --without-openvz
1004 1005
%endif

1006 1007
%if %{with_lxc}
    %define arg_lxc --with-lxc
1008
    %define arg_login_shell --with-login-shell
1009 1010
%else
    %define arg_lxc --without-lxc
1011
    %define arg_login_shell --without-login-shell
1012 1013
%endif

1014 1015 1016 1017
%if %{with_vbox}
    %define arg_vbox --with-vbox
%else
    %define arg_vbox --without-vbox
M
Mark McLoughlin 已提交
1018 1019
%endif

1020 1021 1022 1023
%if %{with_libxl}
    %define arg_libxl --with-libxl
%else
    %define arg_libxl --without-libxl
J
Jim Fehlig 已提交
1024 1025
%endif

1026 1027 1028 1029
%if %{with_phyp}
    %define arg_phyp --with-phyp
%else
    %define arg_phyp --without-phyp
1030 1031
%endif

1032 1033 1034 1035
%if %{with_esx}
    %define arg_esx --with-esx
%else
    %define arg_esx --without-esx
1036 1037
%endif

1038 1039 1040 1041
%if %{with_hyperv}
    %define arg_hyperv --with-hyperv
%else
    %define arg_hyperv --without-hyperv
1042 1043
%endif

1044 1045 1046 1047
%if %{with_vmware}
    %define arg_vmware --with-vmware
%else
    %define arg_vmware --without-vmware
1048 1049
%endif

1050 1051 1052 1053
%if %{with_storage_rbd}
    %define arg_storage_rbd --with-storage-rbd
%else
    %define arg_storage_rbd --without-storage-rbd
1054 1055
%endif

1056 1057 1058 1059
%if %{with_storage_sheepdog}
    %define arg_storage_sheepdog --with-storage-sheepdog
%else
    %define arg_storage_sheepdog --without-storage-sheepdog
1060 1061
%endif

1062 1063 1064 1065
%if %{with_storage_gluster}
    %define arg_storage_gluster --with-storage-gluster
%else
    %define arg_storage_gluster --without-storage-gluster
1066 1067
%endif

1068 1069 1070 1071 1072 1073
%if %{with_storage_zfs}
    %define arg_storage_zfs --with-storage-zfs
%else
    %define arg_storage_zfs --without-storage-zfs
%endif

1074 1075 1076 1077
%if %{with_numactl}
    %define arg_numactl --with-numactl
%else
    %define arg_numactl --without-numactl
1078 1079
%endif

1080 1081 1082 1083
%if %{with_numad}
    %define arg_numad --with-numad
%else
    %define arg_numad --without-numad
1084 1085
%endif

1086 1087 1088 1089
%if %{with_fuse}
    %define arg_fuse --with-fuse
%else
    %define arg_fuse --without-fuse
1090 1091
%endif

1092 1093 1094 1095
%if %{with_sanlock}
    %define arg_sanlock --with-sanlock
%else
    %define arg_sanlock --without-sanlock
1096 1097
%endif

1098
%if %{with_firewalld}
1099 1100 1101
    %define arg_firewalld --with-firewalld
%else
    %define arg_firewalld --without-firewalld
1102 1103
%endif

1104 1105 1106 1107 1108 1109
%if %{with_firewalld_zone}
    %define arg_firewalld_zone --with-firewalld-zone
%else
    %define arg_firewalld_zone --without-firewalld-zone
%endif

1110 1111 1112 1113
%if %{with_wireshark}
    %define arg_wireshark --with-wireshark-dissector
%else
    %define arg_wireshark --without-wireshark-dissector
1114 1115
%endif

1116 1117 1118 1119 1120 1121
%if %{with_storage_iscsi_direct}
    %define arg_storage_iscsi_direct --with-storage-iscsi-direct
%else
    %define arg_storage_iscsi_direct --without-storage-iscsi-direct
%endif

1122 1123 1124
%define when  %(date +"%%F-%%T")
%define where %(hostname)
%define who   %{?packager}%{!?packager:Unknown}
1125 1126
%define arg_packager --with-packager="%{who}, %{when}, %{where}"
%define arg_packager_version --with-packager-version="%{release}"
1127

1128
%define arg_selinux_mount --with-selinux-mount="/sys/fs/selinux"
1129

1130
%if 0%{?fedora}
1131
    # Nightly edk2.git-ovmf-x64
1132
    LOADERS="/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd:/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd"
1133 1134
    # Nightly edk2.git-ovmf-ia32
    LOADERS="$LOADERS:/usr/share/edk2.git/ovmf-ia32/OVMF_CODE-pure-efi.fd:/usr/share/edk2.git/ovmf-ia32/OVMF_VARS-pure-efi.fd"
1135
    # Nightly edk2.git-aarch64
1136
    LOADERS="$LOADERS:/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2.git/aarch64/vars-template-pflash.raw"
1137 1138 1139
    # Nightly edk2.git-arm
    LOADERS="$LOADERS:/usr/share/edk2.git/arm/QEMU_EFI-pflash.raw:/usr/share/edk2.git/arm/vars-template-pflash.raw"

1140
    # Fedora edk2-ovmf
1141
    LOADERS="$LOADERS:/usr/share/edk2/ovmf/OVMF_CODE.fd:/usr/share/edk2/ovmf/OVMF_VARS.fd"
1142 1143
    # Fedora edk2-ovmf-ia32
    LOADERS="$LOADERS:/usr/share/edk2/ovmf-ia32/OVMF_CODE.fd:/usr/share/edk2/ovmf-ia32/OVMF_VARS.fd"
1144
    # Fedora edk2-aarch64
1145
    LOADERS="$LOADERS:/usr/share/edk2/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2/aarch64/vars-template-pflash.raw"
1146 1147
    # Fedora edk2-arm
    LOADERS="$LOADERS:/usr/share/edk2/arm/QEMU_EFI-pflash.raw:/usr/share/edk2/arm/vars-template-pflash.raw"
1148 1149 1150
    %define arg_loader_nvram --with-loader-nvram="$LOADERS"
%endif

1151 1152
# place macros above and build commands below this comment

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

1155 1156 1157 1158
%if 0%{?enable_autotools}
 autoreconf -if
%endif

1159
rm -f po/stamp-po
J
Jim Fehlig 已提交
1160
%configure %{?arg_qemu} \
1161 1162 1163 1164
           %{?arg_openvz} \
           %{?arg_lxc} \
           %{?arg_vbox} \
           %{?arg_libxl} \
1165
           --with-sasl \
1166
           --with-avahi \
1167
           --with-polkit \
1168
           --with-libvirtd \
1169 1170 1171 1172
           %{?arg_phyp} \
           %{?arg_esx} \
           %{?arg_hyperv} \
           %{?arg_vmware} \
1173 1174
           --without-xenapi \
           --without-vz \
1175
           --without-bhyve \
1176
           --with-interface \
1177
           --with-network \
1178 1179 1180
           --with-storage-fs \
           --with-storage-lvm \
           --with-storage-iscsi \
1181
           %{?arg_storage_iscsi_direct} \
1182
           --with-storage-scsi \
1183 1184
           --with-storage-disk \
           --with-storage-mpath \
1185 1186 1187
           %{?arg_storage_rbd} \
           %{?arg_storage_sheepdog} \
           %{?arg_storage_gluster} \
1188
           %{?arg_storage_zfs} \
1189
           --without-storage-vstorage \
1190 1191
           %{?arg_numactl} \
           %{?arg_numad} \
1192
           --with-capng \
1193
           %{?arg_fuse} \
1194
           --with-netcf \
1195
           --with-selinux \
1196
           %{?arg_selinux_mount} \
1197
           --without-apparmor \
1198
           --without-hal \
1199
           --with-udev \
1200
           --with-yajl \
1201
           %{?arg_sanlock} \
1202
           --with-libpcap \
1203
           --with-macvtap \
1204
           --with-audit \
1205
           --with-dtrace \
1206
           --with-driver-modules \
1207
           %{?arg_firewalld} \
1208
           %{?arg_firewalld_zone} \
1209
           %{?arg_wireshark} \
1210
           --without-pm-utils \
1211
           --with-nss-plugin \
1212 1213
           %{arg_packager} \
           %{arg_packager_version} \
1214 1215
           --with-qemu-user=%{qemu_user} \
           --with-qemu-group=%{qemu_group} \
1216
           --with-tls-priority=%{tls_priority} \
1217
           %{?arg_loader_nvram} \
1218
           %{?enable_werror} \
1219
           --enable-expensive-tests \
1220
           --with-init-script=systemd \
1221
           %{?arg_login_shell}
J
Jiri Denemark 已提交
1222
make %{?_smp_mflags} V=1
1223
gzip -9 ChangeLog
1224 1225 1226 1227

%install
rm -fr %{buildroot}

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

C
Cole Robinson 已提交
1230
%make_install %{?_smp_mflags} SYSTEMD_UNIT_DIR=%{_unitdir} V=1
1231

1232
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
1233
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
1234 1235
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.a
1236 1237
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.a
1238 1239
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/storage-backend/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/storage-backend/*.a
1240 1241
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/storage-file/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/storage-file/*.a
1242
%if %{with_wireshark}
1243
rm -f $RPM_BUILD_ROOT%{wireshark_plugindir}/libvirt.la
1244
%endif
1245

1246
install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/lib/libvirt/dnsmasq/
1247 1248 1249 1250 1251 1252
# 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
1253 1254
# libvirt saves this file with mode 0600
chmod 0600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml
1255 1256 1257 1258 1259 1260

# 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/
1261 1262
# libvirt saves these files with mode 600
chmod 600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml
1263

1264
# Strip auto-generated UUID - we need it generated per-install
1265
sed -i -e "/<uuid>/d" $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
1266
%if ! %{with_qemu}
1267 1268
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
1269
%endif
1270
%find_lang %{name}
1271

1272 1273 1274 1275 1276
%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

1277 1278 1279
%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
1280
%endif
1281

1282 1283
%if ! %{with_qemu}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf
1284
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu
1285
%endif
A
Amy Griffis 已提交
1286 1287
%if ! %{with_lxc}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/lxc.conf
1288
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
1289
%endif
1290 1291
%if ! %{with_libxl}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/libxl.conf
J
Jim Fehlig 已提交
1292
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.libxl
1293 1294 1295
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
1296

1297
# Copied into libvirt-docs subpackage eventually
1298
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt libvirt-docs
1299

1300
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
1301 1302
mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes.stp \
   $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes-64.stp
J
Jiri Denemark 已提交
1303 1304

    %if %{with_qemu}
1305 1306
mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \
   $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes-64.stp
J
Jiri Denemark 已提交
1307
    %endif
1308 1309
%endif

1310 1311
%check
cd tests
D
Daniel Veillard 已提交
1312 1313
# These tests don't current work in a mock build root
for i in nodeinfotest seclabeltest
1314 1315
do
  rm -f $i
1316
  printf 'int main(void) { return 0; }' > $i.c
D
Daniel Veillard 已提交
1317
  printf '#!/bin/sh\nexit 0\n' > $i
1318 1319
  chmod +x $i
done
1320
if ! make %{?_smp_mflags} check VIR_TEST_DEBUG=1
1321 1322 1323 1324
then
  cat test-suite.log || true
  exit 1
fi
1325

1326 1327 1328 1329 1330 1331 1332 1333 1334 1335
%post libs
%if 0%{?rhel} == 7
/sbin/ldconfig
%endif

%postun libs
%if 0%{?rhel} == 7
/sbin/ldconfig
%endif

1336 1337 1338 1339 1340 1341 1342 1343
%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

1344
%post daemon
1345

1346 1347 1348
%systemd_post virtlockd.socket virtlockd-admin.socket
%systemd_post virtlogd.socket virtlogd-admin.socket
%systemd_post libvirtd.service
1349

1350 1351 1352 1353
# request daemon restart in posttrans
mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || :
touch %{_localstatedir}/lib/rpm-state/libvirt/restart || :

1354
%preun daemon
1355 1356 1357
%systemd_preun libvirtd.service
%systemd_preun virtlogd.socket virtlogd-admin.socket virtlogd.service
%systemd_preun virtlockd.socket virtlockd-admin.socket virtlockd.service
1358

1359
%postun daemon
1360 1361
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
1362
    /bin/systemctl reload-or-try-restart virtlockd.service >/dev/null 2>&1 || :
1363
    /bin/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || :
1364
fi
1365

1366 1367 1368 1369 1370 1371
# 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
1372 1373 1374 1375
    /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 || :
1376 1377
fi

1378 1379 1380 1381 1382 1383
%posttrans daemon
if [ -f %{_localstatedir}/lib/rpm-state/libvirt/restart ]; then
    /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
fi
rm -rf %{_localstatedir}/lib/rpm-state/libvirt || :

1384
%post daemon-driver-network
1385
%if %{with_firewalld_zone}
1386 1387 1388 1389
    %firewalld_reload
%endif

%postun daemon-driver-network
1390
%if %{with_firewalld_zone}
1391 1392 1393
    %firewalld_reload
%endif

1394 1395
%post daemon-config-network
if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; then
1396 1397 1398 1399 1400 1401 1402 1403 1404
    # 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='
'
1405
    routes="${nl}$(ip route show | cut -d' ' -f1)${nl}"
1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423
    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

1424
    UUID=`/usr/bin/uuidgen`
1425 1426
    sed -e "s/${orig_sub}/${sub}/g" \
        -e "s,</name>,</name>\n  <uuid>$UUID</uuid>," \
1427 1428 1429
         < %{_datadir}/libvirt/networks/default.xml \
         > %{_sysconfdir}/libvirt/qemu/networks/default.xml
    ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
1430 1431
    # libvirt saves this file with mode 0600
    chmod 0600 %{_sysconfdir}/libvirt/qemu/networks/default.xml
1432 1433

    # Make sure libvirt picks up the new network defininiton
1434 1435 1436 1437 1438 1439 1440
    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
    /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
1441
fi
1442
rm -rf %{_localstatedir}/lib/rpm-state/libvirt || :
1443 1444 1445

%post daemon-config-nwfilter
cp %{_datadir}/libvirt/nwfilter/*.xml %{_sysconfdir}/libvirt/nwfilter/
1446 1447
# libvirt saves these files with mode 600
chmod 600 %{_sysconfdir}/libvirt/nwfilter/*.xml
1448
# Make sure libvirt picks up the new nwfilter defininitons
1449 1450 1451 1452 1453 1454 1455 1456
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
    /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
fi
rm -rf %{_localstatedir}/lib/rpm-state/libvirt || :
1457 1458


1459
%if %{with_qemu}
1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473
%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
1474
%endif
1475

J
Jiri Denemark 已提交
1476 1477
%preun client

1478
%systemd_preun libvirt-guests.service
J
Jiri Denemark 已提交
1479 1480

%post client
1481
%systemd_post libvirt-guests.service
1482

1483
%postun client
1484 1485
%systemd_postun libvirt-guests.service

1486 1487 1488 1489 1490 1491
%if %{with_lxc}
%pre login-shell
getent group virtlogin >/dev/null || groupadd -r virtlogin
exit 0
%endif

1492
%files
1493

1494
%files docs
D
Daniel P. Berrange 已提交
1495
%doc AUTHORS ChangeLog.gz NEWS README README.md
1496
%doc libvirt-docs/*
1497 1498 1499 1500 1501 1502 1503

# 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
1504

1505 1506 1507

%files daemon

1508
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
1509

1510
%{_unitdir}/libvirtd.service
1511
%{_unitdir}/virt-guest-shutdown.target
1512 1513
%{_unitdir}/virtlogd.service
%{_unitdir}/virtlogd.socket
J
John Ferlan 已提交
1514
%{_unitdir}/virtlogd-admin.socket
1515 1516
%{_unitdir}/virtlockd.service
%{_unitdir}/virtlockd.socket
J
John Ferlan 已提交
1517
%{_unitdir}/virtlockd-admin.socket
1518
%config(noreplace) %{_sysconfdir}/sysconfig/libvirtd
1519
%config(noreplace) %{_sysconfdir}/sysconfig/virtlogd
1520
%config(noreplace) %{_sysconfdir}/sysconfig/virtlockd
1521
%config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
1522
%config(noreplace) %{_sysconfdir}/libvirt/virtlogd.conf
1523
%config(noreplace) %{_sysconfdir}/libvirt/virtlockd.conf
1524
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
1525
%config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf
1526

1527
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd
1528
%dir %{_datadir}/libvirt/
1529

1530
%ghost %dir %{_localstatedir}/run/libvirt/
1531

1532
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/
1533
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/filesystems/
1534
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/
1535
%dir %attr(0711, root, root) %{_localstatedir}/cache/libvirt/
1536

1537

1538 1539
%dir %attr(0755, root, root) %{_libdir}/libvirt/
%dir %attr(0755, root, root) %{_libdir}/libvirt/connection-driver/
1540
%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver
1541
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so
1542

1543 1544
%{_datadir}/augeas/lenses/libvirtd.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd.aug
1545 1546
%{_datadir}/augeas/lenses/virtlogd.aug
%{_datadir}/augeas/lenses/tests/test_virtlogd.aug
1547 1548
%{_datadir}/augeas/lenses/virtlockd.aug
%{_datadir}/augeas/lenses/tests/test_virtlockd.aug
1549
%{_datadir}/augeas/lenses/libvirt_lockd.aug
1550
%if %{with_qemu}
1551
%{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug
1552
%endif
1553

1554
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
1555
%{_datadir}/polkit-1/actions/org.libvirt.api.policy
1556
%{_datadir}/polkit-1/rules.d/50-libvirt.rules
1557

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

1560
%attr(0755, root, root) %{_libexecdir}/libvirt_iohelper
1561

1562
%attr(0755, root, root) %{_sbindir}/libvirtd
1563
%attr(0755, root, root) %{_sbindir}/virtlogd
1564
%attr(0755, root, root) %{_sbindir}/virtlockd
1565

1566
%{_mandir}/man8/libvirtd.8*
1567
%{_mandir}/man8/virtlogd.8*
1568
%{_mandir}/man8/virtlockd.8*
1569
%{_mandir}/man7/virkey*.7*
1570

1571 1572
%doc examples/polkit/*.rules

1573
%files daemon-config-network
1574 1575
%dir %{_datadir}/libvirt/networks/
%{_datadir}/libvirt/networks/default.xml
1576 1577
%ghost %{_sysconfdir}/libvirt/qemu/networks/default.xml
%ghost %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
1578

1579
%files daemon-config-nwfilter
1580 1581 1582
%dir %{_datadir}/libvirt/nwfilter/
%{_datadir}/libvirt/nwfilter/*.xml
%ghost %{_sysconfdir}/libvirt/nwfilter/*.xml
1583

1584 1585 1586 1587
%files daemon-driver-interface
%{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so

%files daemon-driver-network
1588 1589 1590 1591 1592 1593
%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/
1594
%attr(0755, root, root) %{_libexecdir}/libvirt_leaseshelper
1595 1596
%{_libdir}/%{name}/connection-driver/libvirt_driver_network.so

1597 1598 1599 1600
%if %{with_firewalld_zone}
%{_prefix}/lib/firewalld/zones/libvirt.xml
%endif

1601 1602 1603 1604
%files daemon-driver-nodedev
%{_libdir}/%{name}/connection-driver/libvirt_driver_nodedev.so

%files daemon-driver-nwfilter
1605 1606
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
%ghost %dir %{_localstatedir}/run/libvirt/network/
1607 1608 1609 1610 1611 1612
%{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so

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

%files daemon-driver-storage
1613 1614

%files daemon-driver-storage-core
1615
%attr(0755, root, root) %{_libexecdir}/libvirt_parthelper
1616
%{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so
1617
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_fs.so
1618
%{_libdir}/%{name}/storage-file/libvirt_storage_file_fs.so
1619 1620

%files daemon-driver-storage-disk
1621
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_disk.so
1622 1623

%files daemon-driver-storage-logical
1624
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_logical.so
1625 1626

%files daemon-driver-storage-scsi
1627
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_scsi.so
1628 1629

%files daemon-driver-storage-iscsi
1630
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_iscsi.so
1631

1632
%if %{with_storage_iscsi_direct}
1633 1634
%files daemon-driver-storage-iscsi-direct
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_iscsi-direct.so
1635
%endif
1636

1637
%files daemon-driver-storage-mpath
1638
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_mpath.so
1639

1640
%if %{with_storage_gluster}
1641
%files daemon-driver-storage-gluster
1642
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_gluster.so
1643
%{_libdir}/%{name}/storage-file/libvirt_storage_file_gluster.so
1644
%endif
1645

1646
%if %{with_storage_rbd}
1647
%files daemon-driver-storage-rbd
1648 1649
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_rbd.so
%endif
1650

1651
%if %{with_storage_sheepdog}
1652
%files daemon-driver-storage-sheepdog
1653 1654
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_sheepdog.so
%endif
1655

1656 1657 1658 1659 1660
%if %{with_storage_zfs}
%files daemon-driver-storage-zfs
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_zfs.so
%endif

1661
%if %{with_qemu}
1662
%files daemon-driver-qemu
1663
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
1664 1665 1666 1667
%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
1668
%ghost %dir %{_localstatedir}/run/libvirt/qemu/
1669
%dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
1670 1671 1672
%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
1673
%{_libdir}/%{name}/connection-driver/libvirt_driver_qemu.so
1674 1675
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/swtpm/
%dir %attr(0711, root, root) %{_localstatedir}/log/swtpm/libvirt/qemu/
1676
%endif
1677

1678
%if %{with_lxc}
1679
%files daemon-driver-lxc
1680 1681 1682 1683 1684 1685 1686 1687
%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
1688
%{_libdir}/%{name}/connection-driver/libvirt_driver_lxc.so
1689
%endif
1690

1691
%if %{with_libxl}
1692
%files daemon-driver-libxl
1693
%config(noreplace) %{_sysconfdir}/libvirt/libxl.conf
J
Jim Fehlig 已提交
1694
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.libxl
1695
%config(noreplace) %{_sysconfdir}/libvirt/libxl-lockd.conf
1696 1697
%{_datadir}/augeas/lenses/libvirtd_libxl.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
1698 1699 1700
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/
%ghost %dir %{_localstatedir}/run/libvirt/libxl/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/
1701
%{_libdir}/%{name}/connection-driver/libvirt_driver_libxl.so
1702
%endif
1703

1704
%if %{with_vbox}
1705 1706
%files daemon-driver-vbox
%{_libdir}/%{name}/connection-driver/libvirt_driver_vbox.so
1707
%endif
1708

1709
%if %{with_qemu_tcg}
1710
%files daemon-qemu
1711
%endif
1712

1713
%if %{with_qemu_kvm}
1714
%files daemon-kvm
1715
%endif
1716

1717
%if %{with_lxc}
1718
%files daemon-lxc
1719
%endif
1720

J
Jim Fehlig 已提交
1721
%if %{with_libxl}
1722
%files daemon-xen
1723
%endif
1724

1725
%if %{with_vbox}
1726
%files daemon-vbox
1727
%endif
1728

1729 1730
%if %{with_sanlock}
%files lock-sanlock
1731
    %if %{with_qemu}
1732
%config(noreplace) %{_sysconfdir}/libvirt/qemu-sanlock.conf
1733
    %endif
1734 1735 1736
    %if %{with_libxl}
%config(noreplace) %{_sysconfdir}/libvirt/libxl-sanlock.conf
    %endif
1737
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/sanlock.so
1738 1739
%{_datadir}/augeas/lenses/libvirt_sanlock.aug
%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
1740
%dir %attr(0770, root, sanlock) %{_localstatedir}/lib/libvirt/sanlock
1741 1742
%{_sbindir}/virt-sanlock-cleanup
%{_mandir}/man8/virt-sanlock-cleanup.8*
1743
%attr(0755, root, root) %{_libexecdir}/libvirt_sanlock_helper
1744 1745
%endif

M
Michal Privoznik 已提交
1746
%files client
1747 1748
%{_mandir}/man1/virsh.1*
%{_mandir}/man1/virt-xml-validate.1*
1749
%{_mandir}/man1/virt-pki-validate.1*
1750
%{_mandir}/man1/virt-host-validate.1*
1751 1752
%{_bindir}/virsh
%{_bindir}/virt-xml-validate
1753
%{_bindir}/virt-pki-validate
1754
%{_bindir}/virt-host-validate
1755

1756
%{_datadir}/systemtap/tapset/libvirt_probes*.stp
1757
%{_datadir}/systemtap/tapset/libvirt_functions.stp
J
Jiri Denemark 已提交
1758 1759 1760
%if %{with_qemu}
%{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp
%endif
1761

1762
%if %{with_bash_completion}
1763
%{_datadir}/bash-completion/completions/virsh
1764
%endif
1765

M
Michal Privoznik 已提交
1766 1767 1768 1769 1770 1771

%{_unitdir}/libvirt-guests.service
%config(noreplace) %{_sysconfdir}/sysconfig/libvirt-guests
%attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh

%files libs -f %{name}.lang
1772
%license COPYING COPYING.LESSER
M
Michal Privoznik 已提交
1773 1774 1775 1776 1777 1778
%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.*
1779 1780
%dir %{_datadir}/libvirt/
%dir %{_datadir}/libvirt/schemas/
M
Michal Privoznik 已提交
1781
%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/
1782

1783 1784
%{_datadir}/libvirt/schemas/basictypes.rng
%{_datadir}/libvirt/schemas/capability.rng
J
Jiri Denemark 已提交
1785
%{_datadir}/libvirt/schemas/cputypes.rng
1786
%{_datadir}/libvirt/schemas/domain.rng
M
Michal Privoznik 已提交
1787
%{_datadir}/libvirt/schemas/domaincaps.rng
1788
%{_datadir}/libvirt/schemas/domaincommon.rng
1789
%{_datadir}/libvirt/schemas/domainsnapshot.rng
1790
%{_datadir}/libvirt/schemas/interface.rng
1791
%{_datadir}/libvirt/schemas/network.rng
1792
%{_datadir}/libvirt/schemas/networkcommon.rng
1793
%{_datadir}/libvirt/schemas/nodedev.rng
1794
%{_datadir}/libvirt/schemas/nwfilter.rng
1795 1796
%{_datadir}/libvirt/schemas/nwfilter_params.rng
%{_datadir}/libvirt/schemas/nwfilterbinding.rng
M
Miloslav Trmač 已提交
1797
%{_datadir}/libvirt/schemas/secret.rng
1798
%{_datadir}/libvirt/schemas/storagecommon.rng
1799
%{_datadir}/libvirt/schemas/storagepool.rng
1800
%{_datadir}/libvirt/schemas/storagepoolcaps.rng
1801
%{_datadir}/libvirt/schemas/storagevol.rng
1802

1803
%{_datadir}/libvirt/cpu_map/*.xml
J
Jiri Denemark 已提交
1804

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

1807 1808 1809
%files admin
%{_mandir}/man1/virt-admin.1*
%{_bindir}/virt-admin
1810 1811 1812
%if %{with_bash_completion}
%{_datadir}/bash-completion/completions/virt-admin
%endif
1813

1814 1815 1816 1817
%if %{with_bash_completion}
%files bash-completion
%{_datadir}/bash-completion/completions/vsh
%endif
1818

1819 1820
%if %{with_wireshark}
%files wireshark
1821
%{wireshark_plugindir}/libvirt.so
1822 1823
%endif

1824 1825
%files nss
%{_libdir}/libnss_libvirt.so.2
1826
%{_libdir}/libnss_libvirt_guest.so.2
1827

1828 1829
%if %{with_lxc}
%files login-shell
1830
%attr(4750, root, virtlogin) %{_bindir}/virt-login-shell
1831 1832 1833 1834
%config(noreplace) %{_sysconfdir}/libvirt/virt-login-shell.conf
%{_mandir}/man1/virt-login-shell.1*
%endif

1835
%files devel
1836
%{_libdir}/libvirt.so
1837
%{_libdir}/libvirt-admin.so
1838 1839
%{_libdir}/libvirt-qemu.so
%{_libdir}/libvirt-lxc.so
1840
%dir %{_includedir}/libvirt
1841 1842
%{_includedir}/libvirt/virterror.h
%{_includedir}/libvirt/libvirt.h
1843
%{_includedir}/libvirt/libvirt-admin.h
1844
%{_includedir}/libvirt/libvirt-common.h
1845
%{_includedir}/libvirt/libvirt-domain.h
1846
%{_includedir}/libvirt/libvirt-domain-snapshot.h
1847
%{_includedir}/libvirt/libvirt-event.h
1848
%{_includedir}/libvirt/libvirt-host.h
1849
%{_includedir}/libvirt/libvirt-interface.h
1850
%{_includedir}/libvirt/libvirt-network.h
1851
%{_includedir}/libvirt/libvirt-nodedev.h
1852
%{_includedir}/libvirt/libvirt-nwfilter.h
1853
%{_includedir}/libvirt/libvirt-secret.h
1854
%{_includedir}/libvirt/libvirt-storage.h
1855
%{_includedir}/libvirt/libvirt-stream.h
1856 1857
%{_includedir}/libvirt/libvirt-qemu.h
%{_includedir}/libvirt/libvirt-lxc.h
1858
%{_libdir}/pkgconfig/libvirt.pc
1859
%{_libdir}/pkgconfig/libvirt-admin.pc
1860 1861
%{_libdir}/pkgconfig/libvirt-qemu.pc
%{_libdir}/pkgconfig/libvirt-lxc.pc
1862

1863 1864
%dir %{_datadir}/libvirt/api/
%{_datadir}/libvirt/api/libvirt-api.xml
1865
%{_datadir}/libvirt/api/libvirt-admin-api.xml
1866
%{_datadir}/libvirt/api/libvirt-qemu-api.xml
1867
%{_datadir}/libvirt/api/libvirt-lxc-api.xml
1868

1869

1870
%changelog