From 25f6510de58cbfd9381d350b2222bdeedaf6bbbb Mon Sep 17 00:00:00 2001 From: "David Kaspar [Dee'Kej]" Date: Fri, 7 Oct 2016 14:11:04 +0200 Subject: [PATCH] rebase to 'ghostscript-9.20' Rebase notes: - OpenJPEG support has been re-enabled - ijs-config custom tool removed (pkg-config is used by default now) - no API/ABI changes according to upstream - some patches updated to 'git format-patch' format and renamed - squashed 'ghostscript-Fontmap.local.patch' into 'ghostscript-9.20-runlibfileifexists.patch' - rest of patches deleted (irrelevant for current version), mostly because upstream has fixed those issues in some way --- .gitignore | 1 + ...cript-9.20-fix-openjpeg-system-build.patch | 56 ++++++++++ ...ghostscript-9.20-run-dvipdf-securely.patch | 20 +++- ghostscript-9.20-runlibfileifexists.patch | 93 ++++++++++++++++ ghostscript-9.20-urw-fonts-naming.patch | 101 ++++++++++++++++++ ghostscript-Fontmap.local.patch | 9 -- ghostscript-bz1380416.patch | 80 -------------- ghostscript-icc-missing-check.patch | 12 --- ghostscript-multilib.patch | 14 --- ghostscript-noopt.patch | 12 --- ghostscript-runlibfileifexists.patch | 52 --------- ghostscript-system-zlib.patch | 21 ---- ghostscript-urw-fonts-naming.patch | 93 ---------------- ghostscript-wrf-snprintf.patch | 22 ---- ghostscript.spec | 90 ++++++---------- sources | 2 +- 16 files changed, 299 insertions(+), 379 deletions(-) create mode 100644 ghostscript-9.20-fix-openjpeg-system-build.patch rename ghostscript-scripts.patch => ghostscript-9.20-run-dvipdf-securely.patch (54%) create mode 100644 ghostscript-9.20-runlibfileifexists.patch create mode 100644 ghostscript-9.20-urw-fonts-naming.patch delete mode 100644 ghostscript-Fontmap.local.patch delete mode 100644 ghostscript-bz1380416.patch delete mode 100644 ghostscript-icc-missing-check.patch delete mode 100644 ghostscript-multilib.patch delete mode 100644 ghostscript-noopt.patch delete mode 100644 ghostscript-runlibfileifexists.patch delete mode 100644 ghostscript-system-zlib.patch delete mode 100644 ghostscript-urw-fonts-naming.patch delete mode 100644 ghostscript-wrf-snprintf.patch diff --git a/.gitignore b/.gitignore index acb4845..bcc3585 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ ghostscript-8.71.tar.xz /ghostscript-9.15-cleaned.tar.bz2 /ghostscript-9.15-cleaned-1.tar.bz2 /ghostscript-9.16-cleaned-1.tar.bz2 +/ghostscript-9.20.tar.xz diff --git a/ghostscript-9.20-fix-openjpeg-system-build.patch b/ghostscript-9.20-fix-openjpeg-system-build.patch new file mode 100644 index 0000000..3c637e7 --- /dev/null +++ b/ghostscript-9.20-fix-openjpeg-system-build.patch @@ -0,0 +1,56 @@ +From 99cf218dbd5f6fbdbda2ce6872eb9ab7f475c353 Mon Sep 17 00:00:00 2001 +From: Chris Liddell +Date: Tue, 27 Sep 2016 11:22:18 +0100 +Subject: [PATCH 1/2] Add pre-processor define for shared OpenJPEG + +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 25875ad..2ca2a80 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -290,7 +290,7 @@ JBIG2_CFLAGS=@JBIG2_AUTOCONF_CFLAGS@ + JPX_LIB=@JPX_DECODER@ + SHARE_JPX=@SHARE_JPX@ + JPXSRCDIR=@JPXDIR@ +-JPX_CFLAGS=@JPX_AUTOCONF_CFLAGS@ @JPX_SSE_CFLAGS@ ++JPX_CFLAGS=-DSHARE_JPX=$(SHARE_JPX) @JPX_AUTOCONF_CFLAGS@ @JPX_SSE_CFLAGS@ + + # uncomment the following three lines and one of the last two to + # compile in the Luratech lwf_jp2 codec +-- +2.7.4 + + +From 4f19ab99cac2d8a7d21aea34d8aea0727fad52d3 Mon Sep 17 00:00:00 2001 +From: Didier Raboud +Date: Thu, 6 Oct 2016 17:08:41 +0200 +Subject: [PATCH 2/2] Don't pass -DOPJ_STATIC when compiling the OpenJPEG code. + + It makes the symbols hidden when including + /usr/include/openjpeg-2.1/openjpeg.h. + Fixes a FTBFS against libopenjp2-7 (>= 2.1.1). + + Debian bug: https://bugs.debian.org/832873 +--- + base/lib.mak | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/base/lib.mak b/base/lib.mak +index 173e2c6..cffdc9d 100644 +--- a/base/lib.mak ++++ b/base/lib.mak +@@ -1849,7 +1849,7 @@ $(GLOBJ)sjpx_openjpeg.$(OBJ) : $(GLSRC)sjpx_openjpeg.c $(AK) \ + $(memory__h) $(gserror_h) $(gserrors_h) \ + $(gdebug_h) $(strimpl_h) $(sjpx_openjpeg_h) $(LIB_MAK) $(MAKEDIRS) + $(GLJPXOPJCC) $(GLO_)sjpx_openjpeg.$(OBJ) \ +- $(C_) -DOPJ_STATIC $(GLSRC)sjpx_openjpeg.c ++ $(C_) $(GLSRC)sjpx_openjpeg.c + + # ---------------- Pixel-difference filters ---------------- # + # The Predictor facility of the LZW and Flate filters uses these. +-- +2.7.4 + diff --git a/ghostscript-scripts.patch b/ghostscript-9.20-run-dvipdf-securely.patch similarity index 54% rename from ghostscript-scripts.patch rename to ghostscript-9.20-run-dvipdf-securely.patch index 2f050c2..f5e23f2 100644 --- a/ghostscript-scripts.patch +++ b/ghostscript-9.20-run-dvipdf-securely.patch @@ -1,10 +1,22 @@ -diff -up ghostscript-9.00/lib/dvipdf.scripts ghostscript-9.00/lib/dvipdf ---- ghostscript-9.00/lib/dvipdf.scripts 2010-06-03 01:32:07.000000000 +0100 -+++ ghostscript-9.00/lib/dvipdf 2010-09-23 09:56:35.592796899 +0100 -@@ -44,4 +44,4 @@ fi +From 32d8df77bf3326f708c13d6913547c01ce6d728c Mon Sep 17 00:00:00 2001 +From: "David Kaspar [Dee'Kej]" +Date: Fri, 7 Oct 2016 13:57:01 +0200 +Subject: [PATCH] Make sure 'dvipdf' is being run securely + +--- + lib/dvipdf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/dvipdf b/lib/dvipdf +index 802aeab..c92dfb0 100755 +--- a/lib/dvipdf ++++ b/lib/dvipdf +@@ -43,4 +43,4 @@ fi # We have to include the options twice because -I only takes effect if it # appears before other options. -exec dvips -Ppdf $DVIPSOPTIONS -q -f "$infile" | $GS_EXECUTABLE $OPTIONS -q -P- -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sstdout=%stderr -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite - +exec dvips -R -Ppdf $DVIPSOPTIONS -q -f "$infile" | $GS_EXECUTABLE $OPTIONS -q -P- -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sstdout=%stderr -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite - +-- +2.7.4 diff --git a/ghostscript-9.20-runlibfileifexists.patch b/ghostscript-9.20-runlibfileifexists.patch new file mode 100644 index 0000000..2768fca --- /dev/null +++ b/ghostscript-9.20-runlibfileifexists.patch @@ -0,0 +1,93 @@ +From ea8addd686889af76d70031998680196913243ec Mon Sep 17 00:00:00 2001 +From: "David Kaspar [Dee'Kej]" +Date: Fri, 7 Oct 2016 12:20:29 +0200 +Subject: [PATCH 1/2] Fix error when using ImageMagick's convert: + + Error: /undefined in .runlibfileexists +--- + Resource/Init/gs_fonts.ps | 15 ++++++++++++--- + Resource/Init/gs_init.ps | 9 +++++++++ + 2 files changed, 21 insertions(+), 3 deletions(-) + +diff --git a/Resource/Init/gs_fonts.ps b/Resource/Init/gs_fonts.ps +index a3da615..77814b8 100644 +--- a/Resource/Init/gs_fonts.ps ++++ b/Resource/Init/gs_fonts.ps +@@ -96,10 +96,19 @@ userdict /.nativeFontmap .FontDirectory maxlength dict put + % stack: dict file fontname filename|aliasname + 1 index type /stringtype eq + 1 index type /nametype eq and 1 index xcheck and +- 1 index /run eq 2 index /.runlibfile eq or and { ++ 1 index /run eq 2 index /.runlibfile eq 3 index /.runlibfileifexists eq or or and { + % This is an inclusion entry. +- pop findlibfile { exch pop } { file } ifelse +- 2 index exch .readFontmap pop ++ 0 index /.runlibfileifexists eq { ++ pop findlibfile { ++ exch pop ++ 2 index exch .readFontmap pop ++ } { ++ pop ++ } ifelse ++ } { ++ pop findlibfile { exch pop } { file } ifelse ++ 2 index exch .readFontmap pop ++ } ifelse + } { + % This is a real entry. + % Read and pop tokens until a semicolon. +diff --git a/Resource/Init/gs_init.ps b/Resource/Init/gs_init.ps +index ab7cfed..f9e035b 100644 +--- a/Resource/Init/gs_init.ps ++++ b/Resource/Init/gs_init.ps +@@ -689,6 +689,14 @@ systemdict /internaldict dup .makeinternaldict .makeoperator + { /undefinedfilename signalerror } + ifelse + } bind def ++/runlibfileifexists ++ { % We don't want to bind 'run' into this procedure, ++ % since run may get redefined. ++ findlibfile ++ { exch pop /run .systemvar exec } ++ { pop } ++ ifelse ++ } bind def + /selectdevice + { finddevice setdevice .setdefaultscreen } bind def + /signalerror % signalerror - +@@ -857,6 +865,7 @@ userdict /.currentresourcefile //null put + } bind def + % Temporarily substitute it for the real runlibfile. + /.runlibfile /runlibfile load def ++/.runlibfileifexists /runlibfileifexists load def + /runlibfile /runlibfile0 load def + + % Create the error handling machinery. +-- +2.7.4 + + +From 9878f41a229c67aba2e62ee7ab22ff37c2e5a04f Mon Sep 17 00:00:00 2001 +From: "David Kaspar [Dee'Kej]" +Date: Fri, 7 Oct 2016 12:57:06 +0200 +Subject: [PATCH 2/2] Make sure customizations to + /etc/ghostscript/Fontmap.local are used + + For more info, see: https://bugzilla.redhat.com/show_bug.cgi?id=610301 +--- + Resource/Init/Fontmap | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Resource/Init/Fontmap b/Resource/Init/Fontmap +index ae5af96..72aeb1f 100644 +--- a/Resource/Init/Fontmap ++++ b/Resource/Init/Fontmap +@@ -2,3 +2,5 @@ + % See Fontmap.GS for the syntax of real Fontmap files. + %% Replace 1 (Fontmap.GS) + (Fontmap.GS) .runlibfile ++% must be at the bottom of line to allow people overriding everything. ++(Fontmap.local) .runlibfileifexists +-- +2.7.4 + diff --git a/ghostscript-9.20-urw-fonts-naming.patch b/ghostscript-9.20-urw-fonts-naming.patch new file mode 100644 index 0000000..eaacb71 --- /dev/null +++ b/ghostscript-9.20-urw-fonts-naming.patch @@ -0,0 +1,101 @@ +From 54572e8cf529eeb6a01234341d01a2fd555204e6 Mon Sep 17 00:00:00 2001 +From: "David Kaspar [Dee'Kej]" +Date: Fri, 7 Oct 2016 13:38:13 +0200 +Subject: [PATCH] Use old names of urw-fonts + +--- + Resource/Init/Fontmap.GS | 78 ++++++++++++++++++++++++++---------------------- + 1 file changed, 43 insertions(+), 35 deletions(-) + +diff --git a/Resource/Init/Fontmap.GS b/Resource/Init/Fontmap.GS +index a9fa335..949c152 100644 +--- a/Resource/Init/Fontmap.GS ++++ b/Resource/Init/Fontmap.GS +@@ -81,41 +81,49 @@ + + % Aliases + +-/AvantGarde-BookOblique /URWGothic-BookOblique ; +-/AvantGarde-Book /URWGothic-Book ; +-/AvantGarde-DemiOblique /URWGothic-DemiOblique ; +-/AvantGarde-Demi /URWGothic-Demi ; +-/Bookman-DemiItalic /URWBookman-DemiItalic ; +-/Bookman-Demi /URWBookman-Demi ; +-/Bookman-LightItalic /URWBookman-LightItalic ; +-/Bookman-Light /URWBookman-Light ; +-/Courier-Bold /NimbusMonoPS-Bold ; +-/Courier-BoldOblique /NimbusMonoPS-BoldItalic ; +-/Courier /NimbusMonoPS-Regular ; +-/Courier-Oblique /NimbusMonoPS-Italic ; +-/Helvetica-Bold /NimbusSans-Bold ; +-/Helvetica-BoldOblique /NimbusSans-BoldOblique ; +-/Helvetica-Narrow-Bold /NimbusSansNarrow-Bold ; +-/Helvetica-Narrow-BoldOblique /NimbusSansNarrow-BdOblique ; +-/Helvetica-Narrow /NimbusSansNarrow-Regular ; +-/Helvetica-Narrow-Oblique /NimbusSansNarrow-Oblique ; +-/Helvetica /NimbusSans-Regular ; +-/Helvetica-Oblique /NimbusSans-Oblique ; +-/NewCenturySchlbk-Bold /C059-Bold ; +-/NewCenturySchlbk-BoldItalic /C059-BdIta ; +-/NewCenturySchlbk-Italic /C059-Italic ; +-/NewCenturySchlbk-Roman /C059-Roman ; +-/Palatino-BoldItalic /P052-BoldItalic ; +-/Palatino-Bold /P052-Bold ; +-/Palatino-Italic /P052-Italic ; +-/Palatino-Roman /P052-Roman ; +-/Symbol /StandardSymbolsPS ; +-/Times-BoldItalic /NimbusRoman-BoldItalic ; +-/Times-Bold /NimbusRoman-Bold ; +-/Times-Italic /NimbusRoman-Italic ; +-/Times-Roman /NimbusRoman-Regular ; +-/ZapfChancery-MediumItalic /Z003-MediumItalic ; +-/ZapfDingbats /D050000L ; ++/AvantGarde-BookOblique /URWGothicL-BookObli ; ++/AvantGarde-Book /URWGothicL-Book ; ++/AvantGarde-DemiOblique /URWGothicL-DemiObli ; ++/AvantGarde-Demi /URWGothicL-Demi ; ++ ++/Bookman-DemiItalic /URWBookmanL-DemiBoldItal ; ++/Bookman-Demi /URWBookmanL-DemiBold ; ++/Bookman-LightItalic /URWBookmanL-LighItal ; ++/Bookman-Light /URWBookmanL-Ligh ; ++ ++/Courier-Bold /NimbusMonL-Bold ; ++/Courier-BoldOblique /NimbusMonL-BoldObli ; ++/Courier /NimbusMonL-Regu ; ++/Courier-Oblique /NimbusMonL-ReguObli ; ++ ++/Helvetica-Bold /NimbusSanL-Bold ; ++/Helvetica-BoldOblique /NimbusSanL-BoldItal ; ++/Helvetica-Narrow-Bold /NimbusSanL-BoldCond ; ++/Helvetica-Narrow-BoldOblique /NimbusSanL-BoldCondItal ; ++/Helvetica-Narrow /NimbusSanL-ReguCond ; ++/Helvetica-Narrow-Oblique /NimbusSanL-ReguCondItal ; ++/Helvetica /NimbusSanL-Regu ; ++/Helvetica-Oblique /NimbusSanL-ReguItal ; ++ ++/NewCenturySchlbk-Bold /CenturySchL-Bold ; ++/NewCenturySchlbk-BoldItalic /CenturySchL-BoldItal ; ++/NewCenturySchlbk-Italic /CenturySchL-Ital ; ++/NewCenturySchlbk-Roman /CenturySchL-Roma ; ++ ++/Palatino-Roman /URWPalladioL-Roma ; ++/Palatino-Italic /URWPalladioL-Ital ; ++/Palatino-Bold /URWPalladioL-Bold ; ++/Palatino-BoldItalic /URWPalladioL-BoldItal ; ++ ++/Symbol /StandardSymL ; ++ ++/Times-BoldItalic /NimbusRomNo9L-MediItal ; ++/Times-Bold /NimbusRomNo9L-Medi ; ++/Times-Italic /NimbusRomNo9L-ReguItal ; ++/Times-Roman /NimbusRomNo9L-Regu ; ++ ++/ZapfChancery-MediumItalic /URWChanceryL-MediItal ; ++/ZapfDingbats /Dingbats ; + + % + % +-- +2.7.4 + diff --git a/ghostscript-Fontmap.local.patch b/ghostscript-Fontmap.local.patch deleted file mode 100644 index 3d1fee2..0000000 --- a/ghostscript-Fontmap.local.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -up ghostscript-8.71/Resource/Init/Fontmap.Fontmap.local ghostscript-8.71/Resource/Init/Fontmap ---- ghostscript-8.71/Resource/Init/Fontmap.Fontmap.local 2008-08-08 05:22:38.000000000 +0100 -+++ ghostscript-8.71/Resource/Init/Fontmap 2010-09-03 11:53:47.273865979 +0100 -@@ -2,3 +2,5 @@ - % See Fontmap.GS for the syntax of real Fontmap files. - %% Replace 1 (Fontmap.GS) - (Fontmap.GS) .runlibfile -+% must be at the bottom of line to allow people overriding everything. -+(Fontmap.local) .runlibfileifexists diff --git a/ghostscript-bz1380416.patch b/ghostscript-bz1380416.patch deleted file mode 100644 index 29926e8..0000000 --- a/ghostscript-bz1380416.patch +++ /dev/null @@ -1,80 +0,0 @@ -From dea6ef9be04e25df06a02cbefa45811f640d3298 Mon Sep 17 00:00:00 2001 -From: Chris Liddell -Date: Sat, 5 Mar 2016 14:56:03 -0800 -Subject: [PATCH] Bug 694724: Have filenameforall and getenv honor SAFER - ---- - Resource/Init/gs_init.ps | 2 ++ - psi/zfile.c | 36 ++++++++++++++++++++---------------- - 2 files changed, 22 insertions(+), 16 deletions(-) - -diff --git a/Resource/Init/gs_init.ps b/Resource/Init/gs_init.ps -index 13f11cb..722b78d 100644 ---- a/Resource/Init/gs_init.ps -+++ b/Resource/Init/gs_init.ps -@@ -2030,6 +2030,7 @@ readonly def - - /.locksafe { - .locksafe_userparams -+ systemdict /getenv {pop //false} put - % setpagedevice has the side effect of clearing the page, but - % we will just document that. Using setpagedevice keeps the device - % properties and pagedevice .LockSafetyParams in agreement even -@@ -2048,6 +2049,7 @@ readonly def - %% - /.locksafeglobal { - .locksafe_userparams -+ systemdict /getenv {pop //false} put - % setpagedevice has the side effect of clearing the page, but - % we will just document that. Using setpagedevice keeps the device - % properties and pagedevice .LockSafetyParams in agreement even -diff --git a/psi/zfile.c b/psi/zfile.c -index 93fd78c..e323899 100644 ---- a/psi/zfile.c -+++ b/psi/zfile.c -@@ -371,22 +371,26 @@ file_continue(i_ctx_t *i_ctx_p) - - if (len < devlen) - return_error(e_rangecheck); /* not even room for device len */ -- memcpy((char *)pscratch->value.bytes, iodev->dname, devlen); -- code = iodev->procs.enumerate_next(pfen, (char *)pscratch->value.bytes + devlen, -- len - devlen); -- if (code == ~(uint) 0) { /* all done */ -- esp -= 5; /* pop proc, pfen, devlen, iodev , mark */ -- return o_pop_estack; -- } else if (code > len) /* overran string */ -- return_error(e_rangecheck); -- else { -- push(1); -- ref_assign(op, pscratch); -- r_set_size(op, code + devlen); -- push_op_estack(file_continue); /* come again */ -- *++esp = pscratch[2]; /* proc */ -- return o_push_estack; -- } -+ -+ do { -+ memcpy((char *)pscratch->value.bytes, iodev->dname, devlen); -+ code = iodev->procs.enumerate_next(pfen, (char *)pscratch->value.bytes + devlen, -+ len - devlen); -+ if (code == ~(uint) 0) { /* all done */ -+ esp -= 5; /* pop proc, pfen, devlen, iodev , mark */ -+ return o_pop_estack; -+ } else if (code > len) /* overran string */ -+ return_error(gs_error_rangecheck); -+ else if (iodev != iodev_default(imemory) -+ || (check_file_permissions_reduced(i_ctx_p, (char *)pscratch->value.bytes, code + devlen, "PermitFileReading")) == 0) { -+ push(1); -+ ref_assign(op, pscratch); -+ r_set_size(op, code + devlen); -+ push_op_estack(file_continue); /* come again */ -+ *++esp = pscratch[2]; /* proc */ -+ return o_push_estack; -+ } -+ } while(1); - } - /* Cleanup procedure for enumerating files */ - static int --- -2.7.4 - diff --git a/ghostscript-icc-missing-check.patch b/ghostscript-icc-missing-check.patch deleted file mode 100644 index 9b9109a..0000000 --- a/ghostscript-icc-missing-check.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up ghostscript-9.12/base/gsicc_manage.c.icc-missing-check ghostscript-9.12/base/gsicc_manage.c ---- ghostscript-9.12/base/gsicc_manage.c.icc-missing-check 2014-03-26 11:31:11.296570797 +0000 -+++ ghostscript-9.12/base/gsicc_manage.c 2014-03-26 11:32:10.384912584 +0000 -@@ -613,6 +613,8 @@ gsicc_set_srcgtag_struct(gsicc_manager_t - icc_profile = - gsicc_profile_new(str, mem, curr_ptr, strlen(curr_ptr)); - code = sfclose(str); -+ } -+ if (str != NULL && icc_profile != NULL) { - gsicc_init_profile_info(icc_profile); - cmm = gsCMM_DEFAULT; - /* Check if this object is a devicelink profile. diff --git a/ghostscript-multilib.patch b/ghostscript-multilib.patch deleted file mode 100644 index 27bf5e6..0000000 --- a/ghostscript-multilib.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up ghostscript-8.61/ijs/Makefile.am.multilib ghostscript-8.61/ijs/Makefile.am -diff -up ghostscript-8.61/ijs/ijs-config.in.multilib ghostscript-8.61/ijs/ijs-config.in ---- ghostscript-8.61/ijs/ijs-config.in.multilib 2002-01-31 19:09:46.000000000 +0000 -+++ ghostscript-8.61/ijs/ijs-config.in 2007-11-23 09:19:18.000000000 +0000 -@@ -43,8 +43,7 @@ while test $# -gt 0; do - echo $includes - ;; - --libs) -- libdirs=-L@libdir@ -- echo $libdirs -lijs -+ echo -lijs - ;; - *) - echo "${usage}" 1>&2 diff --git a/ghostscript-noopt.patch b/ghostscript-noopt.patch deleted file mode 100644 index d578051..0000000 --- a/ghostscript-noopt.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up ghostscript-9.16/psi/int.mak.noopt ghostscript-9.16/psi/int.mak ---- ghostscript-9.16/psi/int.mak.noopt 2015-03-30 17:03:47.120475345 +0100 -+++ ghostscript-9.16/psi/int.mak 2015-03-30 17:04:53.004247278 +0100 -@@ -116,7 +116,7 @@ $(PSOBJ)igcref.$(OBJ) : $(PSSRC)igcref.c - $(gsexit_h) $(gsstruct_h)\ - $(iastate_h) $(idebug_h) $(igc_h) $(iname_h) $(ipacked_h) $(store_h)\ - $(MAKEDIRS) -- $(PSCC) $(PSO_)igcref.$(OBJ) $(C_) $(PSSRC)igcref.c -+ $(PSCC) -O0 $(PSO_)igcref.$(OBJ) $(C_) $(PSSRC)igcref.c - - $(PSOBJ)igcstr.$(OBJ) : $(PSSRC)igcstr.c $(GH) $(memory__h)\ - $(gsmdebug_h) $(gsstruct_h) $(iastate_h) $(igcstr_h) $(MAKEDIRS) diff --git a/ghostscript-runlibfileifexists.patch b/ghostscript-runlibfileifexists.patch deleted file mode 100644 index a7dbf46..0000000 --- a/ghostscript-runlibfileifexists.patch +++ /dev/null @@ -1,52 +0,0 @@ -diff -up ghostscript-9.15/Resource/Init/gs_fonts.ps.runlibfileifexists ghostscript-9.15/Resource/Init/gs_fonts.ps ---- ghostscript-9.15/Resource/Init/gs_fonts.ps.runlibfileifexists 2014-09-22 11:17:33.000000000 +0100 -+++ ghostscript-9.15/Resource/Init/gs_fonts.ps 2014-09-23 09:45:44.029511858 +0100 -@@ -95,10 +95,19 @@ userdict /Fontmap .FontDirectory maxleng - % stack: dict file fontname filename|aliasname - 1 index type /stringtype eq - 1 index type /nametype eq and 1 index xcheck and -- 1 index /run eq 2 index /.runlibfile eq or and { -+ 1 index /run eq 2 index /.runlibfile eq 3 index /.runlibfileifexists eq or or and { - % This is an inclusion entry. -- pop findlibfile { exch pop } { file } ifelse -- 2 index exch .readFontmap pop -+ 0 index /.runlibfileifexists eq { -+ pop findlibfile { -+ exch pop -+ 2 index exch .readFontmap pop -+ } { -+ pop -+ } ifelse -+ } { -+ pop findlibfile { exch pop } { file } ifelse -+ 2 index exch .readFontmap pop -+ } ifelse - } { - % This is a real entry. - % Read and pop tokens until a semicolon. -diff -up ghostscript-9.15/Resource/Init/gs_init.ps.runlibfileifexists ghostscript-9.15/Resource/Init/gs_init.ps ---- ghostscript-9.15/Resource/Init/gs_init.ps.runlibfileifexists 2014-09-22 11:17:33.000000000 +0100 -+++ ghostscript-9.15/Resource/Init/gs_init.ps 2014-09-23 09:45:44.030511863 +0100 -@@ -684,6 +684,14 @@ systemdict /internaldict dup .makeintern - { /undefinedfilename signalerror } - ifelse - } bind def -+/runlibfileifexists -+ { % We don't want to bind 'run' into this procedure, -+ % since run may get redefined. -+ findlibfile -+ { exch pop /run .systemvar exec } -+ { pop } -+ ifelse -+ } bind def - /selectdevice - { finddevice setdevice .setdefaultscreen } bind def - /signalerror % signalerror - -@@ -852,6 +860,7 @@ userdict /.currentresourcefile //null pu - } bind def - % Temporarily substitute it for the real runlibfile. - /.runlibfile /runlibfile load def -+/.runlibfileifexists /runlibfileifexists load def - /runlibfile /runlibfile0 load def - - % Create the error handling machinery. diff --git a/ghostscript-system-zlib.patch b/ghostscript-system-zlib.patch deleted file mode 100644 index ef1e3ac..0000000 --- a/ghostscript-system-zlib.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up ghostscript-9.16/devices/devs.mak.system-zlib ghostscript-9.16/devices/devs.mak ---- ghostscript-9.16/devices/devs.mak.system-zlib 2015-03-30 17:47:57.931725800 +0100 -+++ ghostscript-9.16/devices/devs.mak 2015-03-30 17:48:14.539673024 +0100 -@@ -1231,7 +1231,7 @@ $(libtiff_dev) $(MAKEDIRS) - - $(DEVOBJ)gdevxps.$(OBJ) : $(DEVVECSRC)gdevxps.c $(gdevvec_h) \ - $(string__h) $(stdio__h) $(libtiff_dev) $(gx_h) $(gserrors_h) \ --$(gxpath_h) $(gzcpath_h) $(stream_h) $(zlib_h) \ -+$(gxpath_h) $(gzcpath_h) $(stream_h) \ - $(stdint__h) $(gdevtifs_h) $(gsicc_create_h) $(gsicc_cache_h) \ - $(gximdecode_h) $(MAKEDIRS) - $(XPSDEVCC) $(I_)$(TI_)$(_I) $(GLO_)gdevxps.$(OBJ) $(C_) $(DEVVECSRC)gdevxps.c -@@ -1683,7 +1683,7 @@ $(DD)pngalpha.dev : $(DEVS_MAK) $(libpng - fpng_=$(DEVOBJ)gdevfpng.$(OBJ) $(DEVOBJ)gdevpccm.$(OBJ) - - $(DEVOBJ)gdevfpng_0.$(OBJ) : $(DEVSRC)gdevfpng.c\ -- $(gdevprn_h) $(gdevpccm_h) $(gscdefs_h) $(zlib_h) $(MAKEDIRS) -+ $(gdevprn_h) $(gdevpccm_h) $(gscdefs_h) $(MAKEDIRS) - $(CC_) $(I_)$(DEVI_) $(II)$(PI_)$(_I) $(PCF_) $(GLF_) $(DEVO_)gdevfpng_0.$(OBJ) $(C_) $(DEVSRC)gdevfpng.c - - $(DEVOBJ)gdevfpng_1.$(OBJ) : $(DEVSRC)gdevfpng.c\ diff --git a/ghostscript-urw-fonts-naming.patch b/ghostscript-urw-fonts-naming.patch deleted file mode 100644 index ec4bf5b..0000000 --- a/ghostscript-urw-fonts-naming.patch +++ /dev/null @@ -1,93 +0,0 @@ -diff -up ghostscript-9.16/Resource/Init/Fontmap.GS.urw-fonts-naming ghostscript-9.16/Resource/Init/Fontmap.GS ---- ghostscript-9.16/Resource/Init/Fontmap.GS.urw-fonts-naming 2015-03-30 09:21:24.000000000 +0100 -+++ ghostscript-9.16/Resource/Init/Fontmap.GS 2015-03-31 10:53:39.010004012 +0100 -@@ -81,49 +81,49 @@ - - % Aliases - --/Bookman-Demi /BookmanURW-DemBol ; --/Bookman-DemiItalic /BookmanURW-DemBolIta ; --/Bookman-Light /BookmanURW-Lig ; --/Bookman-LightItalic /BookmanURW-LigIta ; -- --/Courier /NimbusMon-Reg ; --/Courier-Oblique /NimbusMon-Obl ; --/Courier-Bold /NimbusMon-Bol ; --/Courier-BoldOblique /NimbusMon-BolObl ; -- --/AvantGarde-Book /URWGothic-Boo ; --/AvantGarde-BookOblique /URWGothic-BooObl ; --/AvantGarde-Demi /URWGothic-Dem ; --/AvantGarde-DemiOblique /URWGothic-DemObl ; -- --/Helvetica /NimbusSan-Reg ; --/Helvetica-Oblique /NimbusSan-Ita ; --/Helvetica-Bold /NimbusSan-Bol ; --/Helvetica-BoldOblique /NimbusSan-BolIta ; -- --/Helvetica-Narrow /NimbusSanNar-Reg ; --/Helvetica-Narrow-Oblique /NimbusSanNar-Ita ; --/Helvetica-Narrow-Bold /NimbusSanNar-Bol ; --/Helvetica-Narrow-BoldOblique /NimbusSanNar-BolIta ; -- --/Palatino-Roman /PalladioURW-Rom ; --/Palatino-Italic /PalladioURW-Ita ; --/Palatino-Bold /PalladioURW-Bol ; --/Palatino-BoldItalic /PalladioURW-BolIta ; -- --/NewCenturySchlbk-Roman /CenturySchURW-Rom ; --/NewCenturySchlbk-Italic /CenturySchURW-Ita ; --/NewCenturySchlbk-Bold /CenturySchURW-Bol ; --/NewCenturySchlbk-BoldItalic /CenturySchURW-BolIta ; -- --/Times-Roman /NimbusRom-Reg ; --/Times-Italic /NimbusRom-Ita ; --/Times-Bold /NimbusRom-Med ; --/Times-BoldItalic /NimbusRom-MedIta ; -+/Bookman-Demi /URWBookmanL-DemiBold ; -+/Bookman-DemiItalic /URWBookmanL-DemiBoldItal ; -+/Bookman-Light /URWBookmanL-Ligh ; -+/Bookman-LightItalic /URWBookmanL-LighItal ; -+ -+/Courier /NimbusMonL-Regu ; -+/Courier-Oblique /NimbusMonL-ReguObli ; -+/Courier-Bold /NimbusMonL-Bold ; -+/Courier-BoldOblique /NimbusMonL-BoldObli ; -+ -+/AvantGarde-Book /URWGothicL-Book ; -+/AvantGarde-BookOblique /URWGothicL-BookObli ; -+/AvantGarde-Demi /URWGothicL-Demi ; -+/AvantGarde-DemiOblique /URWGothicL-DemiObli ; -+ -+/Helvetica /NimbusSanL-Regu ; -+/Helvetica-Oblique /NimbusSanL-ReguItal ; -+/Helvetica-Bold /NimbusSanL-Bold ; -+/Helvetica-BoldOblique /NimbusSanL-BoldItal ; -+ -+/Helvetica-Narrow /NimbusSanL-ReguCond ; -+/Helvetica-Narrow-Oblique /NimbusSanL-ReguCondItal ; -+/Helvetica-Narrow-Bold /NimbusSanL-BoldCond ; -+/Helvetica-Narrow-BoldOblique /NimbusSanL-BoldCondItal ; -+ -+/Palatino-Roman /URWPalladioL-Roma ; -+/Palatino-Italic /URWPalladioL-Ital ; -+/Palatino-Bold /URWPalladioL-Bold ; -+/Palatino-BoldItalic /URWPalladioL-BoldItal ; -+ -+/NewCenturySchlbk-Roman /CenturySchL-Roma ; -+/NewCenturySchlbk-Italic /CenturySchL-Ital ; -+/NewCenturySchlbk-Bold /CenturySchL-Bold ; -+/NewCenturySchlbk-BoldItalic /CenturySchL-BoldItal ; -+ -+/Times-Roman /NimbusRomNo9L-Regu ; -+/Times-Italic /NimbusRomNo9L-ReguItal ; -+/Times-Bold /NimbusRomNo9L-Medi ; -+/Times-BoldItalic /NimbusRomNo9L-MediItal ; - - /Symbol /StandardSymL ; - --/ZapfChancery-MediumItalic /ChanceryURW-MedIta ; -+/ZapfChancery-MediumItalic /URWChanceryL-MediItal ; - - /ZapfDingbats /Dingbats ; - diff --git a/ghostscript-wrf-snprintf.patch b/ghostscript-wrf-snprintf.patch deleted file mode 100644 index 74d8c2a..0000000 --- a/ghostscript-wrf-snprintf.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -up ghostscript-9.07/base/wrfont.c.wrf-snprintf ghostscript-9.07/base/wrfont.c ---- ghostscript-9.07/base/wrfont.c.wrf-snprintf 2013-07-01 13:02:33.373244683 +0100 -+++ ghostscript-9.07/base/wrfont.c 2013-07-01 13:04:55.022864299 +0100 -@@ -72,7 +72,8 @@ WRF_wfloat(WRF_output * a_output, double - { - char buffer[32]; - -- gs_sprintf(buffer, "%f", a_float); -+ if (gs_snprintf(buffer, sizeof (buffer), "%f", a_float) >= sizeof (buffer)) -+ abort(); - WRF_wstring(a_output, buffer); - } - -@@ -81,6 +82,7 @@ WRF_wint(WRF_output * a_output, long a_i - { - char buffer[32]; - -- gs_sprintf(buffer, "%ld", a_int); -+ if (gs_snprintf(buffer, sizeof (buffer), "%ld", a_int) >= sizeof (buffer)) -+ abort(); - WRF_wstring(a_output, buffer); - } diff --git a/ghostscript.spec b/ghostscript.spec index 404ee86..7cb1896 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -1,37 +1,25 @@ -%define gs_ver 9.16 -%define gs_dot_ver 9.16 +%define gs_ver 9.20 +%define gs_dot_ver 9.20 %{expand: %%define build_with_freetype %{?_with_freetype:1}%{!?_with_freetype:0}} Summary: A PostScript interpreter and renderer Name: ghostscript Version: %{gs_ver} -Release: 5%{?dist} +Release: 1%{?dist} # Included CMap data is Redistributable, no modification permitted, # see http://bugzilla.redhat.com/487510 License: AGPLv3+ and Redistributable, no modification permitted URL: http://www.ghostscript.com/ Group: Applications/Publishing -Source0: ghostscript-%{gs_ver}-cleaned-1.tar.bz2 -# ghostscript contains code we cannot ship due to licensing concerns. -# Therefore we use this script to remove it before shipping the -# tarball. -# Download the upstream tarball and invoke this script while in the -# tarball's directory: -Source1: generate-tarball.sh -Source2: CIDFnmap -Source4: cidfmap +Source0: ghostscript-9.20.tar.xz +Source1: CIDFnmap +Source2: cidfmap -Patch1: ghostscript-multilib.patch -Patch2: ghostscript-scripts.patch -Patch3: ghostscript-noopt.patch -Patch4: ghostscript-runlibfileifexists.patch -Patch5: ghostscript-icc-missing-check.patch -Patch6: ghostscript-Fontmap.local.patch -Patch7: ghostscript-wrf-snprintf.patch -Patch9: ghostscript-system-zlib.patch -Patch10: ghostscript-urw-fonts-naming.patch -Patch11: ghostscript-bz1380416.patch +Patch1: ghostscript-9.20-fix-openjpeg-system-build.patch +Patch2: ghostscript-9.20-runlibfileifexists.patch +Patch3: ghostscript-9.20-run-dvipdf-securely.patch +Patch4: ghostscript-9.20-urw-fonts-naming.patch Requires: %{name}-core%{?_isa} = %{version}-%{release} Requires: %{name}-x11%{?_isa} = %{version}-%{release} @@ -120,39 +108,18 @@ A GTK-enabled version of Ghostscript, called 'gsx'. %setup -q -n %{name}-%{gs_ver} rm -rf expat freetype icclib jasper jpeg jpegxr lcms lcms2 libpng openjpeg zlib cups/libs -# Fix ijs-config not to have multilib conflicts (bug #192672) -%patch1 -p1 -b .multilib +# Fix building with system's OpenJPEG shared library: +%patch1 -p1 + +# Fix error when using 'convert' from ImageMagick, and +# make sure the configuration in /etc/ghostscript/Fonts.local is used: +%patch2 -p1 # Fix some shell scripts -%patch2 -p1 -b .scripts - -# Build igcref.c with -O0 to work around bug #150771. -%patch3 -p1 -b .noopt - -# Define .runlibfileifexists. -%patch4 -p1 - -# Fixed missing error check when setting ICC profile. -%patch5 -p1 -b .icc-missing-check - -# Restored Fontmap.local patch, incorrectly dropped after -# ghostscript-8.15.4-3 (bug #610301). -# Note: don't use -b here to avoid the backup file ending up in the -# package manifest. -%patch6 -p1 - -# Use more caution when converting floats to strings (bug #980085). -%patch7 -p1 -b .wrf-snprintf - -# Fixes for using the system zlib. -%patch9 -p1 -b .system-zlib +%patch3 -p1 # Use old names for urw-fonts (bug #1207577). -%patch10 -p1 -b .urw-fonts-naming - -# Fix for ghostscript security issue (bug # ). -# NOTE: This patch is part of 9.20 release. -%patch11 -p1 +%patch4 -p1 # Convert manual pages to UTF-8 from8859_1() { @@ -255,8 +222,8 @@ ln -sf gs $RPM_BUILD_ROOT%{_bindir}/ghostscript mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/Resource/Init/cidfmap{,.GS} # Install our own cidfmap to allow the separated # cidfmap which the font packages own. -install -m0644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/Resource/Init/CIDFnmap -install -m0644 %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/Resource/Init/cidfmap +install -m0644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/Resource/Init/CIDFnmap +install -m0644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/Resource/Init/cidfmap # Documentation install -m0644 doc/COPYING $RPM_BUILD_ROOT%{_docdir}/%{name}-%{gs_dot_ver} @@ -285,11 +252,9 @@ rm -f $RPM_BUILD_ROOT%{_bindir}/fixmswrd.pl rm -f $RPM_BUILD_ROOT%{_datadir}/ghostscript/%{gs_dot_ver}/Resource/CMap/* MAIN_PWD=`pwd` -(cd $RPM_BUILD_ROOT; find .%{_datadir}/ghostscript/%{gs_dot_ver}/Resource -type f | \ - sed -e 's/\.//;' | grep -v Fontmap | grep -v gs_init.ps > $MAIN_PWD/rpm.sharelist - find .%{_bindir}/ | sed -e 's/\.//;' | \ - grep -v '/$\|/hpijs$\|/gsx$\|/ijs-config$' \ - >> $MAIN_PWD/rpm.sharelist) +(cd $RPM_BUILD_ROOT; + find .%{_datadir}/ghostscript/%{gs_dot_ver}/Resource -type f | sed -e 's/\.//;' | grep -v Fontmap | grep -v gs_init.ps > $MAIN_PWD/rpm.sharelist + find .%{_bindir}/ | sed -e 's/\.//;' | grep -v '/$\|/hpijs$\|/gsx$\|/ijs-config$' >> $MAIN_PWD/rpm.sharelist) %clean rm -rf $RPM_BUILD_ROOT @@ -347,12 +312,19 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/ghostscript/*.h %dir %{_includedir}/ijs %{_includedir}/ijs/* -%{_bindir}/ijs-config %{_libdir}/pkgconfig/ijs.pc %{_libdir}/libijs.so %{_libdir}/libgs.so %changelog +* Fri Oct 7 2016 David Kaspar [Dee'Kej] - 9.20-1 +- Rebase to latest ghostscript-9.20. Major changes in this rebase: + - OpenJPEG support has been re-enabled + - ijs-config custom tool has been removed (pkg-config is used by default) + - old irrelevant patches removed (changes are part of upstream release now) + - remaining patches has been updated & renamed + - no API/ABI changes according to upstream + * Tue Oct 4 2016 David Kaspar [Dee'Kej] - 9.16-5 - [TEMPORARY] Support for OpenJPEG disabled for builds to pass. - Security fix for BZ #1380416 backported. diff --git a/sources b/sources index 2cb6b72..d38a3fd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ca0a63aafe68725d61718a3a219b7f34 ghostscript-9.16-cleaned-1.tar.bz2 +8f3d383d48da22345937b66b01ab2960 ghostscript-9.20.tar.xz