aboutsummaryrefslogtreecommitdiff
blob: 4d23c755e6268de5c9830fbace4996b4ab0c7e79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
%define __strip %{_mingw32_strip}
%define __objdump %{_mingw32_objdump}
%define _use_internal_dependency_generator 0
%define __find_requires %{_mingw32_findrequires}
%define __find_provides %{_mingw32_findprovides}
%define __debug_install_post %{_mingw32_debug_install_post}

# 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}

# RHEL ships ESX but not PowerHypervisor, HyperV, or libxenserver (xenapi)
%if 0%{?rhel}
%define with_phyp 0
%define with_xenapi 0
%define with_hyperv 0
%endif

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

License:        LGPLv2+
Group:          Development/Libraries
URL:            http://libvirt.org/
Source0:        ftp://libvirt.org/libvirt/libvirt-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  mingw32-filesystem >= 23
BuildRequires:  mingw32-gcc
BuildRequires:  mingw32-binutils
BuildRequires:  mingw32-libgpg-error
BuildRequires:  mingw32-libgcrypt
BuildRequires:  mingw32-gnutls
BuildRequires:  mingw32-gettext
BuildRequires:  mingw32-libxml2
BuildRequires:  mingw32-portablexdr
BuildRequires:  pkgconfig
# Need native version for msgfmt
BuildRequires:  gettext
%if 0%{?enable_autotools}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
%endif

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

BuildArch:      noarch

%{?_mingw32_debug_package}

%description
MinGW Windows libvirt virtualization library.


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


%build
%if ! %{with_phyp}
%define _without_phyp --without-phyp
%endif

%if ! %{with_esx}
%define _without_esx --without-esx
%endif

%if ! %{with_hyperv}
%define _without_hyperv --without-hyperv
%endif

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

%if 0%{?enable_autotools}
autoreconf -if
%endif
# XXX enable SASL in future
%{_mingw32_configure} \
  --without-xen \
  --without-qemu \
  --without-openvz \
  --without-lxc \
  --without-vbox \
  %{?_without_xenapi} \
  --without-sasl \
  --without-avahi \
  --without-polkit \
  --without-python \
  --without-libvirtd \
  --without-uml \
  %{?_without_phyp} \
  %{?_without_esx} \
  %{?_without_hyperv} \
  --without-vmware \
  --without-netcf \
  --without-audit \
  --without-dtrace
make


%install
rm -rf $RPM_BUILD_ROOT

make DESTDIR=$RPM_BUILD_ROOT install

rm -rf $RPM_BUILD_ROOT%{_mingw32_sysconfdir}/libvirt/nwfilter
rm -rf $RPM_BUILD_ROOT%{_mingw32_datadir}/doc/*
rm -rf $RPM_BUILD_ROOT%{_mingw32_datadir}/gtk-doc/*

rm -rf $RPM_BUILD_ROOT%{_mingw32_libexecdir}/libvirt_iohelper.exe

rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libvirt.a
rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libvirt-qemu.a


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
%dir %{_mingw32_sysconfdir}/libvirt/
%config(noreplace) %{_mingw32_sysconfdir}/libvirt/libvirt.conf

%{_mingw32_bindir}/libvirt-0.dll
%{_mingw32_bindir}/virsh.exe
%{_mingw32_bindir}/virt-xml-validate
%{_mingw32_bindir}/virt-pki-validate
%{_mingw32_bindir}/virt-host-validate.exe
%{_mingw32_bindir}/libvirt-qemu-0.dll

%{_mingw32_libdir}/libvirt.dll.a
%{_mingw32_libdir}/libvirt.la
%{_mingw32_libdir}/pkgconfig/libvirt.pc
%{_mingw32_libdir}/libvirt-qemu.dll.a
%{_mingw32_libdir}/libvirt-qemu.la

%dir %{_mingw32_datadir}/libvirt/api/
%{_mingw32_datadir}/libvirt/api/libvirt-api.xml
%{_mingw32_datadir}/libvirt/api/libvirt-qemu-api.xml

%dir %{_mingw32_datadir}/libvirt/
%dir %{_mingw32_datadir}/libvirt/schemas/
%{_mingw32_datadir}/libvirt/schemas/basictypes.rng
%{_mingw32_datadir}/libvirt/schemas/capability.rng
%{_mingw32_datadir}/libvirt/schemas/domain.rng
%{_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
%{_mingw32_datadir}/libvirt/schemas/storageencryption.rng
%{_mingw32_datadir}/libvirt/schemas/storagepool.rng
%{_mingw32_datadir}/libvirt/schemas/storagevol.rng

%{_mingw32_datadir}/libvirt/cpu_map.xml

%{_mingw32_datadir}/locale/*/LC_MESSAGES/libvirt.mo

%dir %{_mingw32_includedir}/libvirt
%{_mingw32_includedir}/libvirt/libvirt.h
%{_mingw32_includedir}/libvirt/virterror.h
%{_mingw32_includedir}/libvirt/libvirt-qemu.h

%{_mingw32_mandir}/man1/virsh.1*
%{_mingw32_mandir}/man1/virt-xml-validate.1*
%{_mingw32_mandir}/man1/virt-pki-validate.1*
%{_mingw32_mandir}/man1/virt-host-validate.1*


%changelog
* Thu Sep 25 2008 Richard Jones <rjones@redhat.com> - 0.4.6-3
- BuildArch should be noarch

* Wed Sep 24 2008 Richard W.M. Jones <rjones@redhat.com> - 0.4.6-2
- Whitespace removal.

* Wed Sep 24 2008 Richard W.M. Jones <rjones@redhat.com> - 0.4.6-1
- New upstream release 0.4.6.
- Rename mingw -> mingw32.

* Mon Sep 22 2008 Daniel P. Berrange <berrange@redhat.com> - 0.4.5-4%{?extra_release}
- Import crash fix from rawhide

* Thu Sep 11 2008 Daniel P. Berrange <berrange@redhat.com> - 0.4.5-3%{?extra_release}
- Add dep on gettext & pkgconfig

* Wed Sep 10 2008 Richard W.M. Jones <rjones@redhat.com> - 0.4.5-2
- Remove static lib.

* Tue Sep  2 2008 Daniel P. Berrange <berrange@redhat.com> - 0.4.4-1
- Initial RPM release, largely based on earlier work from several sources.