]>
Commit | Line | Data |
---|---|---|
94462445 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with xen # xen | |
4 | %bcond_without xen_proxy # Xen proxy | |
5 | %bcond_without qemu # Qemu | |
6 | %bcond_with polkit # PolicyKit | |
7 | %bcond_with lokkit # Lokkit | |
8 | ||
9 | # Xen is available only on i386 x86_64 ia64 | |
10 | %ifnarch %{ix86} %{x8664} ia64 | |
11 | %undefine with_xen | |
12 | %endif | |
13 | %ifarch i386 i486 i586 | |
14 | %undefine with_xen | |
15 | %endif | |
16 | ||
17 | %if %{without xen} | |
18 | %undefine with_xen_proxy | |
19 | %endif | |
20 | ||
21 | %ifnarch %{ix86} %{x8664} ppc | |
22 | %undefine with_qemu | |
23 | %endif | |
24 | ||
25 | Summary: Toolkit to interact with virtualization capabilities | |
26 | Name: libvirt | |
27 | Version: 0.4.2 | |
28 | Release: 0.1 | |
29 | License: LGPL | |
30 | Group: Base/Kernel | |
31 | URL: http://www.libvirt.org/ | |
32 | Source0: ftp://ftp.libvirt.org/libvirt/%{name}-%{version}.tar.gz | |
33 | # Source0-md5: c87e3d91eaa9445bb3cb1ba191573c83 | |
34 | %{?with_lokkit:BuildRequires: /usr/sbin/lokkit} | |
35 | %{?with_polkit:BuildRequires: PolicyKit-devel >= 0.6} | |
36 | BuildRequires: avahi-devel | |
37 | BuildRequires: bridge-utils | |
38 | BuildRequires: cyrus-sasl-devel | |
39 | BuildRequires: dnsmasq | |
40 | BuildRequires: gettext | |
41 | BuildRequires: gnutls-devel | |
42 | BuildRequires: libselinux-devel | |
43 | BuildRequires: libxml2-devel | |
44 | BuildRequires: ncurses-devel | |
45 | BuildRequires: python-devel | |
46 | BuildRequires: readline-devel | |
47 | # For mount/umount in FS driver | |
48 | BuildRequires: util-linux | |
49 | BuildRequires: xen-devel >= 3.0.4 | |
50 | # For LVM drivers | |
51 | BuildRequires: lvm2 | |
52 | BuildRequires: ncurses-devel | |
53 | # For ISCSI driver | |
54 | BuildRequires: open-iscsi | |
55 | # For disk driver | |
56 | BuildRequires: parted-devel | |
57 | BuildRequires: python | |
58 | BuildRequires: python-devel | |
59 | %{?with_qemu:BuildRequires: qemu} | |
60 | BuildRequires: readline-devel | |
61 | %if %{with qemu} | |
62 | BuildRequires: /usr/bin/qemu-img | |
63 | # From QEMU RPMs | |
64 | %else | |
65 | %if %{with xen} | |
66 | BuildRequires: /usr/sbin/qcow-create | |
67 | # From Xen RPMs | |
68 | %endif | |
69 | %endif | |
70 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
71 | ||
72 | # libxenstore is not versionned properly | |
73 | %define _noautoreq devel(libxenstore.*) | |
74 | ||
75 | %description | |
76 | Libvirt is a C toolkit to interact with the virtualization | |
77 | capabilities of recent versions of Linux. | |
78 | ||
79 | Virtualization of the Linux Operating System means the ability to run | |
80 | multiple instances of Operating Systems concurently on a single | |
81 | hardware system where the basic resources are driven by a Linux | |
82 | instance. The library aim at providing long term stable C API | |
83 | initially for the Xen paravirtualization but should be able to | |
84 | integrate other virtualization mechanisms if needed. | |
85 | ||
86 | %package devel | |
87 | Summary: Development tools for programs using libvirt | |
88 | Group: Development/Libraries | |
89 | Requires: %{name} = %{version}-%{release} | |
90 | %{?with_xen:Requires: xen-devel} | |
91 | ||
92 | %description devel | |
93 | Libvirt is a C toolkit to interact with the virtualization | |
94 | capabilities of recent versions of Linux. | |
95 | ||
96 | This package contains the header files and libraries needed for | |
97 | developing programs using the libvirt library. | |
98 | ||
99 | %package static | |
100 | Summary: Development static libraries for programs using libvirt | |
101 | Group: Development/Libraries | |
102 | ||
103 | %description static | |
104 | Libvirt is a C toolkit to interact with the virtualization | |
105 | capabilities of recent versions of Linux. | |
106 | ||
107 | This package contains the static libraries needed for developing | |
108 | programs using the libvirt library. | |
109 | ||
110 | %package -n python-%{name} | |
111 | Summary: Python bindings to interact with virtualization capabilities | |
112 | Group: Development/Languages/Python | |
113 | Requires: %{name} = %{version}-%{release} | |
114 | ||
115 | %description -n python-%{name} | |
116 | Libvirt is a C toolkit to interact with the virtualization | |
117 | capabilities of recent versions of Linux. | |
118 | ||
119 | This package contains the Python bindings for the libvirt library. | |
120 | ||
121 | %package utils | |
122 | Summary: Tools to interact with virtualization capabilities | |
123 | Group: Base/Kernel | |
124 | Requires: %{name} = %{version}-%{release} | |
125 | ||
126 | %description utils | |
127 | Libvirt is a C toolkit to interact with the virtualization | |
128 | capabilities of recent versions of Linux. | |
129 | ||
130 | This package contains tools for the libvirt library. | |
131 | ||
132 | %prep | |
133 | %setup -q | |
134 | ||
135 | %build | |
136 | CPPFLAGS=-std=c99 | |
137 | %configure \ | |
138 | %{!?with_xen:--without-xen} \ | |
139 | %{!?with_qemu:--without-qemu} \ | |
140 | --with-init-script=redhat \ | |
141 | --with-qemud-pid-file=%{_localstatedir}/run/libvirt_qemud.pid \ | |
142 | --with-remote-file=%{_localstatedir}/run/libvirtd.pid | |
143 | ||
144 | %{__make} | |
145 | ||
146 | %install | |
147 | rm -rf $RPM_BUILD_ROOT | |
148 | %{__make} install \ | |
149 | DESTDIR=$RPM_BUILD_ROOT | |
150 | ||
151 | %find_lang %{name} | |
152 | ||
153 | %clean | |
154 | rm -rf $RPM_BUILD_ROOT | |
155 | ||
156 | %post -p /sbin/ldconfig | |
157 | %postun -p /sbin/ldconfig | |
158 | ||
159 | %files -f %{name}.lang | |
160 | %defattr(644,root,root,755) | |
161 | %doc ChangeLog README TODO NEWS | |
162 | %attr(755,root,root) %{_libdir}/%{name}.so.* | |
163 | #%{_libdir}/%{name}_proxy | |
164 | ||
165 | %files devel | |
166 | %defattr(644,root,root,755) | |
167 | %doc %{_docdir}/%{name}-%{version} | |
168 | %doc %{_datadir}/gtk-doc/html/%{name} | |
169 | %dir %{_includedir}/%{name} | |
170 | %{_includedir}/%{name}/*.h | |
171 | %{_libdir}/%{name}.so | |
172 | %{_libdir}/%{name}.la | |
173 | %{_pkgconfigdir}/%{name}.pc | |
174 | ||
175 | %files static | |
176 | %defattr(644,root,root,755) | |
177 | %{_libdir}/%{name}.a | |
178 | ||
179 | %files -n python-%{name} | |
180 | %defattr(644,root,root,755) | |
181 | %doc %{_docdir}/%{name}-python-%{version} | |
182 | %{py_sitedir}/libvirt.py | |
183 | %{py_sitedir}/libvirtmod.a | |
184 | %{py_sitedir}/libvirtmod.la | |
185 | %{py_sitedir}/libvirtmod.so | |
186 | ||
187 | %files utils | |
188 | %defattr(644,root,root,755) | |
189 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libvirt | |
190 | %config(noreplace) %verify(not md5 mtime size) /etc/sasl2/libvirt.conf | |
191 | %attr(755,root,root) %{_bindir}/virsh | |
192 | %attr(755,root,root) %{_sbindir}/libvirtd | |
193 | #%attr(755,root,root) %{_sbindir}/libvirt_qemud | |
194 | #/etc/rc.d/init.d/libvirtd | |
195 | %{_libdir}/libvirt_parthelper | |
196 | %{_mandir}/man1/virsh.1* |