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