From d6f588a2f8373f30b00b94a29e17cb631d27949d Mon Sep 17 00:00:00 2001
From: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
Date: Tue, 30 Aug 2016 15:40:15 -0400
Subject: [PATCH] packaging: compile gsettings schema for f23

Starting f24 and later, the gsettings schema compilation is
automatically triggered when needed, but we need to explicitly do
it for earlier versions [0].

This patch also disables the gsettings schema local compilation so
that this is not done during 'make install' since the schema will
be compiled post install and it is also not needed locally.

[0] - https://fedoraproject.org/wiki/Packaging:Scriptlets?rd=Packaging:ScriptletSnippets#GSettings_Schema

Change-Id: I8b78c4d50e2208c29200f89d3947aa3117fbb6ab
Tuleap: #975
---
 packaging/rules/debian/rules     |  1 +
 packaging/rules/fedora/ring.spec | 18 +++++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/packaging/rules/debian/rules b/packaging/rules/debian/rules
index 46b0f243..95291a80 100755
--- a/packaging/rules/debian/rules
+++ b/packaging/rules/debian/rules
@@ -73,6 +73,7 @@ override_dh_auto_configure:
 		cmake \
 			-DCMAKE_INSTALL_PREFIX=/usr \
 			-DLibRingClient_PROJECT_DIR=/$(CURDIR)/lrc \
+			-DGSETTINGS_LOCALCOMPILE=OFF \
 			..
 
 	dh_auto_configure
diff --git a/packaging/rules/fedora/ring.spec b/packaging/rules/fedora/ring.spec
index c7036110..f8c05054 100644
--- a/packaging/rules/fedora/ring.spec
+++ b/packaging/rules/fedora/ring.spec
@@ -133,6 +133,7 @@ cd %{_builddir}/ring-project/client-gnome && \
         -DCMAKE_INSTALL_PREFIX=%{_prefix} \
         -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
         -DLibRingClient_PROJECT_DIR=%{_builddir}/ring-project/lrc \
+        -DGSETTINGS_LOCALCOMPILE=OFF \
         ..
 
 #######################
@@ -202,6 +203,21 @@ DESTDIR=%{buildroot} make -C client-gnome/build install
 
 %post -p /sbin/ldconfig
 
-%postun -p /sbin/ldconfig
+%postun
+-p /sbin/ldconfig
+
+#for < f24 we have to update the schema explicitly
+%if 0%{?fedora} < 24
+    if [ $1 -eq 0 ] ; then
+        /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
+    fi
+%endif
+
+%posttrans
+#for < f24 we have to update the schema explicitly
+%if 0%{?fedora} < 24
+    /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
+%endif
+
 
 %changelog
-- 
GitLab