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" \
237 # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
239 # Uses javac which is incompatible with parallel make.
240 make INSTALLDIRS=vendor
244 test -n "$QUICK_RPMBUILD" || make check
248 rm -rf $RPM_BUILD_ROOT
250 make DESTDIR=$RPM_BUILD_ROOT install
252 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a
253 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la
255 # Clean up the examples/ directory which will get installed in %doc.
256 # Note we can't delete the original examples/Makefile because that
257 # will be needed by the check section later in the RPM build.
265 # Same for ocaml/examples.
266 cp -a ocaml/examples ocaml/ex
272 find $RPM_BUILD_ROOT -name perllocal.pod -delete
273 find $RPM_BUILD_ROOT -name .packlist -delete
274 find $RPM_BUILD_ROOT -name '*.bs' -delete
276 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.a
277 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.la
279 if [ "$RPM_BUILD_ROOT%{python_sitearch}" != "$RPM_BUILD_ROOT%{python_sitelib}" ]; then
280 mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
281 mv $RPM_BUILD_ROOT%{python_sitearch}/guestfs.py* \
282 $RPM_BUILD_ROOT%{python_sitelib}/
285 # Install ruby bindings by hand.
286 mkdir -p $RPM_BUILD_ROOT%{ruby_sitelib}
287 mkdir -p $RPM_BUILD_ROOT%{ruby_sitearch}
288 install -p -m0644 ruby/lib/guestfs.rb $RPM_BUILD_ROOT%{ruby_sitelib}
289 install -p -m0755 ruby/ext/guestfs/_guestfs.so $RPM_BUILD_ROOT%{ruby_sitearch}
291 # Remove static-linked Java bindings.
292 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.a
293 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.la
295 # Generator shouldn't be executable when we distribute it.
296 chmod -x src/generator.ml
300 rm -rf $RPM_BUILD_ROOT
303 %post -p /sbin/ldconfig
305 %postun -p /sbin/ldconfig
309 %defattr(-,root,root,-)
312 %{_libdir}/libguestfs.so.*
316 %defattr(-,root,root,-)
317 %doc HACKING TODO README ex html/guestfs.3.html html/pod.css
318 %doc src/generator.ml
319 %{_libdir}/libguestfs.so
320 %{_mandir}/man3/guestfs.3*
321 %{_includedir}/guestfs.h
322 %{_includedir}/guestfs-actions.h
323 %{_includedir}/guestfs-structs.h
324 %{_libdir}/pkgconfig/libguestfs.pc
328 %defattr(-,root,root,-)
329 %doc html/guestfish.1.html html/pod.css
331 %{_mandir}/man1/guestfish.1*
334 %files -n ocaml-%{name}
335 %defattr(-,root,root,-)
337 %{_libdir}/ocaml/guestfs
338 %exclude %{_libdir}/ocaml/guestfs/*.a
339 %exclude %{_libdir}/ocaml/guestfs/*.cmxa
340 %exclude %{_libdir}/ocaml/guestfs/*.cmx
341 %exclude %{_libdir}/ocaml/guestfs/*.mli
342 %{_libdir}/ocaml/stublibs/*.so
343 %{_libdir}/ocaml/stublibs/*.so.owner
346 %files -n ocaml-%{name}-devel
347 %defattr(-,root,root,-)
349 %{_libdir}/ocaml/guestfs/*.a
350 %{_libdir}/ocaml/guestfs/*.cmxa
351 %{_libdir}/ocaml/guestfs/*.cmx
352 %{_libdir}/ocaml/guestfs/*.mli
355 %files -n perl-%{name}
356 %defattr(-,root,root,-)
359 %{_mandir}/man3/Sys::Guestfs.3pm*
362 %files -n python-%{name}
363 %defattr(-,root,root,-)
366 %{python_sitelib}/*.py
367 %{python_sitelib}/*.pyc
368 %{python_sitelib}/*.pyo
371 %files -n ruby-%{name}
372 %defattr(-,root,root,-)
374 %{ruby_sitelib}/guestfs.rb
375 %{ruby_sitearch}/_guestfs.so
379 %defattr(-,root,root,-)
381 %{_libdir}/libguestfs_jni*.so.*
382 %{_datadir}/java/*.jar
386 %defattr(-,root,root,-)
388 %{_libdir}/libguestfs_jni*.so
392 %defattr(-,root,root,-)
394 %{_datadir}/javadoc/%{name}-java-%{version}
398 * Wed Apr 22 2009 Richard Jones <rjones@redhat.com> - @VERSION@-1
399 - New upstream version @VERSION@.
401 * Wed Apr 22 2009 Richard Jones <rjones@redhat.com> - 1.0.6-1
402 - New upstream version 1.0.6.
404 * Mon Apr 20 2009 Richard Jones <rjones@redhat.com> - 1.0.2-1
405 - New upstream version 1.0.2.
407 * Thu Apr 16 2009 Richard Jones <rjones@redhat.com> - 0.9.9-12
408 - Multiple fixes to get it to scratch build in Koji.
410 * Sat Apr 4 2009 Richard Jones <rjones@redhat.com> - 0.9.9-1