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