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 # Basic build requirements:
17 BuildRequires: /usr/bin/pod2man
18 BuildRequires: /usr/bin/pod2text
19 BuildRequires: febootstrap >= 1.5
20 BuildRequires: augeas-devel >= 0.5.0
21 BuildRequires: readline-devel
22 BuildRequires: qemu >= 0.10-7
23 BuildRequires: createrepo
25 # Build requirements for the appliance:
26 # (see 'make-initramfs.sh.in' in the source)
27 BuildRequires: kernel, bash, coreutils, lvm2, ntfs-3g, util-linux-ng
28 BuildRequires: MAKEDEV, net-tools, augeas-libs, file
29 BuildRequires: module-init-tools, procps, strace, iputils
31 # These are only required if you want to build the bindings for
32 # different languages:
34 BuildRequires: ocaml-findlib-devel
35 BuildRequires: perl-devel
36 BuildRequires: perl-Test-Simple
37 BuildRequires: perl-Test-Pod
38 BuildRequires: perl-Test-Pod-Coverage
39 BuildRequires: perl-ExtUtils-MakeMaker
40 BuildRequires: python-devel
41 BuildRequires: ruby-devel
42 BuildRequires: rubygem-rake
45 Requires: qemu >= 0.10-7
49 Libguestfs is a library for accessing and modifying guest disk images.
50 Amongst the things this is good for: making batch configuration
51 changes to guests, getting disk used/free statistics (see also:
52 virt-df), migrating between virtualization systems (see also:
53 virt-p2v), performing partial backups, performing partial guest
54 clones, cloning guests and changing registry/UUID/hostname info, and
57 Libguestfs uses Linux kernel and qemu code, and can access any type of
58 guest filesystem that Linux and qemu can, including but not limited
59 to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition
60 schemes, qcow, qcow2, vmdk.
62 Libguestfs provides ways to enumerate guest storage (eg. partitions,
63 LVs, what filesystem is in each LV, etc.). It can also run commands
64 in the context of the guest. Also you can access filesystems over FTP.
66 Libguestfs is a library that can be linked with C and C++ management
69 See also the 'guestfish' package for shell scripting and command line
72 For Perl bindings, see 'perl-libguestfs'.
74 For OCaml bindings, see 'ocaml-libguestfs-devel'.
76 For Python bindings, see 'python-libguestfs'.
78 For Ruby bindings, see 'ruby-libguestfs'.
82 Summary: Development tools and libraries for %{name}
83 Group: Development/Libraries
84 Requires: %{name} = %{version}-%{release}
88 %{name}-devel contains development tools and libraries
93 Summary: Shell for accessing and modifying virtual machine disk images
94 Group: Development/Tools
96 Requires: %{name} = %{version}-%{release}
97 Requires: /usr/bin/pod2text
100 %description -n guestfish
101 Guestfish is the Filesystem Interactive SHell, for accessing and
102 modifying virtual machine disk images from the command line and shell
106 %package -n ocaml-%{name}
107 Summary: OCaml bindings for %{name}
108 Group: Development/Libraries
109 Requires: %{name} = %{version}-%{release}
112 %description -n ocaml-%{name}
113 ocaml-%{name} contains OCaml bindings for %{name}.
115 This is for toplevel and scripting access only. To compile OCaml
116 programs which use %{name} you will also need ocaml-%{name}-devel.
119 %package -n ocaml-%{name}-devel
120 Summary: OCaml bindings for %{name}
121 Group: Development/Libraries
122 Requires: ocaml-%{name} = %{version}-%{release}
125 %description -n ocaml-%{name}-devel
126 ocaml-%{name}-devel contains development libraries
127 required to use the OCaml bindings for %{name}.
130 %package -n perl-%{name}
131 Summary: Perl bindings for %{name}
132 Group: Development/Libraries
133 Requires: %{name} = %{version}-%{release}
134 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
137 %description -n perl-%{name}
138 perl-%{name} contains Perl bindings for %{name}.
141 %package -n python-%{name}
142 Summary: Python bindings for %{name}
143 Group: Development/Libraries
144 Requires: %{name} = %{version}-%{release}
146 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
147 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
149 %description -n python-%{name}
150 python-%{name} contains Python bindings for %{name}.
153 %package -n ruby-%{name}
154 Summary: Ruby bindings for %{name}
155 Group: Development/Libraries
156 Requires: %{name} = %{version}-%{release}
157 Requires: ruby(abi) = 1.8
158 Provides: ruby(guestfs) = %{version}
160 %{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
161 %{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
163 %description -n ruby-%{name}
164 ruby-%{name} contains Ruby bindings for %{name}.
175 cp $(find /var/cache/yum/build -name '*.rpm') .
178 %define extra --with-mirror=file://$(pwd)/repo --with-repo=fedora-12
183 ./configure --prefix=%{_prefix} --libdir=%{_libdir} %{extra}
185 # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
187 make INSTALLDIRS=vendor
191 test -n "$QUICK_RPMBUILD" || make check
195 rm -rf $RPM_BUILD_ROOT
197 make DESTDIR=$RPM_BUILD_ROOT install
199 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a
200 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la
202 # Clean up the examples/ directory which will get installed in %doc.
203 # Note we can't delete the original examples/Makefile because that
204 # will be needed by the check section later in the RPM build.
212 # Same for ocaml/examples.
213 cp -a ocaml/examples ocaml/ex
219 find $RPM_BUILD_ROOT -name perllocal.pod -delete
220 find $RPM_BUILD_ROOT -name .packlist -delete
221 find $RPM_BUILD_ROOT -name '*.bs' -delete
223 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.a
224 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.la
226 if [ "$RPM_BUILD_ROOT%{python_sitearch}" != "$RPM_BUILD_ROOT%{python_sitelib}" ]; then
227 mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
228 mv $RPM_BUILD_ROOT%{python_sitearch}/guestfs.py* \
229 $RPM_BUILD_ROOT%{python_sitelib}/
232 # Install ruby bindings by hand.
233 mkdir -p $RPM_BUILD_ROOT%{ruby_sitelib}
234 mkdir -p $RPM_BUILD_ROOT%{ruby_sitearch}
235 install -p -m0644 ruby/lib/guestfs.rb $RPM_BUILD_ROOT%{ruby_sitelib}
236 install -p -m0755 ruby/ext/guestfs/_guestfs.so $RPM_BUILD_ROOT%{ruby_sitearch}
238 # Generator shouldn't be executable when we distribute it.
239 chmod -x src/generator.ml
243 rm -rf $RPM_BUILD_ROOT
246 %post -p /sbin/ldconfig
248 %postun -p /sbin/ldconfig
252 %defattr(-,root,root,-)
255 %{_libdir}/libguestfs.so.*
259 %defattr(-,root,root,-)
260 %doc HACKING TODO README ex html/guestfs.3.html html/pod.css
261 %doc src/generator.ml
262 %{_libdir}/libguestfs.so
263 %{_mandir}/man3/guestfs.3*
264 %{_includedir}/guestfs.h
265 %{_includedir}/guestfs-actions.h
266 %{_includedir}/guestfs-structs.h
270 %defattr(-,root,root,-)
271 %doc html/guestfish.1.html html/pod.css
273 %{_mandir}/man1/guestfish.1*
276 %files -n ocaml-%{name}
277 %defattr(-,root,root,-)
279 %{_libdir}/ocaml/guestfs
280 %exclude %{_libdir}/ocaml/guestfs/*.a
281 %exclude %{_libdir}/ocaml/guestfs/*.cmxa
282 %exclude %{_libdir}/ocaml/guestfs/*.cmx
283 %exclude %{_libdir}/ocaml/guestfs/*.mli
284 %{_libdir}/ocaml/stublibs/*.so
285 %{_libdir}/ocaml/stublibs/*.so.owner
288 %files -n ocaml-%{name}-devel
289 %defattr(-,root,root,-)
291 %{_libdir}/ocaml/guestfs/*.a
292 %{_libdir}/ocaml/guestfs/*.cmxa
293 %{_libdir}/ocaml/guestfs/*.cmx
294 %{_libdir}/ocaml/guestfs/*.mli
297 %files -n perl-%{name}
298 %defattr(-,root,root,-)
301 %{_mandir}/man3/Sys::Guestfs.3pm*
304 %files -n python-%{name}
305 %defattr(-,root,root,-)
308 %{python_sitelib}/*.py
309 %{python_sitelib}/*.pyc
310 %{python_sitelib}/*.pyo
313 %files -n ruby-%{name}
314 %defattr(-,root,root,-)
316 %{ruby_sitelib}/guestfs.rb
317 %{ruby_sitearch}/_guestfs.so
321 * Mon Apr 20 2009 Richard Jones <rjones@redhat.com> - @VERSION@-1
322 - New upstream version @VERSION@.
324 * Mon Apr 20 2009 Richard Jones <rjones@redhat.com> - 1.0.2-1
325 - New upstream version 1.0.2.
327 * Thu Apr 16 2009 Richard Jones <rjones@redhat.com> - 0.9.9-12
328 - Multiple fixes to get it to scratch build in Koji.
330 * Sat Apr 4 2009 Richard Jones <rjones@redhat.com> - 0.9.9-1