From a6c366328b458247e344396127408a9beb315025 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Wed, 11 Nov 2020 09:45:07 -0600 Subject: [PATCH] Make GnuTLS patch RHEL-specific, and make glib2-static subpackage Fedora-specific --- glib2.spec | 32 +++++++++++++++++++++++++------- gnutls-hmac.patch | 4 ++-- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/glib2.spec b/glib2.spec index 4e5f51e..649e931 100644 --- a/glib2.spec +++ b/glib2.spec @@ -1,17 +1,18 @@ Name: glib2 Version: 2.67.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A library of handy utility functions License: LGPLv2+ URL: http://www.gtk.org Source0: http://download.gnome.org/sources/glib/2.67/glib-%{version}.tar.xz -# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1728 -Patch0: 1728.patch - +# Required for RHEL core crypto components policy. # https://gitlab.gnome.org/GNOME/glib/-/merge_requests/903 -Patch1: gnutls-hmac.patch +Patch0: gnutls-hmac.patch + +# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1728 +Patch1: 1728.patch # For gnutls-hmac.patch BuildRequires: pkgconfig(gnutls) @@ -72,12 +73,14 @@ BuildRequires: gamin-devel %description fam The glib2-fam package contains the FAM (File Alteration Monitor) module for GIO. +%if 0%{?fedora} %package static Summary: glib static Requires: %{name}-devel = %{version}-%{release} %description static The %{name}-static subpackage contains static libraries for %{name}. +%endif %package tests Summary: Tests for the glib2 package @@ -93,14 +96,24 @@ the functionality of the installed glib2 package. %build # Bug 1324770: Also explicitly remove PCRE sources since we use --with-pcre=system rm glib/pcre/*.[ch] + +# We cannot build with GnuTLS in Fedora since there is no gnutls-static +# subpackage. (glib2-static is needed by qemu in Fedora, but not in RHEL.) +# Accordingly, we can't build a usable glib2-static in RHEL. %meson \ - --default-library=both \ -Dman=true \ -Ddtrace=true \ -Dsystemtap=true \ -Dgtk_doc=true \ -Dfam=true \ - -Dinstalled_tests=true + -Dinstalled_tests=true \ +%if 0%{?rhel} + -Dgnutls=true \ +%endif +%if 0%{?fedora} + --default-library=both \ +%endif + %{nil} %meson_build @@ -211,18 +224,23 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %files fam %{_libdir}/gio/modules/libgiofam.so +%if 0%{?fedora} %files static %{_libdir}/libgio-2.0.a %{_libdir}/libglib-2.0.a %{_libdir}/libgmodule-2.0.a %{_libdir}/libgobject-2.0.a %{_libdir}/libgthread-2.0.a +%endif %files tests %{_libexecdir}/installed-tests %{_datadir}/installed-tests %changelog +* Wed Nov 11 2020 Michael Catanzaro - 2.67.0-4 +- Make GnuTLS patch RHEL-specific, and make glib2-static subpackage Fedora-specific + * Tue Nov 10 2020 Michael Catanzaro - 2.67.0-3 - Use GnuTLS to implement GHmac (thanks to Colin Walters) diff --git a/gnutls-hmac.patch b/gnutls-hmac.patch index 8860632..bd974d5 100644 --- a/gnutls-hmac.patch +++ b/gnutls-hmac.patch @@ -318,7 +318,7 @@ in most cases. mcatanzaro note: I've updated Colin's original patch to implement g_hmac_copy() using gnutls_hmac_copy(), which didn't exist when Colin -developed this patch. I also decided it should be enabled by default. +developed this patch. --- glib/gchecksum.c | 9 ++- glib/gchecksumprivate.h | 32 ++++++++ @@ -658,7 +658,7 @@ index af9645eda..2c4b2c37e 100644 +option('gnutls', + type : 'boolean', -+ value : true, ++ value : false, + description : 'build with gnutls support') + option('internal_pcre',