From 81defae6368f065b1d1679938e6ff68208851a01a506d8c0fb779eda6e263d00 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 7 Feb 2013 14:15:47 +0000 Subject: [PATCH 1/3] . OBS-URL: https://build.opensuse.org/package/show/graphics/xfig?expand=0&rev=31 --- xfig.3.2.5b-mediaboxrealnb.dif | 25 +++++++++++++++++++++++++ xfig.changes | 6 ++++++ xfig.spec | 5 ++++- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 xfig.3.2.5b-mediaboxrealnb.dif diff --git a/xfig.3.2.5b-mediaboxrealnb.dif b/xfig.3.2.5b-mediaboxrealnb.dif new file mode 100644 index 0000000..817f686 --- /dev/null +++ b/xfig.3.2.5b-mediaboxrealnb.dif @@ -0,0 +1,25 @@ +--- f_readeps.c ++++ f_readeps.c 2013-02-07 14:10:06.681492792 +0000 +@@ -79,15 +79,21 @@ read_epsf_pdf(FILE *file, int filetype, + if (pdf_flag) { + if (!strncmp(buf, "/MediaBox", 8)) { /* look for the MediaBox spec */ + char *c; ++ float rllx, rlly, rurx, rury; + + c = strchr(buf, '[') + 1; +- if (c && sscanf(c, "%d %d %d %d", &llx, &lly, &urx, &ury) < 4) { ++ if (c && sscanf(c, "%d %d %d %d", "%f %f %f %f", &rllx, &rlly, &rurx, &rury) < 4) { + llx = lly = 0; + urx = paper_sizes[0].width * 72 / PIX_PER_INCH; + ury = paper_sizes[0].height * 72 / PIX_PER_INCH; + file_msg("Bad MediaBox in header, assuming %s size", + appres.INCHES ? "Letter" : "A4"); + app_flush(); ++ } else { ++ llx = round(rllx); ++ lly = round(rlly); ++ urx = round(rurx); ++ ury = round(rury); + } + } + /* look for bounding box */ diff --git a/xfig.changes b/xfig.changes index cd4c7b2..8dc56c4 100644 --- a/xfig.changes +++ b/xfig.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Feb 7 14:12:21 UTC 2013 - werner@suse.de + +- Add xfig.3.2.5b-mediaboxrealnb.dif to fix regarding pdf import, + reported by Loic Le Guyader compare with Debian bug #530898 + ------------------------------------------------------------------- Wed Oct 10 07:25:44 UTC 2012 - werner@suse.de diff --git a/xfig.spec b/xfig.spec index 5b73351..105b92f 100644 --- a/xfig.spec +++ b/xfig.spec @@ -1,7 +1,7 @@ # # spec file for package xfig # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -60,6 +60,8 @@ Patch0: xfig.%{version}.dif Patch1: xfig.3.2.5-urw-fonts.dif Patch2: xfig.3.2.5-xim.dif Patch3: xfig.3.2.3d-international-std-fonts.dif +# PATCH-FIX-UPSTREAM xfig.3.2.5b-mediaboxrealnb.dif [debian#530898] +Patch4: xfig.3.2.5b-mediaboxrealnb.dif Patch5: xfig.3.2.5b-null.dif Patch6: xfig.3.2.5b-locale.dif Patch7: xfig.3.2.5b-fixes.dif @@ -109,6 +111,7 @@ find -type f | xargs -r chmod a-x,go-w %patch1 -p0 -b .urw-fonts %patch2 -p0 -b .xim %patch3 -p1 -b .international-std-fonts +%patch4 -p0 -b .mbox %patch5 -p0 -b .null %patch6 -p0 -b .locale %patch7 -p0 -b .fixes From a25f2445c9c1d040864c73f9368a7f57e172a0bc0cb7551c40328223d378969d Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 8 Feb 2013 11:15:09 +0000 Subject: [PATCH 2/3] . OBS-URL: https://build.opensuse.org/package/show/graphics/xfig?expand=0&rev=32 --- xfig.3.2.5b-mediaboxrealnb.dif | 32 ++++++++++++++++++-------------- xfig.changes | 5 +++++ 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/xfig.3.2.5b-mediaboxrealnb.dif b/xfig.3.2.5b-mediaboxrealnb.dif index 817f686..b00840a 100644 --- a/xfig.3.2.5b-mediaboxrealnb.dif +++ b/xfig.3.2.5b-mediaboxrealnb.dif @@ -1,25 +1,29 @@ --- f_readeps.c -+++ f_readeps.c 2013-02-07 14:10:06.681492792 +0000 -@@ -79,15 +79,21 @@ read_epsf_pdf(FILE *file, int filetype, - if (pdf_flag) { - if (!strncmp(buf, "/MediaBox", 8)) { /* look for the MediaBox spec */ - char *c; -+ float rllx, rlly, rurx, rury; ++++ f_readeps.c 2013-02-08 11:11:22.717952436 +0000 +@@ -77,11 +77,13 @@ read_epsf_pdf(FILE *file, int filetype, - c = strchr(buf, '[') + 1; + /* look for /MediaBox for pdf file */ + if (pdf_flag) { +- if (!strncmp(buf, "/MediaBox", 8)) { /* look for the MediaBox spec */ ++ char *s; ++ for(s=buf; (s=strchr(s,'/')); s++) { ++ if (!strncmp(s, "/MediaBox", 8)) { /* look for the MediaBox spec */ + char *c; + +- c = strchr(buf, '[') + 1; - if (c && sscanf(c, "%d %d %d %d", &llx, &lly, &urx, &ury) < 4) { -+ if (c && sscanf(c, "%d %d %d %d", "%f %f %f %f", &rllx, &rlly, &rurx, &rury) < 4) { ++ c = strchr(buf, '['); ++ if (c && sscanf(c+1, "%d %d %d %d", &llx, &lly, &urx, &ury) < 4) { llx = lly = 0; urx = paper_sizes[0].width * 72 / PIX_PER_INCH; ury = paper_sizes[0].height * 72 / PIX_PER_INCH; - file_msg("Bad MediaBox in header, assuming %s size", +@@ -89,7 +91,9 @@ read_epsf_pdf(FILE *file, int filetype, appres.INCHES ? "Letter" : "A4"); app_flush(); -+ } else { -+ llx = round(rllx); -+ lly = round(rlly); -+ urx = round(rurx); -+ ury = round(rury); } ++ break; } ++ } /* look for bounding box */ + } else if (!nested && !strncmp(buf, "%%BoundingBox:", 14)) { + if (!strstr(buf, "(atend)")) { /* make sure doesn't say (atend) */ diff --git a/xfig.changes b/xfig.changes index 8dc56c4..f624bce 100644 --- a/xfig.changes +++ b/xfig.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Feb 8 11:14:39 UTC 2013 - werner@suse.de + +- User original patch from Debian + ------------------------------------------------------------------- Thu Feb 7 14:12:21 UTC 2013 - werner@suse.de From 951a758c3fabe62365cc408d88d59de18faf33afa6515cdf1eee0628b7517f06 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 8 Feb 2013 12:53:57 +0000 Subject: [PATCH 3/3] . OBS-URL: https://build.opensuse.org/package/show/graphics/xfig?expand=0&rev=33 --- xfig.3.2.5b-libpng14.dif | 14 -------------- xfig.3.2.5b-patches.tar.bz2 | 3 +++ xfig.3.2.5b.dif | 32 ++++++++++++++++++++++++++++++++ xfig.changes | 2 +- xfig.spec | 4 ++-- 5 files changed, 38 insertions(+), 17 deletions(-) delete mode 100644 xfig.3.2.5b-libpng14.dif create mode 100644 xfig.3.2.5b-patches.tar.bz2 diff --git a/xfig.3.2.5b-libpng14.dif b/xfig.3.2.5b-libpng14.dif deleted file mode 100644 index 08e0625..0000000 --- a/xfig.3.2.5b-libpng14.dif +++ /dev/null @@ -1,14 +0,0 @@ ---- f_readpng.c -+++ f_readpng.c 2010-04-20 15:45:02.627072958 +0000 -@@ -136,7 +136,11 @@ read_png(FILE *file, int filetype, F_pic - - if (png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette)) { - png_get_hIST(png_ptr, info_ptr, &histogram); -+#if (PNG_LIBPNG_VER_MAJOR > 1 || (PNG_LIBPNG_VER_MAJOR == 1 && (PNG_LIBPNG_VER_MINOR > 4))) || defined(png_set_quantize) -+ png_set_quantize(png_ptr, palette, num_palette, 256, histogram, 0); -+#else - png_set_dither(png_ptr, palette, num_palette, 256, histogram, 0); -+#endif - } - } - if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { diff --git a/xfig.3.2.5b-patches.tar.bz2 b/xfig.3.2.5b-patches.tar.bz2 new file mode 100644 index 0000000..6b9ae5f --- /dev/null +++ b/xfig.3.2.5b-patches.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57f3deba38d376e7b6f980e69679f47f491bf8bad6b9d778afa92786b6723756 +size 2485 diff --git a/xfig.3.2.5b.dif b/xfig.3.2.5b.dif index e2e3903..607a9e8 100644 --- a/xfig.3.2.5b.dif +++ b/xfig.3.2.5b.dif @@ -1,3 +1,35 @@ +--- Doc/xfig.man ++++ Doc/xfig.man +@@ -1475,8 +1475,11 @@ + See the + .IR Imakefile . + .TP +-/usr/lib/X11/xfig +-This directory contains the html documentation, the above mentioned ++/usr/share/doc/packages/xfig ++This directory contains the documentation. ++.TP ++/usr/share/X11/xfig ++This directory contains the above mentioned + CompKeyDB file, and a directory of libraries containing Fig objects + such as electrical symbols, logic symbols, etc. + .TP +--- Doc/xfig_man.html ++++ Doc/xfig_man.html +@@ -2539,8 +2539,11 @@ + See the + Imakefile. + +-
/usr/lib/X11/xfig
+-This directory contains the html documentation, the above mentioned ++
/usr/share/doc/packages/xfig
++This directory contains the documentation. ++ ++
/usr/share/X11/xfig
++This directory contains the above mentioned + CompKeyDB file, and a directory of libraries containing Fig objects + such as electrical symbols, logic symbols, etc. +
Fig.ad and Fig-color.ad --- Fig.ad +++ Fig.ad 2009-12-14 11:42:24.307429001 +0000 @@ -15,6 +15,8 @@ Fig.version: 3.2.5b diff --git a/xfig.changes b/xfig.changes index f624bce..add5371 100644 --- a/xfig.changes +++ b/xfig.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Fri Feb 8 11:14:39 UTC 2013 - werner@suse.de -- User original patch from Debian +- User original patches from Debian ------------------------------------------------------------------- Thu Feb 7 14:12:21 UTC 2013 - werner@suse.de diff --git a/xfig.spec b/xfig.spec index 105b92f..74aac4d 100644 --- a/xfig.spec +++ b/xfig.spec @@ -56,6 +56,7 @@ Source1: font-test.fig Source2: browser Source3: xfig.sh Source4: xfig.desktop +Source5: xfig.%{version}-patches.tar.bz2 Patch0: xfig.%{version}.dif Patch1: xfig.3.2.5-urw-fonts.dif Patch2: xfig.3.2.5-xim.dif @@ -66,7 +67,6 @@ Patch5: xfig.3.2.5b-null.dif Patch6: xfig.3.2.5b-locale.dif Patch7: xfig.3.2.5b-fixes.dif Patch8: xfig.3.2.5b-pspdftex.dif -Patch9: xfig.3.2.5b-libpng14.dif Patch10: xfig.3.2.5b-preview.dif Patch11: xfig.3.2.5b-bnc657393.dif Patch12: xfig.3.2.5b-bnc777469.diff @@ -107,6 +107,7 @@ Authors: %prep %setup -q -n xfig.%{version} find -type f | xargs -r chmod a-x,go-w +tar Oxfj %{S:5} | patch -p1 -s %patch0 -p0 %patch1 -p0 -b .urw-fonts %patch2 -p0 -b .xim @@ -116,7 +117,6 @@ find -type f | xargs -r chmod a-x,go-w %patch6 -p0 -b .locale %patch7 -p0 -b .fixes %patch8 -p0 -b .pspdftex -%patch9 -p0 -b .libpng14 %patch10 -p0 -b .preview %patch11 -p0 -b .vsprintf %patch12 -p1 -b .ovflow