Version 0.5: Numerous small fixes to make rpmbuild work again.
[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 find $RPM_BUILD_ROOT -name perllocal.pod -delete
155 find $RPM_BUILD_ROOT -name .packlist -delete
156
157
158 %clean
159 rm -rf $RPM_BUILD_ROOT
160
161
162 %post -p /sbin/ldconfig
163
164 %postun -p /sbin/ldconfig
165
166
167 %files
168 %defattr(-,root,root,-)
169 %doc COPYING
170 %{_libdir}/guestfs/
171 %{_libdir}/libguestfs.so.*
172
173
174 %files devel
175 %defattr(-,root,root,-)
176 %doc HACKING README examples
177 %{_libdir}/libguestfs.so
178 %{_mandir}/man3/guestfs.3*
179 %{_includedir}/guestfs.h
180 %{_includedir}/guestfs-actions.h
181 %{_includedir}/guestfs-structs.h
182
183
184 %files -n guestfish
185 %defattr(-,root,root,-)
186 %{_bindir}/guestfish
187 %{_mandir}/man1/guestfish.1*
188
189
190 %files ocaml
191 %defattr(-,root,root,-)
192 %{_libdir}/ocaml/guestfs
193 %exclude %{_libdir}/ocaml/guestfs/*.a
194 %exclude %{_libdir}/ocaml/guestfs/*.cmxa
195 %exclude %{_libdir}/ocaml/guestfs/*.cmx
196 %exclude %{_libdir}/ocaml/guestfs/*.mli
197 %{_libdir}/ocaml/stublibs/*.so
198 %{_libdir}/ocaml/stublibs/*.so.owner
199
200
201 %files ocaml-devel
202 %defattr(-,root,root,-)
203 %{_libdir}/ocaml/guestfs/*.a
204 %{_libdir}/ocaml/guestfs/*.cmxa
205 %{_libdir}/ocaml/guestfs/*.cmx
206 %{_libdir}/ocaml/guestfs/*.mli
207
208
209 %files perl
210 %defattr(-,root,root,-)
211 %doc perl/examples
212 %{perl_vendorarch}/*
213 %{_mandir}/man3/Sys::Guestfs.3pm*
214
215
216 # %files python
217 # %defattr(-,root,root,-)
218
219
220 %changelog
221 * Sat Apr  4 2009 Richard Jones <rjones@redhat.com> - @VERSION@-1
222 - Initial build.