1 # libguestfs.spec. Generated from libguestfs.spec.in by configure.
3 Summary: Access and modify virtual machine disk images
8 Group: Development/Libraries
9 URL: http://et.redhat.com/~rjones/libguestfs/
10 Source0: http://et.redhat.com/~rjones/libguestfs/files/%{name}-%{version}.tar.gz
11 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
13 # Currently fails on non-x86 because of this error:
14 # "qemu: linux kernel too old to load a ram disk"
15 ExclusiveArch: %{ix86} x86_64
17 # Basic build requirements:
18 BuildRequires: /usr/bin/pod2man
19 BuildRequires: /usr/bin/pod2text
20 BuildRequires: febootstrap >= 1.9
21 BuildRequires: fakechroot >= 2.9-20
22 BuildRequires: fakeroot >= 1.12.2-21
23 BuildRequires: readline-devel
24 BuildRequires: createrepo
26 # This is only needed for RHEL 5 because readline-devel doesn't
27 # properly depend on it, but doesn't do any harm on other platforms:
28 BuildRequires: ncurses-devel
30 # These are only required if you want to build the bindings for
31 # different languages:
33 BuildRequires: ocaml-findlib-devel
34 BuildRequires: perl-Test-Pod
35 BuildRequires: perl-Test-Pod-Coverage
36 BuildRequires: python-devel
37 BuildRequires: ruby-devel
38 BuildRequires: rubygem-rake
39 BuildRequires: java >= 1.5.0
40 BuildRequires: jpackage-utils
41 BuildRequires: java-devel
45 Libguestfs is a library for accessing and modifying guest disk images.
46 Amongst the things this is good for: making batch configuration
47 changes to guests, getting disk used/free statistics (see also:
48 virt-df), migrating between virtualization systems (see also:
49 virt-p2v), performing partial backups, performing partial guest
50 clones, cloning guests and changing registry/UUID/hostname info, and
53 Libguestfs uses Linux kernel and qemu code, and can access any type of
54 guest filesystem that Linux and qemu can, including but not limited
55 to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition
56 schemes, qcow, qcow2, vmdk.
58 Libguestfs provides ways to enumerate guest storage (eg. partitions,
59 LVs, what filesystem is in each LV, etc.). It can also run commands
60 in the context of the guest. Also you can access filesystems over FTP.
62 Libguestfs is a library that can be linked with C and C++ management
65 See also the 'guestfish' package for shell scripting and command line
68 For Perl bindings, see 'perl-libguestfs'.
70 For OCaml bindings, see 'ocaml-libguestfs-devel'.
72 For Python bindings, see 'python-libguestfs'.
74 For Ruby bindings, see 'ruby-libguestfs'.
76 For Java bindings, see 'libguestfs-java-devel'.
80 Summary: Development tools and libraries for %{name}
81 Group: Development/Libraries
82 Requires: %{name} = %{version}-%{release}
87 %{name}-devel contains development tools and libraries
92 Summary: Shell for accessing and modifying virtual machine disk images
93 Group: Development/Tools
95 Requires: %{name} = %{version}-%{release}
96 Requires: /usr/bin/pod2text
99 %description -n guestfish
100 Guestfish is the Filesystem Interactive SHell, for accessing and
101 modifying virtual machine disk images from the command line and shell
105 # virt-inspector cannot yet be built on RHEL 5 because
106 # we need perl-Sys-Virt.
107 #%package -n virt-inspector
108 #Summary: Display OS version, kernel, drivers, etc in a virtual machine
109 #Group: Development/Tools
111 #Requires: %{name} = %{version}-%{release}
113 #Requires: perl-Sys-Virt
116 #%description -n virt-inspector
117 #Virt-inspector examines a virtual machine and tries to determine the
118 #version of the OS, the kernel version, what drivers are installed,
119 #whether the virtual machine is fully virtualized (FV) or
120 #para-virtualized (PV), what applications are installed and more.
123 %package -n ocaml-%{name}
124 Summary: OCaml bindings for %{name}
125 Group: Development/Libraries
126 Requires: %{name} = %{version}-%{release}
129 %description -n ocaml-%{name}
130 ocaml-%{name} contains OCaml bindings for %{name}.
132 This is for toplevel and scripting access only. To compile OCaml
133 programs which use %{name} you will also need ocaml-%{name}-devel.
136 %package -n ocaml-%{name}-devel
137 Summary: OCaml bindings for %{name}
138 Group: Development/Libraries
139 Requires: ocaml-%{name} = %{version}-%{release}
142 %description -n ocaml-%{name}-devel
143 ocaml-%{name}-devel contains development libraries
144 required to use the OCaml bindings for %{name}.
147 %package -n perl-%{name}
148 Summary: Perl bindings for %{name}
149 Group: Development/Libraries
150 Requires: %{name} = %{version}-%{release}
151 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
154 %description -n perl-%{name}
155 perl-%{name} contains Perl bindings for %{name}.
158 %package -n python-%{name}
159 Summary: Python bindings for %{name}
160 Group: Development/Libraries
161 Requires: %{name} = %{version}-%{release}
163 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
164 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
166 %description -n python-%{name}
167 python-%{name} contains Python bindings for %{name}.
170 %package -n ruby-%{name}
171 Summary: Ruby bindings for %{name}
172 Group: Development/Libraries
173 Requires: %{name} = %{version}-%{release}
174 Requires: ruby(abi) = 1.8
175 Provides: ruby(guestfs) = %{version}
177 %{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
178 %{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
180 %description -n ruby-%{name}
181 ruby-%{name} contains Ruby bindings for %{name}.
185 Summary: Java bindings for %{name}
186 Group: Development/Libraries
187 Requires: %{name} = %{version}-%{release}
188 Requires: java >= 1.5.0
189 Requires: jpackage-utils
192 %{name}-java contains Java bindings for %{name}.
194 If you want to develop software in Java which uses %{name}, then
195 you will also need %{name}-java-devel.
199 Summary: Java development package for %{name}
200 Group: Development/Libraries
201 Requires: %{name} = %{version}-%{release}
202 Requires: %{name}-java = %{version}-%{release}
204 %description java-devel
205 %{name}-java-devel contains the tools for developing Java software
208 See also %{name}-javadoc.
212 Summary: Java documentation for %{name}
213 Group: Development/Libraries
214 Requires: %{name} = %{version}-%{release}
215 Requires: %{name}-java = %{version}-%{release}
216 Requires: jpackage-utils
219 %{name}-javadoc contains the Java documentation for %{name}.
231 --prefix=%{_prefix} --libdir=%{_libdir} \
232 --mandir=%{_mandir} \
233 --with-java-home=%{java_home} \
234 --with-qemu="qemu-kvm qemu-system-%{_build_arch} qemu" \
235 --with-repo=centos-5 \
236 --with-mirror=http://mirror.centos.org/centos-5/5.3/os/%{_arch}/ \
237 --with-updates=none \
238 --enable-debug-command
240 # This ensures that /usr/sbin/chroot is on the path. Not needed
241 # except for RHEL 5, it shouldn't do any harm on other platforms.
242 export PATH=/usr/sbin:$PATH
244 # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
246 make INSTALLDIRS=vendor %{?_smp_mflags}
250 # 'make check' won't work in RHEL 5 for well-understood reasons with
251 # the tests in some of the language bindings. However we can still
252 # test the C API, which is what this code does.
254 export LIBGUESTFS_QEMU=$HOME/qemu.wrapper
255 test -n "$QUICK_RPMBUILD" || ./tests
259 rm -rf $RPM_BUILD_ROOT
261 make DESTDIR=$RPM_BUILD_ROOT install
263 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a
264 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la
266 # Clean up the examples/ directory which will get installed in %doc.
267 # Note we can't delete the original examples/Makefile because that
268 # will be needed by the check section later in the RPM build.
276 # Same for ocaml/examples.
277 cp -a ocaml/examples ocaml/ex
283 find $RPM_BUILD_ROOT -name perllocal.pod -delete
284 find $RPM_BUILD_ROOT -name .packlist -delete
285 find $RPM_BUILD_ROOT -name '*.bs' -delete
287 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.a
288 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.la
290 if [ "$RPM_BUILD_ROOT%{python_sitearch}" != "$RPM_BUILD_ROOT%{python_sitelib}" ]; then
291 mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
292 mv $RPM_BUILD_ROOT%{python_sitearch}/guestfs.py* \
293 $RPM_BUILD_ROOT%{python_sitelib}/
296 # Install ruby bindings by hand.
297 mkdir -p $RPM_BUILD_ROOT%{ruby_sitelib}
298 mkdir -p $RPM_BUILD_ROOT%{ruby_sitearch}
299 install -p -m0644 ruby/lib/guestfs.rb $RPM_BUILD_ROOT%{ruby_sitelib}
300 install -p -m0755 ruby/ext/guestfs/_guestfs.so $RPM_BUILD_ROOT%{ruby_sitearch}
302 # Remove static-linked Java bindings.
303 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.a
304 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.la
306 # Generator shouldn't be executable when we distribute it.
307 chmod -x src/generator.ml
311 rm -rf $RPM_BUILD_ROOT
314 %post -p /sbin/ldconfig
316 %postun -p /sbin/ldconfig
320 %defattr(-,root,root,-)
323 %{_libdir}/libguestfs.so.*
327 %defattr(-,root,root,-)
328 %doc ChangeLog HACKING TODO README ex html/guestfs.3.html html/pod.css
329 %doc src/generator.ml
330 %{_libdir}/libguestfs.so
331 %{_mandir}/man3/guestfs.3*
332 %{_includedir}/guestfs.h
333 %{_includedir}/guestfs-actions.h
334 %{_includedir}/guestfs-structs.h
335 %{_libdir}/pkgconfig/libguestfs.pc
339 %defattr(-,root,root,-)
340 %doc html/guestfish.1.html html/pod.css recipes/
342 %{_mandir}/man1/guestfish.1*
345 #%files -n virt-inspector
346 #%defattr(-,root,root,-)
347 #%{_bindir}/virt-inspector
348 #%{_mandir}/man1/virt-inspector.1*
351 %files -n ocaml-%{name}
352 %defattr(-,root,root,-)
354 %{_libdir}/ocaml/guestfs
355 %exclude %{_libdir}/ocaml/guestfs/*.a
356 %exclude %{_libdir}/ocaml/guestfs/*.cmxa
357 %exclude %{_libdir}/ocaml/guestfs/*.cmx
358 %exclude %{_libdir}/ocaml/guestfs/*.mli
359 %{_libdir}/ocaml/stublibs/*.so
360 %{_libdir}/ocaml/stublibs/*.so.owner
363 %files -n ocaml-%{name}-devel
364 %defattr(-,root,root,-)
366 %{_libdir}/ocaml/guestfs/*.a
367 %{_libdir}/ocaml/guestfs/*.cmxa
368 %{_libdir}/ocaml/guestfs/*.cmx
369 %{_libdir}/ocaml/guestfs/*.mli
372 %files -n perl-%{name}
373 %defattr(-,root,root,-)
376 %{_mandir}/man3/Sys::Guestfs.3pm*
379 %files -n python-%{name}
380 %defattr(-,root,root,-)
383 %{python_sitelib}/*.py
384 #%{python_sitelib}/*.pyc
385 #%{python_sitelib}/*.pyo
388 %files -n ruby-%{name}
389 %defattr(-,root,root,-)
391 %{ruby_sitelib}/guestfs.rb
392 %{ruby_sitearch}/_guestfs.so
396 %defattr(-,root,root,-)
398 %{_libdir}/libguestfs_jni*.so.*
399 %{_datadir}/java/*.jar
403 %defattr(-,root,root,-)
405 %{_libdir}/libguestfs_jni*.so
409 %defattr(-,root,root,-)
411 %{_datadir}/javadoc/%{name}-java-%{version}
415 * Thu May 7 2009 Richard Jones <rjones@redhat.com> - 1.0.19-1
416 - New upstream version 1.0.19.
418 * Tue Apr 28 2009 Richard Jones <rjones@redhat.com> - 1.0.15-1
419 - New upstream version 1.0.15.
421 * Fri Apr 24 2009 Richard Jones <rjones@redhat.com> - 1.0.12-1
422 - New upstream version 1.0.12.
424 * Wed Apr 22 2009 Richard Jones <rjones@redhat.com> - 1.0.6-1
425 - New upstream version 1.0.6.
427 * Mon Apr 20 2009 Richard Jones <rjones@redhat.com> - 1.0.2-1
428 - New upstream version 1.0.2.
430 * Thu Apr 16 2009 Richard Jones <rjones@redhat.com> - 0.9.9-12
431 - Multiple fixes to get it to scratch build in Koji.
433 * Sat Apr 4 2009 Richard Jones <rjones@redhat.com> - 0.9.9-1