diff --git a/transfig.3.2.5d-mediaboxrealnb.dif b/transfig.3.2.5d-mediaboxrealnb.dif index 75b0255..0fe1490 100644 --- a/transfig.3.2.5d-mediaboxrealnb.dif +++ b/transfig.3.2.5d-mediaboxrealnb.dif @@ -1,33 +1,27 @@ --- fig2dev/dev/readeps.c -+++ fig2dev/dev/readeps.c 2013-02-07 16:18:36.233452627 +0000 -@@ -79,12 +79,20 @@ read_eps_pdf(file, filetype, pic, llx, l ++++ fig2dev/dev/readeps.c 2013-02-08 11:21:58.593945615 +0000 +@@ -77,16 +77,22 @@ read_eps_pdf(file, filetype, pic, llx, l + while (fgets(buf, 512, file) != NULL) { + /* look for /MediaBox for pdf file */ if (pdf_flag) { ++ char *s; ++ for(s=buf; (s=strchr(s,'/')); s++) { if (!strncmp(buf, "/MediaBox", 8)) { /* look for the MediaBox spec */ - c = strchr(buf,'[')+1; +- c = strchr(buf,'[')+1; - if (c && sscanf(c,"%d %d %d %d",llx,lly,&urx,&ury) < 4) { -+ if (c && sscanf(c, "%lf %lf %lf %lf", -+ &fllx, &flly, &furx, &fury) < 4) { ++ c = strchr(s,'['); ++ if (c && sscanf(c+1,"%d %d %d %d",llx,lly,&urx,&ury) < 4) { *llx = *lly = 0; urx = paperdef[0].width*72; ury = paperdef[0].height*72; put_msg("Bad MediaBox in imported PDF file %s, assuming %s size", pic->file, metric? "A4" : "Letter" ); -+ } else { -+ *llx = (int) floor(fllx); -+ *lly = (int) floor(flly); -+ urx = (int) floor(furx); -+ ury = (int) floor(fury); -+ pic->bit_size.x = (int) (furx-fllx); -+ pic->bit_size.y = (int) (fury-flly); } ++ pic->bit_size.x = (urx-(*llx)); ++ pic->bit_size.y = (ury-(*lly)); ++ break; } ++ } /* look for bounding box for EPS file */ -@@ -101,6 +109,8 @@ read_eps_pdf(file, filetype, pic, llx, l - } - *llx = (int) floor(fllx); - *lly = (int) floor(flly); -+ urx = (int) floor(furx); -+ ury = (int) floor(fury); - pic->bit_size.x = (int) (furx-fllx); - pic->bit_size.y = (int) (fury-flly); - break; + } else if (!nested && !strncmp(buf, "%%BoundingBox:", 14)) { + c=buf+14; diff --git a/transfig.3.2.5d-patches.tar.bz2 b/transfig.3.2.5d-patches.tar.bz2 new file mode 100644 index 0000000..23dfae7 --- /dev/null +++ b/transfig.3.2.5d-patches.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be9f42b720221593ca3ef8f75815797b07bd35161ae858c81215f370b866b158 +size 221348 diff --git a/transfig.3.2.5d.dif b/transfig.3.2.5d.dif index 1ebf681..ae29540 100644 --- a/transfig.3.2.5d.dif +++ b/transfig.3.2.5d.dif @@ -177,8 +177,16 @@ if (strstr(str, "CompositeRoman")) enable_composite_font = True; fputs(str, tfp); --- fig2dev/dev/genpstex.c -+++ fig2dev/dev/genpstex.c 2008-04-25 14:01:42.000000000 +0000 -@@ -64,10 +64,13 @@ extern void ++++ fig2dev/dev/genpstex.c 2013-02-08 12:45:41.649945157 +0000 +@@ -37,6 +37,7 @@ + * Jose Alberto. + */ + ++#include + #include "fig2dev.h" + #include "genps.h" + #include "genpdf.h" +@@ -64,10 +65,13 @@ extern void genps_spline (), genlatex_option (), genlatex_text (), @@ -193,7 +201,7 @@ + genpdf_end(); static char pstex_file[1000] = ""; - + static int iObjectsRead = 0; --- fig2dev/dev/gensvg.c +++ fig2dev/dev/gensvg.c 2009-12-14 13:29:42.000000000 +0000 @@ -816,9 +816,11 @@ gensvg_text (t) @@ -295,7 +303,7 @@ */ @@ -95,4 +98,10 @@ fig_getopt(nargc,nargv,ostr) } - return(optopt); /* dump back option letter */ + return(fig_optopt); /* dump back option letter */ } - +#else diff --git a/transfig.changes b/transfig.changes index b8d7abb..2aaf121 100644 --- a/transfig.changes +++ b/transfig.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Feb 8 11:14:39 UTC 2013 - werner@suse.de + +- User original patches from Debian + ------------------------------------------------------------------- Thu Feb 7 16:34:21 UTC 2013 - werner@suse.de diff --git a/transfig.spec b/transfig.spec index 9f139be..dba3125 100644 --- a/transfig.spec +++ b/transfig.spec @@ -29,14 +29,9 @@ BuildRequires: texlive-pdftex BuildRequires: texlive-times BuildRequires: tex(times.sty) %endif +BuildRequires: libpng-devel BuildRequires: xorg-x11 BuildRequires: xorg-x11-devel -%if 0%{?suse_version} > 1120 -BuildRequires: libpng12-compat-devel -BuildRequires: libpng12-devel -%else -BuildRequires: libpng-devel -%endif Url: http://www.xfig.org/ Provides: transfig.3.2.3d Requires: ghostscript-fonts-std @@ -48,6 +43,7 @@ Summary: Graphic Converter License: MIT Group: Productivity/Graphics/Convertors Source: transfig.%{version}.tar.bz2 +Source1: transfig.%{version}-patches.tar.bz2 Patch0: transfig.3.2.5d.dif Patch2: transfig.3.2.5-binderman.dif Patch3: transfig.3.2.5d-mediaboxrealnb.dif @@ -86,6 +82,8 @@ Authors: %prep %setup -q -n transfig.%{version} +find -type f | xargs -r chmod a-x,go-w +tar Oxfj %{S:1} | patch -p1 -s %patch0 -p0 -b .0 %patch2 -p0 -b .bm %patch3 -p0 -b .mbox