libvirt.spec.in 54.1 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 39 40
    %if 0%{?rhel} >= 7
        %define qemu_kvm_arches x86_64 %{power64}
    %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_pm_utils      1
84

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

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

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

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

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

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

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

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

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

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

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

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

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

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

175

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

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

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

193

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


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

210 211
%if 0%{?fedora} >= 25
    %define tls_priority "@LIBVIRT,SYSTEM"
212
%else
213
    %if 0%{?fedora}
214 215 216 217
        %define tls_priority "@SYSTEM"
    %else
        %define tls_priority "NORMAL"
    %endif
218 219
%endif

220

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

230
%if %(echo %{version} | grep -o \\. | wc -l) == 3
231
    %define mainturl stable_updates/
232
%endif
233
Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.xz
234

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

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

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

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

395 396 397 398
# For mount/umount in FS driver
BuildRequires: util-linux
# For showmount in FS driver (netfs discovery)
BuildRequires: nfs-utils
399

400
# Communication with the firewall and polkit daemons use DBus
401 402
BuildRequires: dbus-devel

403 404
# Fedora build root suckage
BuildRequires: gawk
405

406 407 408
# For storage wiping with different algorithms
BuildRequires: scrub

409 410 411 412
%if %{with_numad}
BuildRequires: numad
%endif

413
%if %{with_wireshark}
414
    %if 0%{fedora} >= 24
415
BuildRequires: wireshark-devel >= 2.1.0
416
    %else
417
BuildRequires: wireshark-devel >= 1.12.1
418
    %endif
419 420
%endif

421 422
Provides: bundled(gnulib)

423
%description
424
Libvirt is a C toolkit to interact with the virtualization capabilities
425 426 427
of recent versions of Linux (and other OSes). The main package includes
the libvirtd server exporting the virtualization support.

428 429 430 431 432 433 434 435
%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.

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

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

%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}
488
Requires: libvirt-daemon-driver-network = %{version}-%{release}
489 490 491 492 493 494 495 496 497

%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}
498
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
499 500 501

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

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

%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}
524
Requires: iptables
525
%if 0%{?rhel} && 0%{?rhel} < 7
526
Requires: iptables-ipv6
527
%endif
528
Requires: ebtables
529 530 531 532 533 534 535 536 537 538 539

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

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

%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}
581 582 583 584
Requires: nfs-utils
# For mkfs
Requires: util-linux
# For glusterfs
585
%if 0%{?fedora}
586
Requires: glusterfs-client >= 2.0.1
587
%endif
588 589 590 591 592 593 594 595 596
# 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
597
%if %{with_storage_sheepdog}
598 599
# For Sheepdog support
Requires: sheepdog
600 601
%endif
%if %{with_qemu}
602 603
# From QEMU RPMs
Requires: /usr/bin/qemu-img
604 605
%else
    %if %{with_xen}
606 607
# From Xen RPMs
Requires: /usr/sbin/qcow-create
608
    %endif
609
%endif
610 611 612 613 614 615 616

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


617
%if %{with_qemu}
618 619 620 621 622
%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
623
Requires: libvirt-daemon-driver-network = %{version}-%{release}
624
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
625 626 627 628 629 630
Requires: /usr/bin/qemu-img
# For image compression
Requires: gzip
Requires: bzip2
Requires: lzop
Requires: xz
A
Andrea Bolognani 已提交
631
    %if 0%{?fedora} >= 24
632
Requires: systemd-container
A
Andrea Bolognani 已提交
633
    %endif
634 635 636 637 638

%description daemon-driver-qemu
The qemu driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
QEMU
639
%endif
640 641


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

%description daemon-driver-lxc
The LXC driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
the Linux kernel
657
%endif
658 659


660
%if %{with_uml}
661 662 663 664 665 666 667 668 669
%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
670
%endif
671 672


673
%if %{with_xen}
674 675 676 677 678 679 680 681 682
%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
683
%endif
684 685


686
%if %{with_vbox}
687 688 689 690 691 692 693 694 695
%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
696
%endif
697 698


699
%if %{with_libxl}
700 701 702 703 704 705 706 707 708
%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
709
%endif
710 711


712

713
%if %{with_qemu_tcg}
714 715 716 717 718
%package daemon-qemu
Summary: Server side daemon & driver required to run QEMU guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
719 720 721 722
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}
723
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
724 725
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
726 727 728 729 730
Requires: qemu

%description daemon-qemu
Server side daemon and driver required to manage the virtualization
capabilities of the QEMU TCG emulators
731
%endif
732 733


734
%if %{with_qemu_kvm}
735 736 737 738 739
%package daemon-kvm
Summary: Server side daemon & driver required to run KVM guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
740 741 742 743
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}
744
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
745 746
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
747 748 749 750 751
Requires: qemu-kvm

%description daemon-kvm
Server side daemon and driver required to manage the virtualization
capabilities of the KVM hypervisor
752
%endif
753 754


755
%if %{with_lxc}
756 757 758 759 760
%package daemon-lxc
Summary: Server side daemon & driver required to run LXC guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
761 762 763 764
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}
765
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
766 767
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
768 769 770 771

%description daemon-lxc
Server side daemon and driver required to manage the virtualization
capabilities of LXC
772
%endif
773 774


775
%if %{with_uml}
776 777 778 779 780
%package daemon-uml
Summary: Server side daemon & driver required to run UML guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
781 782 783 784
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}
785
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
786 787
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
788 789 790 791 792
# 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
793
%endif
794 795


796
%if %{with_xen} || %{with_libxl}
797 798 799 800 801
%package daemon-xen
Summary: Server side daemon & driver required to run XEN guests
Group: Development/Libraries

Requires: libvirt-daemon = %{version}-%{release}
802
    %if %{with_xen}
803
Requires: libvirt-daemon-driver-xen = %{version}-%{release}
804 805
    %endif
    %if %{with_libxl}
806
Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
807
    %endif
808 809 810
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
Requires: libvirt-daemon-driver-network = %{version}-%{release}
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
811
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
812 813
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
814 815 816 817 818
Requires: xen

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

821
%if %{with_vbox}
822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837
%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
838
%endif
839

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

%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
865 866 867 868 869
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 已提交
870 871
%description libs
Shared libraries for accessing the libvirt daemon.
872

873 874 875 876 877 878 879 880 881
%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.

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

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

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

%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

905
%package devel
906
Summary: Libraries, includes, etc. to compile with the libvirt library
907
Group: Development/Libraries
M
Michal Privoznik 已提交
908
Requires: %{name}-libs = %{version}-%{release}
909
Requires: pkgconfig
910 911

%description devel
912
Include header files & development libraries for the libvirt C library.
913

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

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

929 930 931 932 933 934 935 936
%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 已提交
937

938
%prep
939 940 941 942 943
%if ! %{supported_platform}
echo "This RPM requires either Fedora >= 20 or RHEL >= 6"
exit 1
%endif

944 945
%setup -q

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 975 976 977 978 979
# 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
980
rm -rf .git
981

982
%build
983 984 985 986
%if %{with_xen}
    %define arg_xen --with-xen
%else
    %define arg_xen --without-xen
987 988
%endif

989 990 991 992
%if %{with_qemu}
    %define arg_qemu --with-qemu
%else
    %define arg_qemu --without-qemu
993 994
%endif

995 996 997 998
%if %{with_openvz}
    %define arg_openvz --with-openvz
%else
    %define arg_openvz --without-openvz
999 1000
%endif

1001 1002 1003 1004
%if %{with_lxc}
    %define arg_lxc --with-lxc
%else
    %define arg_lxc --without-lxc
1005 1006
%endif

1007 1008 1009 1010
%if %{with_vbox}
    %define arg_vbox --with-vbox
%else
    %define arg_vbox --without-vbox
M
Mark McLoughlin 已提交
1011 1012
%endif

1013 1014 1015 1016
%if %{with_libxl}
    %define arg_libxl --with-libxl
%else
    %define arg_libxl --without-libxl
J
Jim Fehlig 已提交
1017 1018
%endif

1019 1020 1021 1022
%if %{with_phyp}
    %define arg_phyp --with-phyp
%else
    %define arg_phyp --without-phyp
1023 1024
%endif

1025 1026 1027 1028
%if %{with_esx}
    %define arg_esx --with-esx
%else
    %define arg_esx --without-esx
1029 1030
%endif

1031 1032 1033 1034
%if %{with_hyperv}
    %define arg_hyperv --with-hyperv
%else
    %define arg_hyperv --without-hyperv
1035 1036
%endif

1037 1038 1039 1040
%if %{with_vmware}
    %define arg_vmware --with-vmware
%else
    %define arg_vmware --without-vmware
1041 1042
%endif

1043 1044 1045 1046
%if %{with_uml}
    %define arg_uml --with-uml
%else
    %define arg_uml --without-uml
1047 1048
%endif

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

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

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

1067 1068 1069 1070
%if %{with_numactl}
    %define arg_numactl --with-numactl
%else
    %define arg_numactl --without-numactl
1071 1072
%endif

1073 1074 1075 1076
%if %{with_numad}
    %define arg_numad --with-numad
%else
    %define arg_numad --without-numad
1077 1078
%endif

1079 1080 1081 1082
%if %{with_fuse}
    %define arg_fuse --with-fuse
%else
    %define arg_fuse --without-fuse
1083 1084
%endif

1085 1086 1087 1088
%if %{with_sanlock}
    %define arg_sanlock --with-sanlock
%else
    %define arg_sanlock --without-sanlock
1089 1090
%endif

1091
%if %{with_firewalld}
1092 1093 1094
    %define arg_firewalld --with-firewalld
%else
    %define arg_firewalld --without-firewalld
1095 1096
%endif

1097 1098 1099 1100
%if %{with_wireshark}
    %define arg_wireshark --with-wireshark-dissector
%else
    %define arg_wireshark --without-wireshark-dissector
1101 1102
%endif

1103 1104 1105 1106
%if %{with_pm_utils}
    %define arg_pm_utils --with-pm-utils
%else
    %define arg_pm_utils --without-pm-utils
1107 1108
%endif

1109 1110 1111
%define when  %(date +"%%F-%%T")
%define where %(hostname)
%define who   %{?packager}%{!?packager:Unknown}
1112 1113
%define arg_packager --with-packager="%{who}, %{when}, %{where}"
%define arg_packager_version --with-packager-version="%{release}"
1114

1115
%if %{with_systemd}
1116
    %define arg_init_script --with-init-script=systemd
1117
%else
1118
    %define arg_init_script --with-init-script=redhat
1119
%endif
1120

1121
%if 0%{?fedora} || 0%{?rhel} >= 7
1122
    %define arg_selinux_mount --with-selinux-mount="/sys/fs/selinux"
1123
%else
1124
    %define arg_selinux_mount --with-selinux-mount="/selinux"
1125 1126
%endif

1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138
%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

1139 1140 1141 1142 1143 1144
# place macros above and build commands below this comment

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

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

%install
rm -fr %{buildroot}

1210 1211 1212 1213 1214
# 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}

1215 1216
make -C examples distclean

1217
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
1218
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
1219 1220
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.a
1221 1222
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.a
1223
%if %{with_wireshark}
1224
    %if 0%{fedora} >= 24
1225
rm -f $RPM_BUILD_ROOT%{_libdir}/wireshark/plugins/libvirt.la
1226
    %else
1227 1228 1229
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
1230
    %endif
1231
%endif
1232

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

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

1255 1256 1257
%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
1258
%endif
1259

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

1278 1279
# Copied into libvirt-docs subpackage eventually
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} libvirt-docs
1280

1281
%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
1282 1283 1284 1285 1286 1287
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

1288 1289 1290
%clean
rm -fr %{buildroot}

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

1307 1308 1309 1310 1311 1312 1313 1314
%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

1315
%post daemon
1316

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

1340
/sbin/chkconfig --add libvirtd
1341
/sbin/chkconfig --add virtlogd
1342
/sbin/chkconfig --add virtlockd
1343
%endif
1344

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

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

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

1403 1404 1405 1406 1407 1408
# 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
1409
%if %{with_systemd}
1410 1411 1412 1413
        /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 || :
1414
%else
1415
        /sbin/chkconfig libvirtd 1>/dev/null 2>&1 &&
1416
            /sbin/chkconfig virtlogd on || :
1417
        /sbin/service libvirtd status 1>/dev/null 2>&1 &&
1418
            /sbin/service virtlogd start || :
1419
%endif
1420 1421
fi

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

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

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

1466
fi
1467

1468
%if %{with_systemd}
1469 1470 1471 1472 1473 1474 1475 1476 1477
%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 || :
1478
%endif
1479

1480
%if %{with_qemu}
1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494
%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
1495
%endif
1496

J
Jiri Denemark 已提交
1497 1498
%preun client

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

%post client

/sbin/ldconfig
1513
%if %{with_systemd}
1514 1515 1516
    %if %{with_systemd_macros}
        %systemd_post libvirt-guests.service
    %endif
1517
%else
J
Jiri Denemark 已提交
1518
/sbin/chkconfig --add libvirt-guests
1519
%endif
1520

1521
%postun client
1522

1523
/sbin/ldconfig
1524
%if %{with_systemd}
1525
    %if %{with_systemd_macros}
1526
        %systemd_postun libvirt-guests.service
1527
    %endif
1528 1529 1530 1531 1532 1533
%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 ||:

1534
# Run this because the SysV package being removed won't do them
1535 1536 1537
/sbin/chkconfig --del libvirt-guests >/dev/null 2>&1 || :
%endif

1538
%if %{with_sanlock}
1539 1540 1541 1542 1543
%post lock-sanlock
if getent group sanlock > /dev/null ; then
    chmod 0770 %{_localstatedir}/lib/libvirt/sanlock
    chown root:sanlock %{_localstatedir}/lib/libvirt/sanlock
fi
1544
%endif
1545

1546 1547 1548 1549 1550 1551
%if %{with_lxc}
%pre login-shell
getent group virtlogin >/dev/null || groupadd -r virtlogin
exit 0
%endif

1552
%files
1553

1554
%files docs
1555 1556
%doc AUTHORS ChangeLog.gz NEWS README TODO
%doc libvirt-docs/*
1557 1558 1559 1560 1561 1562 1563

# 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
1564 1565 1566 1567 1568 1569 1570 1571 1572
%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
1573
%doc examples/admin
1574

1575 1576 1577

%files daemon

1578
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
1579

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

1600
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd
1601
%dir %{_datadir}/libvirt/
1602

1603
%ghost %dir %{_localstatedir}/run/libvirt/
1604

1605
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/
1606
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/filesystems/
1607
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/
1608
%dir %attr(0711, root, root) %{_localstatedir}/cache/libvirt/
1609

1610

1611
%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver
1612
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so
1613

1614 1615
%{_datadir}/augeas/lenses/libvirtd.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd.aug
1616 1617
%{_datadir}/augeas/lenses/virtlogd.aug
%{_datadir}/augeas/lenses/tests/test_virtlogd.aug
1618 1619
%{_datadir}/augeas/lenses/virtlockd.aug
%{_datadir}/augeas/lenses/tests/test_virtlockd.aug
1620
%{_datadir}/augeas/lenses/libvirt_lockd.aug
1621
%if %{with_qemu}
1622
%{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug
1623
%endif
1624

1625
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
1626
%{_datadir}/polkit-1/actions/org.libvirt.api.policy
1627
%{_datadir}/polkit-1/rules.d/50-libvirt.rules
1628

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

1631
%attr(0755, root, root) %{_libexecdir}/libvirt_iohelper
1632

1633
%attr(0755, root, root) %{_sbindir}/libvirtd
1634
%attr(0755, root, root) %{_sbindir}/virtlogd
1635
%attr(0755, root, root) %{_sbindir}/virtlockd
1636

1637
%{_mandir}/man8/libvirtd.8*
1638
%{_mandir}/man8/virtlogd.8*
1639
%{_mandir}/man8/virtlockd.8*
1640

1641 1642
%doc examples/polkit/*.rules

1643
%files daemon-config-network
1644 1645
%dir %{_datadir}/libvirt/networks/
%{_datadir}/libvirt/networks/default.xml
1646

1647 1648
%files daemon-config-nwfilter
%{_sysconfdir}/libvirt/nwfilter/*.xml
1649

1650 1651 1652 1653
%files daemon-driver-interface
%{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so

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

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

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

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

%files daemon-driver-storage
1675
%attr(0755, root, root) %{_libexecdir}/libvirt_parthelper
1676
%{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so
1677

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

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

1706
%if %{with_uml}
1707
%files daemon-driver-uml
1708 1709 1710 1711
%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/
1712
%{_libdir}/%{name}/connection-driver/libvirt_driver_uml.so
1713
%endif
1714

1715
%if %{with_xen}
1716
%files daemon-driver-xen
1717
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/xen/
1718
%{_libdir}/%{name}/connection-driver/libvirt_driver_xen.so
1719
%endif
1720

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

1734
%if %{with_vbox}
1735 1736
%files daemon-driver-vbox
%{_libdir}/%{name}/connection-driver/libvirt_driver_vbox.so
1737
%endif
1738

1739
%if %{with_qemu_tcg}
1740
%files daemon-qemu
1741
%endif
1742

1743
%if %{with_qemu_kvm}
1744
%files daemon-kvm
1745
%endif
1746

1747
%if %{with_lxc}
1748
%files daemon-lxc
1749
%endif
1750

1751
%if %{with_uml}
1752
%files daemon-uml
1753
%endif
1754

1755
%if %{with_xen} || %{with_libxl}
1756
%files daemon-xen
1757
%endif
1758

1759
%if %{with_vbox}
1760
%files daemon-vbox
1761
%endif
1762

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

M
Michal Privoznik 已提交
1780
%files client
1781 1782
%{_mandir}/man1/virsh.1*
%{_mandir}/man1/virt-xml-validate.1*
1783
%{_mandir}/man1/virt-pki-validate.1*
1784
%{_mandir}/man1/virt-host-validate.1*
1785 1786
%{_bindir}/virsh
%{_bindir}/virt-xml-validate
1787
%{_bindir}/virt-pki-validate
1788
%{_bindir}/virt-host-validate
1789

1790 1791
%{_datadir}/systemtap/tapset/libvirt_probes*.stp
%{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp
1792 1793
%{_datadir}/systemtap/tapset/libvirt_functions.stp

M
Michal Privoznik 已提交
1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810

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

1815 1816
%{_datadir}/libvirt/schemas/basictypes.rng
%{_datadir}/libvirt/schemas/capability.rng
J
Jiri Denemark 已提交
1817
%{_datadir}/libvirt/schemas/cputypes.rng
1818
%{_datadir}/libvirt/schemas/domain.rng
M
Michal Privoznik 已提交
1819
%{_datadir}/libvirt/schemas/domaincaps.rng
1820
%{_datadir}/libvirt/schemas/domaincommon.rng
1821
%{_datadir}/libvirt/schemas/domainsnapshot.rng
1822
%{_datadir}/libvirt/schemas/interface.rng
1823
%{_datadir}/libvirt/schemas/network.rng
1824
%{_datadir}/libvirt/schemas/networkcommon.rng
1825
%{_datadir}/libvirt/schemas/nodedev.rng
1826
%{_datadir}/libvirt/schemas/nwfilter.rng
M
Miloslav Trmač 已提交
1827
%{_datadir}/libvirt/schemas/secret.rng
1828
%{_datadir}/libvirt/schemas/storagecommon.rng
1829 1830
%{_datadir}/libvirt/schemas/storagepool.rng
%{_datadir}/libvirt/schemas/storagevol.rng
1831

J
Jiri Denemark 已提交
1832
%{_datadir}/libvirt/cpu_map.xml
1833
%{_datadir}/libvirt/libvirtLogo.png
J
Jiri Denemark 已提交
1834

1835 1836
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf

1837 1838 1839 1840 1841
%files admin
%{_mandir}/man1/virt-admin.1*
%{_bindir}/virt-admin


1842 1843
%if %{with_wireshark}
%files wireshark
1844
%{_libdir}/wireshark/plugins/libvirt.so
1845 1846
%endif

1847 1848 1849
%files nss
%{_libdir}/libnss_libvirt.so.2

1850 1851
%if %{with_lxc}
%files login-shell
1852
%attr(4750, root, virtlogin) %{_bindir}/virt-login-shell
1853 1854 1855 1856
%config(noreplace) %{_sysconfdir}/libvirt/virt-login-shell.conf
%{_mandir}/man1/virt-login-shell.1*
%endif

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

1885 1886
%dir %{_datadir}/libvirt/api/
%{_datadir}/libvirt/api/libvirt-api.xml
1887
%{_datadir}/libvirt/api/libvirt-admin-api.xml
1888
%{_datadir}/libvirt/api/libvirt-qemu-api.xml
1889
%{_datadir}/libvirt/api/libvirt-lxc-api.xml
1890
# Needed building python bindings
1891
%doc docs/libvirt-api.xml
1892

1893

1894
%changelog