1 |
# Enable to make the appliance use virtio_blk |
2 |
# Default is enabled |
3 |
%if %{defined libguestfs_virtio} |
4 |
%global with_virtio %{libguestfs_virtio} |
5 |
%else |
6 |
%global with_virtio 1 |
7 |
%endif |
8 |
|
9 |
# Enable to run tests during check |
10 |
# Default is enabled |
11 |
%if %{defined libguestfs_runtests} |
12 |
%global runtests %{libguestfs_runtests} |
13 |
%else |
14 |
%global runtests 0 |
15 |
%endif |
16 |
|
17 |
Summary: Access and modify virtual machine disk images |
18 |
Name: libguestfs |
19 |
Epoch: 1 |
20 |
Version: 1.27.33 |
21 |
Release: %mkrel 2 |
22 |
License: LGPLv2+ |
23 |
Group: System/Libraries |
24 |
URL: http://libguestfs.org/ |
25 |
Source0: http://libguestfs.org/download/1.27-development/%{name}-%{version}.tar.gz |
26 |
#Patch0: libguestfs-1.23.13-mga-automake-selinux.patch |
27 |
Patch2: libguestfs-1.23.13-mga-lua.patch |
28 |
Patch3: libguestfs-1.27.33-mga-xml.patch |
29 |
|
30 |
BuildRequires: perl |
31 |
BuildRequires: hivex-devel >= 1.2.2 |
32 |
BuildRequires: augeas-devel >= 0.5.0 |
33 |
BuildRequires: augeas >= 0.5.0 |
34 |
BuildRequires: readline-devel |
35 |
BuildRequires: cdrkit-genisoimage |
36 |
BuildRequires: libxml2-devel |
37 |
BuildRequires: qemu >= 0.10 |
38 |
#BuildRequires: createrepo |
39 |
BuildRequires: selinux-devel |
40 |
BuildRequires: pcre-devel |
41 |
BuildRequires: file-devel |
42 |
BuildRequires: libvirt-devel |
43 |
BuildRequires: po4a |
44 |
BuildRequires: ncurses-devel |
45 |
BuildRequires: lvm2 |
46 |
BuildRequires: ntfs-3g |
47 |
BuildRequires: util-linux-ng |
48 |
BuildRequires: makedev |
49 |
BuildRequires: net-tools |
50 |
BuildRequires: file |
51 |
BuildRequires: module-init-tools |
52 |
BuildRequires: procps |
53 |
BuildRequires: strace |
54 |
BuildRequires: iputils |
55 |
BuildRequires: dosfstools |
56 |
BuildRequires: zerofree |
57 |
BuildRequires: lsof |
58 |
BuildRequires: scrub |
59 |
BuildRequires: libselinux |
60 |
BuildRequires: parted |
61 |
BuildRequires: e2fsprogs |
62 |
BuildRequires: btrfs-progs |
63 |
BuildRequires: gfs2-utils |
64 |
BuildRequires: hfsplus-tools |
65 |
BuildRequires: nilfs-utils |
66 |
BuildRequires: reiserfs-utils |
67 |
BuildRequires: jfsutils |
68 |
BuildRequires: xfsprogs |
69 |
BuildRequires: vim-minimal |
70 |
BuildRequires: cryptsetup-luks |
71 |
BuildRequires: grub |
72 |
BuildRequires: ntfsprogs |
73 |
BuildRequires: ocaml |
74 |
BuildRequires: ocaml-findlib-devel |
75 |
BuildRequires: ocaml-xml-light-devel |
76 |
BuildRequires: perl-devel |
77 |
BuildRequires: perl-Test-Simple |
78 |
BuildRequires: perl-Test-Pod |
79 |
BuildRequires: perl-Test-Pod-Coverage |
80 |
BuildRequires: perl-ExtUtils-MakeMaker |
81 |
BuildRequires: perl-String-ShellQuote |
82 |
BuildRequires: perl-XML-Writer |
83 |
BuildRequires: perl-libintl-perl |
84 |
|
85 |
# For virt tools |
86 |
BuildRequires: perl(Pod::Usage) |
87 |
BuildRequires: perl(Getopt::Long) |
88 |
BuildRequires: perl(Sys::Virt) |
89 |
BuildRequires: perl(Locale::TextDomain) |
90 |
BuildRequires: perl(Win::Hivex) |
91 |
BuildRequires: perl(Win::Hivex::Regedit) |
92 |
|
93 |
BuildRequires: python-devel |
94 |
BuildRequires: ruby-devel |
95 |
BuildRequires: ruby-rake |
96 |
BuildRequires: java |
97 |
BuildRequires: jpackage-utils |
98 |
BuildRequires: java-devel |
99 |
BuildRequires: php-devel |
100 |
BuildRequires: php-cli |
101 |
BuildRequires: ghc |
102 |
BuildRequires: pkgconfig(lua) |
103 |
BuildRequires: pkgconfig(bash-completion) |
104 |
BuildRequires: pkgconfig(gobject-introspection-1.0) |
105 |
BuildRequires: pkgconfig(libsystemd-journal) |
106 |
BuildRequires: pkgconfig(fuse) |
107 |
BuildRequires: pkgconfig(yajl) |
108 |
# not required by devel pkg (unlike FC): |
109 |
BuildRequires: yajl |
110 |
BuildRequires: golang |
111 |
BuildRequires: pkgconfig(gtk+-2.0) |
112 |
BuildRequires: pkgconfig(libconfig) |
113 |
|
114 |
|
115 |
# For libguestfs-tools: |
116 |
BuildRequires: qemu-img |
117 |
|
118 |
BuildRequires: supermin >= 5.1 |
119 |
|
120 |
# Runtime requires: |
121 |
Requires: qemu >= 0.12 |
122 |
|
123 |
# For libguestfs-test-tool. |
124 |
Requires: cdrkit-genisoimage |
125 |
|
126 |
Requires: libselinux-utils |
127 |
Requires: nilfs-utils |
128 |
Requires: hivex |
129 |
|
130 |
BuildRequires: gperf |
131 |
BuildRequires: erlang-compiler |
132 |
BuildRequires: erlang-devel |
133 |
BuildRequires: erlang-tools |
134 |
BuildRequires: erlang-erl_interface |
135 |
|
136 |
# Provide our own custom requires for the supermin appliance. |
137 |
Source1: libguestfs-find-requires.sh |
138 |
%global _use_internal_dependency_generator 0 |
139 |
%global __find_provides %{_rpmconfigdir}/find-provides |
140 |
%global __find_requires %{SOURCE1} %{_rpmconfigdir}/find-requires |
141 |
|
142 |
# libguestfs live service |
143 |
Source2: guestfsd.service |
144 |
Source3: 99-guestfsd.rules |
145 |
|
146 |
%description |
147 |
Libguestfs is a library for accessing and modifying guest disk images. |
148 |
Amongst the things this is good for: making batch configuration |
149 |
changes to guests, getting disk used/free statistics (see also: |
150 |
virt-df), migrating between virtualization systems (see also: |
151 |
virt-p2v), performing partial backups, performing partial guest |
152 |
clones, cloning guests and changing registry/UUID/hostname info, and |
153 |
much else besides. |
154 |
|
155 |
Libguestfs uses Linux kernel and qemu code, and can access any type of |
156 |
guest filesystem that Linux and qemu can, including but not limited |
157 |
to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition |
158 |
schemes, qcow, qcow2, vmdk. |
159 |
|
160 |
Libguestfs provides ways to enumerate guest storage (eg. partitions, |
161 |
LVs, what filesystem is in each LV, etc.). It can also run commands |
162 |
in the context of the guest. |
163 |
|
164 |
%package devel |
165 |
Summary: Development tools and libraries for %{name} |
166 |
Group: System/Libraries |
167 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
168 |
Requires: pkgconfig |
169 |
|
170 |
|
171 |
%description devel |
172 |
%{name}-devel contains development tools and libraries |
173 |
for %{name}. |
174 |
|
175 |
|
176 |
%package -n guestfish |
177 |
Summary: Shell for accessing and modifying virtual machine disk images |
178 |
Group: Development/Tools |
179 |
License: GPLv2+ |
180 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
181 |
Requires: perl |
182 |
Requires: hexedit |
183 |
|
184 |
|
185 |
%description -n guestfish |
186 |
Guestfish is the Filesystem Interactive SHell, for accessing and |
187 |
modifying virtual machine disk images from the command line and shell |
188 |
scripts. |
189 |
|
190 |
|
191 |
%package mount |
192 |
Summary: Mount guest filesystems on the host using FUSE and libguestfs |
193 |
Group: Development/Tools |
194 |
License: GPLv2+ |
195 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
196 |
Requires: virt-inspector |
197 |
|
198 |
|
199 |
%description mount |
200 |
The guestmount command lets you mount guest filesystems on the |
201 |
host using FUSE and %{name}. |
202 |
|
203 |
|
204 |
%package tools |
205 |
Summary: System administration tools for virtual machines |
206 |
Group: Development/Tools |
207 |
License: GPLv2+ |
208 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
209 |
Requires: guestfish |
210 |
Requires: perl-Sys-Virt |
211 |
Requires: perl-String-ShellQuote |
212 |
Requires: perl-XML-Writer |
213 |
Requires: hivex >= 1.2.2 |
214 |
Requires: qemu-img |
215 |
|
216 |
# Obsolete and replace earlier packages. |
217 |
Provides: virt-cat = %{epoch}:%{version}-%{release} |
218 |
Obsoletes: virt-cat < %{epoch}:%{version}-%{release} |
219 |
Provides: virt-df = %{epoch}:%{version}-%{release} |
220 |
Obsoletes: virt-df < %{epoch}:%{version}-%{release} |
221 |
Provides: virt-inspector = %{epoch}:%{version}-%{release} |
222 |
Obsoletes: virt-inspector < %{epoch}:%{version}-%{release} |
223 |
|
224 |
# RHBZ#514309 |
225 |
Provides: virt-df2 = %{epoch}:%{version}-%{release} |
226 |
Obsoletes: virt-df2 < %{epoch}:%{version}-%{release} |
227 |
|
228 |
# These were never packages: |
229 |
Provides: virt-edit = %{epoch}:%{version}-%{release} |
230 |
Provides: virt-rescue = %{epoch}:%{version}-%{release} |
231 |
|
232 |
|
233 |
%description tools |
234 |
This package contains miscellaneous system administrator command line |
235 |
tools for virtual machines. |
236 |
|
237 |
Virt-cat is a command line tool to display the contents of a file in a |
238 |
virtual machine. |
239 |
|
240 |
Virt-df is a command line tool to display free space on virtual |
241 |
machine filesystems. Unlike other tools, it doesn’t just display the |
242 |
amount of space allocated to a virtual machine, but can look inside |
243 |
the virtual machine to see how much space is really being used. It is |
244 |
like the df(1) command, but for virtual machines, except that it also |
245 |
works for Windows virtual machines. |
246 |
|
247 |
Virt-edit is a command line tool to edit the contents of a file in a |
248 |
virtual machine. |
249 |
|
250 |
Virt-inspector examines a virtual machine and tries to determine the |
251 |
version of the OS, the kernel version, what drivers are installed, |
252 |
whether the virtual machine is fully virtualized (FV) or |
253 |
para-virtualized (PV), what applications are installed and more. |
254 |
|
255 |
Virt-list-filesystems can be used to list out the filesystems in a |
256 |
virtual machine image (for shell scripts etc). |
257 |
|
258 |
Virt-list-partitions can be used to list out the partitions in a |
259 |
virtual machine image. |
260 |
|
261 |
Virt-ls is a command line tool to list out files in a virtual machine. |
262 |
|
263 |
Virt-make-fs is a command line tool to build a filesystem out of |
264 |
a collection of files or a tarball. |
265 |
|
266 |
Virt-rescue provides a rescue shell for making interactive, |
267 |
unstructured fixes to virtual machines. |
268 |
|
269 |
Virt-resize can resize existing virtual machine disk images. |
270 |
|
271 |
Virt-tar is an archive, backup and upload tool for virtual machines. |
272 |
|
273 |
Virt-win-reg lets you look inside the Windows Registry for |
274 |
Windows virtual machines. |
275 |
|
276 |
# The Name and Summary of this package is deliberately obscure to |
277 |
# discourage end users from installing and running it. Instead they |
278 |
# need to get the P2V ISO which is a Fedora/RHEL Spin. |
279 |
%package pvhelper |
280 |
Summary: pvhelper |
281 |
|
282 |
|
283 |
%description pvhelper |
284 |
This helper is used when creating a Spin. |
285 |
|
286 |
End users *should not* install this package. |
287 |
|
288 |
|
289 |
%package live-service |
290 |
Summary: %{name} live service |
291 |
Requires(post): systemd-units |
292 |
Requires(preun): systemd-units |
293 |
Requires(postun): systemd-units |
294 |
|
295 |
%description live-service |
296 |
You can install just this package in virtual machines in order to |
297 |
enable libguestfs live service (eg. guestfish --live), which lets you |
298 |
safely edit files in running guests. |
299 |
|
300 |
This daemon is *not* required by %{name}. |
301 |
|
302 |
# https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd |
303 |
%post live-service |
304 |
%systemd_post guestfsd.service |
305 |
%preun live-service |
306 |
%systemd_preun guestfsd.service |
307 |
%postun live-service |
308 |
%systemd_postun_with_restart guestfsd.service |
309 |
|
310 |
%package -n ocaml-%{name} |
311 |
Summary: OCaml bindings for %{name} |
312 |
Group: Development/OCaml |
313 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
314 |
|
315 |
|
316 |
%description -n ocaml-%{name} |
317 |
ocaml-%{name} contains OCaml bindings for %{name}. |
318 |
|
319 |
This is for toplevel and scripting access only. To compile OCaml |
320 |
programs which use %{name} you will also need ocaml-%{name}-devel. |
321 |
|
322 |
|
323 |
%package -n ocaml-%{name}-devel |
324 |
Summary: OCaml bindings for %{name} |
325 |
Group: Development/OCaml |
326 |
Requires: ocaml-%{name} = %{epoch}:%{version}-%{release} |
327 |
|
328 |
|
329 |
%description -n ocaml-%{name}-devel |
330 |
ocaml-%{name}-devel contains development libraries |
331 |
required to use the OCaml bindings for %{name}. |
332 |
|
333 |
|
334 |
%package -n perl-%{name} |
335 |
Summary: Perl bindings for %{name} |
336 |
Group: Development/Perl |
337 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
338 |
Requires: perl |
339 |
Requires: perl-XML-XPath |
340 |
|
341 |
|
342 |
%description -n perl-%{name} |
343 |
perl-%{name} contains Perl bindings for %{name}. |
344 |
|
345 |
|
346 |
%package -n python-%{name} |
347 |
Summary: Python bindings for %{name} |
348 |
Group: Development/Perl |
349 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
350 |
|
351 |
%description -n python-%{name} |
352 |
python-%{name} contains Python bindings for %{name}. |
353 |
|
354 |
|
355 |
%package -n ruby-%{name} |
356 |
Summary: Ruby bindings for %{name} |
357 |
Group: Development/Ruby |
358 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
359 |
Provides: ruby-guestfs = %{version} |
360 |
|
361 |
%description -n ruby-%{name} |
362 |
ruby-%{name} contains Ruby bindings for %{name}. |
363 |
|
364 |
|
365 |
%package java |
366 |
Summary: Java bindings for %{name} |
367 |
Group: Development/Java |
368 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
369 |
Requires: java >= 1.5.0 |
370 |
Requires: jpackage-utils |
371 |
|
372 |
%description java |
373 |
%{name}-java contains Java bindings for %{name}. |
374 |
|
375 |
If you want to develop software in Java which uses %{name}, then |
376 |
you will also need %{name}-java-devel. |
377 |
|
378 |
|
379 |
%package java-devel |
380 |
Summary: Java development package for %{name} |
381 |
Group: Development/Java |
382 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
383 |
Requires: %{name}-java = %{epoch}:%{version}-%{release} |
384 |
|
385 |
%description java-devel |
386 |
%{name}-java-devel contains the tools for developing Java software |
387 |
using %{name}. |
388 |
|
389 |
See also %{name}-javadoc. |
390 |
|
391 |
|
392 |
%package javadoc |
393 |
Summary: Java documentation for %{name} |
394 |
Group: Development/Java |
395 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
396 |
Requires: %{name}-java = %{epoch}:%{version}-%{release} |
397 |
Requires: jpackage-utils |
398 |
|
399 |
%description javadoc |
400 |
%{name}-javadoc contains the Java documentation for %{name}. |
401 |
|
402 |
|
403 |
%package -n php-%{name} |
404 |
Summary: PHP bindings for %{name} |
405 |
Group: Development/PHP |
406 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
407 |
Requires: php |
408 |
|
409 |
%description -n php-%{name} |
410 |
php-%{name} contains PHP bindings for %{name}. |
411 |
|
412 |
%package -n erlang-%{name} |
413 |
Summary: Erlang bindings for %{name} |
414 |
Group: Development/Erlang |
415 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
416 |
|
417 |
%description -n erlang-%{name} |
418 |
erlang-%{name} contains Erlang bindings for %{name}. |
419 |
|
420 |
%package -n gobject-%{name} |
421 |
Summary: Gobject bindings for %{name} |
422 |
Group: Development/Other |
423 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
424 |
|
425 |
%description -n gobject-%{name} |
426 |
gobject-%{name} contains gobject bindings for %{name}. |
427 |
|
428 |
%package -n lua-%{name} |
429 |
Summary: Lua bindings for %{name} |
430 |
Group: Development/Other |
431 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
432 |
|
433 |
%description -n lua-%{name} |
434 |
lua-%{name} contains lua bindings for %{name}. |
435 |
|
436 |
%package -n golang-%{name} |
437 |
Summary: Go bindings for %{name} |
438 |
Group: Development/Other |
439 |
Requires: %{name} = %{epoch}:%{version}-%{release} |
440 |
|
441 |
%description -n golang-%{name} |
442 |
golang-%{name} contains go bindings for %{name}. |
443 |
|
444 |
|
445 |
%prep |
446 |
%setup -q |
447 |
%apply_patches |
448 |
mkdir -p daemon/m4 |
449 |
|
450 |
autoreconf -fi |
451 |
|
452 |
%build |
453 |
%configure2_5x \ |
454 |
--prefix=%{_prefix} --libdir=%{_libdir} \ |
455 |
--mandir=%{_mandir} \ |
456 |
--sysconfdir=%{_sysconfdir} \ |
457 |
--with-default-backend=libvirt \ |
458 |
--with-qemu="qemu-kvm qemu-system-%{_build_arch} qemu" \ |
459 |
--enable-supermin \ |
460 |
--enable-install-daemon \ |
461 |
%if %{with_virtio} |
462 |
--with-drive-if=virtio \ |
463 |
%endif |
464 |
|
465 |
# 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir |
466 |
# not the site dir. |
467 |
# |
468 |
# make v2v causes problems with parallel compiles |
469 |
make INSTALLDIRS=vendor DISTRO=MAGEIA |
470 |
|
471 |
# Useful for debugging appliance problems. |
472 |
#echo "==== files in initramfs ====" |
473 |
#find initramfs -type f |
474 |
echo "==== hostfiles ====" |
475 |
ls -l appliance/supermin.d/hostfiles |
476 |
cat appliance/supermin.d/hostfiles |
477 |
echo "============" |
478 |
|
479 |
# This file is creeping over 1 MB uncompressed, and since it is |
480 |
# included in the -devel subpackage, compress it to reduce |
481 |
# installation size. |
482 |
gzip -9 ChangeLog |
483 |
|
484 |
%check |
485 |
|
486 |
%if %{runtests} |
487 |
|
488 |
# Enable debugging - very useful if a test does fail, although |
489 |
# it produces masses of output in the build.log. |
490 |
export LIBGUESTFS_DEBUG=1 |
491 |
|
492 |
# Enable trace. Since libguestfs 1.9.7 this produces 'greppable' |
493 |
# output even when combined with trace (see RHBZ#673477). |
494 |
export LIBGUESTFS_TRACE=1 |
495 |
|
496 |
# This test fails because we build the ISO after encoding the checksum |
497 |
# of the ISO in the test itself. Need to fix the test to work out the |
498 |
# checksum at runtime. |
499 |
export SKIP_TEST_CHECKSUM_DEVICE=1 |
500 |
|
501 |
# Disable virt-format test (RHBZ#872831). |
502 |
export SKIP_TEST_VIRT_FORMAT_SH=1 |
503 |
|
504 |
# Disable set_label tests (RHBZ#906777). |
505 |
export SKIP_TEST_SET_LABEL=1 |
506 |
|
507 |
# Disable test-btrfs-devices on ix86 only. It fails on Fedora 19 (but not |
508 |
# Fedora 18 nor Fedora 20) with: |
509 |
# guestfsd: error: tar subcommand failed on directory: /data3: tar: ./10/q/4: Cannot open: No space left on device |
510 |
# This seems to be a transient kernel problem, fixed in F20. |
511 |
%ifarch %{ix86} |
512 |
export SKIP_TEST_BTRFS_DEVICES_SH=1 |
513 |
%endif |
514 |
|
515 |
# Disable mdadm test, buggy in kernel 3.13 (RHBZ#1033971). |
516 |
export SKIP_TEST_MDADM_SH=1 |
517 |
|
518 |
# Disable NBD test, buggy in qemu 1.7.0 (RHBZ#1034433). |
519 |
export SKIP_TEST_NBD_PL=1 |
520 |
|
521 |
# Disable parallel virt-alignment-scan & virt-df tests (RHBZ#1025942). |
522 |
export SKIP_TEST_VIRT_ALIGNMENT_SCAN_GUESTS_SH=1 |
523 |
export SKIP_TEST_VIRT_DF_GUESTS_SH=1 |
524 |
|
525 |
# Skip gnulib tests which fail (probably these are kernel/glibc bugs). |
526 |
pushd gnulib/tests |
527 |
make -k check ||: |
528 |
for f in test-getaddrinfo test-utimens ; do |
529 |
rm -f $f $f.o |
530 |
touch $f.o |
531 |
echo 'exit 77' > $f |
532 |
chmod +x $f |
533 |
done |
534 |
popd |
535 |
|
536 |
# Do make quickcheck first, to fail early if the appliance or libvirt |
537 |
# is obviously broken. Also dump libvirt log files if this happens. |
538 |
# Since it's most likely libvirt which is broken, make sure libvirt |
539 |
# debugging is enabled here. |
540 |
if ! make quickcheck LIBVIRT_DEBUG=1; then |
541 |
cat $HOME/.cache/libvirt/qemu/log/* |
542 |
exit 1 |
543 |
fi |
544 |
|
545 |
make check -k |
546 |
|
547 |
%endif |
548 |
|
549 |
%install |
550 |
# 'INSTALLDIRS' ensures that Perl and Ruby libs are installed in the |
551 |
# vendor dir not the site dir. |
552 |
make DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor install |
553 |
|
554 |
# Delete static libraries, libtool files. |
555 |
rm $( |
556 |
find $RPM_BUILD_ROOT -path '*/ocaml/guestfs' -prune -o -name '*.a' -print |
557 |
) |
558 |
find $RPM_BUILD_ROOT -name '*.la' -delete |
559 |
|
560 |
# Delete some bogus Perl files. |
561 |
find $RPM_BUILD_ROOT -name perllocal.pod -delete |
562 |
find $RPM_BUILD_ROOT -name .packlist -delete |
563 |
find $RPM_BUILD_ROOT -name '*.bs' -delete |
564 |
find $RPM_BUILD_ROOT -name 'bindtests.pl' -delete |
565 |
|
566 |
# Delete guestfs-p2v-iso(1) because it is internal documentation. |
567 |
# We might include it in future if it says something useful for end |
568 |
# users about how to create the ISO. |
569 |
rm $RPM_BUILD_ROOT%{_mandir}/man1/guestfs-p2v-iso.1* |
570 |
|
571 |
# Don't use versioned jar file (RHBZ#1022133). |
572 |
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1022184#c4 |
573 |
mv $RPM_BUILD_ROOT%{_datadir}/java/%{name}-%{version}.jar \ |
574 |
$RPM_BUILD_ROOT%{_datadir}/java/%{name}.jar |
575 |
|
576 |
# golang: Ignore what libguestfs upstream installs, and just copy the |
577 |
# source files to %{_datadir}/gocode/src. |
578 |
%ifarch %{golang_arches} |
579 |
rm -r $RPM_BUILD_ROOT/usr/lib/golang |
580 |
mkdir -p $RPM_BUILD_ROOT%{_datadir}/gocode/src |
581 |
cp -a golang/src/libguestfs.org $RPM_BUILD_ROOT%{_datadir}/gocode/src |
582 |
%endif |
583 |
|
584 |
# Delete the ordinary appliance, leaving just the supermin appliance. |
585 |
rm -f $RPM_BUILD_ROOT%{_libdir}/guestfs/vmlinuz.* |
586 |
rm -f $RPM_BUILD_ROOT%{_libdir}/guestfs/initramfs.* |
587 |
|
588 |
|
589 |
# Clean up the examples/ directory which will get installed in %doc. |
590 |
# Note we can't delete the original examples/Makefile because that |
591 |
# will be needed by the check section later in the RPM build. |
592 |
cp -a examples ex |
593 |
pushd ex |
594 |
make clean |
595 |
rm Makefile* |
596 |
rm -rf .deps .libs |
597 |
popd |
598 |
|
599 |
# Same for ocaml/examples. |
600 |
cp -a ocaml/examples ocaml/ex |
601 |
pushd ocaml/ex |
602 |
make clean |
603 |
rm Makefile* |
604 |
popd |
605 |
|
606 |
rm -f $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.a |
607 |
rm -f $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.la |
608 |
|
609 |
if [ "$RPM_BUILD_ROOT%{python_sitearch}" != "$RPM_BUILD_ROOT%{python_sitelib}" ]; then |
610 |
mkdir -p $RPM_BUILD_ROOT%{python_sitelib} |
611 |
mv $RPM_BUILD_ROOT%{python_sitearch}/guestfs.py* \ |
612 |
$RPM_BUILD_ROOT%{python_sitelib}/ |
613 |
fi |
614 |
|
615 |
|
616 |
# Remove static-linked Java bindings. |
617 |
rm -f $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.a |
618 |
rm -f $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.la |
619 |
|
620 |
# Move installed documentation back to the source directory so |
621 |
# we can install it using a %%doc rule. |
622 |
mv $RPM_BUILD_ROOT%{_docdir}/libguestfs installed-docs |
623 |
|
624 |
# Remove Japanese manpages, since these are not translated fully at |
625 |
# the moment. When these are translated properly we intend to add |
626 |
# them back. |
627 |
rm -rf $RPM_BUILD_ROOT%{_mandir}/ja/man{1,3,5}/ |
628 |
|
629 |
# For the libguestfs-live-service subpackage install the systemd |
630 |
# service and udev rules. |
631 |
mkdir -p $RPM_BUILD_ROOT%{_unitdir} |
632 |
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d |
633 |
install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_unitdir} |
634 |
install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d |
635 |
# This deals with UsrMove: |
636 |
mv $RPM_BUILD_ROOT/lib/udev/rules.d/99-guestfs-serial.rules \ |
637 |
$RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d |
638 |
|
639 |
# Find locale files. |
640 |
%find_lang %{name} |
641 |
|
642 |
%files -f %{name}.lang |
643 |
%doc COPYING |
644 |
%{_bindir}/libguestfs-test-tool |
645 |
%{_sbindir}/libguestfs-make-fixed-appliance |
646 |
%{_libdir}/guestfs/ |
647 |
%{_libdir}/libguestfs.so.* |
648 |
#%{_libexecdir}/libguestfs-test-tool-helper |
649 |
%{_mandir}/man1/libguestfs-*.1* |
650 |
%{_mandir}/uk/man1/libguestfs-*.1* |
651 |
|
652 |
|
653 |
%files devel |
654 |
%doc BUGS ChangeLog.gz HACKING TODO README |
655 |
%doc ex html/guestfs.3.html html/pod.css |
656 |
%doc installed-docs/* |
657 |
%{_libdir}/libguestfs.so |
658 |
%{_mandir}/man3/guestfs.3* |
659 |
%{_mandir}/uk/man3/guestfs.3* |
660 |
%{_mandir}/man3/guestfs-examples.3* |
661 |
%{_mandir}/uk/man3/guestfs-examples.3* |
662 |
%{_mandir}/man3/libguestfs.3* |
663 |
%{_includedir}/guestfs.h |
664 |
%{_libdir}/pkgconfig/libguestfs.pc |
665 |
|
666 |
|
667 |
%files -n guestfish |
668 |
%doc html/guestfish.1.html html/pod.css |
669 |
%{_bindir}/guestfish |
670 |
%{_mandir}/man1/guestfish.1* |
671 |
%{_mandir}/uk/man1/guestfish.1* |
672 |
#%dir %{_sysconfdir}/bash_completion.d |
673 |
#%{_sysconfdir}/bash_completion.d/guestfish-bash-completion.sh |
674 |
|
675 |
|
676 |
%files mount |
677 |
%doc COPYING |
678 |
%{_bindir}/guestmount |
679 |
%{_mandir}/man1/guestmount.1* |
680 |
%{_mandir}/uk/man1/guestmount.1* |
681 |
%{_mandir}/man1/guestunmount.1* |
682 |
%{_mandir}/uk/man1/guestunmount.1* |
683 |
%{_bindir}/guestunmount |
684 |
|
685 |
|
686 |
%files tools |
687 |
%{_bindir}/virt-* |
688 |
%{_mandir}/man1/virt-*.1* |
689 |
%{_mandir}/uk/man1/virt-*.1* |
690 |
%{_mandir}/man1/guestfs-*.1* |
691 |
%{_mandir}/man5/libguestfs-tools*.5* |
692 |
%{_mandir}/uk/man1/guestfs-*.1* |
693 |
%{_mandir}/uk/man5/libguestfs-tools*.5* |
694 |
%{_datadir}/bash-completion/* |
695 |
%{_sysconfdir}/libguestfs-tools.conf |
696 |
%{_sysconfdir}/virt-builder |
697 |
%dir %{_sysconfdir}/xdg/virt-builder |
698 |
%dir %{_sysconfdir}/xdg/virt-builder/repos.d |
699 |
%{_sysconfdir}/xdg/virt-builder/repos.d/* |
700 |
|
701 |
%files pvhelper |
702 |
%doc COPYING README |
703 |
%{_libexecdir}/virt-p2v |
704 |
|
705 |
%files live-service |
706 |
%doc COPYING README |
707 |
%{_sbindir}/guestfsd |
708 |
%{_unitdir}/guestfsd.service |
709 |
%{_mandir}/man8/guestfsd.8* |
710 |
%{_prefix}/lib/udev/rules.d/99-guestfsd.rules |
711 |
%{_prefix}/lib/udev/rules.d/99-guestfs-serial.rules |
712 |
|
713 |
%files -n ocaml-%{name} |
714 |
%doc README |
715 |
%{_libdir}/ocaml/guestfs |
716 |
%exclude %{_libdir}/ocaml/guestfs/*.a |
717 |
%exclude %{_libdir}/ocaml/guestfs/*.cmxa |
718 |
%exclude %{_libdir}/ocaml/guestfs/*.cmx |
719 |
%exclude %{_libdir}/ocaml/guestfs/*.mli |
720 |
%{_libdir}/ocaml/stublibs/*.so |
721 |
%{_libdir}/ocaml/stublibs/*.so.owner |
722 |
|
723 |
|
724 |
%files -n ocaml-%{name}-devel |
725 |
%doc ocaml/ex |
726 |
%{_mandir}/man3/guestfs-ocaml.3* |
727 |
%{_mandir}/uk/man3/guestfs-ocaml.3* |
728 |
%{_libdir}/ocaml/guestfs/*.a |
729 |
%{_libdir}/ocaml/guestfs/*.cmxa |
730 |
%{_libdir}/ocaml/guestfs/*.cmx |
731 |
%{_libdir}/ocaml/guestfs/*.mli |
732 |
|
733 |
|
734 |
%files -n perl-%{name} |
735 |
%doc perl/examples |
736 |
%{perl_vendorarch}/* |
737 |
%{_mandir}/man3/Sys::Guestfs.3pm* |
738 |
%{_mandir}/man3/guestfs-perl.3* |
739 |
%{_mandir}/uk/man3/guestfs-perl.3* |
740 |
|
741 |
%files -n python-%{name} |
742 |
%doc README |
743 |
%{python_sitearch}/* |
744 |
%{python_sitelib}/*.py* |
745 |
%{_mandir}/man3/guestfs-python.3* |
746 |
%{_mandir}/uk/man3/guestfs-python.3* |
747 |
|
748 |
%files -n ruby-%{name} |
749 |
%doc README |
750 |
%{ruby_vendorlibdir}/guestfs.rb |
751 |
%{ruby_vendorarchdir}/_guestfs.so |
752 |
%{_mandir}/man3/guestfs-ruby.3* |
753 |
%{_mandir}/uk/man3/guestfs-ruby.3* |
754 |
|
755 |
%files java |
756 |
%doc README |
757 |
%{_libdir}/libguestfs_jni*.so.* |
758 |
%{_datadir}/java/*.jar |
759 |
|
760 |
|
761 |
%files java-devel |
762 |
%doc README |
763 |
%{_libdir}/libguestfs_jni*.so |
764 |
%{_mandir}/man3/guestfs-java.3* |
765 |
%{_mandir}/uk/man3/guestfs-java.3* |
766 |
|
767 |
%files javadoc |
768 |
%doc README |
769 |
%{_datadir}/javadoc/%{name} |
770 |
|
771 |
%files -n php-%{name} |
772 |
%doc php/README-PHP |
773 |
%dir %{_sysconfdir}/php.d |
774 |
%{_sysconfdir}/php.d/guestfs_php.ini |
775 |
%{_libdir}/php/extensions/guestfs_php.so |
776 |
|
777 |
%files -n erlang-%{name} |
778 |
%{_bindir}/erl-guestfs |
779 |
%{_libdir}/erlang/lib/libguestfs-*/ebin/*.beam |
780 |
%{_mandir}/man3/guestfs-erlang.3* |
781 |
%{_mandir}/uk/man3/guestfs-erlang.3* |
782 |
|
783 |
%files -n gobject-%{name} |
784 |
%{_includedir}/guestfs-gobject.h |
785 |
%{_includedir}/guestfs-gobject/* |
786 |
%{_libdir}/libguestfs-gobject-* |
787 |
%{_libdir}/pkgconfig/libguestfs-gobject-1.0.pc |
788 |
%{_libdir}/girepository-1.0/Guestfs-1.0.typelib |
789 |
%{_datadir}/gir-1.0/* |
790 |
%{_datadir}/gtk-doc/* |
791 |
|
792 |
%files -n lua-%{name} |
793 |
%{_libdir}/lua/*/* |
794 |
%{_mandir}/man3/guestfs-lua.3* |
795 |
%{_mandir}/uk/man3/guestfs-lua.3* |
796 |
|
797 |
%files -n golang-%{name} |
798 |
%{_libdir}/golang/* |
799 |
%{_mandir}/man3/guestfs-golang.3* |
800 |
%{_mandir}/uk/man3/guestfs-golang.3* |