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