0da3ce69df890a4f0c03b76db8d1fcec5dde55c6
[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
127 %description python
128 %{name}-python contains Python bindings for %{name}.
129
130
131 %prep
132 %setup -q
133
134
135 %build
136 #%configure --with-mirror=%{mirror}
137 %configure
138
139 # 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
140 # not the site dir.
141 make INSTALLDIRS=vendor
142
143
144 %check
145 make check
146
147
148 %install
149 rm -rf $RPM_BUILD_ROOT
150
151 make DESTDIR=$RPM_BUILD_ROOT install
152
153 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a
154 rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la
155
156 # Clean up the examples/ directory which will get installed in %doc.
157 # Note we can't delete the original examples/Makefile because that
158 # will be needed by the check section later in the RPM build.
159 cp -a examples ex
160 pushd ex
161 make clean
162 rm Makefile*
163 rm -rf .deps .libs
164 popd
165
166 # Same for ocaml/examples.
167 cp -a ocaml/examples ocaml/ex
168 pushd ocaml/ex
169 make clean
170 rm Makefile*
171 popd
172
173 find $RPM_BUILD_ROOT -name perllocal.pod -delete
174 find $RPM_BUILD_ROOT -name .packlist -delete
175
176
177 %clean
178 rm -rf $RPM_BUILD_ROOT
179
180
181 %post -p /sbin/ldconfig
182
183 %postun -p /sbin/ldconfig
184
185
186 %files
187 %defattr(-,root,root,-)
188 %doc COPYING
189 %{_libdir}/guestfs/
190 %{_libdir}/libguestfs.so.*
191
192
193 %files devel
194 %defattr(-,root,root,-)
195 %doc HACKING TODO README ex html/guestfs.3.html html/pod.css
196 %{_libdir}/libguestfs.so
197 %{_mandir}/man3/guestfs.3*
198 %{_includedir}/guestfs.h
199 %{_includedir}/guestfs-actions.h
200 %{_includedir}/guestfs-structs.h
201
202
203 %files -n guestfish
204 %defattr(-,root,root,-)
205 %doc html/guestfish.1.html html/pod.css
206 %{_bindir}/guestfish
207 %{_mandir}/man1/guestfish.1*
208
209
210 %files ocaml
211 %defattr(-,root,root,-)
212 %{_libdir}/ocaml/guestfs
213 %exclude %{_libdir}/ocaml/guestfs/*.a
214 %exclude %{_libdir}/ocaml/guestfs/*.cmxa
215 %exclude %{_libdir}/ocaml/guestfs/*.cmx
216 %exclude %{_libdir}/ocaml/guestfs/*.mli
217 %{_libdir}/ocaml/stublibs/*.so
218 %{_libdir}/ocaml/stublibs/*.so.owner
219
220
221 %files ocaml-devel
222 %defattr(-,root,root,-)
223 %doc ocaml/ex
224 %{_libdir}/ocaml/guestfs/*.a
225 %{_libdir}/ocaml/guestfs/*.cmxa
226 %{_libdir}/ocaml/guestfs/*.cmx
227 %{_libdir}/ocaml/guestfs/*.mli
228
229
230 %files perl
231 %defattr(-,root,root,-)
232 %doc perl/examples
233 %{perl_vendorarch}/*
234 %{_mandir}/man3/Sys::Guestfs.3pm*
235
236
237 %files python
238 %defattr(-,root,root,-)
239
240
241 %changelog
242 * Sat Apr  4 2009 Richard Jones <rjones@redhat.com> - @VERSION@-1
243 - Initial build.