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}
97 %{name}-devel contains development tools and libraries
101 %package -n guestfish
102 Summary: Shell for accessing and modifying virtual machine disk images
103 Group: Development/Tools
105 Requires: %{name} = %{version}-%{release}
106 Requires: /usr/bin/pod2text
109 %description -n guestfish
110 Guestfish is the Filesystem Interactive SHell, for accessing and
111 modifying virtual machine disk images from the command line and shell
115 %package -n ocaml-%{name}
116 Summary: OCaml bindings for %{name}
117 Group: Development/Libraries
118 Requires: %{name} = %{version}-%{release}
121 %description -n ocaml-%{name}
122 ocaml-%{name} contains OCaml bindings for %{name}.
124 This is for toplevel and scripting access only. To compile OCaml
125 programs which use %{name} you will also need ocaml-%{name}-devel.
128 %package -n ocaml-%{name}-devel
129 Summary: OCaml bindings for %{name}
130 Group: Development/Libraries
131 Requires: ocaml-%{name} = %{version}-%{release}
134 %description -n ocaml-%{name}-devel
135 ocaml-%{name}-devel contains development libraries
136 required to use the OCaml bindings for %{name}.
139 %package -n perl-%{name}
140 Summary: Perl bindings for %{name}
141 Group: Development/Libraries
142 Requires: %{name} = %{version}-%{release}
143 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
146 %description -n perl-%{name}
147 perl-%{name} contains Perl bindings for %{name}.
150 %package -n python-%{name}
151 Summary: Python bindings for %{name}
152 Group: Development/Libraries
153 Requires: %{name} = %{version}-%{release}
155 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
156 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
158 %description -n python-%{name}
159 python-%{name} contains Python bindings for %{name}.
162 %package -n ruby-%{name}
163 Summary: Ruby bindings for %{name}
164 Group: Development/Libraries
165 Requires: %{name} = %{version}-%{release}
166 Requires: ruby(abi) = 1.8
167 Provides: ruby(guestfs) = %{version}
169 %{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
170 %{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
172 %description -n ruby-%{name}
173 ruby-%{name} contains Ruby bindings for %{name}.
177 Summary: Java bindings for %{name}
178 Group: Development/Libraries
179 Requires: %{name} = %{version}-%{release}
180 Requires: java >= 1.5.0
181 Requires: jpackage-utils
184 %{name}-java contains Java bindings for %{name}.
186 If you want to develop software in Java which uses %{name}, then
187 you will also need %{name}-java-devel.
191 Summary: Java development package for %{name}
192 Group: Development/Libraries
193 Requires: %{name} = %{version}-%{release}
194 Requires: %{name}-java = %{version}-%{release}
196 %description java-devel
197 %{name}-java-devel contains the tools for developing Java software
200 See also %{name}-javadoc.
204 Summary: Java documentation for %{name}
205 Group: Development/Libraries
206 Requires: %{name} = %{version}-%{release}
207 Requires: %{name}-java = %{version}-%{release}
208 Requires: jpackage-utils
211 %{name}-javadoc contains the Java documentation for %{name}.
222 cp $(find /var/cache/yum/build -name '*.rpm') .
225 %define extra --with-mirror=file://$(pwd)/repo --with-repo=fedora-12
231 --prefix=%{_prefix} --libdir=%{_libdir} \
232 --with-java-home=%{java_home} \
235 # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
237 # Uses javac which is incompatible with parallel make.
238 make INSTALLDIRS=vendor
242 test -n "$QUICK_RPMBUILD" || make check
246 rm -rf $RPM_BUILD_ROOT
248 make DESTDIR=$RPM_BUILD_ROOT install
250 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a
251 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la
253 # Clean up the examples/ directory which will get installed in %doc.
254 # Note we can't delete the original examples/Makefile because that
255 # will be needed by the check section later in the RPM build.
263 # Same for ocaml/examples.
264 cp -a ocaml/examples ocaml/ex
270 find $RPM_BUILD_ROOT -name perllocal.pod -delete
271 find $RPM_BUILD_ROOT -name .packlist -delete
272 find $RPM_BUILD_ROOT -name '*.bs' -delete
274 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.a
275 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.la
277 if [ "$RPM_BUILD_ROOT%{python_sitearch}" != "$RPM_BUILD_ROOT%{python_sitelib}" ]; then
278 mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
279 mv $RPM_BUILD_ROOT%{python_sitearch}/guestfs.py* \
280 $RPM_BUILD_ROOT%{python_sitelib}/
283 # Install ruby bindings by hand.
284 mkdir -p $RPM_BUILD_ROOT%{ruby_sitelib}
285 mkdir -p $RPM_BUILD_ROOT%{ruby_sitearch}
286 install -p -m0644 ruby/lib/guestfs.rb $RPM_BUILD_ROOT%{ruby_sitelib}
287 install -p -m0755 ruby/ext/guestfs/_guestfs.so $RPM_BUILD_ROOT%{ruby_sitearch}
289 # Generator shouldn't be executable when we distribute it.
290 chmod -x src/generator.ml
294 rm -rf $RPM_BUILD_ROOT
297 %post -p /sbin/ldconfig
299 %postun -p /sbin/ldconfig
303 %defattr(-,root,root,-)
306 %{_libdir}/libguestfs.so.*
310 %defattr(-,root,root,-)
311 %doc HACKING TODO README ex html/guestfs.3.html html/pod.css
312 %doc src/generator.ml
313 %{_libdir}/libguestfs.so
314 %{_mandir}/man3/guestfs.3*
315 %{_includedir}/guestfs.h
316 %{_includedir}/guestfs-actions.h
317 %{_includedir}/guestfs-structs.h
321 %defattr(-,root,root,-)
322 %doc html/guestfish.1.html html/pod.css
324 %{_mandir}/man1/guestfish.1*
327 %files -n ocaml-%{name}
328 %defattr(-,root,root,-)
330 %{_libdir}/ocaml/guestfs
331 %exclude %{_libdir}/ocaml/guestfs/*.a
332 %exclude %{_libdir}/ocaml/guestfs/*.cmxa
333 %exclude %{_libdir}/ocaml/guestfs/*.cmx
334 %exclude %{_libdir}/ocaml/guestfs/*.mli
335 %{_libdir}/ocaml/stublibs/*.so
336 %{_libdir}/ocaml/stublibs/*.so.owner
339 %files -n ocaml-%{name}-devel
340 %defattr(-,root,root,-)
342 %{_libdir}/ocaml/guestfs/*.a
343 %{_libdir}/ocaml/guestfs/*.cmxa
344 %{_libdir}/ocaml/guestfs/*.cmx
345 %{_libdir}/ocaml/guestfs/*.mli
348 %files -n perl-%{name}
349 %defattr(-,root,root,-)
352 %{_mandir}/man3/Sys::Guestfs.3pm*
355 %files -n python-%{name}
356 %defattr(-,root,root,-)
359 %{python_sitelib}/*.py
360 %{python_sitelib}/*.pyc
361 %{python_sitelib}/*.pyo
364 %files -n ruby-%{name}
365 %defattr(-,root,root,-)
367 %{ruby_sitelib}/guestfs.rb
368 %{ruby_sitearch}/_guestfs.so
372 %defattr(-,root,root,-)
374 %{_libdir}/libguestfs_jni*.so.*
375 %{_datadir}/java/*.jar
379 %defattr(-,root,root,-)
381 %{_libdir}/libguestfs_jni*.so
385 %defattr(-,root,root,-)
387 /usr/share/javadoc/%{name}-java-%{version}
391 * Mon Apr 20 2009 Richard Jones <rjones@redhat.com> - @VERSION@-1
392 - New upstream version @VERSION@.
394 * Mon Apr 20 2009 Richard Jones <rjones@redhat.com> - 1.0.2-1
395 - New upstream version 1.0.2.
397 * Thu Apr 16 2009 Richard Jones <rjones@redhat.com> - 0.9.9-12
398 - Multiple fixes to get it to scratch build in Koji.
400 * Sat Apr 4 2009 Richard Jones <rjones@redhat.com> - 0.9.9-1