Include the __cplusplus header magic so API really callable from C++.
[libguestfs.git] / libguestfs.spec.in
1 # @configure_input@
2
3 Summary:     Access and modify virtual machine disk images
4 Name:        libguestfs
5 Version:     @VERSION@
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 # Basic build requirements:
14 BuildRequires: /usr/bin/pod2man
15 BuildRequires: /usr/bin/pod2text
16 BuildRequires: febootstrap >= 1.5
17 BuildRequires: augeas-devel >= 0.5.0
18 BuildRequires: readline-devel
19 BuildRequires: qemu >= 0.10-7
20 BuildRequires: createrepo
21
22 # Build requirements for the appliance:
23 # (see 'make-initramfs.sh.in' in the source)
24 BuildRequires: kernel, bash, coreutils, lvm2, ntfs-3g, util-linux-ng
25 BuildRequires: MAKEDEV, net-tools, augeas-libs, file
26 BuildRequires: module-init-tools, procps, strace, iputils
27
28 # These are only required if you want to build the bindings for
29 # different languages:
30 BuildRequires: ocaml
31 BuildRequires: ocaml-findlib-devel
32 BuildRequires: perl-devel
33 BuildRequires: perl-Test-Simple
34 BuildRequires: perl-Test-Pod
35 BuildRequires: perl-Test-Pod-Coverage
36 BuildRequires: perl-ExtUtils-MakeMaker
37 BuildRequires: python-devel
38 BuildRequires: ruby-devel
39 BuildRequires: rubygem-rake
40
41 # Runtime requires:
42 Requires:    qemu >= 0.10-7
43
44
45 %description
46 Libguestfs is a library for accessing and modifying guest disk images.
47 Amongst the things this is good for: making batch configuration
48 changes to guests, getting disk used/free statistics (see also:
49 virt-df), migrating between virtualization systems (see also:
50 virt-p2v), performing partial backups, performing partial guest
51 clones, cloning guests and changing registry/UUID/hostname info, and
52 much else besides.
53
54 Libguestfs uses Linux kernel and qemu code, and can access any type of
55 guest filesystem that Linux and qemu can, including but not limited
56 to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition
57 schemes, qcow, qcow2, vmdk.
58
59 Libguestfs provides ways to enumerate guest storage (eg. partitions,
60 LVs, what filesystem is in each LV, etc.).  It can also run commands
61 in the context of the guest.  Also you can access filesystems over FTP.
62
63 Libguestfs is a library that can be linked with C and C++ management
64 programs.
65
66 See also the 'guestfish' package for shell scripting and command line
67 access.
68
69 For Perl bindings, see 'libguestfs-perl'.
70
71 For OCaml bindings, see 'libguestfs-ocaml-devel'.
72
73 For Python bindings, see 'libguestfs-python'.
74
75 For Ruby bindings, see 'libguestfs-ruby'.
76
77
78 %package devel
79 Summary:     Development tools and libraries for %{name}
80 Group:       Development/Libraries
81 Requires:    %{name} = %{version}-%{release}
82
83
84 %description devel
85 %{name}-devel contains development tools and libraries
86 for %{name}.
87
88
89 %package -n guestfish
90 Summary:     Shell for accessing and modifying virtual machine disk images
91 Group:       Development/Tools
92 License:     GPLv2+
93 Requires:    %{name} = %{version}-%{release}
94 Requires:    /usr/bin/pod2text
95
96
97 %description -n guestfish
98 Guestfish is the Filesystem Interactive SHell, for accessing and
99 modifying virtual machine disk images from the command line and shell
100 scripts.
101
102
103 %package ocaml
104 Summary:     OCaml bindings for %{name}
105 Group:       Development/Libraries
106 Requires:    %{name} = %{version}-%{release}
107
108
109 %description ocaml
110 %{name}-ocaml contains OCaml bindings for %{name}.
111
112 This is for toplevel and scripting access only.  To compile OCaml
113 programs which use %{name} you will also need %{name}-ocaml-devel.
114
115
116 %package ocaml-devel
117 Summary:     OCaml bindings for %{name}
118 Group:       Development/Libraries
119 Requires:    %{name}-ocaml = %{version}-%{release}
120
121
122 %description ocaml-devel
123 %{name}-ocaml-devel contains development libraries
124 required to use the OCaml bindings for %{name}.
125
126
127 %package perl
128 Summary:     Perl bindings for %{name}
129 Group:       Development/Libraries
130 Requires:    %{name} = %{version}-%{release}
131 Requires:    perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
132
133
134 %description perl
135 %{name}-perl contains Perl bindings for %{name}.
136
137
138 %package python
139 Summary:     Python bindings for %{name}
140 Group:       Development/Libraries
141 Requires:    %{name} = %{version}-%{release}
142
143 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
144 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
145
146 %description python
147 %{name}-python contains Python bindings for %{name}.
148
149
150 %package ruby
151 Summary:     Ruby bindings for %{name}
152 Group:       Development/Libraries
153 Requires:    %{name} = %{version}-%{release}
154 Requires:    ruby(abi) = 1.8
155 Provides:    ruby(guestfs) = %{version}
156
157 %{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
158 %{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
159
160 %description ruby
161 %{name}-ruby contains Ruby bindings for %{name}.
162
163
164 %prep
165 %setup -q
166
167
168 %build
169 %configure
170
171 # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
172 # not the site dir.
173 make INSTALLDIRS=vendor
174
175
176 %check
177 test -n "$QUICK_RPMBUILD" || make check
178
179
180 %install
181 rm -rf $RPM_BUILD_ROOT
182
183 make DESTDIR=$RPM_BUILD_ROOT install
184
185 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a
186 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la
187
188 # Clean up the examples/ directory which will get installed in %doc.
189 # Note we can't delete the original examples/Makefile because that
190 # will be needed by the check section later in the RPM build.
191 cp -a examples ex
192 pushd ex
193 make clean
194 rm Makefile*
195 rm -rf .deps .libs
196 popd
197
198 # Same for ocaml/examples.
199 cp -a ocaml/examples ocaml/ex
200 pushd ocaml/ex
201 make clean
202 rm Makefile*
203 popd
204
205 find $RPM_BUILD_ROOT -name perllocal.pod -delete
206 find $RPM_BUILD_ROOT -name .packlist -delete
207
208 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.a
209 rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.la
210
211 if [ "$RPM_BUILD_ROOT%{python_sitearch}" != "$RPM_BUILD_ROOT%{python_sitelib}" ]; then
212    mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
213    mv $RPM_BUILD_ROOT%{python_sitearch}/guestfs.py* \
214      $RPM_BUILD_ROOT%{python_sitelib}/
215 fi
216
217 # Install ruby bindings by hand.
218 mkdir -p $RPM_BUILD_ROOT%{ruby_sitelib}
219 mkdir -p $RPM_BUILD_ROOT%{ruby_sitearch}
220 install -p -m0644 ruby/lib/guestfs.rb $RPM_BUILD_ROOT%{ruby_sitelib}
221 install -p -m0755 ruby/ext/guestfs/_guestfs.so $RPM_BUILD_ROOT%{ruby_sitearch}
222
223
224 %clean
225 rm -rf $RPM_BUILD_ROOT
226
227
228 %post -p /sbin/ldconfig
229
230 %postun -p /sbin/ldconfig
231
232
233 %files
234 %defattr(-,root,root,-)
235 %doc COPYING
236 %{_libdir}/guestfs/
237 %{_libdir}/libguestfs.so.*
238
239
240 %files devel
241 %defattr(-,root,root,-)
242 %doc HACKING TODO README ex html/guestfs.3.html html/pod.css
243 %doc src/generator.ml
244 %{_libdir}/libguestfs.so
245 %{_mandir}/man3/guestfs.3*
246 %{_includedir}/guestfs.h
247 %{_includedir}/guestfs-actions.h
248 %{_includedir}/guestfs-structs.h
249
250
251 %files -n guestfish
252 %defattr(-,root,root,-)
253 %doc html/guestfish.1.html html/pod.css
254 %{_bindir}/guestfish
255 %{_mandir}/man1/guestfish.1*
256
257
258 %files ocaml
259 %defattr(-,root,root,-)
260 %{_libdir}/ocaml/guestfs
261 %exclude %{_libdir}/ocaml/guestfs/*.a
262 %exclude %{_libdir}/ocaml/guestfs/*.cmxa
263 %exclude %{_libdir}/ocaml/guestfs/*.cmx
264 %exclude %{_libdir}/ocaml/guestfs/*.mli
265 %{_libdir}/ocaml/stublibs/*.so
266 %{_libdir}/ocaml/stublibs/*.so.owner
267
268
269 %files ocaml-devel
270 %defattr(-,root,root,-)
271 %doc ocaml/ex
272 %{_libdir}/ocaml/guestfs/*.a
273 %{_libdir}/ocaml/guestfs/*.cmxa
274 %{_libdir}/ocaml/guestfs/*.cmx
275 %{_libdir}/ocaml/guestfs/*.mli
276
277
278 %files perl
279 %defattr(-,root,root,-)
280 %doc perl/examples
281 %{perl_vendorarch}/*
282 %{_mandir}/man3/Sys::Guestfs.3pm*
283
284
285 %files python
286 %defattr(-,root,root,-)
287 %{python_sitearch}/*
288 %{python_sitelib}/*.py
289 %{python_sitelib}/*.pyc
290 %{python_sitelib}/*.pyo
291
292
293 %files ruby
294 %defattr(-,root,root,-)
295 %{ruby_sitelib}/guestfs.rb
296 %{ruby_sitearch}/_guestfs.so
297
298
299 %changelog
300 * Thu Apr 16 2009 Richard Jones <rjones@redhat.com> - @VERSION@-1
301 - New upstream version @VERSION@.
302
303 * Thu Apr 16 2009 Richard Jones <rjones@redhat.com> - 0.9.9-12
304 - Multiple fixes to get it to scratch build in Koji.
305
306 * Sat Apr  4 2009 Richard Jones <rjones@redhat.com> - 0.9.9-1
307 - Initial build.