mingw-libvirt.spec.in 11.8 KB
Newer Older
1 2
%{?mingw_package_header}

A
Andrea Bolognani 已提交
3 4 5
# This spec file assumes you are building on a Fedora version
# that's still supported by the vendor. It may work on other distros
# or versions, but no effort will be made to ensure that going forward.
6
%define min_fedora 29
A
Andrea Bolognani 已提交
7 8 9 10 11 12 13

%if 0%{?fedora} && 0%{?fedora} >= %{min_fedora}
    %define supported_platform 1
%else
    %define supported_platform 0
%endif

14 15 16 17 18 19 20 21 22 23 24 25 26
# 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}
27
%define with_vz            0%{!?_without_vz:0}
28 29 30

# RHEL ships ESX but not PowerHypervisor, HyperV, or libxenserver (xenapi)
%if 0%{?rhel}
31 32 33
    %define with_phyp 0
    %define with_xenapi 0
    %define with_hyperv 0
34 35 36 37
%endif

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

License:        LGPLv2+
42
URL:            https://libvirt.org/
43 44 45 46

%if %(echo %{version} | grep -q "\.0$"; echo $?) == 1
    %define mainturl stable_updates/
%endif
47
Source: https://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.xz
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66

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
67 68
BuildRequires:  mingw32-dlfcn
BuildRequires:  mingw64-dlfcn
69 70 71 72

BuildRequires:  pkgconfig
# Need native version for msgfmt
BuildRequires:  gettext
73
BuildRequires:  libxslt
74
BuildRequires:  python3
75
BuildRequires:  perl-interpreter
76
BuildRequires:  perl(Getopt::Long)
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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
%if 0%{?enable_autotools}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
%endif

BuildRequires: mingw32-libssh2
BuildRequires: mingw64-libssh2
%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
A
Andrea Bolognani 已提交
131 132 133 134 135
%if ! %{supported_platform}
echo "This RPM requires Fedora >= %{min_fedora}"
exit 1
%endif

136
%if ! %{with_phyp}
137
    %define _without_phyp --without-phyp
138 139 140
%endif

%if ! %{with_esx}
141
    %define _without_esx --without-esx
142 143 144
%endif

%if ! %{with_hyperv}
145
    %define _without_hyperv --without-hyperv
146 147 148
%endif

%if ! %{with_xenapi}
149
    %define _without_xenapi --without-xenapi
150 151
%endif

152 153
%if ! %{with_vz}
    %define _without_vz --without-vz
D
Dmitry Guryanov 已提交
154 155
%endif

156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
%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-polkit \
  --without-libvirtd \
  %{?_without_phyp} \
  %{?_without_esx} \
  %{?_without_hyperv} \
  --without-vmware \
D
Dmitry Guryanov 已提交
176
  --without-parallels \
177 178
  --without-netcf \
  --without-audit \
179 180
  --without-dtrace \
  --enable-expensive-tests
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199

%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 已提交
200 201
rm -rf $RPM_BUILD_ROOT%{mingw32_libexecdir}/libvirt-guests.sh
rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-guests.sh
202 203 204 205 206 207


# Mingw32
%files -n mingw32-libvirt
%dir %{mingw32_sysconfdir}/libvirt/
%config(noreplace) %{mingw32_sysconfdir}/libvirt/libvirt.conf
208
%config(noreplace) %{mingw32_sysconfdir}/libvirt/libvirt-admin.conf
209 210 211

%{mingw32_bindir}/libvirt-0.dll
%{mingw32_bindir}/virsh.exe
212
%{mingw32_bindir}/virt-admin.exe
213 214
%{mingw32_bindir}/virt-xml-validate
%{mingw32_bindir}/virt-pki-validate
215
%{mingw32_bindir}/libvirt-lxc-0.dll
216
%{mingw32_bindir}/libvirt-qemu-0.dll
217
%{mingw32_bindir}/libvirt-admin-0.dll
218 219 220

%{mingw32_libdir}/libvirt.dll.a
%{mingw32_libdir}/pkgconfig/libvirt.pc
221 222
%{mingw32_libdir}/pkgconfig/libvirt-qemu.pc
%{mingw32_libdir}/pkgconfig/libvirt-lxc.pc
223
%{mingw32_libdir}/pkgconfig/libvirt-admin.pc
224
%{mingw32_libdir}/libvirt-lxc.dll.a
225
%{mingw32_libdir}/libvirt-qemu.dll.a
226
%{mingw32_libdir}/libvirt-admin.dll.a
227 228 229 230 231

%dir %{mingw32_datadir}/libvirt/
%dir %{mingw32_datadir}/libvirt/schemas/
%{mingw32_datadir}/libvirt/schemas/basictypes.rng
%{mingw32_datadir}/libvirt/schemas/capability.rng
232
%{mingw32_datadir}/libvirt/schemas/cputypes.rng
233
%{mingw32_datadir}/libvirt/schemas/domain.rng
M
Michal Privoznik 已提交
234
%{mingw32_datadir}/libvirt/schemas/domaincaps.rng
235 236 237 238 239 240 241
%{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
242 243
%{mingw32_datadir}/libvirt/schemas/nwfilter_params.rng
%{mingw32_datadir}/libvirt/schemas/nwfilterbinding.rng
244
%{mingw32_datadir}/libvirt/schemas/secret.rng
245
%{mingw32_datadir}/libvirt/schemas/storagecommon.rng
246
%{mingw32_datadir}/libvirt/schemas/storagepool.rng
247
%{mingw32_datadir}/libvirt/schemas/storagepoolcaps.rng
248 249 250
%{mingw32_datadir}/libvirt/schemas/storagevol.rng
%dir %{mingw32_datadir}/libvirt/api/
%{mingw32_datadir}/libvirt/api/libvirt-api.xml
251
%{mingw32_datadir}/libvirt/api/libvirt-lxc-api.xml
252
%{mingw32_datadir}/libvirt/api/libvirt-qemu-api.xml
253
%{mingw32_datadir}/libvirt/api/libvirt-admin-api.xml
254

255
%{mingw32_datadir}/libvirt/cpu_map/*.xml
256

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

259 260 261 262
%{mingw32_datadir}/locale/*/LC_MESSAGES/libvirt.mo

%dir %{mingw32_includedir}/libvirt
%{mingw32_includedir}/libvirt/libvirt.h
263
%{mingw32_includedir}/libvirt/libvirt-common.h
264
%{mingw32_includedir}/libvirt/libvirt-domain.h
265
%{mingw32_includedir}/libvirt/libvirt-domain-snapshot.h
266
%{mingw32_includedir}/libvirt/libvirt-event.h
267
%{mingw32_includedir}/libvirt/libvirt-host.h
268
%{mingw32_includedir}/libvirt/libvirt-interface.h
269
%{mingw32_includedir}/libvirt/libvirt-network.h
270
%{mingw32_includedir}/libvirt/libvirt-nodedev.h
271
%{mingw32_includedir}/libvirt/libvirt-nwfilter.h
272
%{mingw32_includedir}/libvirt/libvirt-secret.h
273
%{mingw32_includedir}/libvirt/libvirt-storage.h
274
%{mingw32_includedir}/libvirt/libvirt-stream.h
275
%{mingw32_includedir}/libvirt/virterror.h
276
%{mingw32_includedir}/libvirt/libvirt-lxc.h
277
%{mingw32_includedir}/libvirt/libvirt-qemu.h
278
%{mingw32_includedir}/libvirt/libvirt-admin.h
279 280

%{mingw32_mandir}/man1/virsh.1*
281
%{mingw32_mandir}/man1/virt-admin.1*
282 283
%{mingw32_mandir}/man1/virt-xml-validate.1*
%{mingw32_mandir}/man1/virt-pki-validate.1*
284
%{mingw32_mandir}/man7/virkey*.7*
285 286 287

%files -n mingw32-libvirt-static
%{mingw32_libdir}/libvirt.a
288
%{mingw32_libdir}/libvirt-lxc.a
289
%{mingw32_libdir}/libvirt-qemu.a
290
%{mingw32_libdir}/libvirt-admin.a
291 292 293 294 295

# Mingw64
%files -n mingw64-libvirt
%dir %{mingw64_sysconfdir}/libvirt/
%config(noreplace) %{mingw64_sysconfdir}/libvirt/libvirt.conf
296
%config(noreplace) %{mingw64_sysconfdir}/libvirt/libvirt-admin.conf
297 298 299

%{mingw64_bindir}/libvirt-0.dll
%{mingw64_bindir}/virsh.exe
300
%{mingw64_bindir}/virt-admin.exe
301 302
%{mingw64_bindir}/virt-xml-validate
%{mingw64_bindir}/virt-pki-validate
303
%{mingw64_bindir}/libvirt-lxc-0.dll
304
%{mingw64_bindir}/libvirt-qemu-0.dll
305
%{mingw64_bindir}/libvirt-admin-0.dll
306 307 308

%{mingw64_libdir}/libvirt.dll.a
%{mingw64_libdir}/pkgconfig/libvirt.pc
309 310
%{mingw64_libdir}/pkgconfig/libvirt-qemu.pc
%{mingw64_libdir}/pkgconfig/libvirt-lxc.pc
311
%{mingw64_libdir}/pkgconfig/libvirt-admin.pc
312
%{mingw64_libdir}/libvirt-lxc.dll.a
313
%{mingw64_libdir}/libvirt-qemu.dll.a
314
%{mingw64_libdir}/libvirt-admin.dll.a
315 316 317 318 319

%dir %{mingw64_datadir}/libvirt/
%dir %{mingw64_datadir}/libvirt/schemas/
%{mingw64_datadir}/libvirt/schemas/basictypes.rng
%{mingw64_datadir}/libvirt/schemas/capability.rng
J
Jiri Denemark 已提交
320
%{mingw64_datadir}/libvirt/schemas/cputypes.rng
321
%{mingw64_datadir}/libvirt/schemas/domain.rng
M
Michal Privoznik 已提交
322
%{mingw64_datadir}/libvirt/schemas/domaincaps.rng
323 324 325 326 327 328 329
%{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
330 331
%{mingw64_datadir}/libvirt/schemas/nwfilter_params.rng
%{mingw64_datadir}/libvirt/schemas/nwfilterbinding.rng
332
%{mingw64_datadir}/libvirt/schemas/secret.rng
333
%{mingw64_datadir}/libvirt/schemas/storagecommon.rng
334
%{mingw64_datadir}/libvirt/schemas/storagepool.rng
335
%{mingw64_datadir}/libvirt/schemas/storagepoolcaps.rng
336 337 338
%{mingw64_datadir}/libvirt/schemas/storagevol.rng
%dir %{mingw64_datadir}/libvirt/api/
%{mingw64_datadir}/libvirt/api/libvirt-api.xml
339
%{mingw64_datadir}/libvirt/api/libvirt-lxc-api.xml
340
%{mingw64_datadir}/libvirt/api/libvirt-qemu-api.xml
341
%{mingw64_datadir}/libvirt/api/libvirt-admin-api.xml
342

343
%{mingw64_datadir}/libvirt/cpu_map/*.xml
344

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

347 348 349 350
%{mingw64_datadir}/locale/*/LC_MESSAGES/libvirt.mo

%dir %{mingw64_includedir}/libvirt
%{mingw64_includedir}/libvirt/libvirt.h
351
%{mingw64_includedir}/libvirt/libvirt-common.h
352
%{mingw64_includedir}/libvirt/libvirt-domain.h
353
%{mingw64_includedir}/libvirt/libvirt-domain-snapshot.h
354
%{mingw64_includedir}/libvirt/libvirt-event.h
355
%{mingw64_includedir}/libvirt/libvirt-host.h
356
%{mingw64_includedir}/libvirt/libvirt-interface.h
357
%{mingw64_includedir}/libvirt/libvirt-network.h
358
%{mingw64_includedir}/libvirt/libvirt-nodedev.h
359
%{mingw64_includedir}/libvirt/libvirt-nwfilter.h
360
%{mingw64_includedir}/libvirt/libvirt-secret.h
361
%{mingw64_includedir}/libvirt/libvirt-storage.h
362
%{mingw64_includedir}/libvirt/libvirt-stream.h
363
%{mingw64_includedir}/libvirt/virterror.h
364
%{mingw64_includedir}/libvirt/libvirt-lxc.h
365
%{mingw64_includedir}/libvirt/libvirt-qemu.h
366
%{mingw64_includedir}/libvirt/libvirt-admin.h
367 368

%{mingw64_mandir}/man1/virsh.1*
369
%{mingw64_mandir}/man1/virt-admin.1*
370 371
%{mingw64_mandir}/man1/virt-xml-validate.1*
%{mingw64_mandir}/man1/virt-pki-validate.1*
372
%{mingw64_mandir}/man7/virkey*.7*
373 374 375

%files -n mingw64-libvirt-static
%{mingw64_libdir}/libvirt.a
376
%{mingw64_libdir}/libvirt-lxc.a
377
%{mingw64_libdir}/libvirt-qemu.a
378
%{mingw64_libdir}/libvirt-admin.a
379 380 381


%changelog