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