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
49 Requires: qemu >= 0.10-7
53 Libguestfs is a library for accessing and modifying guest disk images.
54 Amongst the things this is good for: making batch configuration
55 changes to guests, getting disk used/free statistics (see also:
56 virt-df), migrating between virtualization systems (see also:
57 virt-p2v), performing partial backups, performing partial guest
58 clones, cloning guests and changing registry/UUID/hostname info, and
61 Libguestfs uses Linux kernel and qemu code, and can access any type of
62 guest filesystem that Linux and qemu can, including but not limited
63 to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition
64 schemes, qcow, qcow2, vmdk.
66 Libguestfs provides ways to enumerate guest storage (eg. partitions,
67 LVs, what filesystem is in each LV, etc.). It can also run commands
68 in the context of the guest. Also you can access filesystems over FTP.
70 Libguestfs is a library that can be linked with C and C++ management
73 See also the 'guestfish' package for shell scripting and command line
76 For Perl bindings, see 'perl-libguestfs'.
78 For OCaml bindings, see 'ocaml-libguestfs-devel'.
80 For Python bindings, see 'python-libguestfs'.
82 For Ruby bindings, see 'ruby-libguestfs'.
86 Summary: Development tools and libraries for %{name}
87 Group: Development/Libraries
88 Requires: %{name} = %{version}-%{release}
92 %{name}-devel contains development tools and libraries
97 Summary: Shell for accessing and modifying virtual machine disk images
98 Group: Development/Tools
100 Requires: %{name} = %{version}-%{release}
101 Requires: /usr/bin/pod2text
104 %description -n guestfish
105 Guestfish is the Filesystem Interactive SHell, for accessing and
106 modifying virtual machine disk images from the command line and shell
110 %package -n ocaml-%{name}
111 Summary: OCaml bindings for %{name}
112 Group: Development/Libraries
113 Requires: %{name} = %{version}-%{release}
116 %description -n ocaml-%{name}
117 ocaml-%{name} contains OCaml bindings for %{name}.
119 This is for toplevel and scripting access only. To compile OCaml
120 programs which use %{name} you will also need ocaml-%{name}-devel.
123 %package -n ocaml-%{name}-devel
124 Summary: OCaml bindings for %{name}
125 Group: Development/Libraries
126 Requires: ocaml-%{name} = %{version}-%{release}
129 %description -n ocaml-%{name}-devel
130 ocaml-%{name}-devel contains development libraries
131 required to use the OCaml bindings for %{name}.
134 %package -n perl-%{name}
135 Summary: Perl bindings for %{name}
136 Group: Development/Libraries
137 Requires: %{name} = %{version}-%{release}
138 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
141 %description -n perl-%{name}
142 perl-%{name} contains Perl bindings for %{name}.
145 %package -n python-%{name}
146 Summary: Python bindings for %{name}
147 Group: Development/Libraries
148 Requires: %{name} = %{version}-%{release}
150 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
151 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
153 %description -n python-%{name}
154 python-%{name} contains Python bindings for %{name}.
157 %package -n ruby-%{name}
158 Summary: Ruby bindings for %{name}
159 Group: Development/Libraries
160 Requires: %{name} = %{version}-%{release}
161 Requires: ruby(abi) = 1.8
162 Provides: ruby(guestfs) = %{version}
164 %{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
165 %{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
167 %description -n ruby-%{name}
168 ruby-%{name} contains Ruby bindings for %{name}.
179 cp $(find /var/cache/yum/build -name '*.rpm') .
182 %define extra --with-mirror=file://$(pwd)/repo --with-repo=fedora-12
187 ./configure --prefix=%{_prefix} --libdir=%{_libdir} %{extra}
189 # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
191 make INSTALLDIRS=vendor
195 test -n "$QUICK_RPMBUILD" || make check
199 rm -rf $RPM_BUILD_ROOT
201 make DESTDIR=$RPM_BUILD_ROOT install
203 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a
204 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la
206 # Clean up the examples/ directory which will get installed in %doc.
207 # Note we can't delete the original examples/Makefile because that
208 # will be needed by the check section later in the RPM build.
216 # Same for ocaml/examples.
217 cp -a ocaml/examples ocaml/ex
223 find $RPM_BUILD_ROOT -name perllocal.pod -delete
224 find $RPM_BUILD_ROOT -name .packlist -delete
225 find $RPM_BUILD_ROOT -name '*.bs' -delete
227 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.a
228 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.la
230 if [ "$RPM_BUILD_ROOT%{python_sitearch}" != "$RPM_BUILD_ROOT%{python_sitelib}" ]; then
231 mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
232 mv $RPM_BUILD_ROOT%{python_sitearch}/guestfs.py* \
233 $RPM_BUILD_ROOT%{python_sitelib}/
236 # Install ruby bindings by hand.
237 mkdir -p $RPM_BUILD_ROOT%{ruby_sitelib}
238 mkdir -p $RPM_BUILD_ROOT%{ruby_sitearch}
239 install -p -m0644 ruby/lib/guestfs.rb $RPM_BUILD_ROOT%{ruby_sitelib}
240 install -p -m0755 ruby/ext/guestfs/_guestfs.so $RPM_BUILD_ROOT%{ruby_sitearch}
242 # Generator shouldn't be executable when we distribute it.
243 chmod -x src/generator.ml
247 rm -rf $RPM_BUILD_ROOT
250 %post -p /sbin/ldconfig
252 %postun -p /sbin/ldconfig
256 %defattr(-,root,root,-)
259 %{_libdir}/libguestfs.so.*
263 %defattr(-,root,root,-)
264 %doc HACKING TODO README ex html/guestfs.3.html html/pod.css
265 %doc src/generator.ml
266 %{_libdir}/libguestfs.so
267 %{_mandir}/man3/guestfs.3*
268 %{_includedir}/guestfs.h
269 %{_includedir}/guestfs-actions.h
270 %{_includedir}/guestfs-structs.h
274 %defattr(-,root,root,-)
275 %doc html/guestfish.1.html html/pod.css
277 %{_mandir}/man1/guestfish.1*
280 %files -n ocaml-%{name}
281 %defattr(-,root,root,-)
283 %{_libdir}/ocaml/guestfs
284 %exclude %{_libdir}/ocaml/guestfs/*.a
285 %exclude %{_libdir}/ocaml/guestfs/*.cmxa
286 %exclude %{_libdir}/ocaml/guestfs/*.cmx
287 %exclude %{_libdir}/ocaml/guestfs/*.mli
288 %{_libdir}/ocaml/stublibs/*.so
289 %{_libdir}/ocaml/stublibs/*.so.owner
292 %files -n ocaml-%{name}-devel
293 %defattr(-,root,root,-)
295 %{_libdir}/ocaml/guestfs/*.a
296 %{_libdir}/ocaml/guestfs/*.cmxa
297 %{_libdir}/ocaml/guestfs/*.cmx
298 %{_libdir}/ocaml/guestfs/*.mli
301 %files -n perl-%{name}
302 %defattr(-,root,root,-)
305 %{_mandir}/man3/Sys::Guestfs.3pm*
308 %files -n python-%{name}
309 %defattr(-,root,root,-)
312 %{python_sitelib}/*.py
313 %{python_sitelib}/*.pyc
314 %{python_sitelib}/*.pyo
317 %files -n ruby-%{name}
318 %defattr(-,root,root,-)
320 %{ruby_sitelib}/guestfs.rb
321 %{ruby_sitearch}/_guestfs.so
325 * Mon Apr 20 2009 Richard Jones <rjones@redhat.com> - @VERSION@-1
326 - New upstream version @VERSION@.
328 * Mon Apr 20 2009 Richard Jones <rjones@redhat.com> - 1.0.2-1
329 - New upstream version 1.0.2.
331 * Thu Apr 16 2009 Richard Jones <rjones@redhat.com> - 0.9.9-12
332 - Multiple fixes to get it to scratch build in Koji.
334 * Sat Apr 4 2009 Richard Jones <rjones@redhat.com> - 0.9.9-1