Hello community,

here is the log from the commit of package libspectre for openSUSE:Factory 
checked in at 2015-11-08 11:25:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libspectre (Old)
 and      /work/SRC/openSUSE:Factory/.libspectre.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libspectre"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libspectre/libspectre.changes    2014-01-23 
15:48:34.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libspectre.new/libspectre.changes       
2015-11-08 11:25:37.000000000 +0100
@@ -1,0 +2,13 @@
+Wed Nov  4 15:02:34 UTC 2015 - [email protected]
+
+- Replace the logic in the prep section to use zypper in order to
+  verify the version. The previous version had issues on openSUSE
+  13.2.
+
+-------------------------------------------------------------------
+Wed Nov  4 10:33:43 UTC 2015 - [email protected]
+
+- Add libspectre-gs-9.18.patch: Fix building with ghostscript 9.18;
+  patch only applied when building against GS 9.18+ (boo#953149).
+
+-------------------------------------------------------------------

New:
----
  libspectre-gs-9.18.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libspectre.spec ++++++
--- /var/tmp/diff_new_pack.VzwX87/_old  2015-11-08 11:25:38.000000000 +0100
+++ /var/tmp/diff_new_pack.VzwX87/_new  2015-11-08 11:25:38.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package libspectre
 #
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -25,10 +25,15 @@
 License:        GPL-2.0+
 Group:          Development/Libraries/C and C++
 Source0:        
http://libspectre.freedesktop.org/releases/%{name}-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM libspectre-gs-9.18.patch boo#953149 [email protected] 
-- Fix build with Ghostscript 9.18: e_* is renamed to gs_error_*
+Patch0:         libspectre-gs-9.18.patch
 %define debug_package_requires libspectre1 = %{version}-%{release}
+# Need ghostscript-devel >= 9.18 due to libspectre-gs-9.18 patch
 BuildRequires:  ghostscript-devel
 BuildRequires:  ghostscript-library
 BuildRequires:  pkg-config
+# Zypper is just needed as a helper to properly compare versions, to decide if 
patch0 needs to be applied or not
+BuildRequires:  zypper
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -58,6 +63,10 @@
 
 %prep
 %setup -q
+# Apply the patch only for ghostscript >= 9.18
+if zypper vcmp $(rpm -q --qf '%%{version}' ghostscript-devel) 9.18 | grep -e 
"\(newer\|matches\)"; then
+%patch0 -p1
+fi
 
 %build
 %configure --disable-static --enable-shared

++++++ libspectre-gs-9.18.patch ++++++
Index: libspectre-0.2.7/libspectre/spectre-gs.c
===================================================================
--- libspectre-0.2.7.orig/libspectre/spectre-gs.c
+++ libspectre-0.2.7/libspectre/spectre-gs.c
@@ -43,12 +43,12 @@ critic_error_code (int code)
        
        if (code <= -100) {
                switch (code) {
-                       case e_Fatal:
+                       case gs_error_Fatal:
                                fprintf (stderr, "fatal internal error %d", 
code);
                                return TRUE;
                                break;
 
-                       case e_ExecStackUnderflow:
+                       case gs_error_ExecStackUnderflow:
                                fprintf (stderr, "stack overflow %d", code);
                                return TRUE;
                                break;
@@ -109,9 +109,9 @@ spectre_gs_process (SpectreGS  *gs,
                set = _spectre_strdup_printf ("%d %d translate\n", -x, -y);
                error = gsapi_run_string_continue (ghostscript_instance, set, 
strlen (set),
                                                   0, &exit_code);
-               error = error == e_NeedInput ? 0 : error;
+               error = error == gs_error_NeedInput ? 0 : error;
                free (set);
-               if (error != e_NeedInput && critic_error_code (error)) {
+               if (error != gs_error_NeedInput && critic_error_code (error)) {
                        fclose (fd);
                        return FALSE;
                }
@@ -126,7 +126,7 @@ spectre_gs_process (SpectreGS  *gs,
                read = fread (buf, sizeof (char), to_read, fd);
                error = gsapi_run_string_continue (ghostscript_instance,
                                                   buf, read, 0, &exit_code);
-               error = error == e_NeedInput ? 0 : error;
+               error = error == gs_error_NeedInput ? 0 : error;
                left -= read;
        }
        

Reply via email to