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

3 4
# This spec file assumes you are building for Fedora 20 or newer,
# or for RHEL 6 or newer. It may need some tweaks for other distros.
5
# If neither fedora nor rhel was defined, try to guess them from dist
6
%if (0%{?fedora} && 0%{?fedora} >= 20) || (0%{?rhel} && 0%{?rhel} >= 6)
7
    %define supported_platform 1
8
%else
9
    %define supported_platform 0
10 11
%endif

12 13 14
# 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.
15
%{!?enable_autotools:%global enable_autotools 0}
16

17

18
# The hypervisor drivers that run in libvirtd
19 20 21 22 23 24
%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}
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 36
%endif

%if 0%{?rhel}
    %define with_qemu_tcg 0
    %define qemu_kvm_arches x86_64
37 38 39
    %if 0%{?rhel} >= 7
        %define qemu_kvm_arches x86_64 %{power64}
    %endif
40 41 42
%endif

%ifarch %{qemu_kvm_arches}
43
    %define with_qemu_kvm      %{with_qemu}
44
%else
45
    %define with_qemu_kvm      0
46 47
%endif

48 49 50 51
%if ! %{with_qemu_tcg} && ! %{with_qemu_kvm}
    %define with_qemu 0
%endif

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

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

# A few optional bits off by default, we enable later
74
%define with_fuse          0%{!?_without_fuse:0}
75
%define with_cgconfig      0%{!?_without_cgconfig:0}
76
%define with_sanlock       0%{!?_without_sanlock:0}
77
%define with_systemd       0%{!?_without_systemd:0}
78
%define with_numad         0%{!?_without_numad:0}
79
%define with_firewalld     0%{!?_without_firewalld:0}
80
%define with_libssh2       0%{!?_without_libssh2:0}
81
%define with_wireshark     0%{!?_without_wireshark:0}
82
%define with_pm_utils      1
83

84 85
# Finally set the OS / architecture specific special cases

86
# Xen is available only on i386 x86_64 ia64
P
Peter Robinson 已提交
87
%ifnarch %{ix86} x86_64 ia64
88 89
    %define with_xen 0
    %define with_libxl 0
90 91
%endif

92 93 94 95 96
# vbox is available only on i386 x86_64
%ifnarch %{ix86} x86_64
    %define with_vbox 0
%endif

97 98
# Numactl is not available on s390[x] and ARM
%ifarch s390 s390x %{arm}
99
    %define with_numactl 0
D
Daniel P. Berrange 已提交
100
%endif
101

102 103
# libgfapi is built only on x86_64 on rhel
%ifnarch x86_64
104
    %if 0%{?rhel}
105 106 107 108
        %define with_storage_gluster 0
    %endif
%endif

109 110 111 112 113 114 115
# 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

116
# RHEL doesn't ship OpenVZ, VBox, UML, PowerHypervisor,
J
Ján Tomko 已提交
117
# VMware, libxenserver (xenapi), libxenlight (Xen 4.1 and newer),
118
# or HyperV.
119
%if 0%{?rhel}
120 121 122 123 124 125 126 127
    %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
128
    %define with_vz 0
129 130
%endif

131 132
# Fedora 17 / RHEL-7 are first where we use systemd. Although earlier
# Fedora has systemd, libvirt still used sysvinit there.
133
%if 0%{?fedora} || 0%{?rhel} >= 7
134
    %define with_systemd 1
135
    %define with_pm_utils 0
136 137
%endif

138
# Fedora 18 / RHEL-7 are first where firewalld support is enabled
139
%if 0%{?fedora} || 0%{?rhel} >= 7
140
    %define with_firewalld 1
141 142
%endif

143
# RHEL-6 stopped including Xen on all archs.
144
%if 0%{?rhel}
145
    %define with_xen 0
146 147
%endif

148
# fuse is used to provide virtualized /proc for LXC
149
%if 0%{?fedora} || 0%{?rhel} >= 7
150
    %define with_fuse      0%{!?_without_fuse:1}
151 152
%endif

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

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

169 170 171 172 173
# Enable wireshark plugins for all distros shipping libvirt 1.2.2 or newer
%if 0%{?fedora} >= 21
    %define with_wireshark 0%{!?_without_wireshark:1}
%endif

174

175
%if %{with_qemu} || %{with_lxc} || %{with_uml}
176
# numad is used to manage the CPU and memory placement dynamically,
177
# it's not available on s390[x] and ARM.
178
    %ifnarch s390 s390x %{arm}
179
        %define with_numad    0%{!?_without_numad:1}
180
    %endif
181 182
%endif

183
# Pull in cgroups config system
184 185
%if %{with_qemu} || %{with_lxc}
    %define with_cgconfig 0%{!?_without_cgconfig:1}
186 187
%endif

188
# Force QEMU to run as non-root
189 190
%define qemu_user  qemu
%define qemu_group  qemu
191

192

193
%if 0%{?fedora} || 0%{?rhel} >= 7
194
    %define with_systemd_macros 1
195
%else
196
    %define with_systemd_macros 0
197 198 199
%endif


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

209 210 211 212 213 214
%if 0%{?fedora} >= 21
    %define tls_priority "@SYSTEM"
%else
    %define tls_priority "NORMAL"
%endif

215

C
Cole Robinson 已提交
216
Summary: Library providing a simple virtualization API
217
Name: libvirt
218
Version: @VERSION@
219
Release: 1%{?dist}%{?extra_release}
220
License: LGPLv2+
221
Group: Development/Libraries
222
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
223
URL: http://libvirt.org/
224

225
%if %(echo %{version} | grep -o \\. | wc -l) == 3
226
    %define mainturl stable_updates/
227
%endif
228
Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.xz
229

230 231 232
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-daemon-config-network = %{version}-%{release}
Requires: libvirt-daemon-config-nwfilter = %{version}-%{release}
233
%if %{with_libxl}
234
Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
235 236
%endif
%if %{with_lxc}
237
Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
238 239
%endif
%if %{with_qemu}
240
Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
241 242
%endif
%if %{with_uml}
243
Requires: libvirt-daemon-driver-uml = %{version}-%{release}
244 245
%endif
%if %{with_xen}
246
Requires: libvirt-daemon-driver-xen = %{version}-%{release}
247 248
%endif
%if %{with_vbox}
249
Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
250
%endif
251
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
252 253 254 255 256 257

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

261 262
# All build-time requirements. Run-time requirements are
# listed against each sub-RPM
263 264 265 266 267
%if 0%{?enable_autotools}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
268
BuildRequires: /usr/bin/pod2man
269
%endif
270
BuildRequires: git
271
BuildRequires: perl
D
Daniel P. Berrange 已提交
272
BuildRequires: python
273 274 275
%if %{with_systemd}
BuildRequires: systemd-units
%endif
276
%if %{with_xen} || %{with_libxl}
277
BuildRequires: xen-devel
278
%endif
279
BuildRequires: libxml2-devel
280
BuildRequires: xhtml1-dtds
E
Eric Blake 已提交
281
BuildRequires: libxslt
282
BuildRequires: readline-devel
283
BuildRequires: ncurses-devel
284
BuildRequires: gettext
285
BuildRequires: libtasn1-devel
286
%if (0%{?rhel} && 0%{?rhel} < 7)
287
BuildRequires: libgcrypt-devel
288
%endif
R
Richard W.M. Jones 已提交
289
BuildRequires: gnutls-devel
290
BuildRequires: libattr-devel
291 292
# For pool-build probing for existing pools
BuildRequires: libblkid-devel >= 2.17
E
Eric Blake 已提交
293 294
# for augparse, optionally used in testing
BuildRequires: augeas
295
%if 0%{?fedora} || 0%{?rhel} >= 7
296
BuildRequires: systemd-devel >= 185
297
%else
298 299
BuildRequires: libudev-devel >= 145
%endif
300
BuildRequires: libpciaccess-devel >= 0.10.9
301
BuildRequires: yajl-devel
302
%if %{with_sanlock}
303 304
BuildRequires: sanlock-devel >= 2.4
%endif
305
BuildRequires: libpcap-devel
306 307 308
%if 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: libnl-devel
%else
309
BuildRequires: libnl3-devel
310
%endif
311
BuildRequires: avahi-devel
312
BuildRequires: libselinux-devel
313
BuildRequires: dnsmasq >= 2.41
E
Eric Blake 已提交
314
BuildRequires: iptables
315
%if 0%{?rhel} && 0%{?rhel} < 7
E
Eric Blake 已提交
316 317
BuildRequires: iptables-ipv6
%endif
318
BuildRequires: radvd
E
Eric Blake 已提交
319 320
BuildRequires: ebtables
BuildRequires: module-init-tools
321
BuildRequires: cyrus-sasl-devel
322
%if 0%{?fedora} || 0%{?rhel} >= 7
C
Cole Robinson 已提交
323 324
# F22 polkit-devel doesn't pull in polkit anymore, which we need for pkcheck
BuildRequires: polkit >= 0.112
325
BuildRequires: polkit-devel >= 0.112
326
%else
E
Eric Blake 已提交
327
BuildRequires: polkit-devel >= 0.93
328
%endif
329 330 331 332 333 334
# For mount/umount in FS driver
BuildRequires: util-linux
%if %{with_qemu}
# From QEMU RPMs
BuildRequires: /usr/bin/qemu-img
%else
335
    %if %{with_xen}
336 337
# From Xen RPMs
BuildRequires: /usr/sbin/qcow-create
338
    %endif
339
%endif
340 341
# For LVM drivers
BuildRequires: lvm2
342 343
# For ISCSI driver
BuildRequires: iscsi-initiator-utils
344 345
# For disk driver
BuildRequires: parted-devel
346 347
# For Multipath support
BuildRequires: device-mapper-devel
348
%if %{with_storage_rbd}
349 350 351 352
    %if 0%{?rhel} >= 7
BuildRequires: librados2-devel
BuildRequires: librbd1-devel
    %else
353
BuildRequires: ceph-devel
354
    %endif
355
%endif
356 357 358 359
%if %{with_storage_gluster}
BuildRequires: glusterfs-api-devel >= 3.4.1
BuildRequires: glusterfs-devel >= 3.4.1
%endif
360 361 362
%if %{with_storage_sheepdog}
BuildRequires: sheepdog
%endif
363
%if %{with_numactl}
364 365
# For QEMU/LXC numa info
BuildRequires: numactl-devel
366
%endif
367
BuildRequires: libcap-ng-devel >= 0.5.0
368 369 370
%if %{with_fuse}
BuildRequires: fuse-devel >= 2.8.6
%endif
371
%if %{with_phyp} || %{with_libssh2}
372 373
BuildRequires: libssh2-devel >= 1.3.0
%endif
374

375
%if 0%{?fedora} || 0%{?rhel} >= 7
376
BuildRequires: netcf-devel >= 0.2.2
377
%else
378
BuildRequires: netcf-devel >= 0.1.8
379
%endif
380 381 382
%if %{with_esx}
BuildRequires: libcurl-devel
%endif
383 384 385
%if %{with_hyperv}
BuildRequires: libwsman-devel >= 2.2.3
%endif
386
BuildRequires: audit-libs-devel
D
Daniel Veillard 已提交
387 388 389
# we need /usr/sbin/dtrace
BuildRequires: systemtap-sdt-devel

390 391 392 393
# For mount/umount in FS driver
BuildRequires: util-linux
# For showmount in FS driver (netfs discovery)
BuildRequires: nfs-utils
394

395
# Communication with the firewall and polkit daemons use DBus
396 397
BuildRequires: dbus-devel

398 399
# Fedora build root suckage
BuildRequires: gawk
400

401 402 403
# For storage wiping with different algorithms
BuildRequires: scrub

404 405 406 407
%if %{with_numad}
BuildRequires: numad
%endif

408
%if %{with_wireshark}
409
%if 0%{fedora} >= 24
410
BuildRequires: wireshark-devel >= 2.1.0
411 412 413
%else
BuildRequires: wireshark-devel >= 1.12.1
%endif
414 415
%endif

416 417
Provides: bundled(gnulib)

418
%description
419
Libvirt is a C toolkit to interact with the virtualization capabilities
420 421 422
of recent versions of Linux (and other OSes). The main package includes
the libvirtd server exporting the virtualization support.

423 424 425 426 427 428 429 430
%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.

431 432 433 434 435 436 437
%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 已提交
438 439
# The client side, i.e. shared libs are in a subpackage
Requires: %{name}-libs = %{version}-%{release}
440 441 442 443 444 445

# for modprobe of pci devices
Requires: module-init-tools
# for /sbin/ip & /sbin/tc
Requires: iproute
Requires: avahi-libs
446
%if 0%{?fedora} || 0%{?rhel} >= 7
447
Requires: polkit >= 0.112
448
%else
E
Eric Blake 已提交
449
Requires: polkit >= 0.93
450 451
%endif
%if %{with_cgconfig}
452
Requires: libcgroup
453 454
%endif
%ifarch %{ix86} x86_64 ia64
455 456
# For virConnectGetSysinfo
Requires: dmidecode
457
%endif
458
# For service management
459
%if %{with_systemd}
460 461 462 463
Requires(post): systemd-units
Requires(post): systemd-sysv
Requires(preun): systemd-units
Requires(postun): systemd-units
464 465
%endif
%if %{with_numad}
466
Requires: numad
467
%endif
468 469
# libvirtd depends on 'messagebus' service
Requires: dbus
470 471
# For uid creation during pre
Requires(pre): shadow-utils
472 473 474 475 476 477 478 479 480 481 482

%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}
483
Requires: libvirt-daemon-driver-network = %{version}-%{release}
484 485 486 487 488 489 490 491 492

%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}
493
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
494 495 496

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

498 499 500 501
%package daemon-driver-network
Summary: Network driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
502 503 504
Requires: dnsmasq >= 2.41
Requires: radvd
Requires: iptables
505
%if 0%{?rhel} && 0%{?rhel} < 7
506
Requires: iptables-ipv6
507
%endif
508 509 510 511 512 513 514 515 516 517 518

%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}
519
Requires: iptables
520
%if 0%{?rhel} && 0%{?rhel} < 7
521
Requires: iptables-ipv6
522
%endif
523
Requires: ebtables
524 525 526 527 528 529 530 531 532 533 534

%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}
535
# needed for device enumeration
536
%if 0%{?fedora} || 0%{?rhel} >= 7
537
Requires: systemd >= 185
538
%else
539
Requires: udev >= 145
540
%endif
541 542 543 544 545 546 547 548 549 550 551

%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}
552
%if (0%{?fedora} || 0%{?rhel} >= 7)
553
Requires: netcf-libs >= 0.2.2
554
%endif
555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575

%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.


%package daemon-driver-storage
Summary: Storage driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
576 577 578 579
Requires: nfs-utils
# For mkfs
Requires: util-linux
# For glusterfs
580
%if 0%{?fedora}
581
Requires: glusterfs-client >= 2.0.1
582
%endif
583 584 585 586 587 588 589 590 591
# For LVM drivers
Requires: lvm2
# For ISCSI driver
Requires: iscsi-initiator-utils
# For disk driver
Requires: parted
Requires: device-mapper
# For multipath support
Requires: device-mapper
592
%if %{with_storage_sheepdog}
593 594
# For Sheepdog support
Requires: sheepdog
595 596
%endif
%if %{with_qemu}
597 598
# From QEMU RPMs
Requires: /usr/bin/qemu-img
599 600
%else
    %if %{with_xen}
601 602
# From Xen RPMs
Requires: /usr/sbin/qcow-create
603
    %endif
604
%endif
605 606 607 608 609 610 611

%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.


612
%if %{with_qemu}
613 614 615 616 617
%package daemon-driver-qemu
Summary: Qemu driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
# There really is a hard cross-driver dependency here
618
Requires: libvirt-daemon-driver-network = %{version}-%{release}
619
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
620 621 622 623 624 625
Requires: /usr/bin/qemu-img
# For image compression
Requires: gzip
Requires: bzip2
Requires: lzop
Requires: xz
A
Andrea Bolognani 已提交
626
    %if 0%{?fedora} >= 24
627
Requires: systemd-container
A
Andrea Bolognani 已提交
628
    %endif
629 630 631 632 633

%description daemon-driver-qemu
The qemu driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
QEMU
634
%endif
635 636


637
%if %{with_lxc}
638 639 640 641 642
%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
643
Requires: libvirt-daemon-driver-network = %{version}-%{release}
A
Andrea Bolognani 已提交
644
    %if 0%{?fedora} >= 24
645
Requires: systemd-container
A
Andrea Bolognani 已提交
646
    %endif
647 648 649 650 651

%description daemon-driver-lxc
The LXC driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
the Linux kernel
652
%endif
653 654


655
%if %{with_uml}
656 657 658 659 660 661 662 663 664
%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
665
%endif
666 667


668
%if %{with_xen}
669 670 671 672 673 674 675 676 677
%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
678
%endif
679 680


681
%if %{with_vbox}
682 683 684 685 686 687 688 689 690
%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
691
%endif
692 693


694
%if %{with_libxl}
695 696 697 698 699 700 701 702 703
%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
704
%endif
705 706


707

708
%if %{with_qemu_tcg}
709 710 711 712 713
%package daemon-qemu
Summary: Server side daemon & driver required to run QEMU guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
714 715 716 717
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}
718
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
719 720
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
721 722 723 724 725
Requires: qemu

%description daemon-qemu
Server side daemon and driver required to manage the virtualization
capabilities of the QEMU TCG emulators
726
%endif
727 728


729
%if %{with_qemu_kvm}
730 731 732 733 734
%package daemon-kvm
Summary: Server side daemon & driver required to run KVM guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
735 736 737 738
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}
739
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
740 741
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
742 743 744 745 746
Requires: qemu-kvm

%description daemon-kvm
Server side daemon and driver required to manage the virtualization
capabilities of the KVM hypervisor
747
%endif
748 749


750
%if %{with_lxc}
751 752 753 754 755
%package daemon-lxc
Summary: Server side daemon & driver required to run LXC guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
756 757 758 759
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}
760
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
761 762
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
763 764 765 766

%description daemon-lxc
Server side daemon and driver required to manage the virtualization
capabilities of LXC
767
%endif
768 769


770
%if %{with_uml}
771 772 773 774 775
%package daemon-uml
Summary: Server side daemon & driver required to run UML guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
776 777 778 779
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}
780
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
781 782
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
783 784 785 786 787
# 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
788
%endif
789 790


791
%if %{with_xen} || %{with_libxl}
792 793 794 795 796
%package daemon-xen
Summary: Server side daemon & driver required to run XEN guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
797
    %if %{with_xen}
798
Requires: libvirt-daemon-driver-xen = %{version}-%{release}
799 800
    %endif
    %if %{with_libxl}
801
Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
802
    %endif
803 804 805
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
Requires: libvirt-daemon-driver-network = %{version}-%{release}
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
806
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
807 808
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
809 810 811 812 813
Requires: xen

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

816
%if %{with_vbox}
817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832
%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
833
%endif
834

835
%package client
M
Michal Privoznik 已提交
836
Summary: Client side utilities of the libvirt library
837
Group: Development/Libraries
M
Michal Privoznik 已提交
838
Requires: %{name}-libs = %{version}-%{release}
839 840
Requires: readline
Requires: ncurses
E
Eric Blake 已提交
841
# Needed by /usr/libexec/libvirt-guests.sh script.
O
Osier Yang 已提交
842
Requires: gettext
843 844
# Needed by virt-pki-validate script.
Requires: gnutls-utils
845
%if %{with_pm_utils}
846 847
# Needed for probing the power management features of the host.
Requires: pm-utils
848
%endif
M
Michal Privoznik 已提交
849 850 851 852 853 854 855 856 857 858 859

%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
860 861 862 863 864
Requires: cyrus-sasl
# Not technically required, but makes 'out-of-box' config
# work correctly & doesn't have onerous dependencies
Requires: cyrus-sasl-md5

M
Michal Privoznik 已提交
865 866
%description libs
Shared libraries for accessing the libvirt daemon.
867

868 869 870 871 872 873 874 875 876
%package admin
Summary: Set of tools to control libvirt daemon
Group: Development/Libraries
Requires: %{name}-libs = %{version}-%{release}
Requires: readline

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

877 878 879 880
%if %{with_wireshark}
%package wireshark
Summary: Wireshark dissector plugin for libvirt RPC transactions
Group: Development/Libraries
881
Requires: wireshark >= 1.12.6-4
M
Michal Privoznik 已提交
882
Requires: %{name}-libs = %{version}-%{release}
883 884 885 886 887

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

888 889 890 891
%if %{with_lxc}
%package login-shell
Summary: Login shell for connecting users to an LXC container
Group: Development/Libraries
M
Michal Privoznik 已提交
892
Requires: %{name}-libs = %{version}-%{release}
893 894 895 896 897 898 899

%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

900
%package devel
901
Summary: Libraries, includes, etc. to compile with the libvirt library
902
Group: Development/Libraries
M
Michal Privoznik 已提交
903
Requires: %{name}-libs = %{version}-%{release}
904
Requires: pkgconfig
905 906

%description devel
907
Include header files & development libraries for the libvirt C library.
908

909 910 911 912
%if %{with_sanlock}
%package lock-sanlock
Summary: Sanlock lock manager plugin for QEMU driver
Group: Development/Libraries
913
Requires: sanlock >= 2.4
914 915
#for virt-sanlock-cleanup require augeas
Requires: augeas
916
Requires: %{name}-daemon = %{version}-%{release}
M
Michal Privoznik 已提交
917
Requires: %{name}-libs = %{version}-%{release}
918 919 920 921 922 923

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

924 925 926 927 928 929 930 931
%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 已提交
932

933
%prep
934 935 936 937 938
%if ! %{supported_platform}
echo "This RPM requires either Fedora >= 20 or RHEL >= 6"
exit 1
%endif

939 940
%setup -q

941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974
# 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
975
rm -rf .git
976

977
%build
978 979 980 981
%if %{with_xen}
    %define arg_xen --with-xen
%else
    %define arg_xen --without-xen
982 983
%endif

984 985 986 987
%if %{with_qemu}
    %define arg_qemu --with-qemu
%else
    %define arg_qemu --without-qemu
988 989
%endif

990 991 992 993
%if %{with_openvz}
    %define arg_openvz --with-openvz
%else
    %define arg_openvz --without-openvz
994 995
%endif

996 997 998 999
%if %{with_lxc}
    %define arg_lxc --with-lxc
%else
    %define arg_lxc --without-lxc
1000 1001
%endif

1002 1003 1004 1005
%if %{with_vbox}
    %define arg_vbox --with-vbox
%else
    %define arg_vbox --without-vbox
M
Mark McLoughlin 已提交
1006 1007
%endif

1008 1009 1010 1011
%if %{with_libxl}
    %define arg_libxl --with-libxl
%else
    %define arg_libxl --without-libxl
J
Jim Fehlig 已提交
1012 1013
%endif

1014 1015 1016 1017
%if %{with_phyp}
    %define arg_phyp --with-phyp
%else
    %define arg_phyp --without-phyp
1018 1019
%endif

1020 1021 1022 1023
%if %{with_esx}
    %define arg_esx --with-esx
%else
    %define arg_esx --without-esx
1024 1025
%endif

1026 1027 1028 1029
%if %{with_hyperv}
    %define arg_hyperv --with-hyperv
%else
    %define arg_hyperv --without-hyperv
1030 1031
%endif

1032 1033 1034 1035
%if %{with_vmware}
    %define arg_vmware --with-vmware
%else
    %define arg_vmware --without-vmware
1036 1037
%endif

1038 1039 1040 1041
%if %{with_uml}
    %define arg_uml --with-uml
%else
    %define arg_uml --without-uml
1042 1043
%endif

1044 1045 1046 1047
%if %{with_storage_rbd}
    %define arg_storage_rbd --with-storage-rbd
%else
    %define arg_storage_rbd --without-storage-rbd
1048 1049
%endif

1050 1051 1052 1053
%if %{with_storage_sheepdog}
    %define arg_storage_sheepdog --with-storage-sheepdog
%else
    %define arg_storage_sheepdog --without-storage-sheepdog
1054 1055
%endif

1056 1057 1058 1059
%if %{with_storage_gluster}
    %define arg_storage_gluster --with-storage-gluster
%else
    %define arg_storage_gluster --without-storage-gluster
1060 1061
%endif

1062 1063 1064 1065
%if %{with_numactl}
    %define arg_numactl --with-numactl
%else
    %define arg_numactl --without-numactl
1066 1067
%endif

1068 1069 1070 1071
%if %{with_numad}
    %define arg_numad --with-numad
%else
    %define arg_numad --without-numad
1072 1073
%endif

1074 1075 1076 1077
%if %{with_fuse}
    %define arg_fuse --with-fuse
%else
    %define arg_fuse --without-fuse
1078 1079
%endif

1080 1081 1082 1083
%if %{with_sanlock}
    %define arg_sanlock --with-sanlock
%else
    %define arg_sanlock --without-sanlock
1084 1085
%endif

1086
%if %{with_firewalld}
1087 1088 1089
    %define arg_firewalld --with-firewalld
%else
    %define arg_firewalld --without-firewalld
1090 1091
%endif

1092 1093 1094 1095
%if %{with_wireshark}
    %define arg_wireshark --with-wireshark-dissector
%else
    %define arg_wireshark --without-wireshark-dissector
1096 1097
%endif

1098 1099 1100 1101
%if %{with_pm_utils}
    %define arg_pm_utils --with-pm-utils
%else
    %define arg_pm_utils --without-pm-utils
1102 1103
%endif

1104 1105 1106
%define when  %(date +"%%F-%%T")
%define where %(hostname)
%define who   %{?packager}%{!?packager:Unknown}
1107 1108
%define arg_packager --with-packager="%{who}, %{when}, %{where}"
%define arg_packager_version --with-packager-version="%{release}"
1109

1110
%if %{with_systemd}
1111
    %define arg_init_script --with-init-script=systemd
1112
%else
1113
    %define arg_init_script --with-init-script=redhat
1114
%endif
1115

1116
%if 0%{?fedora} || 0%{?rhel} >= 7
1117
    %define arg_selinux_mount --with-selinux-mount="/sys/fs/selinux"
1118
%else
1119
    %define arg_selinux_mount --with-selinux-mount="/selinux"
1120 1121
%endif

1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133
%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

1134 1135 1136 1137 1138 1139
# place macros above and build commands below this comment

%if 0%{?enable_autotools}
 autoreconf -if
%endif

1140
rm -f po/stamp-po
1141 1142 1143 1144 1145 1146
%configure %{?arg_xen} \
           %{?arg_qemu} \
           %{?arg_openvz} \
           %{?arg_lxc} \
           %{?arg_vbox} \
           %{?arg_libxl} \
1147
           --with-sasl \
1148
           --with-avahi \
1149
           --with-polkit \
1150
           --with-libvirtd \
1151 1152 1153 1154 1155
           %{?arg_uml} \
           %{?arg_phyp} \
           %{?arg_esx} \
           %{?arg_hyperv} \
           %{?arg_vmware} \
1156 1157
           --without-xenapi \
           --without-vz \
1158
           --without-bhyve \
1159
           --with-interface \
1160
           --with-network \
1161 1162 1163 1164 1165
           --with-storage-fs \
           --with-storage-lvm \
           --with-storage-iscsi \
           --with-storage-disk \
           --with-storage-mpath \
1166 1167 1168 1169 1170
           %{?arg_storage_rbd} \
           %{?arg_storage_sheepdog} \
           %{?arg_storage_gluster} \
           %{?arg_numactl} \
           %{?arg_numad} \
1171
           --with-capng \
1172
           %{?arg_fuse} \
1173
           --with-netcf \
1174
           --with-selinux \
1175
           %{?arg_selinux_mount} \
1176
           --without-apparmor \
1177
           --without-hal \
1178
           --with-udev \
1179
           --with-yajl \
1180
           %{?arg_sanlock} \
1181
           --with-libpcap \
1182
           --with-macvtap \
1183
           --with-audit \
1184
           --with-dtrace \
1185
           --with-driver-modules \
1186 1187 1188
           %{?arg_firewalld} \
           %{?arg_wireshark} \
           %{?arg_pm_utils} \
1189
           --with-nss-plugin \
1190 1191
           %{arg_packager} \
           %{arg_packager_version} \
1192 1193
           --with-qemu-user=%{qemu_user} \
           --with-qemu-group=%{qemu_group} \
1194
           --with-tls-priority=%{tls_priority} \
1195
           %{?arg_loader_nvram} \
1196
           %{?enable_werror} \
1197
           --enable-expensive-tests \
1198
           %{arg_init_script}
J
Jim Meyering 已提交
1199
make %{?_smp_mflags}
1200
gzip -9 ChangeLog
1201 1202 1203 1204

%install
rm -fr %{buildroot}

1205 1206 1207 1208 1209
# 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.
make install DESTDIR=%{?buildroot} SYSTEMD_UNIT_DIR=%{_unitdir}

1210 1211
make -C examples distclean

1212
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
1213
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
1214 1215
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.a
1216 1217
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.a
1218
%if %{with_wireshark}
1219
%if 0%{fedora} >= 24
1220
rm -f $RPM_BUILD_ROOT%{_libdir}/wireshark/plugins/libvirt.la
1221 1222 1223 1224 1225
%else
rm -f $RPM_BUILD_ROOT%{_libdir}/wireshark/plugins/*/libvirt.la
mv $RPM_BUILD_ROOT%{_libdir}/wireshark/plugins/*/libvirt.so \
      $RPM_BUILD_ROOT%{_libdir}/wireshark/plugins/libvirt.so
%endif
1226
%endif
1227

1228
install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/lib/libvirt/dnsmasq/
1229 1230 1231 1232 1233 1234 1235 1236
# 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
1237
# Strip auto-generated UUID - we need it generated per-install
1238
sed -i -e "/<uuid>/d" $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
1239
%if ! %{with_qemu}
1240 1241
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
1242
%endif
1243
%find_lang %{name}
1244

1245 1246 1247 1248 1249
%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

1250 1251 1252
%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
1253
%endif
1254

1255 1256
%if ! %{with_qemu}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf
1257
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu
1258
%endif
A
Amy Griffis 已提交
1259 1260
%if ! %{with_lxc}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/lxc.conf
1261
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
1262
%endif
1263 1264
%if ! %{with_libxl}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/libxl.conf
J
Jim Fehlig 已提交
1265
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.libxl
1266 1267 1268
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
1269 1270
%if ! %{with_uml}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
A
Amy Griffis 已提交
1271
%endif
1272

1273 1274
# Copied into libvirt-docs subpackage eventually
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} libvirt-docs
1275

1276
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
1277 1278 1279 1280 1281 1282
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

1283 1284 1285
%clean
rm -fr %{buildroot}

1286 1287
%check
cd tests
D
Daniel Veillard 已提交
1288 1289 1290
make
# These tests don't current work in a mock build root
for i in nodeinfotest seclabeltest
1291 1292
do
  rm -f $i
1293
  printf 'int main(void) { return 0; }' > $i.c
D
Daniel Veillard 已提交
1294
  printf '#!/bin/sh\nexit 0\n' > $i
1295 1296
  chmod +x $i
done
1297 1298 1299 1300 1301
if ! make check VIR_TEST_DEBUG=1
then
  cat test-suite.log || true
  exit 1
fi
1302

1303 1304 1305 1306 1307 1308 1309 1310
%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

1311
%post daemon
1312

1313 1314 1315 1316
%if %{with_systemd}
    %if %{with_systemd_macros}
        %systemd_post virtlockd.socket virtlogd.socket libvirtd.service
    %else
1317 1318
if [ $1 -eq 1 ] ; then
    # Initial installation
1319 1320
    /bin/systemctl enable \
        virtlockd.socket \
1321
        virtlogd.socket \
1322
        libvirtd.service >/dev/null 2>&1 || :
1323
fi
1324 1325 1326
    %endif
%else
    %if %{with_cgconfig}
1327 1328
# Starting with Fedora 16/RHEL-7, systemd automounts all cgroups,
# and cgconfig is no longer a necessary service.
1329
        %if 0%{?rhel} && 0%{?rhel} < 7
1330 1331 1332
if [ "$1" -eq "1" ]; then
/sbin/chkconfig cgconfig on
fi
1333
        %endif
1334
    %endif
1335

1336
/sbin/chkconfig --add libvirtd
1337
/sbin/chkconfig --add virtlogd
1338
/sbin/chkconfig --add virtlockd
1339
%endif
1340

1341
%preun daemon
1342 1343 1344 1345
%if %{with_systemd}
    %if %{with_systemd_macros}
        %systemd_preun libvirtd.service virtlogd.socket virtlogd.service virtlockd.socket virtlockd.service
    %else
1346 1347
if [ $1 -eq 0 ] ; then
    # Package removal, not upgrade
1348 1349
    /bin/systemctl --no-reload disable \
        libvirtd.service \
1350 1351
        virtlogd.socket \
        virtlogd.service \
1352 1353 1354 1355
        virtlockd.socket \
        virtlockd.service > /dev/null 2>&1 || :
    /bin/systemctl stop \
        libvirtd.service \
1356 1357
        virtlogd.socket \
        virtlogd.service \
1358 1359
        virtlockd.socket \
        virtlockd.service > /dev/null 2>&1 || :
1360
fi
1361 1362
    %endif
%else
1363 1364 1365
if [ $1 = 0 ]; then
    /sbin/service libvirtd stop 1>/dev/null 2>&1
    /sbin/chkconfig --del libvirtd
1366 1367
    /sbin/service virtlogd stop 1>/dev/null 2>&1
    /sbin/chkconfig --del virtlogd
1368 1369
    /sbin/service virtlockd stop 1>/dev/null 2>&1
    /sbin/chkconfig --del virtlockd
1370
fi
1371
%endif
1372

1373
%postun daemon
1374
%if %{with_systemd}
1375 1376
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
1377
    /bin/systemctl reload-or-try-restart virtlockd.service >/dev/null 2>&1 || :
1378
    /bin/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || :
1379 1380
    /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
fi
1381
%else
1382 1383
if [ $1 -ge 1 ]; then
    /sbin/service virtlockd reload > /dev/null 2>&1 || :
1384
    /sbin/service virtlogd reload > /dev/null 2>&1 || :
1385 1386
    /sbin/service libvirtd condrestart > /dev/null 2>&1
fi
1387
%endif
1388

1389 1390
%if %{with_systemd}
%else
1391 1392 1393
%triggerpostun daemon -- libvirt-daemon < 1.2.1
if [ "$1" -ge "1" ]; then
    /sbin/service virtlockd reload > /dev/null 2>&1 || :
1394
    /sbin/service virtlogd reload > /dev/null 2>&1 || :
1395 1396
    /sbin/service libvirtd condrestart > /dev/null 2>&1
fi
1397
%endif
1398

1399 1400 1401 1402 1403 1404
# 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
1405
%if %{with_systemd}
1406 1407 1408 1409
        /bin/systemctl is-enabled libvirtd.service 1>/dev/null 2>&1 &&
            /bin/systemctl enable virtlogd.socket || :
        /bin/systemctl is-active libvirtd.service 1>/dev/null 2>&1 &&
            /bin/systemctl start virtlogd.socket || :
1410
%else
1411
        /sbin/chkconfig libvirtd 1>/dev/null 2>&1 &&
1412
            /sbin/chkconfig virtlogd on || :
1413
        /sbin/service libvirtd status 1>/dev/null 2>&1 &&
1414
            /sbin/service virtlogd start || :
1415
%endif
1416 1417
fi

1418 1419
%post daemon-config-network
if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; then
1420 1421 1422 1423 1424 1425 1426 1427 1428
    # 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='
'
1429
    routes="${nl}$(ip route show | cut -d' ' -f1)${nl}"
1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447
    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

1448
    UUID=`/usr/bin/uuidgen`
1449 1450
    sed -e "s/${orig_sub}/${sub}/g" \
        -e "s,</name>,</name>\n  <uuid>$UUID</uuid>," \
1451 1452 1453
         < %{_datadir}/libvirt/networks/default.xml \
         > %{_sysconfdir}/libvirt/qemu/networks/default.xml
    ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
1454 1455

    # Make sure libvirt picks up the new network defininiton
1456
%if %{with_systemd}
1457
    /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 ||:
1458
%else
1459
    /sbin/service libvirtd condrestart > /dev/null 2>&1 || :
1460
%endif
1461

1462
fi
1463

1464
%if %{with_systemd}
1465 1466 1467 1468 1469 1470 1471 1472 1473
%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 || :
1474
%endif
1475

1476
%if %{with_qemu}
1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490
%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
1491
%endif
1492

J
Jiri Denemark 已提交
1493 1494
%preun client

1495
%if %{with_systemd}
1496 1497 1498
    %if %{with_systemd_macros}
        %systemd_preun libvirt-guests.service
    %endif
1499
%else
J
Jiri Denemark 已提交
1500 1501 1502 1503
if [ $1 = 0 ]; then
    /sbin/chkconfig --del libvirt-guests
    rm -f /var/lib/libvirt/libvirt-guests
fi
1504
%endif
J
Jiri Denemark 已提交
1505 1506 1507 1508

%post client

/sbin/ldconfig
1509
%if %{with_systemd}
1510 1511 1512
    %if %{with_systemd_macros}
        %systemd_post libvirt-guests.service
    %endif
1513
%else
J
Jiri Denemark 已提交
1514
/sbin/chkconfig --add libvirt-guests
1515
%endif
1516

1517
%postun client
1518

1519
/sbin/ldconfig
1520
%if %{with_systemd}
1521
    %if %{with_systemd_macros}
1522
        %systemd_postun libvirt-guests.service
1523
    %endif
1524 1525 1526 1527 1528 1529
%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 ||:

1530
# Run this because the SysV package being removed won't do them
1531 1532 1533
/sbin/chkconfig --del libvirt-guests >/dev/null 2>&1 || :
%endif

1534
%if %{with_sanlock}
1535 1536 1537 1538 1539
%post lock-sanlock
if getent group sanlock > /dev/null ; then
    chmod 0770 %{_localstatedir}/lib/libvirt/sanlock
    chown root:sanlock %{_localstatedir}/lib/libvirt/sanlock
fi
1540
%endif
1541

1542 1543 1544 1545 1546 1547
%if %{with_lxc}
%pre login-shell
getent group virtlogin >/dev/null || groupadd -r virtlogin
exit 0
%endif

1548
%files
1549

1550
%files docs
1551 1552
%doc AUTHORS ChangeLog.gz NEWS README TODO
%doc libvirt-docs/*
1553 1554 1555 1556 1557 1558 1559

# 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
1560 1561 1562 1563 1564 1565 1566 1567 1568
%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
1569
%doc examples/admin
1570

1571 1572 1573

%files daemon

1574
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
1575

1576
%if %{with_systemd}
1577
%{_unitdir}/libvirtd.service
1578 1579
%{_unitdir}/virtlogd.service
%{_unitdir}/virtlogd.socket
1580 1581
%{_unitdir}/virtlockd.service
%{_unitdir}/virtlockd.socket
1582
%else
D
Daniel Veillard 已提交
1583
%{_sysconfdir}/rc.d/init.d/libvirtd
1584
%{_sysconfdir}/rc.d/init.d/virtlogd
1585
%{_sysconfdir}/rc.d/init.d/virtlockd
1586
%endif
A
Alan Pevec 已提交
1587
%doc daemon/libvirtd.upstart
1588
%config(noreplace) %{_sysconfdir}/sysconfig/libvirtd
1589
%config(noreplace) %{_sysconfdir}/sysconfig/virtlogd
1590
%config(noreplace) %{_sysconfdir}/sysconfig/virtlockd
1591
%config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
1592
%config(noreplace) %{_sysconfdir}/libvirt/virtlogd.conf
1593
%config(noreplace) %{_sysconfdir}/libvirt/virtlockd.conf
1594
%config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf
1595

1596
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd
1597
%dir %{_datadir}/libvirt/
1598

1599
%ghost %dir %{_localstatedir}/run/libvirt/
1600

1601
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/
1602
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/filesystems/
1603
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/
1604
%dir %attr(0711, root, root) %{_localstatedir}/cache/libvirt/
1605

1606

1607
%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver
1608
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so
1609

1610 1611
%{_datadir}/augeas/lenses/libvirtd.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd.aug
1612 1613
%{_datadir}/augeas/lenses/virtlogd.aug
%{_datadir}/augeas/lenses/tests/test_virtlogd.aug
1614 1615
%{_datadir}/augeas/lenses/virtlockd.aug
%{_datadir}/augeas/lenses/tests/test_virtlockd.aug
1616
%{_datadir}/augeas/lenses/libvirt_lockd.aug
1617
%if %{with_qemu}
1618
%{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug
1619
%endif
1620

1621
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
1622
%{_datadir}/polkit-1/actions/org.libvirt.api.policy
1623
%{_datadir}/polkit-1/rules.d/50-libvirt.rules
1624

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

1627
%attr(0755, root, root) %{_libexecdir}/libvirt_iohelper
1628

1629
%attr(0755, root, root) %{_sbindir}/libvirtd
1630
%attr(0755, root, root) %{_sbindir}/virtlogd
1631
%attr(0755, root, root) %{_sbindir}/virtlockd
1632

1633
%{_mandir}/man8/libvirtd.8*
1634
%{_mandir}/man8/virtlogd.8*
1635
%{_mandir}/man8/virtlockd.8*
1636

1637 1638
%doc examples/polkit/*.rules

1639
%files daemon-config-network
1640 1641
%dir %{_datadir}/libvirt/networks/
%{_datadir}/libvirt/networks/default.xml
1642

1643 1644
%files daemon-config-nwfilter
%{_sysconfdir}/libvirt/nwfilter/*.xml
1645

1646 1647 1648 1649
%files daemon-driver-interface
%{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so

%files daemon-driver-network
1650 1651 1652 1653 1654 1655
%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/
1656
%attr(0755, root, root) %{_libexecdir}/libvirt_leaseshelper
1657 1658 1659 1660 1661 1662
%{_libdir}/%{name}/connection-driver/libvirt_driver_network.so

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

%files daemon-driver-nwfilter
1663 1664
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
%ghost %dir %{_localstatedir}/run/libvirt/network/
1665 1666 1667 1668 1669 1670
%{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so

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

%files daemon-driver-storage
1671
%attr(0755, root, root) %{_libexecdir}/libvirt_parthelper
1672
%{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so
1673

1674
%if %{with_qemu}
1675
%files daemon-driver-qemu
1676
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
1677 1678 1679 1680 1681
%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/
1682
%dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
1683 1684 1685
%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
1686
%{_libdir}/%{name}/connection-driver/libvirt_driver_qemu.so
1687
%endif
1688

1689
%if %{with_lxc}
1690
%files daemon-driver-lxc
1691 1692 1693 1694 1695 1696 1697 1698
%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
1699
%{_libdir}/%{name}/connection-driver/libvirt_driver_lxc.so
1700
%endif
1701

1702
%if %{with_uml}
1703
%files daemon-driver-uml
1704 1705 1706 1707
%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/
1708
%{_libdir}/%{name}/connection-driver/libvirt_driver_uml.so
1709
%endif
1710

1711
%if %{with_xen}
1712
%files daemon-driver-xen
1713
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/xen/
1714
%{_libdir}/%{name}/connection-driver/libvirt_driver_xen.so
1715
%endif
1716

1717
%if %{with_libxl}
1718
%files daemon-driver-libxl
1719
%config(noreplace) %{_sysconfdir}/libvirt/libxl.conf
J
Jim Fehlig 已提交
1720
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.libxl
1721
%config(noreplace) %{_sysconfdir}/libvirt/libxl-lockd.conf
1722 1723
%{_datadir}/augeas/lenses/libvirtd_libxl.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
1724 1725 1726
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/
%ghost %dir %{_localstatedir}/run/libvirt/libxl/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/
1727
%{_libdir}/%{name}/connection-driver/libvirt_driver_libxl.so
1728
%endif
1729

1730
%if %{with_vbox}
1731 1732
%files daemon-driver-vbox
%{_libdir}/%{name}/connection-driver/libvirt_driver_vbox.so
1733
%endif
1734

1735
%if %{with_qemu_tcg}
1736
%files daemon-qemu
1737
%endif
1738

1739
%if %{with_qemu_kvm}
1740
%files daemon-kvm
1741
%endif
1742

1743
%if %{with_lxc}
1744
%files daemon-lxc
1745
%endif
1746

1747
%if %{with_uml}
1748
%files daemon-uml
1749
%endif
1750

1751
%if %{with_xen} || %{with_libxl}
1752
%files daemon-xen
1753
%endif
1754

1755
%if %{with_vbox}
1756
%files daemon-vbox
1757
%endif
1758

1759 1760
%if %{with_sanlock}
%files lock-sanlock
1761
    %if %{with_qemu}
1762
%config(noreplace) %{_sysconfdir}/libvirt/qemu-sanlock.conf
1763
    %endif
1764 1765 1766
    %if %{with_libxl}
%config(noreplace) %{_sysconfdir}/libvirt/libxl-sanlock.conf
    %endif
1767
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/sanlock.so
1768 1769
%{_datadir}/augeas/lenses/libvirt_sanlock.aug
%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
1770
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/sanlock
1771 1772
%{_sbindir}/virt-sanlock-cleanup
%{_mandir}/man8/virt-sanlock-cleanup.8*
1773
%attr(0755, root, root) %{_libexecdir}/libvirt_sanlock_helper
1774 1775
%endif

M
Michal Privoznik 已提交
1776
%files client
1777 1778
%{_mandir}/man1/virsh.1*
%{_mandir}/man1/virt-xml-validate.1*
1779
%{_mandir}/man1/virt-pki-validate.1*
1780
%{_mandir}/man1/virt-host-validate.1*
1781 1782
%{_bindir}/virsh
%{_bindir}/virt-xml-validate
1783
%{_bindir}/virt-pki-validate
1784
%{_bindir}/virt-host-validate
1785

1786 1787
%{_datadir}/systemtap/tapset/libvirt_probes*.stp
%{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp
1788 1789
%{_datadir}/systemtap/tapset/libvirt_functions.stp

M
Michal Privoznik 已提交
1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806

%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
%doc COPYING COPYING.LESSER
%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.*
1807 1808
%dir %{_datadir}/libvirt/
%dir %{_datadir}/libvirt/schemas/
M
Michal Privoznik 已提交
1809
%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/
1810

1811 1812
%{_datadir}/libvirt/schemas/basictypes.rng
%{_datadir}/libvirt/schemas/capability.rng
1813
%{_datadir}/libvirt/schemas/domain.rng
M
Michal Privoznik 已提交
1814
%{_datadir}/libvirt/schemas/domaincaps.rng
1815
%{_datadir}/libvirt/schemas/domaincommon.rng
1816
%{_datadir}/libvirt/schemas/domainsnapshot.rng
1817
%{_datadir}/libvirt/schemas/interface.rng
1818
%{_datadir}/libvirt/schemas/network.rng
1819
%{_datadir}/libvirt/schemas/networkcommon.rng
1820
%{_datadir}/libvirt/schemas/nodedev.rng
1821
%{_datadir}/libvirt/schemas/nwfilter.rng
M
Miloslav Trmač 已提交
1822
%{_datadir}/libvirt/schemas/secret.rng
1823
%{_datadir}/libvirt/schemas/storagecommon.rng
1824 1825
%{_datadir}/libvirt/schemas/storagepool.rng
%{_datadir}/libvirt/schemas/storagevol.rng
1826

J
Jiri Denemark 已提交
1827
%{_datadir}/libvirt/cpu_map.xml
1828
%{_datadir}/libvirt/libvirtLogo.png
J
Jiri Denemark 已提交
1829

1830 1831
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf

1832 1833 1834 1835 1836
%files admin
%{_mandir}/man1/virt-admin.1*
%{_bindir}/virt-admin


1837 1838
%if %{with_wireshark}
%files wireshark
1839
%{_libdir}/wireshark/plugins/libvirt.so
1840 1841
%endif

1842 1843 1844
%files nss
%{_libdir}/libnss_libvirt.so.2

1845 1846
%if %{with_lxc}
%files login-shell
1847
%attr(4750, root, virtlogin) %{_bindir}/virt-login-shell
1848 1849 1850 1851
%config(noreplace) %{_sysconfdir}/libvirt/virt-login-shell.conf
%{_mandir}/man1/virt-login-shell.1*
%endif

1852
%files devel
1853
%{_libdir}/libvirt.so
1854
%{_libdir}/libvirt-admin.so
1855 1856
%{_libdir}/libvirt-qemu.so
%{_libdir}/libvirt-lxc.so
1857
%dir %{_includedir}/libvirt
1858 1859
%{_includedir}/libvirt/virterror.h
%{_includedir}/libvirt/libvirt.h
1860
%{_includedir}/libvirt/libvirt-admin.h
1861
%{_includedir}/libvirt/libvirt-common.h
1862
%{_includedir}/libvirt/libvirt-domain.h
1863
%{_includedir}/libvirt/libvirt-domain-snapshot.h
1864
%{_includedir}/libvirt/libvirt-event.h
1865
%{_includedir}/libvirt/libvirt-host.h
1866
%{_includedir}/libvirt/libvirt-interface.h
1867
%{_includedir}/libvirt/libvirt-network.h
1868
%{_includedir}/libvirt/libvirt-nodedev.h
1869
%{_includedir}/libvirt/libvirt-nwfilter.h
1870
%{_includedir}/libvirt/libvirt-secret.h
1871
%{_includedir}/libvirt/libvirt-storage.h
1872
%{_includedir}/libvirt/libvirt-stream.h
1873 1874
%{_includedir}/libvirt/libvirt-qemu.h
%{_includedir}/libvirt/libvirt-lxc.h
1875
%{_libdir}/pkgconfig/libvirt.pc
1876
%{_libdir}/pkgconfig/libvirt-admin.pc
1877 1878
%{_libdir}/pkgconfig/libvirt-qemu.pc
%{_libdir}/pkgconfig/libvirt-lxc.pc
1879

1880 1881
%dir %{_datadir}/libvirt/api/
%{_datadir}/libvirt/api/libvirt-api.xml
1882
%{_datadir}/libvirt/api/libvirt-admin-api.xml
1883
%{_datadir}/libvirt/api/libvirt-qemu-api.xml
1884
%{_datadir}/libvirt/api/libvirt-lxc-api.xml
1885
# Needed building python bindings
1886
%doc docs/libvirt-api.xml
1887

1888

1889
%changelog