ed982a4d1cf3a2a46fe300b739a09dd549b04c85
[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 For Perl bindings, see 'libguestfs-perl'.
61
62 For OCaml bindings, see 'libguestfs-ocaml-devel'.
63
64 For Python bindings, see 'libguestfs-python'.
65
66
67 %package devel
68 Summary:     Development tools and libraries for %{name}
69 Group:       Development/Libraries
70 Requires:    %{name} = %{version}-%{release}
71
72
73 %description devel
74 %{name}-devel contains development tools and libraries
75 for %{name}.
76
77
78 %package -n guestfish
79 Summary:     Shell for accessing and modifying virtual machine disk images
80 Group:       Development/Tools
81 License:     GPLv2+
82 Requires:    %{name} = %{version}-%{release}
83 Requires:    /usr/bin/pod2text
84
85
86 %description -n guestfish
87 Guestfish is the Filesystem Interactive SHell, for accessing and
88 modifying virtual machine disk images from the command line and shell
89 scripts.
90
91
92 %package ocaml
93 Summary:     OCaml bindings for %{name}
94 Group:       Development/Libraries
95 Requires:    %{name} = %{version}-%{release}
96
97
98 %description ocaml
99 %{name}-ocaml contains OCaml bindings for %{name}.
100
101 This is for toplevel and scripting access only.  To compile OCaml
102 programs which use %{name} you will also need %{name}-ocaml-devel.
103
104
105 %package ocaml-devel
106 Summary:     OCaml bindings for %{name}
107 Group:       Development/Libraries
108 Requires:    %{name}-ocaml = %{version}-%{release}
109
110
111 %description ocaml-devel
112 %{name}-ocaml-devel contains development libraries
113 required to use the OCaml bindings for %{name}.
114
115
116 %package perl
117 Summary:     Perl bindings for %{name}
118 Group:       Development/Libraries
119 Requires:    %{name} = %{version}-%{release}
120 Requires:    perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
121
122
123 %description perl
124 %{name}-perl contains Perl bindings for %{name}.
125
126
127 %package python
128 Summary:     Python bindings for %{name}
129 Group:       Development/Libraries
130 Requires:    %{name} = %{version}-%{release}
131
132 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
133 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
134
135 %description python
136 %{name}-python contains Python bindings for %{name}.
137
138
139 %prep
140 %setup -q
141
142
143 %build
144 #%configure --with-mirror=%{mirror}
145 %configure
146
147 # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
148 # not the site dir.
149 make INSTALLDIRS=vendor
150
151
152 %check
153 make check
154
155
156 %install
157 rm -rf $RPM_BUILD_ROOT
158
159 make DESTDIR=$RPM_BUILD_ROOT install
160
161 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a
162 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la
163
164 # Clean up the examples/ directory which will get installed in %doc.
165 # Note we can't delete the original examples/Makefile because that
166 # will be needed by the check section later in the RPM build.
167 cp -a examples ex
168 pushd ex
169 make clean
170 rm Makefile*
171 rm -rf .deps .libs
172 popd
173
174 # Same for ocaml/examples.
175 cp -a ocaml/examples ocaml/ex
176 pushd ocaml/ex
177 make clean
178 rm Makefile*
179 popd
180
181 find $RPM_BUILD_ROOT -name perllocal.pod -delete
182 find $RPM_BUILD_ROOT -name .packlist -delete
183
184
185 %clean
186 rm -rf $RPM_BUILD_ROOT
187
188
189 %post -p /sbin/ldconfig
190
191 %postun -p /sbin/ldconfig
192
193
194 %files
195 %defattr(-,root,root,-)
196 %doc COPYING
197 %{_libdir}/guestfs/
198 %{_libdir}/libguestfs.so.*
199
200
201 %files devel
202 %defattr(-,root,root,-)
203 %doc HACKING TODO README ex html/guestfs.3.html html/pod.css
204 %doc src/generator.ml
205 %{_libdir}/libguestfs.so
206 %{_mandir}/man3/guestfs.3*
207 %{_includedir}/guestfs.h
208 %{_includedir}/guestfs-actions.h
209 %{_includedir}/guestfs-structs.h
210
211
212 %files -n guestfish
213 %defattr(-,root,root,-)
214 %doc html/guestfish.1.html html/pod.css
215 %{_bindir}/guestfish
216 %{_mandir}/man1/guestfish.1*
217
218
219 %files ocaml
220 %defattr(-,root,root,-)
221 %{_libdir}/ocaml/guestfs
222 %exclude %{_libdir}/ocaml/guestfs/*.a
223 %exclude %{_libdir}/ocaml/guestfs/*.cmxa
224 %exclude %{_libdir}/ocaml/guestfs/*.cmx
225 %exclude %{_libdir}/ocaml/guestfs/*.mli
226 %{_libdir}/ocaml/stublibs/*.so
227 %{_libdir}/ocaml/stublibs/*.so.owner
228
229
230 %files ocaml-devel
231 %defattr(-,root,root,-)
232 %doc ocaml/ex
233 %{_libdir}/ocaml/guestfs/*.a
234 %{_libdir}/ocaml/guestfs/*.cmxa
235 %{_libdir}/ocaml/guestfs/*.cmx
236 %{_libdir}/ocaml/guestfs/*.mli
237
238
239 %files perl
240 %defattr(-,root,root,-)
241 %doc perl/examples
242 %{perl_vendorarch}/*
243 %{_mandir}/man3/Sys::Guestfs.3pm*
244
245
246 %files python
247 %defattr(-,root,root,-)
248
249
250 %changelog
251 * Sat Apr  4 2009 Richard Jones <rjones@redhat.com> - @VERSION@-1
252 - Initial build.