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