Remove the specfile from the tarball. Include contrib/ dir.
[libguestfs.git] / contrib / centos5.3-libguestfs.spec
1 # libguestfs.spec.  Generated from libguestfs.spec.in by configure.
2
3 Summary:     Access and modify virtual machine disk images
4 Name:        libguestfs
5 Version:     1.0.19
6 Release:     1%{?dist}
7 License:     LGPLv2+
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
12
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
16
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
25
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
29
30 # These are only required if you want to build the bindings for
31 # different languages:
32 BuildRequires: ocaml
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
42
43
44 %description
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
51 much else besides.
52
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.
57
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.
61
62 Libguestfs is a library that can be linked with C and C++ management
63 programs.
64
65 See also the 'guestfish' package for shell scripting and command line
66 access.
67
68 For Perl bindings, see 'perl-libguestfs'.
69
70 For OCaml bindings, see 'ocaml-libguestfs-devel'.
71
72 For Python bindings, see 'python-libguestfs'.
73
74 For Ruby bindings, see 'ruby-libguestfs'.
75
76 For Java bindings, see 'libguestfs-java-devel'.
77
78
79 %package devel
80 Summary:     Development tools and libraries for %{name}
81 Group:       Development/Libraries
82 Requires:    %{name} = %{version}-%{release}
83 Requires:    pkgconfig
84
85
86 %description devel
87 %{name}-devel contains development tools and libraries
88 for %{name}.
89
90
91 %package -n guestfish
92 Summary:     Shell for accessing and modifying virtual machine disk images
93 Group:       Development/Tools
94 License:     GPLv2+
95 Requires:    %{name} = %{version}-%{release}
96 Requires:    /usr/bin/pod2text
97
98
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
102 scripts.
103
104
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
110 #License:     GPLv2+
111 #Requires:    %{name} = %{version}-%{release}
112 #Requires:    guestfish
113 #Requires:    perl-Sys-Virt
114 #
115 #
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.
121
122
123 %package -n ocaml-%{name}
124 Summary:     OCaml bindings for %{name}
125 Group:       Development/Libraries
126 Requires:    %{name} = %{version}-%{release}
127
128
129 %description -n ocaml-%{name}
130 ocaml-%{name} contains OCaml bindings for %{name}.
131
132 This is for toplevel and scripting access only.  To compile OCaml
133 programs which use %{name} you will also need ocaml-%{name}-devel.
134
135
136 %package -n ocaml-%{name}-devel
137 Summary:     OCaml bindings for %{name}
138 Group:       Development/Libraries
139 Requires:    ocaml-%{name} = %{version}-%{release}
140
141
142 %description -n ocaml-%{name}-devel
143 ocaml-%{name}-devel contains development libraries
144 required to use the OCaml bindings for %{name}.
145
146
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))
152
153
154 %description -n perl-%{name}
155 perl-%{name} contains Perl bindings for %{name}.
156
157
158 %package -n python-%{name}
159 Summary:     Python bindings for %{name}
160 Group:       Development/Libraries
161 Requires:    %{name} = %{version}-%{release}
162
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)")}
165
166 %description -n python-%{name}
167 python-%{name} contains Python bindings for %{name}.
168
169
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}
176
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']")}
179
180 %description -n ruby-%{name}
181 ruby-%{name} contains Ruby bindings for %{name}.
182
183
184 %package java
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
190
191 %description java
192 %{name}-java contains Java bindings for %{name}.
193
194 If you want to develop software in Java which uses %{name}, then
195 you will also need %{name}-java-devel.
196
197
198 %package java-devel
199 Summary:     Java development package for %{name}
200 Group:       Development/Libraries
201 Requires:    %{name} = %{version}-%{release}
202 Requires:    %{name}-java = %{version}-%{release}
203
204 %description java-devel
205 %{name}-java-devel contains the tools for developing Java software
206 using %{name}.
207
208 See also %{name}-javadoc.
209
210
211 %package 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
217
218 %description javadoc
219 %{name}-javadoc contains the Java documentation for %{name}.
220
221
222 %prep
223 %setup -q
224
225 mkdir -p daemon/m4
226
227
228 %build
229 vmchannel_test=no \
230 ./configure \
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
239
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
243
244 # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
245 # not the site dir.
246 make INSTALLDIRS=vendor %{?_smp_mflags}
247
248
249 %check
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.
253 make tests
254 export LIBGUESTFS_QEMU=$HOME/qemu.wrapper
255 test -n "$QUICK_RPMBUILD" || ./tests
256
257
258 %install
259 rm -rf $RPM_BUILD_ROOT
260
261 make DESTDIR=$RPM_BUILD_ROOT install
262
263 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a
264 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la
265
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.
269 cp -a examples ex
270 pushd ex
271 make clean
272 rm Makefile*
273 rm -rf .deps .libs
274 popd
275
276 # Same for ocaml/examples.
277 cp -a ocaml/examples ocaml/ex
278 pushd ocaml/ex
279 make clean
280 rm Makefile*
281 popd
282
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
286
287 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.a
288 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.la
289
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}/
294 fi
295
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}
301
302 # Remove static-linked Java bindings.
303 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.a
304 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.la
305
306 # Generator shouldn't be executable when we distribute it.
307 chmod -x src/generator.ml
308
309
310 %clean
311 rm -rf $RPM_BUILD_ROOT
312
313
314 %post -p /sbin/ldconfig
315
316 %postun -p /sbin/ldconfig
317
318
319 %files
320 %defattr(-,root,root,-)
321 %doc COPYING
322 %{_libdir}/guestfs/
323 %{_libdir}/libguestfs.so.*
324
325
326 %files devel
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
336
337
338 %files -n guestfish
339 %defattr(-,root,root,-)
340 %doc html/guestfish.1.html html/pod.css recipes/
341 %{_bindir}/guestfish
342 %{_mandir}/man1/guestfish.1*
343
344
345 #%files -n virt-inspector
346 #%defattr(-,root,root,-)
347 #%{_bindir}/virt-inspector
348 #%{_mandir}/man1/virt-inspector.1*
349
350
351 %files -n ocaml-%{name}
352 %defattr(-,root,root,-)
353 %doc README
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
361
362
363 %files -n ocaml-%{name}-devel
364 %defattr(-,root,root,-)
365 %doc ocaml/ex
366 %{_libdir}/ocaml/guestfs/*.a
367 %{_libdir}/ocaml/guestfs/*.cmxa
368 %{_libdir}/ocaml/guestfs/*.cmx
369 %{_libdir}/ocaml/guestfs/*.mli
370
371
372 %files -n perl-%{name}
373 %defattr(-,root,root,-)
374 %doc perl/examples
375 %{perl_vendorarch}/*
376 %{_mandir}/man3/Sys::Guestfs.3pm*
377
378
379 %files -n python-%{name}
380 %defattr(-,root,root,-)
381 %doc README
382 %{python_sitearch}/*
383 %{python_sitelib}/*.py
384 #%{python_sitelib}/*.pyc
385 #%{python_sitelib}/*.pyo
386
387
388 %files -n ruby-%{name}
389 %defattr(-,root,root,-)
390 %doc README
391 %{ruby_sitelib}/guestfs.rb
392 %{ruby_sitearch}/_guestfs.so
393
394
395 %files java
396 %defattr(-,root,root,-)
397 %doc README
398 %{_libdir}/libguestfs_jni*.so.*
399 %{_datadir}/java/*.jar
400
401
402 %files java-devel
403 %defattr(-,root,root,-)
404 %doc README
405 %{_libdir}/libguestfs_jni*.so
406
407
408 %files javadoc
409 %defattr(-,root,root,-)
410 %doc README
411 %{_datadir}/javadoc/%{name}-java-%{version}
412
413
414 %changelog
415 * Thu May  7 2009 Richard Jones <rjones@redhat.com> - 1.0.19-1
416 - New upstream version 1.0.19.
417
418 * Tue Apr 28 2009 Richard Jones <rjones@redhat.com> - 1.0.15-1
419 - New upstream version 1.0.15.
420
421 * Fri Apr 24 2009 Richard Jones <rjones@redhat.com> - 1.0.12-1
422 - New upstream version 1.0.12.
423
424 * Wed Apr 22 2009 Richard Jones <rjones@redhat.com> - 1.0.6-1
425 - New upstream version 1.0.6.
426
427 * Mon Apr 20 2009 Richard Jones <rjones@redhat.com> - 1.0.2-1
428 - New upstream version 1.0.2.
429
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.
432
433 * Sat Apr  4 2009 Richard Jones <rjones@redhat.com> - 0.9.9-1
434 - Initial build.