3 # Enable to build w/o network.
6 Summary: Access and modify virtual machine disk images
11 Group: Development/Libraries
12 URL: http://et.redhat.com/~rjones/libguestfs/
13 Source0: http://et.redhat.com/~rjones/libguestfs/files/%{name}-%{version}.tar.gz
14 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
16 # Currently fails on non-x86 because of this error:
17 # "qemu: linux kernel too old to load a ram disk"
18 ExclusiveArch: %{ix86} x86_64
20 # Basic build requirements:
21 BuildRequires: /usr/bin/pod2man
22 BuildRequires: /usr/bin/pod2text
23 BuildRequires: febootstrap >= 1.5
24 BuildRequires: augeas-devel >= 0.5.0
25 BuildRequires: readline-devel
26 BuildRequires: qemu >= 0.10-7
27 BuildRequires: createrepo
29 # This is only needed for RHEL 5 because readline-devel doesn't
30 # properly depend on it, but doesn't do any harm on other platforms:
31 BuildRequires: ncurses-devel
33 # Build requirements for the appliance:
34 # (see 'make-initramfs.sh.in' in the source)
35 BuildRequires: kernel, bash, coreutils, lvm2, ntfs-3g, util-linux-ng
36 BuildRequires: MAKEDEV, net-tools, augeas-libs, file
37 BuildRequires: module-init-tools, procps, strace, iputils
39 # These are only required if you want to build the bindings for
40 # different languages:
42 BuildRequires: ocaml-findlib-devel
43 BuildRequires: perl-devel
44 BuildRequires: perl-Test-Simple
45 BuildRequires: perl-Test-Pod
46 BuildRequires: perl-Test-Pod-Coverage
47 BuildRequires: perl-ExtUtils-MakeMaker
48 BuildRequires: python-devel
49 BuildRequires: ruby-devel
50 BuildRequires: rubygem-rake
51 BuildRequires: java >= 1.5.0
52 BuildRequires: jpackage-utils
53 BuildRequires: java-devel
56 BuildRequires: perl-Sys-Virt
59 Requires: qemu >= 0.10-7
63 Libguestfs is a library for accessing and modifying guest disk images.
64 Amongst the things this is good for: making batch configuration
65 changes to guests, getting disk used/free statistics (see also:
66 virt-df), migrating between virtualization systems (see also:
67 virt-p2v), performing partial backups, performing partial guest
68 clones, cloning guests and changing registry/UUID/hostname info, and
71 Libguestfs uses Linux kernel and qemu code, and can access any type of
72 guest filesystem that Linux and qemu can, including but not limited
73 to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition
74 schemes, qcow, qcow2, vmdk.
76 Libguestfs provides ways to enumerate guest storage (eg. partitions,
77 LVs, what filesystem is in each LV, etc.). It can also run commands
78 in the context of the guest. Also you can access filesystems over FTP.
80 Libguestfs is a library that can be linked with C and C++ management
83 See also the 'guestfish' package for shell scripting and command line
86 For Perl bindings, see 'perl-libguestfs'.
88 For OCaml bindings, see 'ocaml-libguestfs-devel'.
90 For Python bindings, see 'python-libguestfs'.
92 For Ruby bindings, see 'ruby-libguestfs'.
94 For Java bindings, see 'libguestfs-java-devel'.
98 Summary: Development tools and libraries for %{name}
99 Group: Development/Libraries
100 Requires: %{name} = %{version}-%{release}
105 %{name}-devel contains development tools and libraries
109 %package -n guestfish
110 Summary: Shell for accessing and modifying virtual machine disk images
111 Group: Development/Tools
113 Requires: %{name} = %{version}-%{release}
114 Requires: /usr/bin/pod2text
117 %description -n guestfish
118 Guestfish is the Filesystem Interactive SHell, for accessing and
119 modifying virtual machine disk images from the command line and shell
123 %package -n virt-inspector
124 Summary: Display OS version, kernel, drivers, etc in a virtual machine
125 Group: Development/Tools
127 Requires: %{name} = %{version}-%{release}
129 Requires: perl-Sys-Virt
132 %description -n virt-inspector
133 Virt-inspector examines a virtual machine and tries to determine the
134 version of the OS, the kernel version, what drivers are installed,
135 whether the virtual machine is fully virtualized (FV) or
136 para-virtualized (PV), what applications are installed and more.
139 %package -n ocaml-%{name}
140 Summary: OCaml bindings for %{name}
141 Group: Development/Libraries
142 Requires: %{name} = %{version}-%{release}
145 %description -n ocaml-%{name}
146 ocaml-%{name} contains OCaml bindings for %{name}.
148 This is for toplevel and scripting access only. To compile OCaml
149 programs which use %{name} you will also need ocaml-%{name}-devel.
152 %package -n ocaml-%{name}-devel
153 Summary: OCaml bindings for %{name}
154 Group: Development/Libraries
155 Requires: ocaml-%{name} = %{version}-%{release}
158 %description -n ocaml-%{name}-devel
159 ocaml-%{name}-devel contains development libraries
160 required to use the OCaml bindings for %{name}.
163 %package -n perl-%{name}
164 Summary: Perl bindings for %{name}
165 Group: Development/Libraries
166 Requires: %{name} = %{version}-%{release}
167 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
170 %description -n perl-%{name}
171 perl-%{name} contains Perl bindings for %{name}.
174 %package -n python-%{name}
175 Summary: Python bindings for %{name}
176 Group: Development/Libraries
177 Requires: %{name} = %{version}-%{release}
179 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
180 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
182 %description -n python-%{name}
183 python-%{name} contains Python bindings for %{name}.
186 %package -n ruby-%{name}
187 Summary: Ruby bindings for %{name}
188 Group: Development/Libraries
189 Requires: %{name} = %{version}-%{release}
190 Requires: ruby(abi) = 1.8
191 Provides: ruby(guestfs) = %{version}
193 %{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
194 %{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
196 %description -n ruby-%{name}
197 ruby-%{name} contains Ruby bindings for %{name}.
201 Summary: Java bindings for %{name}
202 Group: Development/Libraries
203 Requires: %{name} = %{version}-%{release}
204 Requires: java >= 1.5.0
205 Requires: jpackage-utils
208 %{name}-java contains Java bindings for %{name}.
210 If you want to develop software in Java which uses %{name}, then
211 you will also need %{name}-java-devel.
215 Summary: Java development package for %{name}
216 Group: Development/Libraries
217 Requires: %{name} = %{version}-%{release}
218 Requires: %{name}-java = %{version}-%{release}
220 %description java-devel
221 %{name}-java-devel contains the tools for developing Java software
224 See also %{name}-javadoc.
228 Summary: Java documentation for %{name}
229 Group: Development/Libraries
230 Requires: %{name} = %{version}-%{release}
231 Requires: %{name}-java = %{version}-%{release}
232 Requires: jpackage-utils
235 %{name}-javadoc contains the Java documentation for %{name}.
247 find /var/cache/yum/build -type f -name '*.rpm' -print0 | xargs -0 cp -t repo
249 %define extra --with-mirror=file://$(pwd)/repo --with-repo=fedora-12
255 --prefix=%{_prefix} --libdir=%{_libdir} \
256 --mandir=%{_mandir} \
257 --with-java-home=%{java_home} \
258 --with-qemu="qemu-kvm qemu-system-%{_build_arch} qemu" \
259 --enable-debug-command \
262 # This ensures that /usr/sbin/chroot is on the path. Not needed
263 # except for RHEL 5, it shouldn't do any harm on other platforms.
264 export PATH=/usr/sbin:$PATH
266 # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
268 make INSTALLDIRS=vendor %{?_smp_mflags}
272 test -n "$QUICK_RPMBUILD" || make check
276 rm -rf $RPM_BUILD_ROOT
278 make DESTDIR=$RPM_BUILD_ROOT install
280 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a
281 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la
283 # Clean up the examples/ directory which will get installed in %doc.
284 # Note we can't delete the original examples/Makefile because that
285 # will be needed by the check section later in the RPM build.
293 # Same for ocaml/examples.
294 cp -a ocaml/examples ocaml/ex
300 find $RPM_BUILD_ROOT -name perllocal.pod -delete
301 find $RPM_BUILD_ROOT -name .packlist -delete
302 find $RPM_BUILD_ROOT -name '*.bs' -delete
304 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.a
305 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.la
307 if [ "$RPM_BUILD_ROOT%{python_sitearch}" != "$RPM_BUILD_ROOT%{python_sitelib}" ]; then
308 mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
309 mv $RPM_BUILD_ROOT%{python_sitearch}/guestfs.py* \
310 $RPM_BUILD_ROOT%{python_sitelib}/
313 # Install ruby bindings by hand.
314 mkdir -p $RPM_BUILD_ROOT%{ruby_sitelib}
315 mkdir -p $RPM_BUILD_ROOT%{ruby_sitearch}
316 install -p -m0644 ruby/lib/guestfs.rb $RPM_BUILD_ROOT%{ruby_sitelib}
317 install -p -m0755 ruby/ext/guestfs/_guestfs.so $RPM_BUILD_ROOT%{ruby_sitearch}
319 # Remove static-linked Java bindings.
320 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.a
321 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.la
323 # Generator shouldn't be executable when we distribute it.
324 chmod -x src/generator.ml
328 rm -rf $RPM_BUILD_ROOT
331 %post -p /sbin/ldconfig
333 %postun -p /sbin/ldconfig
337 %defattr(-,root,root,-)
340 %{_libdir}/libguestfs.so.*
344 %defattr(-,root,root,-)
345 %doc ChangeLog HACKING TODO README ex html/guestfs.3.html html/pod.css
346 %doc src/generator.ml
347 %{_libdir}/libguestfs.so
348 %{_mandir}/man3/guestfs.3*
349 %{_includedir}/guestfs.h
350 %{_includedir}/guestfs-actions.h
351 %{_includedir}/guestfs-structs.h
352 %{_libdir}/pkgconfig/libguestfs.pc
356 %defattr(-,root,root,-)
357 %doc html/guestfish.1.html html/pod.css recipes/
359 %{_mandir}/man1/guestfish.1*
362 %files -n virt-inspector
363 %defattr(-,root,root,-)
364 %{_bindir}/virt-inspector
365 %{_mandir}/man1/virt-inspector.1*
368 %files -n ocaml-%{name}
369 %defattr(-,root,root,-)
371 %{_libdir}/ocaml/guestfs
372 %exclude %{_libdir}/ocaml/guestfs/*.a
373 %exclude %{_libdir}/ocaml/guestfs/*.cmxa
374 %exclude %{_libdir}/ocaml/guestfs/*.cmx
375 %exclude %{_libdir}/ocaml/guestfs/*.mli
376 %{_libdir}/ocaml/stublibs/*.so
377 %{_libdir}/ocaml/stublibs/*.so.owner
380 %files -n ocaml-%{name}-devel
381 %defattr(-,root,root,-)
383 %{_libdir}/ocaml/guestfs/*.a
384 %{_libdir}/ocaml/guestfs/*.cmxa
385 %{_libdir}/ocaml/guestfs/*.cmx
386 %{_libdir}/ocaml/guestfs/*.mli
389 %files -n perl-%{name}
390 %defattr(-,root,root,-)
393 %{_mandir}/man3/Sys::Guestfs.3pm*
396 %files -n python-%{name}
397 %defattr(-,root,root,-)
400 %{python_sitelib}/*.py
401 %{python_sitelib}/*.pyc
402 %{python_sitelib}/*.pyo
405 %files -n ruby-%{name}
406 %defattr(-,root,root,-)
408 %{ruby_sitelib}/guestfs.rb
409 %{ruby_sitearch}/_guestfs.so
413 %defattr(-,root,root,-)
415 %{_libdir}/libguestfs_jni*.so.*
416 %{_datadir}/java/*.jar
420 %defattr(-,root,root,-)
422 %{_libdir}/libguestfs_jni*.so
426 %defattr(-,root,root,-)
428 %{_datadir}/javadoc/%{name}-java-%{version}
432 * Tue Apr 28 2009 Richard Jones <rjones@redhat.com> - @VERSION@-1
433 - New upstream version @VERSION@.
435 * Thu May 7 2009 Richard Jones <rjones@redhat.com> - 1.0.20-1
436 - New upstream version 1.0.20.
438 * Thu May 7 2009 Richard Jones <rjones@redhat.com> - 1.0.19-1
439 - New upstream version 1.0.19.
441 * Tue Apr 28 2009 Richard Jones <rjones@redhat.com> - 1.0.15-1
442 - New upstream version 1.0.15.
444 * Fri Apr 24 2009 Richard Jones <rjones@redhat.com> - 1.0.12-1
445 - New upstream version 1.0.12.
447 * Wed Apr 22 2009 Richard Jones <rjones@redhat.com> - 1.0.6-1
448 - New upstream version 1.0.6.
450 * Mon Apr 20 2009 Richard Jones <rjones@redhat.com> - 1.0.2-1
451 - New upstream version 1.0.2.
453 * Thu Apr 16 2009 Richard Jones <rjones@redhat.com> - 0.9.9-12
454 - Multiple fixes to get it to scratch build in Koji.
456 * Sat Apr 4 2009 Richard Jones <rjones@redhat.com> - 0.9.9-1