Version 1.0.33
[libguestfs.git] / contrib / fedora-libguestfs.spec
1 # libguestfs.spec.  Generated from libguestfs.spec.in by configure.
2
3 # Enable to build w/o network.
4 %global buildnonet 0
5
6 Summary:     Access and modify virtual machine disk images
7 Name:        libguestfs
8 Version:     1.0.23
9 Release:     1%{?dist}
10 License:     LGPLv2+
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
15
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
19
20 # Basic build requirements:
21 BuildRequires: /usr/bin/pod2man
22 BuildRequires: /usr/bin/pod2text
23 BuildRequires: febootstrap >= 2.0
24 BuildRequires: augeas-devel >= 0.5.0
25 BuildRequires: readline-devel
26 BuildRequires: qemu >= 0.10-7
27 BuildRequires: createrepo
28
29 # This is only needed for RHEL 5 because readline-devel doesn't
30 # properly depend on it, but doesn't do any harm on other platforms:
31 BuildRequires: ncurses-devel
32
33 # Build requirements for the appliance:
34 # (see 'make-initramfs.sh.in' in the source)
35 BuildRequires: kernel, bash, coreutils, lvm2, ntfs-3g, util-linux-ng
36 BuildRequires: MAKEDEV, net-tools, augeas-libs, file
37 BuildRequires: module-init-tools, procps, strace, iputils
38 BuildRequires: grub, dosfstools, ntfsprogs
39 BuildRequires: zerofree
40
41 # These are only required if you want to build the bindings for
42 # different languages:
43 BuildRequires: ocaml
44 BuildRequires: ocaml-findlib-devel
45 BuildRequires: perl-devel
46 BuildRequires: perl-Test-Simple
47 BuildRequires: perl-Test-Pod
48 BuildRequires: perl-Test-Pod-Coverage
49 BuildRequires: perl-ExtUtils-MakeMaker
50 BuildRequires: python-devel
51 BuildRequires: ruby-devel
52 BuildRequires: rubygem-rake
53 BuildRequires: java >= 1.5.0
54 BuildRequires: jpackage-utils
55 BuildRequires: java-devel
56
57 # For virt-inspector:
58 BuildRequires: perl-Sys-Virt
59
60 # Runtime requires:
61 Requires:    qemu >= 0.10-7
62
63
64 %description
65 Libguestfs is a library for accessing and modifying guest disk images.
66 Amongst the things this is good for: making batch configuration
67 changes to guests, getting disk used/free statistics (see also:
68 virt-df), migrating between virtualization systems (see also:
69 virt-p2v), performing partial backups, performing partial guest
70 clones, cloning guests and changing registry/UUID/hostname info, and
71 much else besides.
72
73 Libguestfs uses Linux kernel and qemu code, and can access any type of
74 guest filesystem that Linux and qemu can, including but not limited
75 to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition
76 schemes, qcow, qcow2, vmdk.
77
78 Libguestfs provides ways to enumerate guest storage (eg. partitions,
79 LVs, what filesystem is in each LV, etc.).  It can also run commands
80 in the context of the guest.  Also you can access filesystems over FTP.
81
82 Libguestfs is a library that can be linked with C and C++ management
83 programs.
84
85 See also the 'guestfish' package for shell scripting and command line
86 access.
87
88 For Perl bindings, see 'perl-libguestfs'.
89
90 For OCaml bindings, see 'ocaml-libguestfs-devel'.
91
92 For Python bindings, see 'python-libguestfs'.
93
94 For Ruby bindings, see 'ruby-libguestfs'.
95
96 For Java bindings, see 'libguestfs-java-devel'.
97
98
99 %package devel
100 Summary:     Development tools and libraries for %{name}
101 Group:       Development/Libraries
102 Requires:    %{name} = %{version}-%{release}
103 Requires:    pkgconfig
104
105
106 %description devel
107 %{name}-devel contains development tools and libraries
108 for %{name}.
109
110
111 %package -n guestfish
112 Summary:     Shell for accessing and modifying virtual machine disk images
113 Group:       Development/Tools
114 License:     GPLv2+
115 Requires:    %{name} = %{version}-%{release}
116 Requires:    /usr/bin/pod2text
117
118
119 %description -n guestfish
120 Guestfish is the Filesystem Interactive SHell, for accessing and
121 modifying virtual machine disk images from the command line and shell
122 scripts.
123
124
125 %package -n virt-inspector
126 Summary:     Display OS version, kernel, drivers, etc in a virtual machine
127 Group:       Development/Tools
128 License:     GPLv2+
129 Requires:    %{name} = %{version}-%{release}
130 Requires:    guestfish
131 Requires:    perl-Sys-Virt
132
133
134 %description -n virt-inspector
135 Virt-inspector examines a virtual machine and tries to determine the
136 version of the OS, the kernel version, what drivers are installed,
137 whether the virtual machine is fully virtualized (FV) or
138 para-virtualized (PV), what applications are installed and more.
139
140
141 %package -n ocaml-%{name}
142 Summary:     OCaml bindings for %{name}
143 Group:       Development/Libraries
144 Requires:    %{name} = %{version}-%{release}
145
146
147 %description -n ocaml-%{name}
148 ocaml-%{name} contains OCaml bindings for %{name}.
149
150 This is for toplevel and scripting access only.  To compile OCaml
151 programs which use %{name} you will also need ocaml-%{name}-devel.
152
153
154 %package -n ocaml-%{name}-devel
155 Summary:     OCaml bindings for %{name}
156 Group:       Development/Libraries
157 Requires:    ocaml-%{name} = %{version}-%{release}
158
159
160 %description -n ocaml-%{name}-devel
161 ocaml-%{name}-devel contains development libraries
162 required to use the OCaml bindings for %{name}.
163
164
165 %package -n perl-%{name}
166 Summary:     Perl bindings for %{name}
167 Group:       Development/Libraries
168 Requires:    %{name} = %{version}-%{release}
169 Requires:    perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
170
171
172 %description -n perl-%{name}
173 perl-%{name} contains Perl bindings for %{name}.
174
175
176 %package -n python-%{name}
177 Summary:     Python bindings for %{name}
178 Group:       Development/Libraries
179 Requires:    %{name} = %{version}-%{release}
180
181 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
182 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
183
184 %description -n python-%{name}
185 python-%{name} contains Python bindings for %{name}.
186
187
188 %package -n ruby-%{name}
189 Summary:     Ruby bindings for %{name}
190 Group:       Development/Libraries
191 Requires:    %{name} = %{version}-%{release}
192 Requires:    ruby(abi) = 1.8
193 Provides:    ruby(guestfs) = %{version}
194
195 %{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
196 %{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
197
198 %description -n ruby-%{name}
199 ruby-%{name} contains Ruby bindings for %{name}.
200
201
202 %package java
203 Summary:     Java bindings for %{name}
204 Group:       Development/Libraries
205 Requires:    %{name} = %{version}-%{release}
206 Requires:    java >= 1.5.0
207 Requires:    jpackage-utils
208
209 %description java
210 %{name}-java contains Java bindings for %{name}.
211
212 If you want to develop software in Java which uses %{name}, then
213 you will also need %{name}-java-devel.
214
215
216 %package java-devel
217 Summary:     Java development package for %{name}
218 Group:       Development/Libraries
219 Requires:    %{name} = %{version}-%{release}
220 Requires:    %{name}-java = %{version}-%{release}
221
222 %description java-devel
223 %{name}-java-devel contains the tools for developing Java software
224 using %{name}.
225
226 See also %{name}-javadoc.
227
228
229 %package javadoc
230 Summary:     Java documentation for %{name}
231 Group:       Development/Libraries
232 Requires:    %{name} = %{version}-%{release}
233 Requires:    %{name}-java = %{version}-%{release}
234 Requires:    jpackage-utils
235
236 %description javadoc
237 %{name}-javadoc contains the Java documentation for %{name}.
238
239
240 %prep
241 %setup -q
242
243 mkdir -p daemon/m4
244
245
246 %build
247 %if %{buildnonet}
248 mkdir repo
249 find /var/cache/yum/build -type f -name '*.rpm' -print0 | xargs -0 cp -t repo
250 createrepo repo
251 %define extra --with-mirror=file://$(pwd)/repo --with-repo=fedora-12
252 %else
253 %define extra %nil
254 %endif
255
256 ./configure \
257   --prefix=%{_prefix} --libdir=%{_libdir} \
258   --mandir=%{_mandir} \
259   --with-java-home=%{java_home} \
260   --with-qemu="qemu-kvm qemu-system-%{_build_arch} qemu" \
261   --enable-debug-command \
262   %{extra}
263
264 # This ensures that /usr/sbin/chroot is on the path.  Not needed
265 # except for RHEL 5, it shouldn't do any harm on other platforms.
266 export PATH=/usr/sbin:$PATH
267
268 # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
269 # not the site dir.
270 make INSTALLDIRS=vendor %{?_smp_mflags}
271
272
273 %check
274 test -n "$QUICK_RPMBUILD" || make check
275
276
277 %install
278 rm -rf $RPM_BUILD_ROOT
279
280 make DESTDIR=$RPM_BUILD_ROOT install
281
282 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a
283 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la
284
285 # Clean up the examples/ directory which will get installed in %doc.
286 # Note we can't delete the original examples/Makefile because that
287 # will be needed by the check section later in the RPM build.
288 cp -a examples ex
289 pushd ex
290 make clean
291 rm Makefile*
292 rm -rf .deps .libs
293 popd
294
295 # Same for ocaml/examples.
296 cp -a ocaml/examples ocaml/ex
297 pushd ocaml/ex
298 make clean
299 rm Makefile*
300 popd
301
302 find $RPM_BUILD_ROOT -name perllocal.pod -delete
303 find $RPM_BUILD_ROOT -name .packlist -delete
304 find $RPM_BUILD_ROOT -name '*.bs' -delete
305
306 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.a
307 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.la
308
309 if [ "$RPM_BUILD_ROOT%{python_sitearch}" != "$RPM_BUILD_ROOT%{python_sitelib}" ]; then
310    mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
311    mv $RPM_BUILD_ROOT%{python_sitearch}/guestfs.py* \
312      $RPM_BUILD_ROOT%{python_sitelib}/
313 fi
314
315 # Install ruby bindings by hand.
316 mkdir -p $RPM_BUILD_ROOT%{ruby_sitelib}
317 mkdir -p $RPM_BUILD_ROOT%{ruby_sitearch}
318 install -p -m0644 ruby/lib/guestfs.rb $RPM_BUILD_ROOT%{ruby_sitelib}
319 install -p -m0755 ruby/ext/guestfs/_guestfs.so $RPM_BUILD_ROOT%{ruby_sitearch}
320
321 # Remove static-linked Java bindings.
322 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.a
323 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.la
324
325 # Generator shouldn't be executable when we distribute it.
326 chmod -x src/generator.ml
327
328
329 %clean
330 rm -rf $RPM_BUILD_ROOT
331
332
333 %post -p /sbin/ldconfig
334
335 %postun -p /sbin/ldconfig
336
337
338 %files
339 %defattr(-,root,root,-)
340 %doc COPYING
341 %{_libdir}/guestfs/
342 %{_libdir}/libguestfs.so.*
343
344
345 %files devel
346 %defattr(-,root,root,-)
347 %doc ChangeLog HACKING TODO README ex html/guestfs.3.html html/pod.css
348 %doc src/generator.ml
349 %{_libdir}/libguestfs.so
350 %{_mandir}/man3/guestfs.3*
351 %{_includedir}/guestfs.h
352 %{_includedir}/guestfs-actions.h
353 %{_includedir}/guestfs-structs.h
354 %{_libdir}/pkgconfig/libguestfs.pc
355
356
357 %files -n guestfish
358 %defattr(-,root,root,-)
359 %doc html/guestfish.1.html html/pod.css recipes/
360 %{_bindir}/guestfish
361 %{_mandir}/man1/guestfish.1*
362
363
364 %files -n virt-inspector
365 %defattr(-,root,root,-)
366 %{_bindir}/virt-inspector
367 %{_mandir}/man1/virt-inspector.1*
368
369
370 %files -n ocaml-%{name}
371 %defattr(-,root,root,-)
372 %doc README
373 %{_libdir}/ocaml/guestfs
374 %exclude %{_libdir}/ocaml/guestfs/*.a
375 %exclude %{_libdir}/ocaml/guestfs/*.cmxa
376 %exclude %{_libdir}/ocaml/guestfs/*.cmx
377 %exclude %{_libdir}/ocaml/guestfs/*.mli
378 %{_libdir}/ocaml/stublibs/*.so
379 %{_libdir}/ocaml/stublibs/*.so.owner
380
381
382 %files -n ocaml-%{name}-devel
383 %defattr(-,root,root,-)
384 %doc ocaml/ex
385 %{_libdir}/ocaml/guestfs/*.a
386 %{_libdir}/ocaml/guestfs/*.cmxa
387 %{_libdir}/ocaml/guestfs/*.cmx
388 %{_libdir}/ocaml/guestfs/*.mli
389
390
391 %files -n perl-%{name}
392 %defattr(-,root,root,-)
393 %doc perl/examples
394 %{perl_vendorarch}/*
395 %{_mandir}/man3/Sys::Guestfs.3pm*
396
397
398 %files -n python-%{name}
399 %defattr(-,root,root,-)
400 %doc README
401 %{python_sitearch}/*
402 %{python_sitelib}/*.py
403 %{python_sitelib}/*.pyc
404 %{python_sitelib}/*.pyo
405
406
407 %files -n ruby-%{name}
408 %defattr(-,root,root,-)
409 %doc README
410 %{ruby_sitelib}/guestfs.rb
411 %{ruby_sitearch}/_guestfs.so
412
413
414 %files java
415 %defattr(-,root,root,-)
416 %doc README
417 %{_libdir}/libguestfs_jni*.so.*
418 %{_datadir}/java/*.jar
419
420
421 %files java-devel
422 %defattr(-,root,root,-)
423 %doc README
424 %{_libdir}/libguestfs_jni*.so
425
426
427 %files javadoc
428 %defattr(-,root,root,-)
429 %doc README
430 %{_datadir}/javadoc/%{name}-java-%{version}
431
432
433 %changelog
434 * Fri May  8 2009 Richard Jones <rjones@redhat.com> - 1.0.23-1
435 - New upstream version 1.0.23.
436
437 * Fri May  8 2009 Richard Jones <rjones@redhat.com> - 1.0.21-2
438 - New upstream version 1.0.21.
439
440 * Thu May  7 2009 Richard Jones <rjones@redhat.com> - 1.0.20-2
441 - New upstream version 1.0.20.
442
443 * Thu May  7 2009 Richard Jones <rjones@redhat.com> - 1.0.19-1
444 - New upstream version 1.0.19.
445
446 * Tue Apr 28 2009 Richard Jones <rjones@redhat.com> - 1.0.15-1
447 - New upstream version 1.0.15.
448
449 * Fri Apr 24 2009 Richard Jones <rjones@redhat.com> - 1.0.12-1
450 - New upstream version 1.0.12.
451
452 * Wed Apr 22 2009 Richard Jones <rjones@redhat.com> - 1.0.6-1
453 - New upstream version 1.0.6.
454
455 * Mon Apr 20 2009 Richard Jones <rjones@redhat.com> - 1.0.2-1
456 - New upstream version 1.0.2.
457
458 * Thu Apr 16 2009 Richard Jones <rjones@redhat.com> - 0.9.9-12
459 - Multiple fixes to get it to scratch build in Koji.
460
461 * Sat Apr  4 2009 Richard Jones <rjones@redhat.com> - 0.9.9-1
462 - Initial build.