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

3 4 5
# This spec file assumes you are building on a Fedora or RHEL version
# that's still supported by the vendor: that means Fedora 23 or newer,
# or RHEL 6 or newer. It may need some tweaks for other distros.
6
# If neither fedora nor rhel was defined, try to guess them from dist
7
%if (0%{?fedora} && 0%{?fedora} >= 23) || (0%{?rhel} && 0%{?rhel} >= 6)
8
    %define supported_platform 1
9
%else
10
    %define supported_platform 0
11 12
%endif

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

18

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

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

%define qemu_kvm_arches %{ix86} x86_64

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

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

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

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

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

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

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

86 87
# Finally set the OS / architecture specific special cases

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

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

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

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

111 112 113 114 115 116 117
# 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

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

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

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

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

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

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

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

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

176 177 178 179 180
# Enable libssh transport for new enough distros
%if 0%{?fedora}
    %define with_libssh 0%{!?_without_libssh:1}
%endif

181

182
%if %{with_qemu} || %{with_lxc} || %{with_uml}
183
# numad is used to manage the CPU and memory placement dynamically,
184
# it's not available on s390[x] and ARM.
185
    %ifnarch s390 s390x %{arm}
186
        %define with_numad    0%{!?_without_numad:1}
187
    %endif
188 189
%endif

190
# Pull in cgroups config system
191 192
%if %{with_qemu} || %{with_lxc}
    %define with_cgconfig 0%{!?_without_cgconfig:1}
193 194
%endif

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

199

200
%if 0%{?fedora} || 0%{?rhel} >= 7
201
    %define with_systemd_macros 1
202
%else
203
    %define with_systemd_macros 0
204 205 206
%endif


207 208 209 210 211
# 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 已提交
212
%else
213
    %define enable_werror --disable-werror
214 215
%endif

216 217
%if 0%{?fedora} >= 25
    %define tls_priority "@LIBVIRT,SYSTEM"
218
%else
219
    %if 0%{?fedora}
220 221 222 223
        %define tls_priority "@SYSTEM"
    %else
        %define tls_priority "NORMAL"
    %endif
224 225
%endif

226

C
Cole Robinson 已提交
227
Summary: Library providing a simple virtualization API
228
Name: libvirt
229
Version: @VERSION@
230
Release: 1%{?dist}%{?extra_release}
231
License: LGPLv2+
232
Group: Development/Libraries
233
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
234
URL: http://libvirt.org/
235

236
%if %(echo %{version} | grep -o \\. | wc -l) == 3
237
    %define mainturl stable_updates/
238
%endif
239
Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.xz
240

241 242 243
Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-daemon-config-network = %{version}-%{release}
Requires: libvirt-daemon-config-nwfilter = %{version}-%{release}
244
%if %{with_libxl}
245
Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
246 247
%endif
%if %{with_lxc}
248
Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
249 250
%endif
%if %{with_qemu}
251
Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
252 253
%endif
%if %{with_uml}
254
Requires: libvirt-daemon-driver-uml = %{version}-%{release}
255 256
%endif
%if %{with_xen}
257
Requires: libvirt-daemon-driver-xen = %{version}-%{release}
258 259
%endif
%if %{with_vbox}
260
Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
261
%endif
262
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
263 264 265 266 267 268

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

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

388
%if 0%{?fedora} || 0%{?rhel} >= 7
389
BuildRequires: netcf-devel >= 0.2.2
390
%else
391
BuildRequires: netcf-devel >= 0.1.8
392
%endif
393 394 395
%if %{with_esx}
BuildRequires: libcurl-devel
%endif
396 397 398
%if %{with_hyperv}
BuildRequires: libwsman-devel >= 2.2.3
%endif
399
BuildRequires: audit-libs-devel
D
Daniel Veillard 已提交
400 401 402
# we need /usr/sbin/dtrace
BuildRequires: systemtap-sdt-devel

403 404 405 406
# For mount/umount in FS driver
BuildRequires: util-linux
# For showmount in FS driver (netfs discovery)
BuildRequires: nfs-utils
407

408
# Communication with the firewall and polkit daemons use DBus
409 410
BuildRequires: dbus-devel

411 412
# Fedora build root suckage
BuildRequires: gawk
413

414 415 416
# For storage wiping with different algorithms
BuildRequires: scrub

417 418 419 420
%if %{with_numad}
BuildRequires: numad
%endif

421
%if %{with_wireshark}
422
    %if 0%{fedora} >= 24
423
BuildRequires: wireshark-devel >= 2.1.0
424
    %else
425
BuildRequires: wireshark-devel >= 1.12.1
426
    %endif
427 428
%endif

429 430 431 432
%if %{with_libssh}
BuildRequires: libssh-devel >= 0.7.0
%endif

433 434
Provides: bundled(gnulib)

435
%description
436
Libvirt is a C toolkit to interact with the virtualization capabilities
437 438 439
of recent versions of Linux (and other OSes). The main package includes
the libvirtd server exporting the virtualization support.

440 441 442 443 444 445 446 447
%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.

448 449 450 451 452 453 454
%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 已提交
455 456
# The client side, i.e. shared libs are in a subpackage
Requires: %{name}-libs = %{version}-%{release}
457 458 459 460 461 462

# for modprobe of pci devices
Requires: module-init-tools
# for /sbin/ip & /sbin/tc
Requires: iproute
Requires: avahi-libs
463
%if 0%{?fedora} || 0%{?rhel} >= 7
464
Requires: polkit >= 0.112
465
%else
E
Eric Blake 已提交
466
Requires: polkit >= 0.93
467 468
%endif
%if %{with_cgconfig}
469
Requires: libcgroup
470 471
%endif
%ifarch %{ix86} x86_64 ia64
472 473
# For virConnectGetSysinfo
Requires: dmidecode
474
%endif
475
# For service management
476
%if %{with_systemd}
477 478 479 480
Requires(post): systemd-units
Requires(post): systemd-sysv
Requires(preun): systemd-units
Requires(postun): systemd-units
481 482
%endif
%if %{with_numad}
483
Requires: numad
484
%endif
485 486
# libvirtd depends on 'messagebus' service
Requires: dbus
487 488
# For uid creation during pre
Requires(pre): shadow-utils
489 490 491 492 493 494 495 496 497 498 499

%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}
500
Requires: libvirt-daemon-driver-network = %{version}-%{release}
501 502 503 504 505 506 507 508 509

%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}
510
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
511 512 513

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

515 516 517 518
%package daemon-driver-network
Summary: Network driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
519 520 521
Requires: dnsmasq >= 2.41
Requires: radvd
Requires: iptables
522
%if 0%{?rhel} && 0%{?rhel} < 7
523
Requires: iptables-ipv6
524
%endif
525 526 527 528 529 530 531 532 533 534 535

%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}
536
Requires: iptables
537
%if 0%{?rhel} && 0%{?rhel} < 7
538
Requires: iptables-ipv6
539
%endif
540
Requires: ebtables
541 542 543 544 545 546 547 548 549 550 551

%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}
552
# needed for device enumeration
553
%if 0%{?fedora} || 0%{?rhel} >= 7
554
Requires: systemd >= 185
555
%else
556
Requires: udev >= 145
557
%endif
558 559 560 561 562 563 564 565 566 567 568

%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}
569
%if (0%{?fedora} || 0%{?rhel} >= 7)
570
Requires: netcf-libs >= 0.2.2
571
%endif
572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592

%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}
593 594 595 596
Requires: nfs-utils
# For mkfs
Requires: util-linux
# For glusterfs
597
%if 0%{?fedora}
598
Requires: glusterfs-client >= 2.0.1
599
%endif
600 601 602 603
# gluster cli tool for pool discovery
%if (0%{?fedora} || 0%{?with_storage_gluster})
Requires: /usr/sbin/gluster
%endif
604 605 606 607 608 609 610 611 612
# 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
613
%if %{with_storage_sheepdog}
614 615
# For Sheepdog support
Requires: sheepdog
616 617
%endif
%if %{with_qemu}
618 619
# From QEMU RPMs
Requires: /usr/bin/qemu-img
620 621
%else
    %if %{with_xen}
622 623
# From Xen RPMs
Requires: /usr/sbin/qcow-create
624
    %endif
625
%endif
626 627 628 629 630 631 632

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


633
%if %{with_qemu}
634 635 636 637 638
%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
639
Requires: libvirt-daemon-driver-network = %{version}-%{release}
640
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
641 642 643 644 645 646
Requires: /usr/bin/qemu-img
# For image compression
Requires: gzip
Requires: bzip2
Requires: lzop
Requires: xz
A
Andrea Bolognani 已提交
647
    %if 0%{?fedora} >= 24
648
Requires: systemd-container
A
Andrea Bolognani 已提交
649
    %endif
650 651 652 653 654

%description daemon-driver-qemu
The qemu driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
QEMU
655
%endif
656 657


658
%if %{with_lxc}
659 660 661 662 663
%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
664
Requires: libvirt-daemon-driver-network = %{version}-%{release}
A
Andrea Bolognani 已提交
665
    %if 0%{?fedora} >= 24
666
Requires: systemd-container
A
Andrea Bolognani 已提交
667
    %endif
668 669 670 671 672

%description daemon-driver-lxc
The LXC driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
the Linux kernel
673
%endif
674 675


676
%if %{with_uml}
677 678 679 680 681 682 683 684 685
%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
686
%endif
687 688


689
%if %{with_xen}
690 691 692 693 694 695 696 697 698
%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
699
%endif
700 701


702
%if %{with_vbox}
703 704 705 706 707 708 709 710 711
%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
712
%endif
713 714


715
%if %{with_libxl}
716 717 718 719 720 721 722 723 724
%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
725
%endif
726 727


728

729
%if %{with_qemu_tcg}
730 731 732 733 734
%package daemon-qemu
Summary: Server side daemon & driver required to run QEMU 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

%description daemon-qemu
Server side daemon and driver required to manage the virtualization
capabilities of the QEMU TCG emulators
747
%endif
748 749


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

Requires: libvirt-daemon = %{version}-%{release}
756 757 758 759
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}
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 767
Requires: qemu-kvm

%description daemon-kvm
Server side daemon and driver required to manage the virtualization
capabilities of the KVM hypervisor
768
%endif
769 770


771
%if %{with_lxc}
772 773 774 775 776
%package daemon-lxc
Summary: Server side daemon & driver required to run LXC guests
Group: Development/Libraries

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

%description daemon-lxc
Server side daemon and driver required to manage the virtualization
capabilities of LXC
788
%endif
789 790


791
%if %{with_uml}
792 793 794 795 796
%package daemon-uml
Summary: Server side daemon & driver required to run UML guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
797 798 799 800
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}
801
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
802 803
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
804 805 806 807 808
# 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
809
%endif
810 811


812
%if %{with_xen} || %{with_libxl}
813 814 815 816 817
%package daemon-xen
Summary: Server side daemon & driver required to run XEN guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
818
    %if %{with_xen}
819
Requires: libvirt-daemon-driver-xen = %{version}-%{release}
820 821
    %endif
    %if %{with_libxl}
822
Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
823
    %endif
824 825 826
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
Requires: libvirt-daemon-driver-network = %{version}-%{release}
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
827
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
828 829
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
830 831 832 833 834
Requires: xen

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

837
%if %{with_vbox}
838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853
%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
854
%endif
855

856
%package client
M
Michal Privoznik 已提交
857
Summary: Client side utilities of the libvirt library
858
Group: Development/Libraries
M
Michal Privoznik 已提交
859
Requires: %{name}-libs = %{version}-%{release}
860 861
Requires: readline
Requires: ncurses
E
Eric Blake 已提交
862
# Needed by /usr/libexec/libvirt-guests.sh script.
O
Osier Yang 已提交
863
Requires: gettext
864 865
# Needed by virt-pki-validate script.
Requires: gnutls-utils
866
%if %{with_pm_utils}
867 868
# Needed for probing the power management features of the host.
Requires: pm-utils
869
%endif
M
Michal Privoznik 已提交
870 871 872 873 874 875 876 877 878 879 880

%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
881 882 883 884 885
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 已提交
886 887
%description libs
Shared libraries for accessing the libvirt daemon.
888

889 890 891 892 893 894 895 896 897
%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.

898 899 900 901
%if %{with_wireshark}
%package wireshark
Summary: Wireshark dissector plugin for libvirt RPC transactions
Group: Development/Libraries
902
Requires: wireshark >= 1.12.6-4
M
Michal Privoznik 已提交
903
Requires: %{name}-libs = %{version}-%{release}
904 905 906 907 908

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

909 910 911 912
%if %{with_lxc}
%package login-shell
Summary: Login shell for connecting users to an LXC container
Group: Development/Libraries
M
Michal Privoznik 已提交
913
Requires: %{name}-libs = %{version}-%{release}
914 915 916 917 918 919 920

%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

921
%package devel
922
Summary: Libraries, includes, etc. to compile with the libvirt library
923
Group: Development/Libraries
M
Michal Privoznik 已提交
924
Requires: %{name}-libs = %{version}-%{release}
925
Requires: pkgconfig
926 927

%description devel
928
Include header files & development libraries for the libvirt C library.
929

930 931 932 933
%if %{with_sanlock}
%package lock-sanlock
Summary: Sanlock lock manager plugin for QEMU driver
Group: Development/Libraries
934
Requires: sanlock >= 2.4
935 936
#for virt-sanlock-cleanup require augeas
Requires: augeas
937
Requires: %{name}-daemon = %{version}-%{release}
M
Michal Privoznik 已提交
938
Requires: %{name}-libs = %{version}-%{release}
939 940 941 942 943 944

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

945 946 947 948 949 950 951 952
%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 已提交
953

954
%prep
955 956 957 958 959
%if ! %{supported_platform}
echo "This RPM requires either Fedora >= 20 or RHEL >= 6"
exit 1
%endif

960 961
%setup -q

962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995
# 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
996
rm -rf .git
997

998
%build
999 1000 1001 1002
%if %{with_xen}
    %define arg_xen --with-xen
%else
    %define arg_xen --without-xen
1003 1004
%endif

1005 1006 1007 1008
%if %{with_qemu}
    %define arg_qemu --with-qemu
%else
    %define arg_qemu --without-qemu
1009 1010
%endif

1011 1012 1013 1014
%if %{with_openvz}
    %define arg_openvz --with-openvz
%else
    %define arg_openvz --without-openvz
1015 1016
%endif

1017 1018 1019 1020
%if %{with_lxc}
    %define arg_lxc --with-lxc
%else
    %define arg_lxc --without-lxc
1021 1022
%endif

1023 1024 1025 1026
%if %{with_vbox}
    %define arg_vbox --with-vbox
%else
    %define arg_vbox --without-vbox
M
Mark McLoughlin 已提交
1027 1028
%endif

1029 1030 1031 1032
%if %{with_libxl}
    %define arg_libxl --with-libxl
%else
    %define arg_libxl --without-libxl
J
Jim Fehlig 已提交
1033 1034
%endif

1035 1036 1037 1038
%if %{with_phyp}
    %define arg_phyp --with-phyp
%else
    %define arg_phyp --without-phyp
1039 1040
%endif

1041 1042 1043 1044
%if %{with_esx}
    %define arg_esx --with-esx
%else
    %define arg_esx --without-esx
1045 1046
%endif

1047 1048 1049 1050
%if %{with_hyperv}
    %define arg_hyperv --with-hyperv
%else
    %define arg_hyperv --without-hyperv
1051 1052
%endif

1053 1054 1055 1056
%if %{with_vmware}
    %define arg_vmware --with-vmware
%else
    %define arg_vmware --without-vmware
1057 1058
%endif

1059 1060 1061 1062
%if %{with_uml}
    %define arg_uml --with-uml
%else
    %define arg_uml --without-uml
1063 1064
%endif

1065 1066 1067 1068
%if %{with_storage_rbd}
    %define arg_storage_rbd --with-storage-rbd
%else
    %define arg_storage_rbd --without-storage-rbd
1069 1070
%endif

1071 1072 1073 1074
%if %{with_storage_sheepdog}
    %define arg_storage_sheepdog --with-storage-sheepdog
%else
    %define arg_storage_sheepdog --without-storage-sheepdog
1075 1076
%endif

1077 1078 1079 1080
%if %{with_storage_gluster}
    %define arg_storage_gluster --with-storage-gluster
%else
    %define arg_storage_gluster --without-storage-gluster
1081 1082
%endif

1083 1084 1085 1086
%if %{with_numactl}
    %define arg_numactl --with-numactl
%else
    %define arg_numactl --without-numactl
1087 1088
%endif

1089 1090 1091 1092
%if %{with_numad}
    %define arg_numad --with-numad
%else
    %define arg_numad --without-numad
1093 1094
%endif

1095 1096 1097 1098
%if %{with_fuse}
    %define arg_fuse --with-fuse
%else
    %define arg_fuse --without-fuse
1099 1100
%endif

1101 1102 1103 1104
%if %{with_sanlock}
    %define arg_sanlock --with-sanlock
%else
    %define arg_sanlock --without-sanlock
1105 1106
%endif

1107
%if %{with_firewalld}
1108 1109 1110
    %define arg_firewalld --with-firewalld
%else
    %define arg_firewalld --without-firewalld
1111 1112
%endif

1113 1114 1115 1116
%if %{with_wireshark}
    %define arg_wireshark --with-wireshark-dissector
%else
    %define arg_wireshark --without-wireshark-dissector
1117 1118
%endif

1119 1120 1121 1122
%if %{with_pm_utils}
    %define arg_pm_utils --with-pm-utils
%else
    %define arg_pm_utils --without-pm-utils
1123 1124
%endif

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

1131
%if %{with_systemd}
1132
    %define arg_init_script --with-init-script=systemd
1133
%else
1134
    %define arg_init_script --with-init-script=redhat
1135
%endif
1136

1137
%if 0%{?fedora} || 0%{?rhel} >= 7
1138
    %define arg_selinux_mount --with-selinux-mount="/sys/fs/selinux"
1139
%else
1140
    %define arg_selinux_mount --with-selinux-mount="/selinux"
1141 1142
%endif

1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154
%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

1155 1156 1157 1158 1159 1160
# place macros above and build commands below this comment

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

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

%install
rm -fr %{buildroot}

1229 1230 1231
# 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.
1232
make %{?_smp_mflags} install DESTDIR=%{?buildroot} SYSTEMD_UNIT_DIR=%{_unitdir}
1233

1234
make %{?_smp_mflags} -C examples distclean
1235

1236
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
1237
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
1238 1239
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.a
1240 1241
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.a
1242
%if %{with_wireshark}
1243
    %if 0%{fedora} >= 24
1244
rm -f $RPM_BUILD_ROOT%{_libdir}/wireshark/plugins/libvirt.la
1245
    %else
1246 1247 1248
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
1249
    %endif
1250
%endif
1251

1252
install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/lib/libvirt/dnsmasq/
1253 1254 1255 1256 1257 1258 1259 1260
# 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
1261
# Strip auto-generated UUID - we need it generated per-install
1262
sed -i -e "/<uuid>/d" $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
1263
%if ! %{with_qemu}
1264 1265
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
1266
%endif
1267
%find_lang %{name}
1268

1269 1270 1271 1272 1273
%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

1274 1275 1276
%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
1277
%endif
1278

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

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

1300
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
1301 1302 1303 1304 1305 1306
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

1307 1308 1309
%clean
rm -fr %{buildroot}

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

1334
%post daemon
1335

1336 1337 1338 1339
%if %{with_systemd}
    %if %{with_systemd_macros}
        %systemd_post virtlockd.socket virtlogd.socket libvirtd.service
    %else
1340 1341
if [ $1 -eq 1 ] ; then
    # Initial installation
1342 1343
    /bin/systemctl enable \
        virtlockd.socket \
1344
        virtlogd.socket \
1345
        libvirtd.service >/dev/null 2>&1 || :
1346
fi
1347 1348 1349
    %endif
%else
    %if %{with_cgconfig}
1350 1351
# Starting with Fedora 16/RHEL-7, systemd automounts all cgroups,
# and cgconfig is no longer a necessary service.
1352
        %if 0%{?rhel} && 0%{?rhel} < 7
1353 1354 1355
if [ "$1" -eq "1" ]; then
/sbin/chkconfig cgconfig on
fi
1356
        %endif
1357
    %endif
1358

1359
/sbin/chkconfig --add libvirtd
1360
/sbin/chkconfig --add virtlogd
1361
/sbin/chkconfig --add virtlockd
1362
%endif
1363

1364
%preun daemon
1365 1366 1367 1368
%if %{with_systemd}
    %if %{with_systemd_macros}
        %systemd_preun libvirtd.service virtlogd.socket virtlogd.service virtlockd.socket virtlockd.service
    %else
1369 1370
if [ $1 -eq 0 ] ; then
    # Package removal, not upgrade
1371 1372
    /bin/systemctl --no-reload disable \
        libvirtd.service \
1373 1374
        virtlogd.socket \
        virtlogd.service \
1375 1376 1377 1378
        virtlockd.socket \
        virtlockd.service > /dev/null 2>&1 || :
    /bin/systemctl stop \
        libvirtd.service \
1379 1380
        virtlogd.socket \
        virtlogd.service \
1381 1382
        virtlockd.socket \
        virtlockd.service > /dev/null 2>&1 || :
1383
fi
1384 1385
    %endif
%else
1386 1387 1388
if [ $1 = 0 ]; then
    /sbin/service libvirtd stop 1>/dev/null 2>&1
    /sbin/chkconfig --del libvirtd
1389 1390
    /sbin/service virtlogd stop 1>/dev/null 2>&1
    /sbin/chkconfig --del virtlogd
1391 1392
    /sbin/service virtlockd stop 1>/dev/null 2>&1
    /sbin/chkconfig --del virtlockd
1393
fi
1394
%endif
1395

1396
%postun daemon
1397
%if %{with_systemd}
1398 1399
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
1400
    /bin/systemctl reload-or-try-restart virtlockd.service >/dev/null 2>&1 || :
1401
    /bin/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || :
1402 1403
    /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
fi
1404
%else
1405 1406
if [ $1 -ge 1 ]; then
    /sbin/service virtlockd reload > /dev/null 2>&1 || :
1407
    /sbin/service virtlogd reload > /dev/null 2>&1 || :
1408 1409
    /sbin/service libvirtd condrestart > /dev/null 2>&1
fi
1410
%endif
1411

1412 1413
%if %{with_systemd}
%else
1414 1415 1416
%triggerpostun daemon -- libvirt-daemon < 1.2.1
if [ "$1" -ge "1" ]; then
    /sbin/service virtlockd reload > /dev/null 2>&1 || :
1417
    /sbin/service virtlogd reload > /dev/null 2>&1 || :
1418 1419
    /sbin/service libvirtd condrestart > /dev/null 2>&1
fi
1420
%endif
1421

1422 1423 1424 1425 1426 1427
# 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
1428
%if %{with_systemd}
1429 1430 1431 1432
        /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 || :
1433
%else
1434
        /sbin/chkconfig libvirtd 1>/dev/null 2>&1 &&
1435
            /sbin/chkconfig virtlogd on || :
1436
        /sbin/service libvirtd status 1>/dev/null 2>&1 &&
1437
            /sbin/service virtlogd start || :
1438
%endif
1439 1440
fi

1441 1442
%post daemon-config-network
if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; then
1443 1444 1445 1446 1447 1448 1449 1450 1451
    # 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='
'
1452
    routes="${nl}$(ip route show | cut -d' ' -f1)${nl}"
1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470
    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

1471
    UUID=`/usr/bin/uuidgen`
1472 1473
    sed -e "s/${orig_sub}/${sub}/g" \
        -e "s,</name>,</name>\n  <uuid>$UUID</uuid>," \
1474 1475 1476
         < %{_datadir}/libvirt/networks/default.xml \
         > %{_sysconfdir}/libvirt/qemu/networks/default.xml
    ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
1477 1478

    # Make sure libvirt picks up the new network defininiton
1479
%if %{with_systemd}
1480
    /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 ||:
1481
%else
1482
    /sbin/service libvirtd condrestart > /dev/null 2>&1 || :
1483
%endif
1484

1485
fi
1486

1487
%if %{with_systemd}
1488 1489 1490 1491 1492 1493 1494 1495 1496
%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 || :
1497
%endif
1498

1499
%if %{with_qemu}
1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513
%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
1514
%endif
1515

J
Jiri Denemark 已提交
1516 1517
%preun client

1518
%if %{with_systemd}
1519 1520 1521
    %if %{with_systemd_macros}
        %systemd_preun libvirt-guests.service
    %endif
1522
%else
J
Jiri Denemark 已提交
1523 1524 1525 1526
if [ $1 = 0 ]; then
    /sbin/chkconfig --del libvirt-guests
    rm -f /var/lib/libvirt/libvirt-guests
fi
1527
%endif
J
Jiri Denemark 已提交
1528 1529 1530 1531

%post client

/sbin/ldconfig
1532
%if %{with_systemd}
1533 1534 1535
    %if %{with_systemd_macros}
        %systemd_post libvirt-guests.service
    %endif
1536
%else
J
Jiri Denemark 已提交
1537
/sbin/chkconfig --add libvirt-guests
1538
%endif
1539

1540
%postun client
1541

1542
/sbin/ldconfig
1543
%if %{with_systemd}
1544
    %if %{with_systemd_macros}
1545
        %systemd_postun libvirt-guests.service
1546
    %endif
1547 1548 1549 1550 1551 1552
%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 ||:

1553
# Run this because the SysV package being removed won't do them
1554 1555 1556
/sbin/chkconfig --del libvirt-guests >/dev/null 2>&1 || :
%endif

1557
%if %{with_sanlock}
1558 1559 1560 1561 1562
%post lock-sanlock
if getent group sanlock > /dev/null ; then
    chmod 0770 %{_localstatedir}/lib/libvirt/sanlock
    chown root:sanlock %{_localstatedir}/lib/libvirt/sanlock
fi
1563
%endif
1564

1565 1566 1567 1568 1569 1570
%if %{with_lxc}
%pre login-shell
getent group virtlogin >/dev/null || groupadd -r virtlogin
exit 0
%endif

1571
%files
1572

1573
%files docs
1574 1575
%doc AUTHORS ChangeLog.gz NEWS README TODO
%doc libvirt-docs/*
1576 1577 1578 1579 1580 1581 1582

# 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
1583 1584 1585 1586 1587 1588 1589 1590 1591
%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
1592
%doc examples/admin
1593

1594 1595 1596

%files daemon

1597
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
1598

1599
%if %{with_systemd}
1600
%{_unitdir}/libvirtd.service
1601
%{_unitdir}/virt-guest-shutdown.target
1602 1603
%{_unitdir}/virtlogd.service
%{_unitdir}/virtlogd.socket
1604 1605
%{_unitdir}/virtlockd.service
%{_unitdir}/virtlockd.socket
1606
%else
D
Daniel Veillard 已提交
1607
%{_sysconfdir}/rc.d/init.d/libvirtd
1608
%{_sysconfdir}/rc.d/init.d/virtlogd
1609
%{_sysconfdir}/rc.d/init.d/virtlockd
1610
%endif
A
Alan Pevec 已提交
1611
%doc daemon/libvirtd.upstart
1612
%config(noreplace) %{_sysconfdir}/sysconfig/libvirtd
1613
%config(noreplace) %{_sysconfdir}/sysconfig/virtlogd
1614
%config(noreplace) %{_sysconfdir}/sysconfig/virtlockd
1615
%config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
1616
%config(noreplace) %{_sysconfdir}/libvirt/virtlogd.conf
1617
%config(noreplace) %{_sysconfdir}/libvirt/virtlockd.conf
1618
%config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf
1619

1620
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd
1621
%dir %{_datadir}/libvirt/
1622

1623
%ghost %dir %{_localstatedir}/run/libvirt/
1624

1625
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/
1626
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/filesystems/
1627
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/
1628
%dir %attr(0711, root, root) %{_localstatedir}/cache/libvirt/
1629

1630

1631
%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver
1632
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so
1633

1634 1635
%{_datadir}/augeas/lenses/libvirtd.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd.aug
1636 1637
%{_datadir}/augeas/lenses/virtlogd.aug
%{_datadir}/augeas/lenses/tests/test_virtlogd.aug
1638 1639
%{_datadir}/augeas/lenses/virtlockd.aug
%{_datadir}/augeas/lenses/tests/test_virtlockd.aug
1640
%{_datadir}/augeas/lenses/libvirt_lockd.aug
1641
%if %{with_qemu}
1642
%{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug
1643
%endif
1644

1645
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
1646
%{_datadir}/polkit-1/actions/org.libvirt.api.policy
1647
%{_datadir}/polkit-1/rules.d/50-libvirt.rules
1648

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

1651
%attr(0755, root, root) %{_libexecdir}/libvirt_iohelper
1652

1653
%attr(0755, root, root) %{_sbindir}/libvirtd
1654
%attr(0755, root, root) %{_sbindir}/virtlogd
1655
%attr(0755, root, root) %{_sbindir}/virtlockd
1656

1657
%{_mandir}/man8/libvirtd.8*
1658
%{_mandir}/man8/virtlogd.8*
1659
%{_mandir}/man8/virtlockd.8*
1660

1661 1662
%doc examples/polkit/*.rules

1663
%files daemon-config-network
1664 1665
%dir %{_datadir}/libvirt/networks/
%{_datadir}/libvirt/networks/default.xml
1666

1667 1668
%files daemon-config-nwfilter
%{_sysconfdir}/libvirt/nwfilter/*.xml
1669

1670 1671 1672 1673
%files daemon-driver-interface
%{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so

%files daemon-driver-network
1674 1675 1676 1677 1678 1679
%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/
1680
%attr(0755, root, root) %{_libexecdir}/libvirt_leaseshelper
1681 1682 1683 1684 1685 1686
%{_libdir}/%{name}/connection-driver/libvirt_driver_network.so

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

%files daemon-driver-nwfilter
1687 1688
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
%ghost %dir %{_localstatedir}/run/libvirt/network/
1689 1690 1691 1692 1693 1694
%{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so

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

%files daemon-driver-storage
1695
%attr(0755, root, root) %{_libexecdir}/libvirt_parthelper
1696
%{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so
1697

1698
%if %{with_qemu}
1699
%files daemon-driver-qemu
1700
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
1701 1702 1703 1704 1705
%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/
1706
%dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
1707 1708 1709
%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
1710
%{_libdir}/%{name}/connection-driver/libvirt_driver_qemu.so
1711
%endif
1712

1713
%if %{with_lxc}
1714
%files daemon-driver-lxc
1715 1716 1717 1718 1719 1720 1721 1722
%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
1723
%{_libdir}/%{name}/connection-driver/libvirt_driver_lxc.so
1724
%endif
1725

1726
%if %{with_uml}
1727
%files daemon-driver-uml
1728 1729 1730 1731
%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/
1732
%{_libdir}/%{name}/connection-driver/libvirt_driver_uml.so
1733
%endif
1734

1735
%if %{with_xen}
1736
%files daemon-driver-xen
1737
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/xen/
1738
%{_libdir}/%{name}/connection-driver/libvirt_driver_xen.so
1739
%endif
1740

1741
%if %{with_libxl}
1742
%files daemon-driver-libxl
1743
%config(noreplace) %{_sysconfdir}/libvirt/libxl.conf
J
Jim Fehlig 已提交
1744
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.libxl
1745
%config(noreplace) %{_sysconfdir}/libvirt/libxl-lockd.conf
1746 1747
%{_datadir}/augeas/lenses/libvirtd_libxl.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
1748 1749 1750
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/
%ghost %dir %{_localstatedir}/run/libvirt/libxl/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/
1751
%{_libdir}/%{name}/connection-driver/libvirt_driver_libxl.so
1752
%endif
1753

1754
%if %{with_vbox}
1755 1756
%files daemon-driver-vbox
%{_libdir}/%{name}/connection-driver/libvirt_driver_vbox.so
1757
%endif
1758

1759
%if %{with_qemu_tcg}
1760
%files daemon-qemu
1761
%endif
1762

1763
%if %{with_qemu_kvm}
1764
%files daemon-kvm
1765
%endif
1766

1767
%if %{with_lxc}
1768
%files daemon-lxc
1769
%endif
1770

1771
%if %{with_uml}
1772
%files daemon-uml
1773
%endif
1774

1775
%if %{with_xen} || %{with_libxl}
1776
%files daemon-xen
1777
%endif
1778

1779
%if %{with_vbox}
1780
%files daemon-vbox
1781
%endif
1782

1783 1784
%if %{with_sanlock}
%files lock-sanlock
1785
    %if %{with_qemu}
1786
%config(noreplace) %{_sysconfdir}/libvirt/qemu-sanlock.conf
1787
    %endif
1788 1789 1790
    %if %{with_libxl}
%config(noreplace) %{_sysconfdir}/libvirt/libxl-sanlock.conf
    %endif
1791
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/sanlock.so
1792 1793
%{_datadir}/augeas/lenses/libvirt_sanlock.aug
%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
1794
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/sanlock
1795 1796
%{_sbindir}/virt-sanlock-cleanup
%{_mandir}/man8/virt-sanlock-cleanup.8*
1797
%attr(0755, root, root) %{_libexecdir}/libvirt_sanlock_helper
1798 1799
%endif

M
Michal Privoznik 已提交
1800
%files client
1801 1802
%{_mandir}/man1/virsh.1*
%{_mandir}/man1/virt-xml-validate.1*
1803
%{_mandir}/man1/virt-pki-validate.1*
1804
%{_mandir}/man1/virt-host-validate.1*
1805 1806
%{_bindir}/virsh
%{_bindir}/virt-xml-validate
1807
%{_bindir}/virt-pki-validate
1808
%{_bindir}/virt-host-validate
1809

1810 1811
%{_datadir}/systemtap/tapset/libvirt_probes*.stp
%{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp
1812 1813
%{_datadir}/systemtap/tapset/libvirt_functions.stp

M
Michal Privoznik 已提交
1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830

%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.*
1831 1832
%dir %{_datadir}/libvirt/
%dir %{_datadir}/libvirt/schemas/
M
Michal Privoznik 已提交
1833
%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/
1834

1835 1836
%{_datadir}/libvirt/schemas/basictypes.rng
%{_datadir}/libvirt/schemas/capability.rng
J
Jiri Denemark 已提交
1837
%{_datadir}/libvirt/schemas/cputypes.rng
1838
%{_datadir}/libvirt/schemas/domain.rng
M
Michal Privoznik 已提交
1839
%{_datadir}/libvirt/schemas/domaincaps.rng
1840
%{_datadir}/libvirt/schemas/domaincommon.rng
1841
%{_datadir}/libvirt/schemas/domainsnapshot.rng
1842
%{_datadir}/libvirt/schemas/interface.rng
1843
%{_datadir}/libvirt/schemas/network.rng
1844
%{_datadir}/libvirt/schemas/networkcommon.rng
1845
%{_datadir}/libvirt/schemas/nodedev.rng
1846
%{_datadir}/libvirt/schemas/nwfilter.rng
M
Miloslav Trmač 已提交
1847
%{_datadir}/libvirt/schemas/secret.rng
1848
%{_datadir}/libvirt/schemas/storagecommon.rng
1849 1850
%{_datadir}/libvirt/schemas/storagepool.rng
%{_datadir}/libvirt/schemas/storagevol.rng
1851

J
Jiri Denemark 已提交
1852 1853
%{_datadir}/libvirt/cpu_map.xml

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

1856 1857
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf

1858 1859 1860 1861 1862
%files admin
%{_mandir}/man1/virt-admin.1*
%{_bindir}/virt-admin


1863 1864
%if %{with_wireshark}
%files wireshark
1865
%{_libdir}/wireshark/plugins/libvirt.so
1866 1867
%endif

1868 1869
%files nss
%{_libdir}/libnss_libvirt.so.2
1870
%{_libdir}/libnss_libvirt_guest.so.2
1871

1872 1873
%if %{with_lxc}
%files login-shell
1874
%attr(4750, root, virtlogin) %{_bindir}/virt-login-shell
1875 1876 1877 1878
%config(noreplace) %{_sysconfdir}/libvirt/virt-login-shell.conf
%{_mandir}/man1/virt-login-shell.1*
%endif

1879
%files devel
1880
%{_libdir}/libvirt.so
1881
%{_libdir}/libvirt-admin.so
1882 1883
%{_libdir}/libvirt-qemu.so
%{_libdir}/libvirt-lxc.so
1884
%dir %{_includedir}/libvirt
1885 1886
%{_includedir}/libvirt/virterror.h
%{_includedir}/libvirt/libvirt.h
1887
%{_includedir}/libvirt/libvirt-admin.h
1888
%{_includedir}/libvirt/libvirt-common.h
1889
%{_includedir}/libvirt/libvirt-domain.h
1890
%{_includedir}/libvirt/libvirt-domain-snapshot.h
1891
%{_includedir}/libvirt/libvirt-event.h
1892
%{_includedir}/libvirt/libvirt-host.h
1893
%{_includedir}/libvirt/libvirt-interface.h
1894
%{_includedir}/libvirt/libvirt-network.h
1895
%{_includedir}/libvirt/libvirt-nodedev.h
1896
%{_includedir}/libvirt/libvirt-nwfilter.h
1897
%{_includedir}/libvirt/libvirt-secret.h
1898
%{_includedir}/libvirt/libvirt-storage.h
1899
%{_includedir}/libvirt/libvirt-stream.h
1900 1901
%{_includedir}/libvirt/libvirt-qemu.h
%{_includedir}/libvirt/libvirt-lxc.h
1902
%{_libdir}/pkgconfig/libvirt.pc
1903
%{_libdir}/pkgconfig/libvirt-admin.pc
1904 1905
%{_libdir}/pkgconfig/libvirt-qemu.pc
%{_libdir}/pkgconfig/libvirt-lxc.pc
1906

1907 1908
%dir %{_datadir}/libvirt/api/
%{_datadir}/libvirt/api/libvirt-api.xml
1909
%{_datadir}/libvirt/api/libvirt-admin-api.xml
1910
%{_datadir}/libvirt/api/libvirt-qemu-api.xml
1911
%{_datadir}/libvirt/api/libvirt-lxc-api.xml
1912
# Needed building python bindings
1913
%doc docs/libvirt-api.xml
1914

1915

1916
%changelog