/[packages]/cauldron/libvirt/current/SPECS/libvirt.spec
ViewVC logotype

Contents of /cauldron/libvirt/current/SPECS/libvirt.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1379414 - (show annotations) (download)
Thu Mar 21 09:01:25 2019 UTC (5 years, 1 month ago) by tv
File size: 15164 byte(s)
- BR xfsprogs-devel for XFS reflink clone support
- Fix use of deprecated RBD features
- Avoid using firewalld if unprivileged
- Don't require ipv6 firewall support at startup (rhbz#1688968)
1 # Please keep this package in sync with FC
2
3 # "fix" underlinking:
4 %define _disable_ld_no_undefined 1
5 %global _debugsource_packages 0
6
7 # Default to skipping autoreconf. Distros can change just this one line
8 # (or provide a command-line override) if they backport any patches that
9 # touch configure.ac or Makefile.am.
10 %{!?enable_autotools:%global enable_autotools 0}
11
12 %define server_drivers 1
13 %define with_libxl 0%{!?_without_libxl:%{server_drivers}}
14 # Xen is available only on i386 x86_64 ia64
15 %ifnarch %{ix86} x86_64 ia64
16 %define with_libxl 0
17 %endif
18
19 %define common_summary interact with virtualization capabilities
20 %define common_description Libvirt is a C toolkit to interact with the virtualization\
21 capabilities of recent versions of Linux.
22
23 %define lib_major 0
24 %define nss_major 2
25
26 %define lib_name %mklibname virt %{lib_major}
27 %define nss_name %mklibname nss_libvirt %{nss_major}
28 %define develname %mklibname -d virt
29 %define staticdevelname %mklibname -d -s virt
30
31 # libxenstore is not versionned properly
32 %global __requires_exclude devel\\(libxenstore.*\\)
33
34 %define enable_werror --disable-werror
35
36 %define wireshark_plugindir %(pkg-config --variable plugindir wireshark)
37
38 Summary: Toolkit to %{common_summary}
39 Name: libvirt
40 Version: 5.1.0
41 Release: %mkrel 2
42 License: LGPLv2+
43 Group: System/Kernel and hardware
44 URL: https://libvirt.org/
45
46 %if %(echo %{version} | grep -o \\. | wc -l) == 3
47 %define mainturl stable_updates/
48 %endif
49 Source: https://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.xz
50 Source1: %{name}-tmpfiles.conf
51
52 Patch1: 0001-storage-split-off-code-for-calling-rbd_list.patch
53 Patch2: 0002-storage-add-support-for-new-rbd_list2-method.patch
54 Patch3: 0003-network-improve-error-report-when-firewall-chain-cre.patch
55 Patch4: 0004-network-split-setup-of-ipv4-and-ipv6-top-level-chain.patch
56 Patch5: 0005-network-avoid-trying-to-create-global-firewall-rules.patch
57
58 Patch10: fix-compiling-with-wireshark3.patch
59
60 # Fedora patches:
61
62 Requires: cyrus-sasl
63 # All build-time requirements. Run-time requirements are
64 # listed against each sub-RPM
65 BuildRequires: autoconf
66 BuildRequires: automake
67 BuildRequires: gettext-devel
68 BuildRequires: libtool
69 BuildRequires: perl
70 BuildRequires: python2
71 BuildRequires: systemd-units
72 BuildRequires: systemd-devel
73 %if %{with_libxl}
74 BuildRequires: xen-devel
75 %endif
76 BuildRequires: libxml2-devel
77 BuildRequires: xsltproc
78 BuildRequires: readline-devel
79 BuildRequires: bash-completion >= 2.0
80 BuildRequires: ncurses-devel
81 BuildRequires: gettext
82 BuildRequires: libtasn1-devel
83 BuildRequires: gnutls-devel
84 BuildRequires: libattr-devel
85 # For pool-build probing for existing pools
86 BuildRequires: libblkid-devel >= 2.17
87 BuildRequires: libxml2-utils
88 BuildRequires: xmlrpc-c-devel
89 # for augparse, optionally used in testing
90 BuildRequires: augeas
91 BuildRequires: systemd-devel >= 185
92 BuildRequires: libpciaccess-devel >= 0.10.9
93 BuildRequires: yajl-devel
94 # make sure libvirt is built with new enough sanlock on
95 # distros that have it; required for on_lockfailure
96 #BuildRequires: sanlock-devel >= 2.4
97 BuildRequires: libpcap-devel
98 # (tmb) build against kernel-devel-latest
99 BuildRequires: kernel-desktop-devel-latest
100 # (tmb) use fixed headers with kvm*.h exported
101 BuildRequires: kernel-userspace-headers >= 4.14.32-1
102
103 BuildRequires: libnl3-devel
104 BuildRequires: libavahi-client-devel
105 BuildRequires: dnsmasq >= 2.41
106 BuildRequires: iptables
107 BuildRequires: iptables-ipv6
108 BuildRequires: parted
109 BuildRequires: radvd
110 BuildRequires: libsasl-devel
111 #BuildRequires: ebtables
112 BuildRequires: module-init-tools
113 # F22 polkit-devel doesn't pull in polkit anymore, which we need for pkcheck
114 BuildRequires: polkit >= 0.112
115 # For mount/umount in FS driver
116 BuildRequires: util-linux
117 # For managing ACLs
118 BuildRequires: libacl-devel
119 # From QEMU RPMs
120 BuildRequires: qemu-img
121 # For LVM drivers
122 BuildRequires: lvm2
123 # For pool type=iscsi
124 BuildRequires: iscsi-initiator-utils
125 # For pool type=iscsi-direct
126 BuildRequires: libiscsi-devel
127 # For disk driver
128 BuildRequires: parted-devel
129 # Broken RHEL-5 parted RPM is missing a dep
130 BuildRequires: e2fsprogs-devel
131 # For Multipath support
132 BuildRequires: device-mapper
133 BuildRequires: device-mapper-devel
134 # For XFS reflink clone support
135 BuildRequires: xfsprogs-devel
136 # glusterfs was dropped in mga6 as unmaintained
137 #BuildRequires: glusterfs-devel >= 3.4.0
138 # Support any conforming implementation of zfs. On stock Fedora
139 # this is zfs-fuse
140 %ifnarch %{arm} aarch64
141 BuildRequires: zfs-fuse
142 %endif
143 # For QEMU/LXC numa info
144 %ifnarch %{arm}
145 BuildRequires: numa-devel
146 BuildRequires: numactl
147 %endif
148 BuildRequires: libcap-ng-devel >= 0.5.0
149 BuildRequires: fuse-devel >= 2.8.6
150 BuildRequires: libssh2-devel >= 1.3.0
151 BuildRequires: libtirpc-devel
152 BuildRequires: netcf-devel >= 0.2.2
153 BuildRequires: curl-devel
154 # (tv) For hyper-V support, we need openwsman (which needs sblim-sfcc-devel)
155 %if 0
156 BuildRequires: libwsman-devel >= 2.2.3
157 %endif
158 BuildRequires: systemtap
159 # For mount/umount in FS driver
160 BuildRequires: util-linux
161 # For showmount in FS driver (netfs discovery)
162 BuildRequires: nfs-utils
163
164 # Communication with the firewall and polkit daemons use DBus
165 BuildRequires: dbus-devel
166
167 BuildRequires: gawk
168
169 # For storage wiping with different algorithms
170 BuildRequires: scrub
171 %ifnarch %{arm}
172 BuildRequires: numad
173 %endif
174 # for the wireshark plugin
175 BuildRequires: wireshark-devel >= 2.4.0
176 BuildRequires: wireshark
177 BuildRequires: libssh-devel >= 0.7.0
178
179 %description
180 %{common_description}
181
182 Virtualization of the Linux Operating System means the
183 ability to run multiple instances of Operating Systems concurently on
184 a single hardware system where the basic resources are driven by a
185 Linux instance. The library aim at providing long term stable C API
186 initially for the Xen paravirtualization but should be able to
187 integrate other virtualization mechanisms if needed.
188
189 %package docs
190 Summary: API reference and website documentation
191 Group: Documentation
192
193 %description docs
194 Includes the API reference for the libvirt C library, and a complete
195 copy of the libvirt.org website documentation.
196
197 %package -n %{lib_name}
198 Summary: A library to %{common_summary}
199 Group: System/Libraries
200 # For LXC move (mga#14566)
201 Conflicts: %{develname} < %version-%release
202
203 %description -n %{lib_name}
204 %{common_description}
205
206 This package contains the library needed to run programs dynamically
207 linked with %{name}.
208
209 %package -n %{develname}
210 Summary: Development tools for programs using %{name}
211 Group: Development/C
212 Requires: %{lib_name} = %{version}
213 %if %{with_libxl}
214 Requires: xen-devel
215 %endif
216 Provides: %{name}-devel = %{version}-%{release}
217 Obsoletes: %{lib_name}-devel
218 # For LXC move (mga#14566)
219 Conflicts: %{lib_name} < %version-%release
220 # For api/*.xml move:
221 Conflicts: libvirt-utils < 1.3.4-2
222
223 %description -n %{develname}
224 %{common_description}
225
226 This package contains the header files and libraries needed for
227 developing programs using the %{name} library.
228
229 %package -n %{staticdevelname}
230 Summary: Development static libraries for programs using %{name}
231 Group: Development/C
232 Provides: %{name}-static-devel = %{version}-%{release}
233 Obsoletes: %{lib_name}-static-devel
234
235 %description -n %{staticdevelname}
236 %{common_description}
237
238 This package contains the static libraries needed for developing
239 programs using the %{name} library.
240
241 %package -n %{name}-utils
242 Summary: Tools to %{common_summary}
243 Group: System/Kernel and hardware
244 Requires: bridge-utils
245 Requires: %{lib_name} = %{version}
246 Requires: polkit
247 Requires: ebtables
248 Requires: netcf
249 # required by libvirt-guests.service
250 Requires: gettext
251 Requires(post): systemd >= %{systemd_required_version}
252 Requires(post): rpm-helper >= 0.24.8-1
253 Requires(preun): rpm-helper >= 0.24.8-1
254 # fix "Cannot check dnsmasq binary dnsmasq":
255 Recommends: dnsmasq
256 Recommends: netcat-openbsd
257 Conflicts: libvirt0 < 0.7.1-2
258 Conflicts: lib64virt0 < 0.7.1-2
259 Provides: %{name}-client = %{version}-%{release}
260 Requires: qemu-kvm
261 Requires: qemu-img
262 Requires: iptables
263
264 %description -n %{name}-utils
265 %{common_description}
266
267 This package contains tools for the %{name} library.
268
269 %package -n wireshark-%{name}
270 Summary: Wireshark dissector plugin for libvirt RPC transactions
271 Group: Monitoring
272 Requires: wireshark
273
274 %description -n wireshark-%{name}
275 Wireshark dissector plugin for better analysis of libvirt RPC traffic.
276
277 %package -n %nss_name
278 Summary: Libvirt plugin for Name Service Switch
279 # temp cauldron fix before mga7:
280 Obsoletes: %{mklibname virt 2} < %version-%release
281 Provides: %{mklibname virt 2} = %version-%release
282
283 %description -n %nss_name
284 Libvirt plugin for NSS for translating domain names into IP addresses.
285
286 %prep
287 %setup -q
288 %autopatch -p1
289
290 %build
291
292 %if 0%{?mageia}
293 # Nightly edk2.git-ovmf-x64
294 LOADERS="/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd:/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd"
295 # Nightly edk2.git-ovmf-ia32
296 LOADERS="$LOADERS:/usr/share/edk2.git/ovmf-ia32/OVMF_CODE-pure-efi.fd:/usr/share/edk2.git/ovmf-ia32/OVMF_VARS-pure-efi.fd"
297 # Nightly edk2.git-aarch64
298 LOADERS="$LOADERS:/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2.git/aarch64/vars-template-pflash.raw"
299 # Nightly edk2.git-arm
300 LOADERS="$LOADERS:/usr/share/edk2.git/arm/QEMU_EFI-pflash.raw:/usr/share/edk2.git/arm/vars-template-pflash.raw"
301
302 # Fedora edk2-ovmf
303 LOADERS="$LOADERS:/usr/share/edk2/ovmf/OVMF_CODE.fd:/usr/share/edk2/ovmf/OVMF_VARS.fd"
304 # Fedora edk2-ovmf-ia32
305 LOADERS="$LOADERS:/usr/share/edk2/ovmf-ia32/OVMF_CODE.fd:/usr/share/edk2/ovmf-ia32/OVMF_VARS.fd"
306 # Fedora edk2-aarch64
307 LOADERS="$LOADERS:/usr/share/edk2/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2/aarch64/vars-template-pflash.raw"
308 # Fedora edk2-arm
309 LOADERS="$LOADERS:/usr/share/edk2/arm/QEMU_EFI-pflash.raw:/usr/share/edk2/arm/vars-template-pflash.raw"
310 %define arg_loader_nvram --with-loader-nvram="$LOADERS"
311 %endif
312
313 # place macros above and build commands below this comment
314
315 export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
316
317 %if 0%{?enable_autotools}
318 autoreconf -if
319 %endif
320 # fix compiling wireshark plugin:
321 export CFLAGS="`pkg-config --cflags glib-2.0` $CFLAGS"
322 %configure2_5x --disable-static \
323 --localstatedir=%{_var} \
324 --with-numactl \
325 %ifarch %{arm}
326 --without-numactl \
327 --without-numad \
328 %endif
329 --with-udev \
330 --with-yajl \
331 --without-hal \
332 --with-init_script=systemd \
333 --with-openssl \
334 --without-selinux \
335 --without-selinux-mount \
336 --with-test-suite \
337 --with-nss-plugin \
338 %{?arg_loader_nvram} \
339 %{?enable_werror} \
340 --with-wireshark-dissector
341 %make V=1
342 gzip -9 ChangeLog
343
344 %install
345 %make_install SYSTEMD_UNIT_DIR=%{_unitdir}
346
347 rm -f %{buildroot}%{_initrddir}/libvirt-guests
348 find %{buildroot} -name '*.la' -delete
349
350 install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf
351 install -d -m 0755 %{buildroot}%{_var}/lib/%{name}
352 %find_lang %{name}
353
354 # Copied into libvirt-docs subpackage eventually
355 mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} libvirt-docs
356
357
358 %check
359 cd tests
360 # These tests don't current work in a mock build root
361 for i in nodeinfotest seclabeltest
362 do
363 rm -f $i
364 printf 'int main(void) { return 0; }' > $i.c
365 printf '#!/bin/sh\nexit 0\n' > $i
366 chmod +x $i
367 done
368 if ! make check VIR_TEST_DEBUG=1
369 then
370 cat test-suite.log || true
371 #exit 1
372 fi
373
374 %post -n %{name}-utils
375 %_tmpfilescreate %{name}
376 %_post_service libvirtd
377 %_post_service libvirt-guests
378 %_post_service virtlockd
379
380 %preun -n %{name}-utils
381 %_preun_service libvirt-guests
382 %_preun_service libvirtd
383 %_preun_service virtlockd
384
385 %files docs
386 %doc AUTHORS ChangeLog.gz NEWS README README.md
387 %doc libvirt-docs/*
388 #doc docs/*.html docs/html docs/*.gif
389 %doc docs/*.css
390
391 # API docs
392 %dir %{_datadir}/gtk-doc/html/libvirt/
393 %doc %{_datadir}/gtk-doc/html/libvirt/*.devhelp
394 %doc %{_datadir}/gtk-doc/html/libvirt/*.html
395 %doc %{_datadir}/gtk-doc/html/libvirt/*.png
396 %doc %{_datadir}/gtk-doc/html/libvirt/*.css
397 %doc examples/hellolibvirt
398 %doc examples/object-events
399 %doc examples/dominfo
400 %doc examples/domsuspend
401 %doc examples/dommigrate
402 %doc examples/openauth
403 %doc examples/xml
404 %doc examples/rename
405 %doc examples/systemtap
406
407
408 %files -n %{lib_name}
409 %license COPYING COPYING.LESSER
410 %{_libdir}/%{name}.so.%{lib_major}{,.*}
411 %{_libdir}/%{name}-admin.so.%{lib_major}{,.*}
412 %{_libdir}/%{name}-qemu.so.%{lib_major}{,.*}
413 %{_libdir}/%{name}-lxc.so.%{lib_major}{,.*}
414
415 %files -n %nss_name
416 %{_libdir}/libnss_libvirt.so.%{nss_major}{,.*}
417 %{_libdir}/libnss_libvirt_guest.so.%{nss_major}{,.*}
418
419
420 %files -n %{develname}
421 %{_includedir}/%{name}
422 %{_libdir}/%{name}.so
423 %{_libdir}/%{name}-admin.so
424 %{_libdir}/%{name}-qemu.so
425 %{_libdir}/%{name}-lxc.so
426 %{_libdir}/pkgconfig/%{name}.pc
427 %{_libdir}/pkgconfig/%{name}-lxc.pc
428 %{_libdir}/pkgconfig/%{name}-qemu.pc
429 %{_libdir}/pkgconfig/%{name}-admin.pc
430 # Needed building python bindings
431 %dir %{_datadir}/libvirt/api/
432 %{_datadir}/libvirt/api/libvirt-api.xml
433 %{_datadir}/libvirt/api/libvirt-qemu-api.xml
434 %{_datadir}/libvirt/api/libvirt-lxc-api.xml
435 # Needed building python bindings
436 %doc docs/libvirt-api.xml
437
438 %files -n %{name}-utils -f %{name}.lang
439 %doc README NEWS
440 %{_bindir}/*
441 %{_mandir}/man1/*
442 %{_mandir}/man7/*
443 %{_mandir}/man8/*
444 %{_sbindir}/*
445 %{_unitdir}/libvirtd.service
446 %{_unitdir}/virtlogd.service
447 %{_unitdir}/virtlogd.socket
448 %{_unitdir}/virtlogd-admin.socket
449 %{_unitdir}/virt-guest-shutdown.target
450 %{_unitdir}/virtlockd.service
451 %{_unitdir}/virtlockd.socket
452 %{_unitdir}/virtlockd-admin.socket
453 %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
454 %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
455 %{_libexecdir}/libvirt_lxc
456 %{_libexecdir}/libvirt_leaseshelper
457 %{_libexecdir}/libvirt_parthelper
458 %{_libexecdir}/libvirt_iohelper
459 %{_libexecdir}/libvirt-guests.sh
460 %{_var}/lib/libvirt
461 %{_datadir}/polkit-1/actions/org.libvirt.unix.policy
462 %{_datadir}/polkit-1/actions/org.libvirt.api.policy
463 %{_datadir}/polkit-1/rules.d/50-libvirt.rules
464 %{_datadir}/augeas/lenses/*.aug
465 %{_datadir}/augeas/lenses/tests/*.aug
466 %{_datadir}/systemtap/tapset/*.stp
467 %{_datadir}/bash-completion/completions/vsh
468 %{_datadir}/%{name}
469 %exclude %{_datadir}/libvirt/api/
470 %exclude %{_datadir}/libvirt/api/*.xml
471 %config(noreplace) %{_sysconfdir}/libvirt
472 %config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
473 %config(noreplace) %{_sysconfdir}/sysconfig/libvirtd
474 %config(noreplace) %{_sysconfdir}/sysconfig/libvirt-guests
475 %config(noreplace) %{_sysconfdir}/sysconfig/virtlockd
476 %config(noreplace) %{_sysconfdir}/sysconfig/virtlogd
477 %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd*
478 %{_prefix}/lib/sysctl.d/*.conf
479 %{_unitdir}/libvirt-guests.service
480 %{_tmpfilesdir}/%{name}.conf
481 %{_libdir}/libvirt/connection-driver
482 %{_prefix}/lib/firewalld/zones/libvirt.xml
483 %dir %attr(0755, root, root) %{_libdir}/libvirt/
484 %dir %attr(0755, root, root) %{_libdir}/libvirt/connection-driver/
485 %dir %{_libdir}/libvirt/lock-driver
486 %{_libdir}/libvirt/lock-driver/*.so
487 %{_libdir}/libvirt/storage-backend/*.so
488 %{_libdir}/%{name}/storage-file/libvirt_storage_file_fs.so
489 %{_datadir}/bash-completion/completions/
490
491 %files -n wireshark-%{name}
492 %{wireshark_plugindir}/epan/libvirt.so

  ViewVC Help
Powered by ViewVC 1.1.30