File libvirt.spec of Package libvirt (Revision 14)
Currently displaying revision 14, show latest
x
1
#
2
# spec file for package libvirt
3
#
4
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via http://bugs.opensuse.org/
16
#
17
18
# norootforbuild
19
20
# For now, default to a full server + client build
21
%define client_only 0
22
23
# Disable all server side drivers if client only build requested
24
%if %{client_only}
25
%define server_drivers 0
26
%else
27
%define server_drivers 1
28
%endif
29
30
# Now set the defaults for all the important features, independent
31
# of any particular OS
32
33
# First the daemon itself
34
%define with_libvirtd 0%{!?_without_libvirtd:%{server_drivers}}
35
%define with_avahi 0%{!?_without_avahi:%{server_drivers}}
36
37
# Then the hypervisor drivers that run on local host
38
%define with_xen 0%{!?_without_xen:%{server_drivers}}
39
%define with_qemu 0%{!?_without_qemu:%{server_drivers}}
40
%define with_openvz 0%{!?_without_openvz:%{server_drivers}}
41
%define with_lxc 0%{!?_without_lxc:%{server_drivers}}
42
%define with_vbox 0%{!?_without_vbox:%{server_drivers}}
43
%define with_uml 0%{!?_without_uml:%{server_drivers}}
44
%define with_xenapi 0%{!?_without_xenapi:%{server_drivers}}
45
%define with_libxl 0%{!?_without_libxl:%{server_drivers}}
46
47
# Then the hypervisor drivers that talk a native remote protocol
48
%define with_phyp 0%{!?_without_phyp:1}
49
%define with_esx 0%{!?_without_esx:1}
50
%define with_vmware 0%{!?_without_vmware:1}
51
%define with_hyperv 0%{!?_without_hyperv:1}
52
53
# Then the secondary host drivers
54
%define with_network 0%{!?_without_network:%{server_drivers}}
55
%define with_storage_fs 0%{!?_without_storage_fs:%{server_drivers}}
56
%define with_storage_lvm 0%{!?_without_storage_lvm:%{server_drivers}}
57
%define with_storage_iscsi 0%{!?_without_storage_iscsi:%{server_drivers}}
58
%define with_storage_disk 0%{!?_without_storage_disk:%{server_drivers}}
59
%define with_storage_mpath 0%{!?_without_storage_mpath:%{server_drivers}}
60
%define with_numactl 0%{!?_without_numactl:%{server_drivers}}
61
%define with_selinux 0%{!?_without_selinux:%{server_drivers}}
62
%define with_apparmor 0%{!?_without_apparmor:0}
63
64
# A few optional bits off by default, we enable later
65
%define with_polkit 0%{!?_without_polkit:0}
66
%define with_capng 0%{!?_without_capng:0}
67
%define with_netcf 0%{!?_without_netcf:0}
68
%define with_udev 0%{!?_without_udev:0}
69
%define with_hal 0%{!?_without_hal:0}
70
%define with_yajl 0%{!?_without_yajl:0}
71
%define with_nwfilter 0%{!?_without_nwfilter:0}
72
%define with_libpcap 0%{!?_without_libpcap:0}
73
%define with_macvtap 0%{!?_without_macvtap:0}
74
%define with_libnl 0%{!?_without_libnl:0}
75
%define with_audit 0%{!?_without_audit:0}
76
%define with_dtrace 0%{!?_without_dtrace:0}
77
%define with_cgconfig 0%{!?_without_cgconfig:0}
78
79
# Non-server/HV driver defaults which are always enabled
80
%define with_python 0%{!?_without_python:1}
81
%define with_sasl 0%{!?_without_sasl:1}
82
83
# Set the OS / architecture specific special cases
84
85
# Xen is available only on i386 x86_64
86
%ifnarch %ix86 x86_64
87
%define with_xen 0
88
%define with_libxl 0
89
%endif
90
91
# libxenlight driver requires Xen >= 4.1, which is only
92
# available in openSUSE >= 12.1 or SLE >= 11sp2
93
%if 0%{?suse_version} < 1210
94
%define with_libxl 0
95
%endif
96
97
# numactl only on x86_64 and ia64
98
%ifnarch x86_64 ia64
99
%define with_numactl 0
100
%endif
101
102
# SLES doesn't contain OpenVZ, VBox, UML, ESX, VMWare, or Citrix XenAPI
103
%if 0%{?sles_version}
104
%define with_openvz 0
105
%define with_vbox 0
106
%define with_uml 0
107
%define with_esx 1
108
%define with_vmware 1
109
%define with_hyperv 1
110
%define with_xenapi 1
111
%endif
112
113
# Enable phyp driver for IBM Power systems
114
%ifarch ppc64
115
%define with_phyp 1
116
%endif
117
118
# LXC and selinux are not available on anything < openSUSE 11.1
119
%if 0%{?suse_version} < 1110
120
%define with_lxc 0
121
%define with_selinux 0
122
%endif
123
124
# udev is used to manage host devices in 11.1 or newer
125
%if 0%{?suse_version} > 1110
126
%define with_udev 0%{!?_without_udev:%{server_drivers}}
127
%else
128
%define with_hal 0%{!?_without_hal:%{server_drivers}}
129
%endif
130
131
# libcapng is used to manage capabilities in 11.3 or newer.
132
# It is also used by lxc and needs to be enabled if lxc is enabled.
133
%if 0%{?suse_version} >= 1130 || %{with_lxc}
134
%define with_capng 0%{!?_without_capng:1}
135
%endif
136
137
# netcf is used to manage network interfaces in 11.4 or newer
138
%if 0%{?suse_version} >= 1140
139
%define with_netcf 0%{!?_without_netcf:%{server_drivers}}
140
%endif
141
142
# Enable yajl library for JSON mode with QEMU in 11.4 or newer
143
%if 0%{?suse_version} >= 1140
144
%define with_yajl 0%{!?_without_yajl:%{server_drivers}}
145
%endif
146
147
# Enable libpcap library
148
%if %{with_qemu}
149
%if 0%{?suse_version} >= 1140
150
%define with_nwfilter 0%{!?_without_nwfilter:%{server_drivers}}
151
%define with_libpcap 0%{!?_without_libpcap:%{server_drivers}}
152
%define with_macvtap 0%{!?_without_macvtap:%{server_drivers}}
153
%endif
154
%endif
155
156
%if %{with_macvtap}
157
%define with_libnl 1
158
%endif
159
160
# there's no use compiling the network driver without
161
# the libvirt daemon
162
%if ! %{with_libvirtd}
163
%define with_network 0
164
%endif
165
166
BuildRequires: python-devel
167
BuildRequires: libxml2-devel
168
BuildRequires: xhtml-dtd
169
BuildRequires: libxslt
170
BuildRequires: readline-devel
171
BuildRequires: ncurses-devel
172
BuildRequires: gettext
173
BuildRequires: gnutls-devel
174
BuildRequires: bridge-utils
175
BuildRequires: fdupes
176
BuildRequires: pkg-config
177
BuildRequires: python-xml
178
# Only for directory ownership:
179
BuildRequires: gtk-doc
180
%if %{with_xen} || %{with_libxl}
181
BuildRequires: xen-devel
182
%endif
183
%if %{with_sasl}
184
BuildRequires: cyrus-sasl-devel
185
%endif
186
%if %{with_hal}
187
BuildRequires: hal-devel
188
%endif
189
%if %{with_udev}
190
BuildRequires: libudev-devel >= 145
191
BuildRequires: libpciaccess0-devel >= 0.10.9
192
%endif
193
%if %{with_avahi}
194
%if 0%{?suse_version} > 1030
195
BuildRequires: libavahi-devel
196
%else
197
BuildRequires: avahi-devel
198
%endif
199
%endif
200
%if %{with_selinux}
201
BuildRequires: libselinux-devel
202
%endif
203
%if %{with_apparmor}
204
BuildRequires: libapparmor-devel
205
%endif
206
%if %{with_numactl}
207
BuildRequires: libnuma-devel
208
%endif
209
%if %{with_polkit}
210
%if 0%{?suse_version} > 1110
211
BuildRequires: polkit >= 0.9
212
%else
213
BuildRequires: PolicyKit-devel >= 0.6
214
%endif
215
%endif
216
%if %{with_phyp}
217
BuildRequires: libssh2-devel
218
%endif
219
%if %{with_yajl}
220
BuildRequires: libyajl-devel
221
%endif
222
%if %{with_macvtap}
223
BuildRequires: libnl-devel
224
%endif
225
%if %{with_esx}
226
BuildRequires: libcurl-devel
227
%endif
228
%if %{with_hyperv}
229
BuildRequires: libwsman-devel
230
%endif
231
%if %{with_capng}
232
BuildRequires: libcap-ng-devel >= 0.5.0
233
%endif
234
%if %{with_netcf}
235
BuildRequires: netcf-devel >= 0.1.4
236
%endif
237
%if %{with_network}
238
BuildRequires: dnsmasq >= 2.41
239
BuildRequires: iptables-devel
240
BuildRequires: radvd
241
%endif
242
%if %{with_nwfilter}
243
BuildRequires: ebtables
244
%endif
245
%if %{with_libpcap}
246
BuildRequires: libpcap-devel
247
%endif
248
%if %{with_libnl}
249
BuildRequires: libnl-devel
250
%endif
251
%if %{with_storage_fs}
252
# For mount/umount in FS driver
253
BuildRequires: util-linux
254
%endif
255
%if %{with_storage_lvm}
256
# For LVM drivers
257
BuildRequires: lvm2
258
%endif
259
%if %{with_storage_iscsi}
260
# For ISCSI driver
261
BuildRequires: open-iscsi
262
%endif
263
%if %{with_storage_disk}
264
# For disk driver
265
BuildRequires: parted-devel
266
%endif
267
%if %{with_storage_mpath}
268
# For Multipath support
269
BuildRequires: device-mapper-devel
270
%endif
271
272
Name: libvirt
273
Url: http://libvirt.org/
274
License: LGPLv2.1+
275
Group: Development/Libraries/C and C++
276
AutoReqProv: yes
277
Version: 0.9.10
278
Release: 1
279
Summary: A C toolkit to interract with the virtualization capabilities of Linux
280
281
# The client side, i.e. shared libs and virsh are in a subpackage
282
Requires: %{name}-client = %{version}-%{release}
283
Requires: virt-utils
284
# Used by many of the drivers, so turn it on whenever the
285
# daemon is present
286
%if %{with_libvirtd}
287
Recommends: bridge-utils
288
# for modprobe of pci devices
289
Requires: module-init-tools
290
# for /sbin/ip
291
Requires: iproute
292
%endif
293
%if %{with_network}
294
Recommends: dnsmasq >= 2.41
295
Recommends: radvd
296
%endif
297
%if %{with_network} || %{with_nwfilter}
298
Recommends: iptables
299
%endif
300
%if %{with_nwfilter}
301
Recommends: ebtables
302
%endif
303
Recommends: logrotate
304
Recommends: nfs-client
305
%if %{with_hal}
306
Requires: hal
307
%endif
308
Requires: /usr/sbin/dmidecode
309
%if %{with_udev}
310
Requires: udev >= 145
311
%endif
312
%if %{with_polkit}
313
%if 0%{?suse_version} > 1110
314
Recommends: polkit >= 0.9
315
%else
316
Recommends: PolicyKit >= 0.6
317
%endif
318
%endif
319
%if %{with_storage_fs}
320
Recommends: nfs-utils
321
%endif
322
%if %{with_storage_lvm}
323
# For LVM drivers
324
Recommends: lvm2
325
%endif
326
%if %{with_storage_iscsi}
327
# For ISCSI driver
328
Recommends: open-iscsi
329
%endif
330
%if %{with_storage_disk}
331
# For disk driver
332
Recommends: parted
333
Recommends: device-mapper
334
%endif
335
%if %{with_storage_mpath}
336
# For multipath support
337
Recommends: device-mapper
338
%endif
339
340
Source0: %{name}-%{version}.tar.bz2
341
Source1: libvirtd.init
342
# Upstream patches
343
# Need to go upstream
344
Patch100: xen-name-for-devid.patch
345
Patch101: clone-0.9.10.patch
346
Patch102: xen-pv-cdrom.patch
347
# Our patches
348
Patch200: libvirtd-defaults-0.9.4.patch
349
Patch201: use-init-script-redhat-0.9.10.patch
350
BuildRoot: %{_tmppath}/%{name}-%{version}-build
351
352
%description
353
Libvirt is a C toolkit to interact with the virtualization
354
capabilities of Linux. Virtualization of the Linux Operating System means
355
the ability to run multiple instances of Operating Systems concurrently
356
on a single hardware system where the basic resources are driven by a
357
Linux instance. The library aims to provide long term stable C API
358
to interact with Linux virtualization technologies.
359
360
361
362
Authors:
363
--------
364
Daniel Veillard <veillard@redhat.com>
365
Karel Zak <kzak@redhat.com>
366
367
%package client
368
License: LGPLv2.1+
369
Summary: Client side library and utilities of the libvirt library
370
Group: Development/Libraries/C and C++
371
Requires: readline
372
Requires: ncurses
373
# Needed by libvirt-guests init script.
374
Requires: gettext
375
Requires: cyrus-sasl
376
Recommends: cyrus-sasl-digestmd5
377
# So remote clients can access libvirt over SSH tunnel
378
# (client invokes 'nc' against the UNIX socket on the server)
379
Recommends: netcat-openbsd
380
381
%description client
382
Libvirt is a C toolkit to interract with the virtualization
383
capabilities of Linux. The libvirt-client package contains shared
384
libraries and client binaries needed to access the virtualization
385
capabilities of recent versions of Linux (and other OSes).
386
387
388
389
Authors:
390
--------
391
Daniel Veillard <veillard@redhat.com>
392
Karel Zak <kzak@redhat.com>
393
394
%package devel
395
License: LGPLv2.1+
396
Summary: A C toolkit to interract with the virtualization capabilities of Linux
397
Group: Development/Libraries/C and C++
398
Requires: %{name}-client = %{version}-%{release} libxml2-devel
399
Requires: pkg-config
400
%if %{with_xen} || %{with_libxl}
401
Requires: xen-devel
402
%endif
403
404
%description devel
405
Libvirt is a C toolkit to interract with the virtualization
406
capabilities of Linux. The libvirt-devel package contains headers
407
and libraries needed for developing libvirt applications.
408
409
410
411
Authors:
412
--------
413
Daniel Veillard <veillard@redhat.com>
414
Karel Zak <kzak@redhat.com>
415
416
%package doc
417
License: LGPLv2.1+
418
Summary: A C toolkit to interract with the virtualization capabilities of Linux
419
Group: Development/Libraries/C and C++
420
Requires: %{name}-client = %{version}-%{release}
421
422
%description doc
423
Libvirt is a C toolkit to interract with the virtualization
424
capabilities of Linux. The libvirt-doc packages contains documentation
425
for the libvirt API and tools.
426
427
428
429
Authors:
430
--------
431
Daniel Veillard <veillard@redhat.com>
432
Karel Zak <kzak@redhat.com>
433
434
%if %{with_python}
435
436
%package python
437
License: LGPLv2.1+
438
Summary: A C toolkit to interract with the virtualization capabilities of Linux
439
Group: Development/Libraries/C and C++
440
Requires: %{name}-client = %{version}-%{release}
441
%py_requires
442
443
%description python
444
Libvirt is a C toolkit to interract with the virtualization
445
capabilities of Linux. The libvirt-python package provides python
446
bindings for the libvirt C API.
447
448
449
450
Authors:
451
--------
452
Daniel Veillard <veillard@redhat.com>
453
Karel Zak <kzak@redhat.com>
454
%endif
455
456
%prep
457
%setup -q
458
%patch100 -p1
459
%patch101
460
%patch102 -p1
461
%patch200 -p1
462
%patch201 -p1
463
464
%build
465
%if ! %{with_xen}
466
%define _without_xen --without-xen
467
%endif
468
%if ! %{with_qemu}
469
%define _without_qemu --without-qemu
470
%endif
471
%if ! %{with_openvz}
472
%define _without_openvz --without-openvz
473
%endif
474
%if ! %{with_lxc}
475
%define _without_lxc --without-lxc
476
%endif
477
%if ! %{with_vbox}
478
%define _without_vbox --without-vbox
479
%endif
480
%if ! %{with_xenapi}
481
%define _without_xenapi --without-xenapi
482
%endif
483
%if ! %{with_uml}
484
%define _without_uml --without-uml
485
%endif
486
%if ! %{with_phyp}
487
%define _without_phyp --without-phyp
488
%endif
489
%if ! %{with_esx}
490
%define _without_esx --without-esx
491
%endif
492
%if ! %{with_vmware}
493
%define _without_vmware --without-vmware
494
%endif
495
%if ! %{with_hyperv}
496
%define _without_hyperv --without-hyperv
497
%endif
498
%if ! %{with_libxl}
499
%define _without_libxl --without-libxl
500
%endif
501
%if ! %{with_libvirtd}
502
%define _without_libvirtd --without-libvirtd
503
%endif
504
%if ! %{with_storage_fs}
505
%define _without_storage_fs --without-storage-fs
506
%endif
507
%if ! %{with_storage_lvm}
508
%define _without_storage_lvm --without-storage-lvm
509
%endif
510
%if ! %{with_storage_iscsi}
511
%define _without_storage_iscsi --without-storage-iscsi
512
%endif
513
%if ! %{with_storage_disk}
514
%define _without_storage_disk --without-storage-disk
515
%endif
516
%if ! %{with_storage_mpath}
517
%define _without_storage_mpath --without-storage-mpath
518
%endif
519
%if ! %{with_numactl}
520
%define _without_numactl --without-numactl
521
%endif
522
%if ! %{with_selinux}
523
%define _without_selinux --without-selinux
524
%endif
525
%if ! %{with_apparmor}
526
%define _without_apparmor --without-apparmor
527
%endif
528
%if ! %{with_capng}
529
%define _without_capng --without-capng
530
%endif
531
%if ! %{with_netcf}
532
%define _without_netcf --without-netcf
533
%endif
534
%if ! %{with_hal}
535
%define _without_hal --without-hal
536
%endif
537
%if ! %{with_udev}
538
%define _without_udev --without-udev
539
%endif
540
%if ! %{with_yajl}
541
%define _without_yajl --without-yajl
542
%endif
543
%if ! %{with_macvtap}
544
%define _without_macvtap --without-macvtap
545
%endif
546
%if ! %{with_polkit}
547
%define _without_polkit --without-polkit
548
%endif
549
%if ! %{with_network}
550
%define _without_network --without-network
551
%endif
552
%if ! %{with_sasl}
553
%define _without_sasl --without-sasl
554
%endif
555
%if ! %{with_python}
556
%define _without_python --without-python
557
%endif
558
%if ! %{with_libpcap}
559
%define _without_libpcap --without-libpcap
560
%endif
561
562
autoreconf -f -i
563
export CFLAGS="$RPM_OPT_FLAGS"
564
%configure --disable-static --with-pic \
565
%{?_without_xen} \
566
%{?_without_qemu} \
567
%{?_without_openvz} \
568
%{?_without_lxc} \
569
%{?_without_vbox} \
570
%{?_without_xenapi} \
571
%{?_without_uml} \
572
%{?_without_phyp} \
573
%{?_without_esx} \
574
%{?_without_vmware} \
575
%{?_without_hyperv} \
576
%{?_without_libxl} \
577
%{?_without_libvirtd} \
578
%{?_without_storage_fs} \
579
%{?_without_storage_lvm} \
580
%{?_without_storage_iscsi} \
581
%{?_without_storage_disk} \
582
%{?_without_storage_mpath} \
583
%{?_without_numactl} \
584
%{?_without_selinux} \
585
%{?_without_apparmor} \
586
%{?_without_capng} \
587
%{?_without_netcf} \
588
%{?_without_hal} \
589
%{?_without_udev} \
590
%{?_without_yajl} \
591
%{?_without_macvtap} \
592
%{?_without_polkit} \
593
%{?_without_network} \
594
%{?_without_sasl} \
595
%{?_without_python} \
596
%{?_without_libpcap} \
597
--libexecdir=%{_libdir}/%{name} \
598
--with-remote-pid-file=%{_localstatedir}/run/libvirtd.pid \
599
--with-init-script=redhat \
600
ac_cv_path_MODPROBE=/sbin/modprobe \
601
ac_cv_path_UDEVADM=/sbin/udevadm \
602
ac_cv_path_SHOWMOUNT=/usr/sbin/showmount
603
make %{?jobs:-j%jobs} DOCS_DIR=%{_docdir}/%{name}-python EXAMPLE_DIR=%{_docdir}/%{name}-python/examples HTML_DIR=%{_docdir}/%{name}
604
605
%install
606
%makeinstall DOCS_DIR=%{_docdir}/%{name}-python EXAMPLE_DIR=%{_docdir}/%{name}-python/examples HTML_DIR=%{_docdir}/%{name}
607
cp -a AUTHORS ChangeLog COPYING NEWS README TODO $RPM_BUILD_ROOT%{_docdir}/%{name}/
608
cd docs ; cp -a *.html $RPM_BUILD_ROOT%{_docdir}/%{name} ; cp -a *.png $RPM_BUILD_ROOT%{_docdir}/%{name} ; cd ..
609
# remove currently unsupported locale(s)
610
rm -rf $RPM_BUILD_ROOT/usr/share/locale/sr@latin
611
%if 0%{?suse_version} < 1130
612
rm -rf $RPM_BUILD_ROOT/usr/share/locale/vi_VN
613
%endif
614
mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/libvirt
615
rm $RPM_BUILD_ROOT%{_libdir}/*.*a $RPM_BUILD_ROOT%{py_sitedir}/*.*a
616
%find_lang %{name}
617
%if %{with_network}
618
install -d -m 0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/libvirt/dnsmasq/
619
install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/
620
cp $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml \
621
$RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
622
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml
623
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
624
# Strip auto-generated UUID - we need it generated per-install
625
sed -i -e "/<uuid>/d" $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
626
%else
627
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml
628
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
629
%endif
630
%if ! %{with_lxc}
631
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/lxc.conf
632
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_lxc.aug
633
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
634
%endif
635
%if ! %{with_qemu}
636
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf
637
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
638
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu
639
%endif
640
%if ! %{with_uml}
641
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
642
%endif
643
%if ! %{with_python}
644
rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}-python
645
%endif
646
%if ! %{with_libvirtd}
647
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter
648
%endif
649
650
ln_dupes()
651
{
652
target=""
653
fdupes -r "$1" | while read file; do
654
if [ -z "$file" ] || [ -z "$target" ]; then
655
target="$file"
656
continue
657
fi
658
ln -sf "${target#.}" "$file"
659
done
660
}
661
(
662
cd $RPM_BUILD_ROOT
663
ln_dupes .%{_docdir}/%{name}
664
ln_dupes ./usr/share/locale
665
)
666
# init scripts
667
mkdir -p $RPM_BUILD_ROOT/etc/init.d
668
%if %{with_libvirtd}
669
install %SOURCE1 $RPM_BUILD_ROOT%{_sysconfdir}/init.d/libvirtd
670
ln -s /etc/init.d/libvirtd $RPM_BUILD_ROOT%{_sbindir}/rclibvirtd
671
%endif
672
ln -s /etc/init.d/libvirt-guests $RPM_BUILD_ROOT%{_sbindir}/rclibvirt-guests
673
674
%clean
675
rm -rf $RPM_BUILD_ROOT
676
677
%post
678
/sbin/ldconfig
679
%if %{with_libvirtd}
680
%if %{with_network}
681
# Install the default network if one doesn't exist
682
if test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml
683
then
684
UUID=`/usr/bin/uuidgen`
685
sed -e "s,</name>,</name>\n <uuid>$UUID</uuid>," \
686
< %{_datadir}/libvirt/networks/default.xml \
687
> %{_sysconfdir}/libvirt/qemu/networks/default.xml
688
fi
689
%endif
690
%if 0%{?sles_version}
691
%{fillup_and_insserv -y libvirtd}
692
%else
693
%{fillup_only -n libvirtd}
694
%endif
695
%endif
696
%{fillup_only -n libvirt-guests}
697
698
%preun
699
%if %{with_libvirtd}
700
%stop_on_removal libvirtd
701
%endif
702
703
%postun
704
/sbin/ldconfig
705
%if %{with_libvirtd}
706
%restart_on_update libvirtd
707
%endif
708
%insserv_cleanup
709
710
%post client -p /sbin/ldconfig
711
712
%postun client -p /sbin/ldconfig
713
714
%if %{with_libvirtd}
715
716
%files
717
%defattr(-, root, root)
718
%{_sbindir}/libvirtd
719
%dir %{_libdir}/%{name}
720
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
721
%dir %{_sysconfdir}/sysctl.d
722
%config %{_sysconfdir}/sysctl.d/libvirtd
723
%if %{with_network}
724
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
725
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
726
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
727
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
728
%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/
729
%dir %{_datadir}/libvirt/networks/
730
%{_datadir}/libvirt/networks/default.xml
731
%endif
732
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
733
%{_sysconfdir}/libvirt/nwfilter/*.xml
734
%{_localstatedir}/adm/fillup-templates/sysconfig.libvirtd
735
%config /etc/init.d/libvirtd
736
%{_sbindir}/rclibvirtd
737
%config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
738
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd
739
%dir %{_localstatedir}/lib/libvirt/
740
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/
741
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/
742
%dir %attr(0711, root, root) %{_localstatedir}/cache/libvirt/
743
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/
744
%if %{with_polkit}
745
%if 0%{?suse_version} > 1110
746
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
747
%else
748
%{_datadir}/PolicyKit/policy/org.libvirt.unix.policy
749
%endif
750
%endif
751
%{_datadir}/augeas
752
%if %{with_qemu}
753
%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
754
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
755
%dir %attr(0750, root, root) %{_localstatedir}/lib/libvirt/qemu/
756
%dir %attr(0750, root, root) %{_localstatedir}/cache/libvirt/qemu/
757
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
758
%endif
759
%if %{with_lxc}
760
%config(noreplace) %{_sysconfdir}/libvirt/lxc.conf
761
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc
762
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/lxc/
763
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
764
%attr(0755, root, root) %{_libdir}/%{name}/libvirt_lxc
765
%endif
766
%if %{with_uml}
767
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml
768
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/
769
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/
770
%endif
771
%if %{with_libxl}
772
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/
773
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/
774
%endif
775
%if %{with_storage_disk}
776
%attr(0755, root, root) %{_libdir}/%{name}/libvirt_parthelper
777
%endif
778
%attr(0755, root, root) %{_libdir}/%{name}/libvirt_iohelper
779
%doc %{_mandir}/man8/libvirtd.8*
780
%endif
781
782
%files client -f %{name}.lang
783
%defattr(-, root, root)
784
%doc %dir %{_docdir}/%{name}
785
%doc %{_docdir}/%{name}/[CNRT]*
786
%doc %{_docdir}/%{name}/AUTHORS
787
%doc %{_mandir}/man1/virsh.1*
788
%doc %{_mandir}/man1/virt-xml-validate.1*
789
%doc %{_mandir}/man1/virt-pki-validate.1*
790
%doc %{_mandir}/man1/virt-host-validate.1*
791
%{_bindir}/virsh
792
%{_bindir}/virt-xml-validate
793
%{_bindir}/virt-pki-validate
794
%{_bindir}/virt-host-validate
795
%dir %{_libdir}/%{name}
796
%{_libdir}/lib*.so.*
797
%{_localstatedir}/adm/fillup-templates/sysconfig.libvirt-guests
798
%config(noreplace) %{_sysconfdir}/libvirt/libvirt.conf
799
%config /etc/init.d/libvirt-guests
800
%{_sbindir}/rclibvirt-guests
801
802
%dir %{_datadir}/libvirt/
803
%dir %{_datadir}/libvirt/schemas/
804
%{_datadir}/libvirt/schemas/basictypes.rng
805
%{_datadir}/libvirt/schemas/networkcommon.rng
806
%{_datadir}/libvirt/schemas/domain.rng
807
%{_datadir}/libvirt/schemas/network.rng
808
%{_datadir}/libvirt/schemas/storagepool.rng
809
%{_datadir}/libvirt/schemas/storagevol.rng
810
%{_datadir}/libvirt/schemas/nodedev.rng
811
%{_datadir}/libvirt/schemas/capability.rng
812
%{_datadir}/libvirt/schemas/interface.rng
813
%{_datadir}/libvirt/schemas/secret.rng
814
%{_datadir}/libvirt/schemas/storageencryption.rng
815
%{_datadir}/libvirt/cpu_map.xml
816
%{_datadir}/libvirt/schemas/nwfilter.rng
817
%{_datadir}/libvirt/schemas/domainsnapshot.rng
818
%{_datadir}/libvirt/schemas/domaincommon.rng
819
%if %{with_sasl}
820
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
821
%endif
822
823
%files devel
824
%defattr(-, root, root)
825
%{_includedir}/libvirt
826
%{_libdir}/*.so
827
%{_libdir}/pkgconfig/libvirt.pc
828
829
%files doc
830
%defattr(-, root, root)
831
%{_datadir}/gtk-doc/html/libvirt
832
%doc %{_docdir}/%{name}/*.png
833
%doc %{_docdir}/%{name}/*.html
834
%doc %{_docdir}/%{name}/*.gif
835
%doc %{_docdir}/%{name}/*.css
836
%doc %{_docdir}/%{name}/html
837
838
%if %{with_python}
839
840
%files python
841
%defattr(-, root, root)
842
%doc %{_docdir}/%{name}-python
843
%{py_sitedir}/libvirt.py*
844
%{py_sitedir}/libvirtmod*
845
%{py_sitedir}/libvirt_qemu*
846
%endif
847
848
%changelog
849