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 # Build requirements for the appliance:
30 # (see 'make-initramfs.sh.in' in the source)
31 BuildRequires: kernel, bash, coreutils, lvm2, ntfs-3g, util-linux-ng
32 BuildRequires: MAKEDEV, net-tools, augeas-libs, file
33 BuildRequires: module-init-tools, procps, strace, iputils
35 # These are only required if you want to build the bindings for
36 # different languages:
38 BuildRequires: ocaml-findlib-devel
39 BuildRequires: perl-devel
40 BuildRequires: perl-Test-Simple
41 BuildRequires: perl-Test-Pod
42 BuildRequires: perl-Test-Pod-Coverage
43 BuildRequires: perl-ExtUtils-MakeMaker
44 BuildRequires: python-devel
45 BuildRequires: ruby-devel
46 BuildRequires: rubygem-rake
47 BuildRequires: java >= 1.5.0
48 BuildRequires: jpackage-utils
49 BuildRequires: java-devel
52 BuildRequires: perl-Sys-Virt
55 Requires: qemu >= 0.10-7
59 Libguestfs is a library for accessing and modifying guest disk images.
60 Amongst the things this is good for: making batch configuration
61 changes to guests, getting disk used/free statistics (see also:
62 virt-df), migrating between virtualization systems (see also:
63 virt-p2v), performing partial backups, performing partial guest
64 clones, cloning guests and changing registry/UUID/hostname info, and
67 Libguestfs uses Linux kernel and qemu code, and can access any type of
68 guest filesystem that Linux and qemu can, including but not limited
69 to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition
70 schemes, qcow, qcow2, vmdk.
72 Libguestfs provides ways to enumerate guest storage (eg. partitions,
73 LVs, what filesystem is in each LV, etc.). It can also run commands
74 in the context of the guest. Also you can access filesystems over FTP.
76 Libguestfs is a library that can be linked with C and C++ management
79 See also the 'guestfish' package for shell scripting and command line
82 For Perl bindings, see 'perl-libguestfs'.
84 For OCaml bindings, see 'ocaml-libguestfs-devel'.
86 For Python bindings, see 'python-libguestfs'.
88 For Ruby bindings, see 'ruby-libguestfs'.
90 For Java bindings, see 'libguestfs-java-devel'.
94 Summary: Development tools and libraries for %{name}
95 Group: Development/Libraries
96 Requires: %{name} = %{version}-%{release}
101 %{name}-devel contains development tools and libraries
105 %package -n guestfish
106 Summary: Shell for accessing and modifying virtual machine disk images
107 Group: Development/Tools
109 Requires: %{name} = %{version}-%{release}
110 Requires: /usr/bin/pod2text
113 %description -n guestfish
114 Guestfish is the Filesystem Interactive SHell, for accessing and
115 modifying virtual machine disk images from the command line and shell
119 %package -n virt-inspector
120 Summary: Display OS version, kernel, drivers, etc in a virtual machine
121 Group: Development/Tools
123 Requires: %{name} = %{version}-%{release}
125 Requires: perl-Sys-Virt
128 %description -n virt-inspector
129 Virt-inspector examines a virtual machine and tries to determine the
130 version of the OS, the kernel version, what drivers are installed,
131 whether the virtual machine is fully virtualized (FV) or
132 para-virtualized (PV), what applications are installed and more.
135 %package -n ocaml-%{name}
136 Summary: OCaml bindings for %{name}
137 Group: Development/Libraries
138 Requires: %{name} = %{version}-%{release}
141 %description -n ocaml-%{name}
142 ocaml-%{name} contains OCaml bindings for %{name}.
144 This is for toplevel and scripting access only. To compile OCaml
145 programs which use %{name} you will also need ocaml-%{name}-devel.
148 %package -n ocaml-%{name}-devel
149 Summary: OCaml bindings for %{name}
150 Group: Development/Libraries
151 Requires: ocaml-%{name} = %{version}-%{release}
154 %description -n ocaml-%{name}-devel
155 ocaml-%{name}-devel contains development libraries
156 required to use the OCaml bindings for %{name}.
159 %package -n perl-%{name}
160 Summary: Perl bindings for %{name}
161 Group: Development/Libraries
162 Requires: %{name} = %{version}-%{release}
163 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
166 %description -n perl-%{name}
167 perl-%{name} contains Perl bindings for %{name}.
170 %package -n python-%{name}
171 Summary: Python bindings for %{name}
172 Group: Development/Libraries
173 Requires: %{name} = %{version}-%{release}
175 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
176 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
178 %description -n python-%{name}
179 python-%{name} contains Python bindings for %{name}.
182 %package -n ruby-%{name}
183 Summary: Ruby bindings for %{name}
184 Group: Development/Libraries
185 Requires: %{name} = %{version}-%{release}
186 Requires: ruby(abi) = 1.8
187 Provides: ruby(guestfs) = %{version}
189 %{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
190 %{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
192 %description -n ruby-%{name}
193 ruby-%{name} contains Ruby bindings for %{name}.
197 Summary: Java bindings for %{name}
198 Group: Development/Libraries
199 Requires: %{name} = %{version}-%{release}
200 Requires: java >= 1.5.0
201 Requires: jpackage-utils
204 %{name}-java contains Java bindings for %{name}.
206 If you want to develop software in Java which uses %{name}, then
207 you will also need %{name}-java-devel.
211 Summary: Java development package for %{name}
212 Group: Development/Libraries
213 Requires: %{name} = %{version}-%{release}
214 Requires: %{name}-java = %{version}-%{release}
216 %description java-devel
217 %{name}-java-devel contains the tools for developing Java software
220 See also %{name}-javadoc.
224 Summary: Java documentation for %{name}
225 Group: Development/Libraries
226 Requires: %{name} = %{version}-%{release}
227 Requires: %{name}-java = %{version}-%{release}
228 Requires: jpackage-utils
231 %{name}-javadoc contains the Java documentation for %{name}.
242 cp $(find /var/cache/yum/build -name '*.rpm') .
245 %define extra --with-mirror=file://$(pwd)/repo --with-repo=fedora-12
251 --prefix=%{_prefix} --libdir=%{_libdir} \
252 --with-java-home=%{java_home} \
253 --with-qemu="qemu-kvm qemu-system-%{_build_arch} qemu" \
254 --enable-debug-command \
257 # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
259 # Uses javac which is incompatible with parallel make.
260 make INSTALLDIRS=vendor
264 test -n "$QUICK_RPMBUILD" || make check
268 rm -rf $RPM_BUILD_ROOT
270 make DESTDIR=$RPM_BUILD_ROOT install
272 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a
273 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la
275 # Clean up the examples/ directory which will get installed in %doc.
276 # Note we can't delete the original examples/Makefile because that
277 # will be needed by the check section later in the RPM build.
285 # Same for ocaml/examples.
286 cp -a ocaml/examples ocaml/ex
292 find $RPM_BUILD_ROOT -name perllocal.pod -delete
293 find $RPM_BUILD_ROOT -name .packlist -delete
294 find $RPM_BUILD_ROOT -name '*.bs' -delete
296 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.a
297 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.la
299 if [ "$RPM_BUILD_ROOT%{python_sitearch}" != "$RPM_BUILD_ROOT%{python_sitelib}" ]; then
300 mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
301 mv $RPM_BUILD_ROOT%{python_sitearch}/guestfs.py* \
302 $RPM_BUILD_ROOT%{python_sitelib}/
305 # Install ruby bindings by hand.
306 mkdir -p $RPM_BUILD_ROOT%{ruby_sitelib}
307 mkdir -p $RPM_BUILD_ROOT%{ruby_sitearch}
308 install -p -m0644 ruby/lib/guestfs.rb $RPM_BUILD_ROOT%{ruby_sitelib}
309 install -p -m0755 ruby/ext/guestfs/_guestfs.so $RPM_BUILD_ROOT%{ruby_sitearch}
311 # Remove static-linked Java bindings.
312 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.a
313 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.la
315 # Generator shouldn't be executable when we distribute it.
316 chmod -x src/generator.ml
320 rm -rf $RPM_BUILD_ROOT
323 %post -p /sbin/ldconfig
325 %postun -p /sbin/ldconfig
329 %defattr(-,root,root,-)
332 %{_libdir}/libguestfs.so.*
336 %defattr(-,root,root,-)
337 %doc ChangeLog HACKING TODO README ex html/guestfs.3.html html/pod.css
338 %doc src/generator.ml
339 %{_libdir}/libguestfs.so
340 %{_mandir}/man3/guestfs.3*
341 %{_includedir}/guestfs.h
342 %{_includedir}/guestfs-actions.h
343 %{_includedir}/guestfs-structs.h
344 %{_libdir}/pkgconfig/libguestfs.pc
348 %defattr(-,root,root,-)
349 %doc html/guestfish.1.html html/pod.css recipes/
351 %{_mandir}/man1/guestfish.1*
354 %files -n virt-inspector
355 %defattr(-,root,root,-)
356 %{_bindir}/virt-inspector
357 %{_mandir}/man1/virt-inspector.1*
360 %files -n ocaml-%{name}
361 %defattr(-,root,root,-)
363 %{_libdir}/ocaml/guestfs
364 %exclude %{_libdir}/ocaml/guestfs/*.a
365 %exclude %{_libdir}/ocaml/guestfs/*.cmxa
366 %exclude %{_libdir}/ocaml/guestfs/*.cmx
367 %exclude %{_libdir}/ocaml/guestfs/*.mli
368 %{_libdir}/ocaml/stublibs/*.so
369 %{_libdir}/ocaml/stublibs/*.so.owner
372 %files -n ocaml-%{name}-devel
373 %defattr(-,root,root,-)
375 %{_libdir}/ocaml/guestfs/*.a
376 %{_libdir}/ocaml/guestfs/*.cmxa
377 %{_libdir}/ocaml/guestfs/*.cmx
378 %{_libdir}/ocaml/guestfs/*.mli
381 %files -n perl-%{name}
382 %defattr(-,root,root,-)
385 %{_mandir}/man3/Sys::Guestfs.3pm*
388 %files -n python-%{name}
389 %defattr(-,root,root,-)
392 %{python_sitelib}/*.py
393 %{python_sitelib}/*.pyc
394 %{python_sitelib}/*.pyo
397 %files -n ruby-%{name}
398 %defattr(-,root,root,-)
400 %{ruby_sitelib}/guestfs.rb
401 %{ruby_sitearch}/_guestfs.so
405 %defattr(-,root,root,-)
407 %{_libdir}/libguestfs_jni*.so.*
408 %{_datadir}/java/*.jar
412 %defattr(-,root,root,-)
414 %{_libdir}/libguestfs_jni*.so
418 %defattr(-,root,root,-)
420 %{_datadir}/javadoc/%{name}-java-%{version}
424 * Fri Apr 24 2009 Richard Jones <rjones@redhat.com> - @VERSION@-1
425 - New upstream version @VERSION@.
427 * Fri Apr 24 2009 Richard Jones <rjones@redhat.com> - 1.0.12-1
428 - New upstream version 1.0.12.
430 * Wed Apr 22 2009 Richard Jones <rjones@redhat.com> - 1.0.6-1
431 - New upstream version 1.0.6.
433 * Mon Apr 20 2009 Richard Jones <rjones@redhat.com> - 1.0.2-1
434 - New upstream version 1.0.2.
436 * Thu Apr 16 2009 Richard Jones <rjones@redhat.com> - 0.9.9-12
437 - Multiple fixes to get it to scratch build in Koji.
439 * Sat Apr 4 2009 Richard Jones <rjones@redhat.com> - 0.9.9-1