diff --git a/gpgme-1.9.0.tar.bz2 b/gpgme-1.9.0.tar.bz2
new file mode 100644
index 0000000..8fe4c80
--- /dev/null
+++ b/gpgme-1.9.0.tar.bz2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:1b29fedb8bfad775e70eafac5b0590621683b2d9869db994568e6401f4034ceb
+size 1344222
diff --git a/libassuan-2.4.3.tar.bz2 b/libassuan-2.4.3.tar.bz2
new file mode 100644
index 0000000..a8e5c8e
--- /dev/null
+++ b/libassuan-2.4.3.tar.bz2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:22843a3bdb256f59be49842abf24da76700354293a066d82ade8134bb5aa2b71
+size 559867
diff --git a/libgpg-error-1.27.tar.bz2 b/libgpg-error-1.27.tar.bz2
new file mode 100644
index 0000000..19c3ccd
--- /dev/null
+++ b/libgpg-error-1.27.tar.bz2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4f93aac6fecb7da2b92871bb9ee33032be6a87b174f54abf8ddf0911a22d29d2
+size 813060
diff --git a/libreoffice.changes b/libreoffice.changes
index 134ce87..f544d78 100644
--- a/libreoffice.changes
+++ b/libreoffice.changes
@@ -1,3 +1,10 @@
+-------------------------------------------------------------------
+Thu Nov 2 13:36:04 UTC 2017 - tchvatal@suse.com
+
+- Switch to bundled gpgme on old distros where it is not possible
+ to update
+- Rebase scp2-user-config-suse.diff to apply again
+
-------------------------------------------------------------------
Thu Nov 2 09:24:49 UTC 2017 - tchvatal@suse.com
diff --git a/libreoffice.spec b/libreoffice.spec
index e992e27..1d59424 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -35,6 +35,11 @@
%else
%bcond_with firebird
%endif
+%if 0%{?suse_version} > 1320 || (0%{?sle_version} >= 120300 && 0%{?is_opensuse})
+%bcond_without system_gpgme
+%else
+%bcond_with system_gpgme
+%endif
Name: libreoffice
Version: 5.4.2.2
Release: 0
@@ -53,6 +58,10 @@ Source402: %{external_url}/b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_%{nu
# used extensions sources
Source450: %{external_url}/1f467e5bb703f12cbbb09d5cf67ecf4a-converttexttonumber-1-5-0.oxt
Source452: %{external_url}/90401bca927835b6fbae4a707ed187c8-nlpsolver-0.9.tar.bz2
+# GPGME bundle list
+Source1000: %{external_url}/gpgme-1.9.0.tar.bz2
+Source1001: %{external_url}/libgpg-error-1.27.tar.bz2
+Source1002: %{external_url}/libassuan-2.4.3.tar.bz2
# This never had an release so just bundle it as per what other distros do
Source1999: %{external_url}/4b87018f7fff1d054939d19920b751a0-collada2gltf-master-cb1d97788a.tar.bz2
# Internal bundled stuff we can't remove
@@ -121,7 +130,9 @@ BuildRequires: libcppunit-devel >= 1.14.0
BuildRequires: libexif
BuildRequires: libfonts
BuildRequires: libformula
+%if %{with system_gpgme}
BuildRequires: libgpgmepp-devel
+%endif
BuildRequires: libjpeg-devel
BuildRequires: liblayout
BuildRequires: libloader
@@ -1029,6 +1040,11 @@ export NOCONFIGURE=yes
%else
--disable-kde4 \
%endif
+%if %{with system_gpgme}
+ --with-system-gpgmepp \
+%else
+ --without-system-gpgmepp \
+%endif
%if %{with firebird}
--enable-firebird-sdbc \
%else
diff --git a/scp2-user-config-suse.diff b/scp2-user-config-suse.diff
index 1d9f728..6ae0a8f 100644
--- a/scp2-user-config-suse.diff
+++ b/scp2-user-config-suse.diff
@@ -3,24 +3,24 @@
scp2/source/ooo/common_brand.scp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
-diff --git officecfg/registry/data/org/openoffice/Setup.xcu officecfg/registry/data/org/openoffice/Setup.xcu
-index 8e18ca5..7c0b95d 100644
---- officecfg/registry/data/org/openoffice/Setup.xcu
+Index: officecfg/registry/data/org/openoffice/Setup.xcu
+===================================================================
+--- officecfg/registry/data/org/openoffice/Setup.xcu.orig
+++ officecfg/registry/data/org/openoffice/Setup.xcu
-@@ -788,7 +788,7 @@
+@@ -787,7 +787,7 @@
10
-- Libreoffice 3=libreoffice/3,Openofice.org 3=openoffice.org/3,OpenOffice.org 2=openoffice.org2,StarOffice 8=staroffice8,StarSuite 8=starsuite8
-+ Libreoffice 3=libreoffice/3-suse,Openofice.org 3=ooo3,OpenOffice.org 2=ooo-2.0,StarOffice 8=staroffice8,StarSuite 8=starsuite8
+- Libreoffice 3=libreoffice/3,Openoffice.org 3=openoffice.org/3,OpenOffice.org 2=openoffice.org2,StarOffice 8=staroffice8,StarSuite 8=starsuite8
++ Libreoffice 3=libreoffice/3-suse,Openoffice.org 3=openoffice.org/3,OpenOffice.org 2=openoffice.org2,StarOffice 8=staroffice8,StarSuite 8=starsuite8
-diff --git scp2/source/ooo/common_brand.scp scp2/source/ooo/common_brand.scp
-index 7bbf873..0b235a0 100644
---- scp2/source/ooo/common_brand.scp
+Index: scp2/source/ooo/common_brand.scp
+===================================================================
+--- scp2/source/ooo/common_brand.scp.orig
+++ scp2/source/ooo/common_brand.scp
-@@ -774,7 +774,7 @@ ProfileItem gid_Brand_Profileitem_Bootstrap_Userinstall
+@@ -381,7 +381,7 @@ ProfileItem gid_Brand_Profileitem_Bootst
#elif defined MACOSX
Value = "$SYSUSERCONFIG/%ONEWORDPRODUCTNAME/%USERDIRPRODUCTVERSION";
#else
@@ -29,6 +29,3 @@ index 7bbf873..0b235a0 100644
#endif
End
---
-1.7.0.1
-