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