[Spice-devel] [PATCH spice-protocol v3 4/5] build-sys: Allows spec file to build MingW packages

Frediano Ziglio fziglio at redhat.com
Tue Oct 22 08:33:57 UTC 2019


Add MingW support. This allows to build MingW packages easily with a

  $ rpmbuild -ta spice-protocol-XXXX.tar.bz2

This is base on some work by Eduardo Lima adding MingW support to SPEC
files.
Part of dependencies, description and names came from Fedora SPEC file
for mingw-spice-protocol package.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 spice-protocol.spec.in | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/spice-protocol.spec.in b/spice-protocol.spec.in
index 49724c6..54aacfd 100644
--- a/spice-protocol.spec.in
+++ b/spice-protocol.spec.in
@@ -8,21 +8,53 @@ License:        BSD and LGPLv2+
 URL:            https://www.spice-space.org
 Source0:        https://www.spice-space.org/download/releases/%{name}-%{version}.tar.bz2
 BuildArch:      noarch
+BuildRequires:  mingw32-filesystem >= 95
+BuildRequires:  mingw64-filesystem >= 95
 
 %description
 Header files describing the spice protocol
 and the para-virtual graphics card QXL.
 
 
+%define mingw_files() \
+%package -n %{1}-spice-protocol \
+Summary:        Spice protocol header files \
+Requires:       pkgconfig \
+\
+%description -n %{1}-spice-protocol \
+Header files describing the spice protocol \
+and the para-virtual graphics card QXL. \
+\
+%files -n %{1}-spice-protocol \
+%doc COPYING CHANGELOG.md \
+%{expand:%%{%{1}_includedir}}/spice-1 \
+%{expand:%%{%{1}_datadir}}/pkgconfig/spice-protocol.pc
+
+%mingw_files mingw32
+%mingw_files mingw64
+
+
 %prep
 %setup -q
 
 %build
+cp -rl . ../build_spice_protocol_tmp
+mv ../build_spice_protocol_tmp build
+pushd build
 %configure
 make %{?_smp_mflags}
+popd
+
+%mingw_configure
+%mingw_make %{?_smp_mflags} V=1
+
 
 %install
+pushd build
 make DESTDIR=%{buildroot} install
+popd
+
+%mingw_make install DESTDIR=%{buildroot}
 
 
 %files
-- 
2.21.0



More information about the Spice-devel mailing list