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 Requires: qemu >= 0.10-7
56 Libguestfs is a library for accessing and modifying guest disk images.
57 Amongst the things this is good for: making batch configuration
58 changes to guests, getting disk used/free statistics (see also:
59 virt-df), migrating between virtualization systems (see also:
60 virt-p2v), performing partial backups, performing partial guest
61 clones, cloning guests and changing registry/UUID/hostname info, and
64 Libguestfs uses Linux kernel and qemu code, and can access any type of
65 guest filesystem that Linux and qemu can, including but not limited
66 to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition
67 schemes, qcow, qcow2, vmdk.
69 Libguestfs provides ways to enumerate guest storage (eg. partitions,
70 LVs, what filesystem is in each LV, etc.). It can also run commands
71 in the context of the guest. Also you can access filesystems over FTP.
73 Libguestfs is a library that can be linked with C and C++ management
76 See also the 'guestfish' package for shell scripting and command line
79 For Perl bindings, see 'perl-libguestfs'.
81 For OCaml bindings, see 'ocaml-libguestfs-devel'.
83 For Python bindings, see 'python-libguestfs'.
85 For Ruby bindings, see 'ruby-libguestfs'.
87 For Java bindings, see 'libguestfs-java-devel'.
91 Summary: Development tools and libraries for %{name}
92 Group: Development/Libraries
93 Requires: %{name} = %{version}-%{release}
98 %{name}-devel contains development tools and libraries
102 %package -n guestfish
103 Summary: Shell for accessing and modifying virtual machine disk images
104 Group: Development/Tools
106 Requires: %{name} = %{version}-%{release}
107 Requires: /usr/bin/pod2text
110 %description -n guestfish
111 Guestfish is the Filesystem Interactive SHell, for accessing and
112 modifying virtual machine disk images from the command line and shell
116 %package -n ocaml-%{name}
117 Summary: OCaml bindings for %{name}
118 Group: Development/Libraries
119 Requires: %{name} = %{version}-%{release}
122 %description -n ocaml-%{name}
123 ocaml-%{name} contains OCaml bindings for %{name}.
125 This is for toplevel and scripting access only. To compile OCaml
126 programs which use %{name} you will also need ocaml-%{name}-devel.
129 %package -n ocaml-%{name}-devel
130 Summary: OCaml bindings for %{name}
131 Group: Development/Libraries
132 Requires: ocaml-%{name} = %{version}-%{release}
135 %description -n ocaml-%{name}-devel
136 ocaml-%{name}-devel contains development libraries
137 required to use the OCaml bindings for %{name}.
140 %package -n perl-%{name}
141 Summary: Perl bindings for %{name}
142 Group: Development/Libraries
143 Requires: %{name} = %{version}-%{release}
144 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
147 %description -n perl-%{name}
148 perl-%{name} contains Perl bindings for %{name}.
151 %package -n python-%{name}
152 Summary: Python bindings for %{name}
153 Group: Development/Libraries
154 Requires: %{name} = %{version}-%{release}
156 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
157 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
159 %description -n python-%{name}
160 python-%{name} contains Python bindings for %{name}.
163 %package -n ruby-%{name}
164 Summary: Ruby bindings for %{name}
165 Group: Development/Libraries
166 Requires: %{name} = %{version}-%{release}
167 Requires: ruby(abi) = 1.8
168 Provides: ruby(guestfs) = %{version}
170 %{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
171 %{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
173 %description -n ruby-%{name}
174 ruby-%{name} contains Ruby bindings for %{name}.
178 Summary: Java bindings for %{name}
179 Group: Development/Libraries
180 Requires: %{name} = %{version}-%{release}
181 Requires: java >= 1.5.0
182 Requires: jpackage-utils
185 %{name}-java contains Java bindings for %{name}.
187 If you want to develop software in Java which uses %{name}, then
188 you will also need %{name}-java-devel.
192 Summary: Java development package for %{name}
193 Group: Development/Libraries
194 Requires: %{name} = %{version}-%{release}
195 Requires: %{name}-java = %{version}-%{release}
197 %description java-devel
198 %{name}-java-devel contains the tools for developing Java software
201 See also %{name}-javadoc.
205 Summary: Java documentation for %{name}
206 Group: Development/Libraries
207 Requires: %{name} = %{version}-%{release}
208 Requires: %{name}-java = %{version}-%{release}
209 Requires: jpackage-utils
212 %{name}-javadoc contains the Java documentation for %{name}.
223 cp $(find /var/cache/yum/build -name '*.rpm') .
226 %define extra --with-mirror=file://$(pwd)/repo --with-repo=fedora-12
232 --prefix=%{_prefix} --libdir=%{_libdir} \
233 --with-java-home=%{java_home} \
234 --with-qemu="qemu-kvm qemu-system-%{_build_arch} qemu" \
235 --enable-debug-command \
238 # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
240 # Uses javac which is incompatible with parallel make.
241 make INSTALLDIRS=vendor
245 test -n "$QUICK_RPMBUILD" || make check
249 rm -rf $RPM_BUILD_ROOT
251 make DESTDIR=$RPM_BUILD_ROOT install
253 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a
254 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la
256 # Clean up the examples/ directory which will get installed in %doc.
257 # Note we can't delete the original examples/Makefile because that
258 # will be needed by the check section later in the RPM build.
266 # Same for ocaml/examples.
267 cp -a ocaml/examples ocaml/ex
273 find $RPM_BUILD_ROOT -name perllocal.pod -delete
274 find $RPM_BUILD_ROOT -name .packlist -delete
275 find $RPM_BUILD_ROOT -name '*.bs' -delete
277 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.a
278 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.la
280 if [ "$RPM_BUILD_ROOT%{python_sitearch}" != "$RPM_BUILD_ROOT%{python_sitelib}" ]; then
281 mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
282 mv $RPM_BUILD_ROOT%{python_sitearch}/guestfs.py* \
283 $RPM_BUILD_ROOT%{python_sitelib}/
286 # Install ruby bindings by hand.
287 mkdir -p $RPM_BUILD_ROOT%{ruby_sitelib}
288 mkdir -p $RPM_BUILD_ROOT%{ruby_sitearch}
289 install -p -m0644 ruby/lib/guestfs.rb $RPM_BUILD_ROOT%{ruby_sitelib}
290 install -p -m0755 ruby/ext/guestfs/_guestfs.so $RPM_BUILD_ROOT%{ruby_sitearch}
292 # Remove static-linked Java bindings.
293 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.a
294 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.la
296 # Generator shouldn't be executable when we distribute it.
297 chmod -x src/generator.ml
301 rm -rf $RPM_BUILD_ROOT
304 %post -p /sbin/ldconfig
306 %postun -p /sbin/ldconfig
310 %defattr(-,root,root,-)
313 %{_libdir}/libguestfs.so.*
317 %defattr(-,root,root,-)
318 %doc ChangeLog HACKING TODO README ex html/guestfs.3.html html/pod.css
319 %doc src/generator.ml
320 %{_libdir}/libguestfs.so
321 %{_mandir}/man3/guestfs.3*
322 %{_includedir}/guestfs.h
323 %{_includedir}/guestfs-actions.h
324 %{_includedir}/guestfs-structs.h
325 %{_libdir}/pkgconfig/libguestfs.pc
329 %defattr(-,root,root,-)
330 %doc html/guestfish.1.html html/pod.css
332 %{_mandir}/man1/guestfish.1*
335 %files -n ocaml-%{name}
336 %defattr(-,root,root,-)
338 %{_libdir}/ocaml/guestfs
339 %exclude %{_libdir}/ocaml/guestfs/*.a
340 %exclude %{_libdir}/ocaml/guestfs/*.cmxa
341 %exclude %{_libdir}/ocaml/guestfs/*.cmx
342 %exclude %{_libdir}/ocaml/guestfs/*.mli
343 %{_libdir}/ocaml/stublibs/*.so
344 %{_libdir}/ocaml/stublibs/*.so.owner
347 %files -n ocaml-%{name}-devel
348 %defattr(-,root,root,-)
350 %{_libdir}/ocaml/guestfs/*.a
351 %{_libdir}/ocaml/guestfs/*.cmxa
352 %{_libdir}/ocaml/guestfs/*.cmx
353 %{_libdir}/ocaml/guestfs/*.mli
356 %files -n perl-%{name}
357 %defattr(-,root,root,-)
360 %{_mandir}/man3/Sys::Guestfs.3pm*
363 %files -n python-%{name}
364 %defattr(-,root,root,-)
367 %{python_sitelib}/*.py
368 %{python_sitelib}/*.pyc
369 %{python_sitelib}/*.pyo
372 %files -n ruby-%{name}
373 %defattr(-,root,root,-)
375 %{ruby_sitelib}/guestfs.rb
376 %{ruby_sitearch}/_guestfs.so
380 %defattr(-,root,root,-)
382 %{_libdir}/libguestfs_jni*.so.*
383 %{_datadir}/java/*.jar
387 %defattr(-,root,root,-)
389 %{_libdir}/libguestfs_jni*.so
393 %defattr(-,root,root,-)
395 %{_datadir}/javadoc/%{name}-java-%{version}
399 * Wed Apr 22 2009 Richard Jones <rjones@redhat.com> - @VERSION@-1
400 - New upstream version @VERSION@.
402 * Wed Apr 22 2009 Richard Jones <rjones@redhat.com> - 1.0.6-1
403 - New upstream version 1.0.6.
405 * Mon Apr 20 2009 Richard Jones <rjones@redhat.com> - 1.0.2-1
406 - New upstream version 1.0.2.
408 * Thu Apr 16 2009 Richard Jones <rjones@redhat.com> - 0.9.9-12
409 - Multiple fixes to get it to scratch build in Koji.
411 * Sat Apr 4 2009 Richard Jones <rjones@redhat.com> - 0.9.9-1