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