[gtk-vnc] rpm: merge mingw specfile into native spec



commit b7f7eafe5129d0d38819a844bed3391bda1a374e
Author: Daniel P. Berrangé <dan berrange com>
Date:   Mon Aug 8 09:48:18 2022 -0400

    rpm: merge mingw specfile into native spec
    
    Fedora best practice is to now maintain native and mingw
    builds together, to prevent mingw falling behind and reduce
    the maint burden.
    
    Signed-off-by: Daniel P. Berrangé <berrange redhat com>

 gtk-vnc.spec.in       | 151 ++++++++++++++++++++++++++++++++++++++++++++++
 meson.build           |   6 --
 mingw-gtk-vnc.spec.in | 163 --------------------------------------------------
 prepare-release.sh    |   4 --
 4 files changed, 151 insertions(+), 173 deletions(-)
---
diff --git a/gtk-vnc.spec.in b/gtk-vnc.spec.in
index a4db3b4..0581f57 100644
--- a/gtk-vnc.spec.in
+++ b/gtk-vnc.spec.in
@@ -6,6 +6,12 @@
 %global tls_priority "@LIBVIRT,SYSTEM"
 %global verdir %(echo ${version} | cut -d. -f1,2)
 
+%global with_mingw 0
+
+%if 0%{?fedora}
+%global with_mingw 1
+%endif
+
 Summary: A GTK widget for VNC clients
 Name: gtk-vnc
 Version: @VERSION@
@@ -23,6 +29,25 @@ BuildRequires: pulseaudio-libs-devel
 BuildRequires: /usr/bin/pod2man
 BuildRequires: meson
 
+%if %{with_mingw}
+BuildRequires:  mingw32-filesystem >= 95
+BuildRequires:  mingw32-gcc
+BuildRequires: mingw32-cairo
+BuildRequires: mingw32-gettext
+BuildRequires: mingw32-libgcrypt
+BuildRequires: mingw32-gnutls
+BuildRequires: mingw32-gtk3
+
+
+BuildRequires: mingw64-filesystem >= 95
+BuildRequires: mingw64-gcc
+BuildRequires: mingw64-cairo
+BuildRequires: mingw64-gettext
+BuildRequires: mingw64-libgcrypt
+BuildRequires: mingw64-gnutls
+BuildRequires: mingw64-gtk3
+%endif
+
 %description
 gtk-vnc is a VNC viewer widget for GTK. It is built using coroutines
 allowing it to be completely asynchronous while remaining single threaded.
@@ -99,6 +124,68 @@ allowing it to be completely asynchronous while remaining single threaded.
 
 Libraries, includes, etc. to compile with the gtk-vnc library
 
+%if %{with_mingw}
+# Mingw32
+%package -n mingw32-gvnc
+Summary: MinGW Windows port of VNC GObject
+BuildArch: noarch
+
+%package -n mingw32-gvnc-tools
+Summary: Command line VNC tools
+BuildArch: noarch
+
+%package -n mingw32-gtk-vnc2
+Summary: A GTK3 widget for VNC clients
+Requires: pkgconfig
+Obsoletes: mingw32-gtk-vnc < 1.0.0
+BuildArch: noarch
+
+%description -n mingw32-gvnc
+gvnc is a GObject for managing a VNC connection. It provides all the
+infrastructure required to build a VNC client without having to deal
+with the raw protocol itself.
+
+%description -n mingw32-gvnc-tools
+Provides useful command line utilities for interacting with
+VNC servers. Includes the gvnccapture program for capturing
+screenshots of a VNC desktop
+
+%description -n mingw32-gtk-vnc2
+gtk-vnc is a VNC viewer widget for GTK. It is built using coroutines
+allowing it to be completely asynchronous while remaining single threaded.
+
+# Mingw64
+%package -n mingw64-gvnc
+Summary: MinGW Windows port of VNC GObject
+BuildArch: noarch
+
+%package -n mingw64-gvnc-tools
+Summary: Command line VNC tools
+BuildArch: noarch
+
+%package -n mingw64-gtk-vnc2
+Summary: A GTK3 widget for VNC clients
+Requires: pkgconfig
+Obsoletes: mingw64-gtk-vnc < 1.0.0
+BuildArch: noarch
+
+%description -n mingw64-gvnc
+gvnc is a GObject for managing a VNC connection. It provides all the
+infrastructure required to build a VNC client without having to deal
+with the raw protocol itself.
+
+%description -n mingw64-gvnc-tools
+Provides useful command line utilities for interacting with
+VNC servers. Includes the gvnccapture program for capturing
+screenshots of a VNC desktop
+
+%description -n mingw64-gtk-vnc2
+gtk-vnc is a VNC viewer widget for GTK. It is built using coroutines
+allowing it to be completely asynchronous while remaining single threaded.
+
+%{?mingw_debug_package}
+%endif
+
 %prep
 %autosetup -n gtk-vnc-%{version}
 
@@ -107,11 +194,29 @@ Libraries, includes, etc. to compile with the gtk-vnc library
 %meson_build
 chmod -x examples/*.pl examples/*.js examples/*.py
 
+%if %{with_mingw}
+%mingw_meson -Dintrospection=disabled
+%mingw_ninja
+%endif
+
+
 %install
 %meson_install
 
 %find_lang %{name}
 
+%if %{with_mingw}
+export DESTDIR=%{buildroot}
+%mingw_ninja install
+
+rm -f $RPM_BUILD_ROOT%{mingw32_mandir}/man1/gvnccapture.1*
+rm -f $RPM_BUILD_ROOT%{mingw64_mandir}/man1/gvnccapture.1*
+
+%mingw_debug_install_post
+
+%mingw_find_lang gtk-vnc
+%endif
+
 %check
 %meson_test
 
@@ -168,4 +273,50 @@ chmod -x examples/*.pl examples/*.js examples/*.py
 %{_libdir}/pkgconfig/%{name}-2.0.pc
 %{_datadir}/gir-1.0/GtkVnc-2.0.gir
 
+%if %{with_mingw}
+# Mingw32
+%files -n mingw32-gvnc -f gtk-vnc.lang
+%doc AUTHORS
+%doc ChangeLog
+%doc ChangeLog-old
+%doc NEWS
+%doc README
+%doc COPYING.LIB
+%{mingw32_bindir}/libgvnc-1.0-0.dll
+%{mingw32_libdir}/libgvnc-1.0.dll.a
+%{mingw32_libdir}/pkgconfig/gvnc-1.0.pc
+%{mingw32_includedir}/gvnc-1.0
+
+%files -n mingw32-gtk-vnc2
+%{mingw32_bindir}/libgtk-vnc-2.0-0.dll
+%{mingw32_libdir}/libgtk-vnc-2.0.dll.a
+%{mingw32_libdir}/pkgconfig/gtk-vnc-2.0.pc
+%{mingw32_includedir}/gtk-vnc-2.0
+
+%files -n mingw32-gvnc-tools
+%{mingw32_bindir}/gvnccapture.exe
+
+# Mingw64
+%files -n mingw64-gvnc -f gtk-vnc.lang
+%doc AUTHORS
+%doc ChangeLog
+%doc ChangeLog-old
+%doc NEWS
+%doc README
+%doc COPYING.LIB
+%{mingw64_bindir}/libgvnc-1.0-0.dll
+%{mingw64_libdir}/libgvnc-1.0.dll.a
+%{mingw64_libdir}/pkgconfig/gvnc-1.0.pc
+%{mingw64_includedir}/gvnc-1.0
+
+%files -n mingw64-gtk-vnc2
+%{mingw64_bindir}/libgtk-vnc-2.0-0.dll
+%{mingw64_libdir}/libgtk-vnc-2.0.dll.a
+%{mingw64_libdir}/pkgconfig/gtk-vnc-2.0.pc
+%{mingw64_includedir}/gtk-vnc-2.0
+
+%files -n mingw64-gvnc-tools
+%{mingw64_bindir}/gvnccapture.exe
+%endif
+
 %changelog
diff --git a/meson.build b/meson.build
index 7ab2f25..db34df3 100644
--- a/meson.build
+++ b/meson.build
@@ -372,9 +372,3 @@ configure_file(
   output: 'gtk-vnc.spec',
   configuration: pkgdata,
 )
-
-configure_file(
-  input: 'mingw-gtk-vnc.spec.in',
-  output: 'mingw-gtk-vnc.spec',
-  configuration: pkgdata,
-)
diff --git a/prepare-release.sh b/prepare-release.sh
index 57c9161..6ffdac2 100755
--- a/prepare-release.sh
+++ b/prepare-release.sh
@@ -12,7 +12,3 @@ ninja -C build dist
 rpmbuild --nodeps \
    --define "_sourcedir `pwd`/build/meson-dist/" \
    -ba --clean build/gtk-vnc.spec
-
-rpmbuild --nodeps \
-   --define "_sourcedir `pwd`/build/meson-dist/" \
-   -ba --clean build/mingw-gtk-vnc.spec


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]