mingw-libvirt.spec.in 10.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
%{?mingw_package_header}

# Default to skipping autoreconf.  Distros can change just this one line
# (or provide a command-line override) if they backport any patches that
# touch configure.ac or Makefile.am.
%{!?enable_autotools:%define enable_autotools 0}

# The mingw build is client only.  Set up defaults for hypervisor drivers
# that talk via a native remote protocol, and for which prereq mingw
# libraries exist.
%define with_phyp          0%{!?_without_phyp:1}
%define with_esx           0%{!?_without_esx:1}
# missing libwsman, so can't build hyper-v
%define with_hyperv        0%{!?_without_hyperv:0}
%define with_xenapi        0%{!?_without_xenapi:1}
16
%define with_vz            0%{!?_without_vz:0}
17 18 19

# RHEL ships ESX but not PowerHypervisor, HyperV, or libxenserver (xenapi)
%if 0%{?rhel}
20 21 22
    %define with_phyp 0
    %define with_xenapi 0
    %define with_hyperv 0
23 24 25 26 27 28 29 30 31 32
%endif

Name:           mingw-libvirt
Version:        @VERSION@
Release:        1%{?dist}%{?extra_release}
Summary:        MinGW Windows libvirt virtualization library

License:        LGPLv2+
Group:          Development/Libraries
URL:            http://libvirt.org/
33
Source0:        ftp://libvirt.org/libvirt/libvirt-%{version}.tar.xz
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

BuildRequires:  mingw32-filesystem >= 95
BuildRequires:  mingw64-filesystem >= 95
BuildRequires:  mingw32-gcc
BuildRequires:  mingw64-gcc
BuildRequires:  mingw32-binutils
BuildRequires:  mingw64-binutils
BuildRequires:  mingw32-libgpg-error
BuildRequires:  mingw64-libgpg-error
BuildRequires:  mingw32-libgcrypt
BuildRequires:  mingw64-libgcrypt
BuildRequires:  mingw32-gnutls
BuildRequires:  mingw64-gnutls
BuildRequires:  mingw32-gettext
BuildRequires:  mingw64-gettext
BuildRequires:  mingw32-libxml2
BuildRequires:  mingw64-libxml2
BuildRequires:  mingw32-portablexdr
BuildRequires:  mingw64-portablexdr

BuildRequires:  pkgconfig
# Need native version for msgfmt
BuildRequires:  gettext
57 58
BuildRequires:  perl
BuildRequires:  perl(Getopt::Long)
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
%if 0%{?enable_autotools}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
%endif

%if %{with_phyp}
BuildRequires: mingw32-libssh2
BuildRequires: mingw64-libssh2
%endif
%if %{with_esx}
BuildRequires: mingw32-curl
BuildRequires: mingw64-curl
%endif

BuildArch:      noarch

%description
MinGW Windows libvirt virtualization library.

# Mingw32
%package -n mingw32-libvirt
Summary: %{summary}

%description -n mingw32-libvirt
MinGW Windows libvirt virtualization library.

%package -n mingw32-libvirt-static
Summary: %{summary}
Requires: mingw32-libvirt = %{version}-%{release}

%description -n mingw32-libvirt-static
MinGW Windows libvirt virtualization library, static version.

# Mingw64
%package -n mingw64-libvirt
Summary: %{summary}

%description -n mingw64-libvirt
MinGW Windows libvirt virtualization library.

%package -n mingw64-libvirt-static
Summary: %{summary}
Requires: mingw64-libvirt = %{version}-%{release}

%description -n mingw64-libvirt-static
MinGW Windows libvirt virtualization library, static version.

%{?mingw_debug_package}


%prep
%setup -q -n libvirt-%{version}

%build
%if ! %{with_phyp}
116
    %define _without_phyp --without-phyp
117 118 119
%endif

%if ! %{with_esx}
120
    %define _without_esx --without-esx
121 122 123
%endif

%if ! %{with_hyperv}
124
    %define _without_hyperv --without-hyperv
125 126 127
%endif

%if ! %{with_xenapi}
128
    %define _without_xenapi --without-xenapi
129 130
%endif

131 132
%if ! %{with_vz}
    %define _without_vz --without-vz
D
Dmitry Guryanov 已提交
133 134
%endif

135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
%if 0%{?enable_autotools}
autoreconf -if
%endif

# XXX enable SASL in future
%mingw_configure \
  --enable-static \
  --without-xen \
  --without-qemu \
  --without-openvz \
  --without-lxc \
  --without-vbox \
  %{?_without_xenapi} \
  --without-sasl \
  --without-avahi \
  --without-polkit \
  --without-libvirtd \
  --without-uml \
  %{?_without_phyp} \
  %{?_without_esx} \
  %{?_without_hyperv} \
  --without-vmware \
D
Dmitry Guryanov 已提交
157
  --without-parallels \
158 159
  --without-netcf \
  --without-audit \
160 161
  --without-dtrace \
  --enable-expensive-tests
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180

%mingw_make %{?_smp_mflags}


%install
%mingw_make_install "DESTDIR=$RPM_BUILD_ROOT"

# Libtool files don't need to be bundled
find $RPM_BUILD_ROOT -name "*.la" -delete

rm -rf $RPM_BUILD_ROOT%{mingw32_sysconfdir}/libvirt/nwfilter
rm -rf $RPM_BUILD_ROOT%{mingw64_sysconfdir}/libvirt/nwfilter
rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/doc/*
rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/doc/*
rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/gtk-doc/*
rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/gtk-doc/*

rm -rf $RPM_BUILD_ROOT%{mingw32_libexecdir}/libvirt_iohelper.exe
rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt_iohelper.exe
E
Eric Blake 已提交
181 182
rm -rf $RPM_BUILD_ROOT%{mingw32_libexecdir}/libvirt-guests.sh
rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-guests.sh
183 184 185 186 187 188


# Mingw32
%files -n mingw32-libvirt
%dir %{mingw32_sysconfdir}/libvirt/
%config(noreplace) %{mingw32_sysconfdir}/libvirt/libvirt.conf
189
%config(noreplace) %{mingw32_sysconfdir}/libvirt/libvirt-admin.conf
190 191 192

%{mingw32_bindir}/libvirt-0.dll
%{mingw32_bindir}/virsh.exe
193
%{mingw32_bindir}/virt-admin.exe
194 195
%{mingw32_bindir}/virt-xml-validate
%{mingw32_bindir}/virt-pki-validate
196
%{mingw32_bindir}/libvirt-lxc-0.dll
197
%{mingw32_bindir}/libvirt-qemu-0.dll
198
%{mingw32_bindir}/libvirt-admin-0.dll
199 200 201

%{mingw32_libdir}/libvirt.dll.a
%{mingw32_libdir}/pkgconfig/libvirt.pc
202 203
%{mingw32_libdir}/pkgconfig/libvirt-qemu.pc
%{mingw32_libdir}/pkgconfig/libvirt-lxc.pc
204
%{mingw32_libdir}/pkgconfig/libvirt-admin.pc
205
%{mingw32_libdir}/libvirt-lxc.dll.a
206
%{mingw32_libdir}/libvirt-qemu.dll.a
207
%{mingw32_libdir}/libvirt-admin.dll.a
208 209 210 211 212

%dir %{mingw32_datadir}/libvirt/
%dir %{mingw32_datadir}/libvirt/schemas/
%{mingw32_datadir}/libvirt/schemas/basictypes.rng
%{mingw32_datadir}/libvirt/schemas/capability.rng
213
%{mingw32_datadir}/libvirt/schemas/cputypes.rng
214
%{mingw32_datadir}/libvirt/schemas/domain.rng
M
Michal Privoznik 已提交
215
%{mingw32_datadir}/libvirt/schemas/domaincaps.rng
216 217 218 219 220 221 222 223
%{mingw32_datadir}/libvirt/schemas/domaincommon.rng
%{mingw32_datadir}/libvirt/schemas/domainsnapshot.rng
%{mingw32_datadir}/libvirt/schemas/interface.rng
%{mingw32_datadir}/libvirt/schemas/network.rng
%{mingw32_datadir}/libvirt/schemas/networkcommon.rng
%{mingw32_datadir}/libvirt/schemas/nodedev.rng
%{mingw32_datadir}/libvirt/schemas/nwfilter.rng
%{mingw32_datadir}/libvirt/schemas/secret.rng
224
%{mingw32_datadir}/libvirt/schemas/storagecommon.rng
225 226 227 228
%{mingw32_datadir}/libvirt/schemas/storagepool.rng
%{mingw32_datadir}/libvirt/schemas/storagevol.rng
%dir %{mingw32_datadir}/libvirt/api/
%{mingw32_datadir}/libvirt/api/libvirt-api.xml
229
%{mingw32_datadir}/libvirt/api/libvirt-lxc-api.xml
230
%{mingw32_datadir}/libvirt/api/libvirt-qemu-api.xml
231
%{mingw32_datadir}/libvirt/api/libvirt-admin-api.xml
232 233 234

%{mingw32_datadir}/libvirt/cpu_map.xml

D
Daniel P. Berrange 已提交
235 236
%{mingw32_datadir}/libvirt/test-screenshot.png

237 238 239 240
%{mingw32_datadir}/locale/*/LC_MESSAGES/libvirt.mo

%dir %{mingw32_includedir}/libvirt
%{mingw32_includedir}/libvirt/libvirt.h
241
%{mingw32_includedir}/libvirt/libvirt-common.h
242
%{mingw32_includedir}/libvirt/libvirt-domain.h
243
%{mingw32_includedir}/libvirt/libvirt-domain-snapshot.h
244
%{mingw32_includedir}/libvirt/libvirt-event.h
245
%{mingw32_includedir}/libvirt/libvirt-host.h
246
%{mingw32_includedir}/libvirt/libvirt-interface.h
247
%{mingw32_includedir}/libvirt/libvirt-network.h
248
%{mingw32_includedir}/libvirt/libvirt-nodedev.h
249
%{mingw32_includedir}/libvirt/libvirt-nwfilter.h
250
%{mingw32_includedir}/libvirt/libvirt-secret.h
251
%{mingw32_includedir}/libvirt/libvirt-storage.h
252
%{mingw32_includedir}/libvirt/libvirt-stream.h
253
%{mingw32_includedir}/libvirt/virterror.h
254
%{mingw32_includedir}/libvirt/libvirt-lxc.h
255
%{mingw32_includedir}/libvirt/libvirt-qemu.h
256
%{mingw32_includedir}/libvirt/libvirt-admin.h
257 258

%{mingw32_mandir}/man1/virsh.1*
259
%{mingw32_mandir}/man1/virt-admin.1*
260 261
%{mingw32_mandir}/man1/virt-xml-validate.1*
%{mingw32_mandir}/man1/virt-pki-validate.1*
262
%{mingw32_mandir}/man7/virkey*.7*
263 264 265

%files -n mingw32-libvirt-static
%{mingw32_libdir}/libvirt.a
266
%{mingw32_libdir}/libvirt-lxc.a
267
%{mingw32_libdir}/libvirt-qemu.a
268
%{mingw32_libdir}/libvirt-admin.a
269 270 271 272 273

# Mingw64
%files -n mingw64-libvirt
%dir %{mingw64_sysconfdir}/libvirt/
%config(noreplace) %{mingw64_sysconfdir}/libvirt/libvirt.conf
274
%config(noreplace) %{mingw64_sysconfdir}/libvirt/libvirt-admin.conf
275 276 277

%{mingw64_bindir}/libvirt-0.dll
%{mingw64_bindir}/virsh.exe
278
%{mingw64_bindir}/virt-admin.exe
279 280
%{mingw64_bindir}/virt-xml-validate
%{mingw64_bindir}/virt-pki-validate
281
%{mingw64_bindir}/libvirt-lxc-0.dll
282
%{mingw64_bindir}/libvirt-qemu-0.dll
283
%{mingw64_bindir}/libvirt-admin-0.dll
284 285 286

%{mingw64_libdir}/libvirt.dll.a
%{mingw64_libdir}/pkgconfig/libvirt.pc
287 288
%{mingw64_libdir}/pkgconfig/libvirt-qemu.pc
%{mingw64_libdir}/pkgconfig/libvirt-lxc.pc
289
%{mingw64_libdir}/pkgconfig/libvirt-admin.pc
290
%{mingw64_libdir}/libvirt-lxc.dll.a
291
%{mingw64_libdir}/libvirt-qemu.dll.a
292
%{mingw64_libdir}/libvirt-admin.dll.a
293 294 295 296 297

%dir %{mingw64_datadir}/libvirt/
%dir %{mingw64_datadir}/libvirt/schemas/
%{mingw64_datadir}/libvirt/schemas/basictypes.rng
%{mingw64_datadir}/libvirt/schemas/capability.rng
J
Jiri Denemark 已提交
298
%{mingw64_datadir}/libvirt/schemas/cputypes.rng
299
%{mingw64_datadir}/libvirt/schemas/domain.rng
M
Michal Privoznik 已提交
300
%{mingw64_datadir}/libvirt/schemas/domaincaps.rng
301 302 303 304 305 306 307 308
%{mingw64_datadir}/libvirt/schemas/domaincommon.rng
%{mingw64_datadir}/libvirt/schemas/domainsnapshot.rng
%{mingw64_datadir}/libvirt/schemas/interface.rng
%{mingw64_datadir}/libvirt/schemas/network.rng
%{mingw64_datadir}/libvirt/schemas/networkcommon.rng
%{mingw64_datadir}/libvirt/schemas/nodedev.rng
%{mingw64_datadir}/libvirt/schemas/nwfilter.rng
%{mingw64_datadir}/libvirt/schemas/secret.rng
309
%{mingw64_datadir}/libvirt/schemas/storagecommon.rng
310 311 312 313
%{mingw64_datadir}/libvirt/schemas/storagepool.rng
%{mingw64_datadir}/libvirt/schemas/storagevol.rng
%dir %{mingw64_datadir}/libvirt/api/
%{mingw64_datadir}/libvirt/api/libvirt-api.xml
314
%{mingw64_datadir}/libvirt/api/libvirt-lxc-api.xml
315
%{mingw64_datadir}/libvirt/api/libvirt-qemu-api.xml
316
%{mingw64_datadir}/libvirt/api/libvirt-admin-api.xml
317 318 319

%{mingw64_datadir}/libvirt/cpu_map.xml

D
Daniel P. Berrange 已提交
320 321
%{mingw64_datadir}/libvirt/test-screenshot.png

322 323 324 325
%{mingw64_datadir}/locale/*/LC_MESSAGES/libvirt.mo

%dir %{mingw64_includedir}/libvirt
%{mingw64_includedir}/libvirt/libvirt.h
326
%{mingw64_includedir}/libvirt/libvirt-common.h
327
%{mingw64_includedir}/libvirt/libvirt-domain.h
328
%{mingw64_includedir}/libvirt/libvirt-domain-snapshot.h
329
%{mingw64_includedir}/libvirt/libvirt-event.h
330
%{mingw64_includedir}/libvirt/libvirt-host.h
331
%{mingw64_includedir}/libvirt/libvirt-interface.h
332
%{mingw64_includedir}/libvirt/libvirt-network.h
333
%{mingw64_includedir}/libvirt/libvirt-nodedev.h
334
%{mingw64_includedir}/libvirt/libvirt-nwfilter.h
335
%{mingw64_includedir}/libvirt/libvirt-secret.h
336
%{mingw64_includedir}/libvirt/libvirt-storage.h
337
%{mingw64_includedir}/libvirt/libvirt-stream.h
338
%{mingw64_includedir}/libvirt/virterror.h
339
%{mingw64_includedir}/libvirt/libvirt-lxc.h
340
%{mingw64_includedir}/libvirt/libvirt-qemu.h
341
%{mingw64_includedir}/libvirt/libvirt-admin.h
342 343

%{mingw64_mandir}/man1/virsh.1*
344
%{mingw64_mandir}/man1/virt-admin.1*
345 346
%{mingw64_mandir}/man1/virt-xml-validate.1*
%{mingw64_mandir}/man1/virt-pki-validate.1*
347
%{mingw64_mandir}/man7/virkey*.7*
348 349 350

%files -n mingw64-libvirt-static
%{mingw64_libdir}/libvirt.a
351
%{mingw64_libdir}/libvirt-lxc.a
352
%{mingw64_libdir}/libvirt-qemu.a
353
%{mingw64_libdir}/libvirt-admin.a
354 355 356


%changelog