From 40cf467ef13b5921bfb7d86b037b35a2dc3a709d Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Sun, 22 Sep 2013 01:20:26 -0400 Subject: [PATCH 1/5] fix desktop file, CVE-2012-2142 --- xpdf-3.03-CVE-2012-2142.diff | 55 ++++++++++++++++++++++++++++++++++++ xpdf.desktop | 2 +- xpdf.spec | 15 ++++++++-- 3 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 xpdf-3.03-CVE-2012-2142.diff diff --git a/xpdf-3.03-CVE-2012-2142.diff b/xpdf-3.03-CVE-2012-2142.diff new file mode 100644 index 0000000..891c41f --- /dev/null +++ b/xpdf-3.03-CVE-2012-2142.diff @@ -0,0 +1,55 @@ +From 3945969e0072217c143fefa3044512a31ac2afa8 Mon Sep 17 00:00:00 2001 +From: mancha +Date: Sun, 11 Aug 2013 +Subject: CVE-2012-2142 + +Filter stuff that might end up in the shell to address CVE-2012-2142. +This code was adapted from the Poppler project. +--- + Error.cc | 21 ++++++++++++++++----- + 1 file changed, 16 insertions(+), 5 deletions(-) + +--- a/xpdf/Error.cc 2013-08-11 ++++ b/xpdf/Error.cc 2013-08-11 +@@ -43,7 +43,7 @@ void setErrorCallback(void (*cbk)(void * + + void CDECL error(ErrorCategory category, int pos, const char *msg, ...) { + va_list args; +- GString *s; ++ GString *s, *sanitized; + + // NB: this can be called before the globalParams object is created + if (!errorCbk && globalParams && globalParams->getErrQuiet()) { +@@ -52,17 +52,28 @@ void CDECL error(ErrorCategory category, + va_start(args, msg); + s = GString::formatv(msg, args); + va_end(args); ++ ++ sanitized = new GString (); ++ for (int i = 0; i < s->getLength(); ++i) { ++ const char c = s->getChar(i); ++ if (c < (char)0x20 || c >= (char)0x7f) { ++ sanitized->appendf("<{0:02x}>", c & 0xff); ++ } else { ++ sanitized->append(c); ++ } ++ } ++ + if (errorCbk) { +- (*errorCbk)(errorCbkData, category, pos, s->getCString()); ++ (*errorCbk)(errorCbkData, category, pos, sanitized->getCString()); + } else { + if (pos >= 0) { + fprintf(stderr, "%s (%d): %s\n", +- errorCategoryNames[category], pos, s->getCString()); ++ errorCategoryNames[category], pos, sanitized->getCString()); + } else { + fprintf(stderr, "%s: %s\n", +- errorCategoryNames[category], s->getCString()); ++ errorCategoryNames[category], sanitized->getCString()); + } + fflush(stderr); + } +- delete s; ++ delete sanitized; + } diff --git a/xpdf.desktop b/xpdf.desktop index 90ac5c4..9ad44d3 100644 --- a/xpdf.desktop +++ b/xpdf.desktop @@ -11,5 +11,5 @@ Comment[de]=PDF-Betrachter Exec=xpdf %f Terminal=0 Type=Application -Icon=xpdf.png +Icon=xpdf MimeType=application/pdf diff --git a/xpdf.spec b/xpdf.spec index 9cc4e4d..8b6c9df 100644 --- a/xpdf.spec +++ b/xpdf.spec @@ -1,7 +1,7 @@ Summary: A PDF file viewer for the X Window System Name: xpdf Version: 3.03 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2 or GPLv3 Epoch: 1 Url: http://www.foolabs.com/xpdf/ @@ -39,14 +39,14 @@ Patch9: xpdf-3.00-papersize.patch Patch10: xpdf-3.00-gcc4.patch Patch11: xpdf-3.03-crash.patch Patch12: xpdf-3.03-64bit.patch -# Patch13: xpdf-3.01-resize.patch -# Patch14: xpdf-3.01-freetype-internals.patch +# Patch13: xpdf-3.01-resize.patch# Patch14: xpdf-3.01-freetype-internals.patch Patch15: xpdf-3.01-nocmap.patch Patch16: xpdf-3.02-fontlist.patch Patch19: xpdf-3.02-additionalzoom.patch Patch20: xpdf-3.03-compile-fix.patch # Security patches +Patch100: xpdf-3.03-CVE-2012-2142.diff # Debian patches Patch200: 02_permissions.dpatch @@ -60,7 +60,11 @@ Requires: poppler-utils Requires: xorg-x11-fonts-ISO8859-1-75dpi Requires: xorg-x11-fonts-ISO8859-1-100dpi +%if 0%{?rhel} +BuildRequires: openmotif-devel +%else BuildRequires: lesstif-devel +%endif BuildRequires: freetype-devel >= 2.1.7 BuildRequires: desktop-file-utils BuildRequires: libpaper-devel @@ -101,6 +105,7 @@ standard X fonts. %patch20 -p1 -b .charfix # security patches +%patch100 -p1 -b .CVE-2012-2142 # debian patches %patch200 -p1 -b .permissions @@ -254,6 +259,10 @@ update-desktop-database &> /dev/null ||: %{_datadir}/xpdf/latin2 %changelog +* Sun Sep 22 2013 Tom Callaway - 1:3.03-8 +- fix CVE-2012-2142 +- fix issue with icon name in .desktop file (except on el5) + * Sun Aug 04 2013 Fedora Release Engineering - 1:3.03-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild From b2e2e1869254f335ddec31c4cbd8b354bf60a487 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Thu, 29 May 2014 16:30:28 -0400 Subject: [PATCH 2/5] 3.04 --- 02_permissions.dpatch | 52 +++++++------- sources | 24 +++---- xpdf-3.04-64bit.patch | 57 ++++++++++++++++ xpdf-3.04-crash.patch | 22 ++++++ xpdf-3.04-nocmap.patch | 53 +++++++++++++++ xpdf-3.04-pdftopng.patch | 32 +++++++++ xpdf-3.04-redhat-new.patch | 136 +++++++++++++++++++++++++++++++++++++ xpdf.spec | 91 ++++++++++++++----------- 8 files changed, 390 insertions(+), 77 deletions(-) create mode 100644 xpdf-3.04-64bit.patch create mode 100644 xpdf-3.04-crash.patch create mode 100644 xpdf-3.04-nocmap.patch create mode 100644 xpdf-3.04-pdftopng.patch create mode 100644 xpdf-3.04-redhat-new.patch diff --git a/02_permissions.dpatch b/02_permissions.dpatch index 36d46a4..fdd3978 100644 --- a/02_permissions.dpatch +++ b/02_permissions.dpatch @@ -1,16 +1,16 @@ -diff -up xpdf-3.03/xpdf/PDFCore.cc.permissions xpdf-3.03/xpdf/PDFCore.cc ---- xpdf-3.03/xpdf/PDFCore.cc.permissions 2011-08-15 17:08:53.000000000 -0400 -+++ xpdf-3.03/xpdf/PDFCore.cc 2011-08-22 13:54:13.553262082 -0400 +diff -up xpdf-3.04/xpdf/PDFCore.cc.permissions xpdf-3.04/xpdf/PDFCore.cc +--- xpdf-3.04/xpdf/PDFCore.cc.permissions 2014-05-28 14:50:50.000000000 -0400 ++++ xpdf-3.04/xpdf/PDFCore.cc 2014-05-29 15:42:47.290665898 -0400 @@ -4,6 +4,8 @@ // - // Copyright 2004 Glyph & Cog, LLC + // Copyright 2004-2013 Glyph & Cog, LLC // +// Modified for Debian by Hamish Moffatt, 18 August 2005. +// //======================================================================== #include -@@ -1619,9 +1621,11 @@ GString *PDFCore::extractText(int pg, do +@@ -1677,9 +1679,11 @@ GString *PDFCore::extractText(int pg, do int x0, y0, x1, y1, t; GString *s; @@ -22,9 +22,9 @@ diff -up xpdf-3.03/xpdf/PDFCore.cc.permissions xpdf-3.03/xpdf/PDFCore.cc if ((page = findPage(pg))) { cvtUserToDev(pg, xMin, yMin, &x0, &y0); cvtUserToDev(pg, xMax, yMax, &x1, &y1); -diff -up xpdf-3.03/xpdf/pdfimages.cc.permissions xpdf-3.03/xpdf/pdfimages.cc ---- xpdf-3.03/xpdf/pdfimages.cc.permissions 2011-08-15 17:08:53.000000000 -0400 -+++ xpdf-3.03/xpdf/pdfimages.cc 2011-08-22 13:58:49.976195545 -0400 +diff -up xpdf-3.04/xpdf/pdfimages.cc.permissions xpdf-3.04/xpdf/pdfimages.cc +--- xpdf-3.04/xpdf/pdfimages.cc.permissions 2014-05-28 14:50:50.000000000 -0400 ++++ xpdf-3.04/xpdf/pdfimages.cc 2014-05-29 15:40:57.814449375 -0400 @@ -4,6 +4,8 @@ // // Copyright 1998-2003 Glyph & Cog, LLC @@ -49,9 +49,9 @@ diff -up xpdf-3.03/xpdf/pdfimages.cc.permissions xpdf-3.03/xpdf/pdfimages.cc // get page range if (firstPage < 1) -diff -up xpdf-3.03/xpdf/pdftops.cc.permissions xpdf-3.03/xpdf/pdftops.cc ---- xpdf-3.03/xpdf/pdftops.cc.permissions 2011-08-15 17:08:53.000000000 -0400 -+++ xpdf-3.03/xpdf/pdftops.cc 2011-08-22 13:59:33.638714938 -0400 +diff -up xpdf-3.04/xpdf/pdftops.cc.permissions xpdf-3.04/xpdf/pdftops.cc +--- xpdf-3.04/xpdf/pdftops.cc.permissions 2014-05-28 14:50:50.000000000 -0400 ++++ xpdf-3.04/xpdf/pdftops.cc 2014-05-29 15:40:57.815449368 -0400 @@ -4,6 +4,8 @@ // // Copyright 1996-2003 Glyph & Cog, LLC @@ -61,7 +61,7 @@ diff -up xpdf-3.03/xpdf/pdftops.cc.permissions xpdf-3.03/xpdf/pdftops.cc //======================================================================== #include -@@ -278,12 +280,14 @@ int main(int argc, char *argv[]) { +@@ -300,12 +302,14 @@ int main(int argc, char *argv[]) { goto err1; } @@ -76,19 +76,19 @@ diff -up xpdf-3.03/xpdf/pdftops.cc.permissions xpdf-3.03/xpdf/pdftops.cc // construct PostScript file name if (argc == 3) { -diff -up xpdf-3.03/xpdf/pdftotext.cc.permissions xpdf-3.03/xpdf/pdftotext.cc ---- xpdf-3.03/xpdf/pdftotext.cc.permissions 2011-08-15 17:08:53.000000000 -0400 -+++ xpdf-3.03/xpdf/pdftotext.cc 2011-08-22 14:00:05.227367840 -0400 +diff -up xpdf-3.04/xpdf/pdftotext.cc.permissions xpdf-3.04/xpdf/pdftotext.cc +--- xpdf-3.04/xpdf/pdftotext.cc.permissions 2014-05-28 14:50:50.000000000 -0400 ++++ xpdf-3.04/xpdf/pdftotext.cc 2014-05-29 15:43:37.923303455 -0400 @@ -4,6 +4,8 @@ // - // Copyright 1997-2003 Glyph & Cog, LLC + // Copyright 1997-2013 Glyph & Cog, LLC // +// Modified for Debian by Hamish Moffatt, 22 May 2002. +// //======================================================================== #include -@@ -168,6 +170,7 @@ int main(int argc, char *argv[]) { +@@ -188,6 +190,7 @@ int main(int argc, char *argv[]) { goto err2; } @@ -96,7 +96,7 @@ diff -up xpdf-3.03/xpdf/pdftotext.cc.permissions xpdf-3.03/xpdf/pdftotext.cc // check for copy permission if (!doc->okToCopy()) { error(errNotAllowed, -1, -@@ -175,6 +178,7 @@ int main(int argc, char *argv[]) { +@@ -195,6 +198,7 @@ int main(int argc, char *argv[]) { exitCode = 3; goto err2; } @@ -104,9 +104,9 @@ diff -up xpdf-3.03/xpdf/pdftotext.cc.permissions xpdf-3.03/xpdf/pdftotext.cc // construct text file name if (argc == 3) { -diff -up xpdf-3.03/xpdf/XPDFCore.cc.permissions xpdf-3.03/xpdf/XPDFCore.cc ---- xpdf-3.03/xpdf/XPDFCore.cc.permissions 2011-08-22 13:54:13.488262809 -0400 -+++ xpdf-3.03/xpdf/XPDFCore.cc 2011-08-22 13:57:21.556171863 -0400 +diff -up xpdf-3.04/xpdf/XPDFCore.cc.permissions xpdf-3.04/xpdf/XPDFCore.cc +--- xpdf-3.04/xpdf/XPDFCore.cc.permissions 2014-05-29 15:40:57.777449640 -0400 ++++ xpdf-3.04/xpdf/XPDFCore.cc 2014-05-29 15:40:57.819449339 -0400 @@ -4,6 +4,8 @@ // // Copyright 2002-2003 Glyph & Cog, LLC @@ -116,7 +116,7 @@ diff -up xpdf-3.03/xpdf/XPDFCore.cc.permissions xpdf-3.03/xpdf/XPDFCore.cc //======================================================================== #include -@@ -384,12 +386,16 @@ void XPDFCore::endSelection(int wx, int +@@ -384,12 +386,16 @@ void XPDFCore::endSelection(int wx, int #ifndef NO_TEXT_SELECT if (selectULX != selectLRX && selectULY != selectLRY) { @@ -145,9 +145,9 @@ diff -up xpdf-3.03/xpdf/XPDFCore.cc.permissions xpdf-3.03/xpdf/XPDFCore.cc if (getSelection(&pg, &ulx, &uly, &lrx, &lry)) { //~ for multithreading: need a mutex here if (currentSelection) { -diff -up xpdf-3.03/xpdf/XPDFViewer.cc.permissions xpdf-3.03/xpdf/XPDFViewer.cc ---- xpdf-3.03/xpdf/XPDFViewer.cc.permissions 2011-08-22 13:54:13.540262229 -0400 -+++ xpdf-3.03/xpdf/XPDFViewer.cc 2011-08-22 13:58:15.021581012 -0400 +diff -up xpdf-3.04/xpdf/XPDFViewer.cc.permissions xpdf-3.04/xpdf/XPDFViewer.cc +--- xpdf-3.04/xpdf/XPDFViewer.cc.permissions 2014-05-29 15:40:57.808449418 -0400 ++++ xpdf-3.04/xpdf/XPDFViewer.cc 2014-05-29 15:40:57.821449325 -0400 @@ -4,6 +4,8 @@ // // Copyright 2002-2003 Glyph & Cog, LLC @@ -157,7 +157,7 @@ diff -up xpdf-3.03/xpdf/XPDFViewer.cc.permissions xpdf-3.03/xpdf/XPDFViewer.cc //======================================================================== #include -@@ -3494,10 +3496,12 @@ void XPDFViewer::printPrintCbk(Widget wi +@@ -3503,10 +3505,12 @@ void XPDFViewer::printPrintCbk(Widget wi PSOutputDev *psOut; doc = viewer->core->getDoc(); diff --git a/sources b/sources index 106603d..75f71be 100644 --- a/sources +++ b/sources @@ -1,12 +1,12 @@ -03e68fb1ee46edb3613d63e36e16e91d xpdf-3.03-novms.tar.gz -ba4b037ab691f8b029ec2b9820a2fb8c xpdf-chinese-simplified-2004-jul-27-NOCMAP.tar.gz -697e7edc09a285115b597ab03f2eddf9 xpdf-chinese-traditional-2004-jul-27-NOCMAP.tar.gz -7b22f31289ce0812d2ec77014e7b0cdf xpdf-cyrillic-2003-jun-28.tar.gz -f759b1b9624c7364e5d5a1ab3d146597 xpdf-japanese-2004-jul-27-NOCMAP.tar.gz -276624cddd1b70c29a3ae03ddb20fb3a xpdf-korean-2005-jul-07-NOCMAP.tar.gz -96e058c1b0429ae1ba0b50f1784b0985 xpdf-thai-2002-jan-16.tar.gz -67f05f65bc64bf022b36138c7c26746d xpdf-arabic-2003-feb-16.tar.gz -dacacda02b84b1184235a5fab072fbd8 xpdf-greek-2003-jun-28.tar.gz -438dd417517641cbb78a94facf2d938e xpdf-hebrew-2003-feb-16.tar.gz -ac19ef990cd63afd2837c10dc7e1c3ab xpdf-latin2-2002-oct-22.tar.gz -511758c86e21328a241adc8590834ea2 xpdf-turkish-2002-apr-10.tar.gz +3bc86c69c8ff444db52461270bef3f44 xpdf-3.04.tar.gz +ae8cdd4759295e02988506e7a570d00c xpdf-arabic-2011-aug-15.tar.gz +abd221d2df88de2011daad8d184dd66b xpdf-chinese-simplified-2011-sep-02-NOCMAP.tar.gz +63431231acd6d8f75e23bb3205793ff3 xpdf-chinese-traditional-2011-sep-02-NOCMAP.tar.gz +ea8ed8fd0ed26b8448e6558827249999 xpdf-cyrillic-2011-aug-15.tar.gz +2e988edf0c57def63717ee14bd6d30dd xpdf-greek-2011-aug-15.tar.gz +e1cb33f22bb71fb01998e5c59f538472 xpdf-hebrew-2011-aug-15.tar.gz +4033838d6bca641d5d2e76c7d1240c3e xpdf-japanese-2011-sep-02-NOCMAP.tar.gz +b9390fe8dc484d9d6ed78359fa520c33 xpdf-korean-2011-sep-02-NOCMAP.tar.gz +c135fe93f933edaa0f042a8d3cc9f799 xpdf-latin2-2011-aug-15.tar.gz +57fc888436f19cdf4a68ef17c17b86b7 xpdf-thai-2011-aug-15.tar.gz +640615c24581b26c4083210bef3013bf xpdf-turkish-2011-aug-15.tar.gz diff --git a/xpdf-3.04-64bit.patch b/xpdf-3.04-64bit.patch new file mode 100644 index 0000000..49e3052 --- /dev/null +++ b/xpdf-3.04-64bit.patch @@ -0,0 +1,57 @@ +diff -up xpdf-3.04/goo/gmem.cc.alloc xpdf-3.04/goo/gmem.cc +--- xpdf-3.04/goo/gmem.cc.alloc 2014-05-28 14:50:50.000000000 -0400 ++++ xpdf-3.04/goo/gmem.cc 2014-05-29 15:00:18.670819951 -0400 +@@ -48,9 +48,9 @@ static int gMaxMemInUse = 0; + + #endif /* DEBUG_MEM */ + +-void *gmalloc(int size) GMEM_EXCEP { ++void *gmalloc(size_t size) GMEM_EXCEP { + #ifdef DEBUG_MEM +- int size1; ++ size_t size1; + char *mem; + GMemHdr *hdr; + void *data; +@@ -106,11 +106,11 @@ void *gmalloc(int size) GMEM_EXCEP { + #endif + } + +-void *grealloc(void *p, int size) GMEM_EXCEP { ++void *grealloc(void *p, size_t size) GMEM_EXCEP { + #ifdef DEBUG_MEM + GMemHdr *hdr; + void *q; +- int oldSize; ++ size_t oldSize; + + if (size < 0) { + gMemError("Invalid memory allocation size"); +@@ -186,7 +186,7 @@ void *greallocn(void *p, int nObjs, int + + void gfree(void *p) { + #ifdef DEBUG_MEM +- int size; ++ size_t size; + GMemHdr *hdr; + unsigned long *trl, *clr; + +diff -up xpdf-3.04/goo/gmem.h.alloc xpdf-3.04/goo/gmem.h +--- xpdf-3.04/goo/gmem.h.alloc 2014-05-28 14:50:50.000000000 -0400 ++++ xpdf-3.04/goo/gmem.h 2014-05-29 14:59:04.364344108 -0400 +@@ -36,13 +36,13 @@ extern "C" { + * Same as malloc, but prints error message and exits if malloc() + * returns NULL. + */ +-extern void *gmalloc(int size) GMEM_EXCEP; ++extern void *gmalloc(size_t size) GMEM_EXCEP; + + /* + * Same as realloc, but prints error message and exits if realloc() + * returns NULL. If

is NULL, calls malloc instead of realloc(). + */ +-extern void *grealloc(void *p, int size) GMEM_EXCEP; ++extern void *grealloc(void *p, size_t size) GMEM_EXCEP; + + /* + * These are similar to gmalloc and grealloc, but take an object count diff --git a/xpdf-3.04-crash.patch b/xpdf-3.04-crash.patch new file mode 100644 index 0000000..a816d89 --- /dev/null +++ b/xpdf-3.04-crash.patch @@ -0,0 +1,22 @@ +diff -up xpdf-3.04/fofi/FoFiType1.cc.crash xpdf-3.04/fofi/FoFiType1.cc +--- xpdf-3.04/fofi/FoFiType1.cc.crash 2014-05-28 14:50:50.000000000 -0400 ++++ xpdf-3.04/fofi/FoFiType1.cc 2014-05-29 14:56:09.199571189 -0400 +@@ -268,9 +268,14 @@ void FoFiType1::parse() { + } + } + } else { +- if (strtok(buf, " \t") && +- (p = strtok(NULL, " \t\n\r")) && !strcmp(p, "def")) { +- break; ++ p = strtok(buf, " \t\n\r"); ++ if (p) ++ { ++ if (!strcmp(p, "def")) break; ++ if (!strcmp(p, "readonly")) break; ++ // the spec does not says this but i'm mantaining old xpdf behaviour that accepts "foo def" as end of the encoding array ++ p = strtok(buf, " \t\n\r"); ++ if (p && !strcmp(p, "def")) break; + } + } + } +diff -up xpdf-3.04/splash/Splash.cc.crash xpdf-3.04/splash/Splash.cc diff --git a/xpdf-3.04-nocmap.patch b/xpdf-3.04-nocmap.patch new file mode 100644 index 0000000..d5ffc7f --- /dev/null +++ b/xpdf-3.04-nocmap.patch @@ -0,0 +1,53 @@ +diff -up xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc.orig xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc +--- xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc.orig 2014-05-29 15:01:29.238318492 -0400 ++++ xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc 2014-05-29 15:02:30.453883329 -0400 +@@ -3,7 +3,7 @@ cidToUnicode Adobe-GB1 /usr/sharexpdf/ch + unicodeMap ISO-2022-CN /usr/sharexpdf/chinese-simplified/ISO-2022-CN.unicodeMap + unicodeMap EUC-CN /usr/sharexpdf/chinese-simplified/EUC-CN.unicodeMap + unicodeMap GBK /usr/sharexpdf/chinese-simplified/GBK.unicodeMap +-cMapDir Adobe-GB1 /usr/sharexpdf/chinese-simplified/CMap +-toUnicodeDir /usr/sharexpdf/chinese-simplified/CMap ++#cMapDir Adobe-GB1 /usr/sharexpdf/chinese-simplified/CMap ++#toUnicodeDir /usr/sharexpdf/chinese-simplified/CMap + #fontFileCC Adobe-GB1 /usr/..../gkai00mp.ttf + #----- end Chinese Simplified support package +diff -up xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc.orig xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc +--- xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc.orig 2014-05-29 15:01:29.237318499 -0400 ++++ xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc 2014-05-29 15:02:01.979085766 -0400 +@@ -2,7 +2,7 @@ + cidToUnicode Adobe-CNS1 /usr/share/xpdf/chinese-traditional/Adobe-CNS1.cidToUnicode + unicodeMap Big5 /usr/share/xpdf/chinese-traditional/Big5.unicodeMap + unicodeMap Big5ascii /usr/share/xpdf/chinese-traditional/Big5ascii.unicodeMap +-cMapDir Adobe-CNS1 /usr/share/xpdf/chinese-traditional/CMap +-toUnicodeDir /usr/share/xpdf/chinese-traditional/CMap ++#cMapDir Adobe-CNS1 /usr/share/xpdf/chinese-traditional/CMap ++#toUnicodeDir /usr/share/xpdf/chinese-traditional/CMap + #fontFileCC Adobe-CNS1 /usr/..../bkai00mp.ttf + #----- end Chinese Traditional support package +diff -up xpdf-3.04/xpdf-japanese/add-to-xpdfrc.orig xpdf-3.04/xpdf-japanese/add-to-xpdfrc +--- xpdf-3.04/xpdf-japanese/add-to-xpdfrc.orig 2014-05-29 15:01:29.238318492 -0400 ++++ xpdf-3.04/xpdf-japanese/add-to-xpdfrc 2014-05-29 15:02:43.814788329 -0400 +@@ -3,7 +3,7 @@ cidToUnicode Adobe-Japan1 /usr/sharexpdf + unicodeMap ISO-2022-JP /usr/sharexpdf/japanese/ISO-2022-JP.unicodeMap + unicodeMap EUC-JP /usr/sharexpdf/japanese/EUC-JP.unicodeMap + unicodeMap Shift-JIS /usr/sharexpdf/japanese/Shift-JIS.unicodeMap +-cMapDir Adobe-Japan1 /usr/sharexpdf/japanese/CMap +-toUnicodeDir /usr/sharexpdf/japanese/CMap ++#cMapDir Adobe-Japan1 /usr/sharexpdf/japanese/CMap ++#toUnicodeDir /usr/sharexpdf/japanese/CMap + #fontFileCC Adobe-Japan1 /usr/..../kochi-mincho.ttf + #----- end Japanese support package +diff -up xpdf-3.04/xpdf-korean/add-to-xpdfrc.orig xpdf-3.04/xpdf-korean/add-to-xpdfrc +--- xpdf-3.04/xpdf-korean/add-to-xpdfrc.orig 2014-05-29 15:01:29.238318492 -0400 ++++ xpdf-3.04/xpdf-korean/add-to-xpdfrc 2014-05-29 15:02:16.581981953 -0400 +@@ -1,8 +1,8 @@ + #----- begin Korean support package (2011-sep-02) + cidToUnicode Adobe-Korea1 /usr/sharexpdf/korean/Adobe-Korea1.cidToUnicode + unicodeMap ISO-2022-KR /usr/sharexpdf/korean/ISO-2022-KR.unicodeMap +-cMapDir Adobe-Korea1 /usr/sharexpdf/korean/CMap +-toUnicodeDir /usr/sharexpdf/korean/CMap ++#cMapDir Adobe-Korea1 /usr/sharexpdf/korean/CMap ++#toUnicodeDir /usr/sharexpdf/korean/CMap + #fontFileCC Adobe-Korea1 /usr/..../batang.ttf" + #fontFileCC Unidocs-Korea1 /usr/..../batang.ttf" + #----- end Korean support package diff --git a/xpdf-3.04-pdftopng.patch b/xpdf-3.04-pdftopng.patch new file mode 100644 index 0000000..6229d0a --- /dev/null +++ b/xpdf-3.04-pdftopng.patch @@ -0,0 +1,32 @@ +diff -up xpdf-3.04/Makefile.in.pdftopng xpdf-3.04/Makefile.in +--- xpdf-3.04/Makefile.in.pdftopng 2014-05-29 15:56:14.405875939 -0400 ++++ xpdf-3.04/Makefile.in 2014-05-29 15:58:11.755031543 -0400 +@@ -37,6 +37,12 @@ xpdf: dummy + cd @UP_DIR@splash; $(MAKE) + cd @UP_DIR@xpdf; $(MAKE) xpdf$(EXE) + ++pdftopng: dummy ++ cd goo; $(MAKE) ++ cd @UP_DIR@fofi; $(MAKE) ++ cd @UP_DIR@splash; $(MAKE) ++ cd @UP_DIR@xpdf; $(MAKE) pdftopng$(EXE) ++ + pdftops: dummy + cd goo; $(MAKE) + cd @UP_DIR@fofi; $(MAKE) +@@ -91,6 +97,7 @@ install: dummy + $(INSTALL_PROGRAM) xpdf/pdfdetach$(EXE) $(DESTDIR)@bindir@/pdfdetach$(EXE) + @X@ $(INSTALL_PROGRAM) xpdf/pdftoppm$(EXE) $(DESTDIR)@bindir@/pdftoppm$(EXE) + $(INSTALL_PROGRAM) xpdf/pdfimages$(EXE) $(DESTDIR)@bindir@/pdfimages$(EXE) ++ $(INSTALL_PROGRAM) xpdf/pdftopng$(EXE) $(DESTDIR)@bindir@/pdftopng$(EXE) + -mkdir -p $(DESTDIR)@mandir@/man1 + @X@ $(INSTALL_DATA) $(srcdir)/doc/xpdf.1 $(DESTDIR)@mandir@/man1/xpdf.1 + $(INSTALL_DATA) $(srcdir)/doc/pdftops.1 $(DESTDIR)@mandir@/man1/pdftops.1 +@@ -100,6 +107,7 @@ install: dummy + $(INSTALL_DATA) $(srcdir)/doc/pdfdetach.1 $(DESTDIR)@mandir@/man1/pdfdetach.1 + @X@ $(INSTALL_DATA) $(srcdir)/doc/pdftoppm.1 $(DESTDIR)@mandir@/man1/pdftoppm.1 + $(INSTALL_DATA) $(srcdir)/doc/pdfimages.1 $(DESTDIR)@mandir@/man1/pdfimages.1 ++ $(INSTALL_DATA) $(srcdir)/doc/pdftopng.1 $(DESTDIR)@mandir@/man1/pdftopng.1 + -mkdir -p $(DESTDIR)@mandir@/man5 + $(INSTALL_DATA) $(srcdir)/doc/xpdfrc.5 $(DESTDIR)@mandir@/man5/xpdfrc.5 + -mkdir -p $(DESTDIR)@sysconfdir@ diff --git a/xpdf-3.04-redhat-new.patch b/xpdf-3.04-redhat-new.patch new file mode 100644 index 0000000..fda1662 --- /dev/null +++ b/xpdf-3.04-redhat-new.patch @@ -0,0 +1,136 @@ +diff -up xpdf-3.04/doc/sample-xpdfrc.orig xpdf-3.04/doc/sample-xpdfrc +--- xpdf-3.04/doc/sample-xpdfrc.orig 2014-05-28 14:50:50.000000000 -0400 ++++ xpdf-3.04/doc/sample-xpdfrc 2014-05-29 14:50:23.704974484 -0400 +@@ -56,7 +56,7 @@ + + # Set the default PostScript file or command. + +-#psFile "|lpr -Pmyprinter" ++psFile "|lpr" + + # Set the default PostScript paper size -- this can be letter, legal, + # A4, or A3. You can also specify a paper size as width and height +@@ -88,4 +88,10 @@ + # clicked. + + #launchCommand viewer-script +-#urlCommand "netscape -remote 'openURL(%s)'" ++urlCommand "xdg-open '%s'" ++ ++# CJK ++include /etc/xpdf/add-to-xpdfrc.japanese ++include /etc/xpdf/add-to-xpdfrc.korean ++include /etc/xpdf/add-to-xpdfrc.chinese-simplified ++include /etc/xpdf/add-to-xpdfrc.chinese-traditional +diff -up xpdf-3.04/doc/xpdfrc.5.orig xpdf-3.04/doc/xpdfrc.5 +--- xpdf-3.04/doc/xpdfrc.5.orig 2014-05-28 14:50:50.000000000 -0400 ++++ xpdf-3.04/doc/xpdfrc.5 2014-05-29 14:50:23.701974504 -0400 +@@ -7,7 +7,7 @@ All of the Xpdf tools read a single conf + .I .xpdfrc + file in your home directory, it will be read. Otherwise, a + system-wide configuration file will be read from +-.IR /usr/local/etc/xpdfrc , ++.IR /etc/xpdfrc , + if it exists. (This is its default location; depending on build + options, it may be placed elsewhere.) On Win32 systems, the + .I xpdfrc +@@ -672,7 +672,7 @@ urlCommand "netscape \-remote 'open + .fi + .SH FILES + .TP +-.B /usr/local/etc/xpdfrc ++.B /etc/xpdfrc + This is the default location for the system-wide configuration file. + Depending on build options, it may be placed elsewhere. + .TP +diff -up xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc.orig xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc +--- xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc.orig 2014-05-29 14:50:23.700974511 -0400 ++++ xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc 2014-05-29 14:53:15.316783717 -0400 +@@ -1,9 +1,9 @@ + #----- begin Chinese Simplified support package (2011-sep-02) +-cidToUnicode Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/Adobe-GB1.cidToUnicode +-unicodeMap ISO-2022-CN /usr/local/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap +-unicodeMap EUC-CN /usr/local/share/xpdf/chinese-simplified/EUC-CN.unicodeMap +-unicodeMap GBK /usr/local/share/xpdf/chinese-simplified/GBK.unicodeMap +-cMapDir Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/CMap +-toUnicodeDir /usr/local/share/xpdf/chinese-simplified/CMap ++cidToUnicode Adobe-GB1 /usr/sharexpdf/chinese-simplified/Adobe-GB1.cidToUnicode ++unicodeMap ISO-2022-CN /usr/sharexpdf/chinese-simplified/ISO-2022-CN.unicodeMap ++unicodeMap EUC-CN /usr/sharexpdf/chinese-simplified/EUC-CN.unicodeMap ++unicodeMap GBK /usr/sharexpdf/chinese-simplified/GBK.unicodeMap ++cMapDir Adobe-GB1 /usr/sharexpdf/chinese-simplified/CMap ++toUnicodeDir /usr/sharexpdf/chinese-simplified/CMap + #fontFileCC Adobe-GB1 /usr/..../gkai00mp.ttf + #----- end Chinese Simplified support package +diff -up xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc.orig xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc +--- xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc.orig 2014-05-29 14:50:23.699974518 -0400 ++++ xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc 2014-05-29 14:53:15.321783682 -0400 +@@ -1,8 +1,8 @@ + #----- begin Chinese Traditional support package (2011-sep-02) +-cidToUnicode Adobe-CNS1 /usr/local/share/xpdf/chinese-traditional/Adobe-CNS1.cidToUnicode +-unicodeMap Big5 /usr/local/share/xpdf/chinese-traditional/Big5.unicodeMap +-unicodeMap Big5ascii /usr/local/share/xpdf/chinese-traditional/Big5ascii.unicodeMap +-cMapDir Adobe-CNS1 /usr/local/share/xpdf/chinese-traditional/CMap +-toUnicodeDir /usr/local/share/xpdf/chinese-traditional/CMap ++cidToUnicode Adobe-CNS1 /usr/share/xpdf/chinese-traditional/Adobe-CNS1.cidToUnicode ++unicodeMap Big5 /usr/share/xpdf/chinese-traditional/Big5.unicodeMap ++unicodeMap Big5ascii /usr/share/xpdf/chinese-traditional/Big5ascii.unicodeMap ++cMapDir Adobe-CNS1 /usr/share/xpdf/chinese-traditional/CMap ++toUnicodeDir /usr/share/xpdf/chinese-traditional/CMap + #fontFileCC Adobe-CNS1 /usr/..../bkai00mp.ttf + #----- end Chinese Traditional support package +diff -up xpdf-3.04/xpdf-cyrillic/add-to-xpdfrc.orig xpdf-3.04/xpdf-cyrillic/add-to-xpdfrc +--- xpdf-3.04/xpdf-cyrillic/add-to-xpdfrc.orig 2014-05-29 14:50:23.704974484 -0400 ++++ xpdf-3.04/xpdf-cyrillic/add-to-xpdfrc 2014-05-29 14:53:15.325783654 -0400 +@@ -1,4 +1,4 @@ + #----- begin Cyrillic support package (2011-aug-15) +-nameToUnicode /usr/local/share/xpdf/cyrillic/Bulgarian.nameToUnicode +-unicodeMap KOI8-R /usr/local/share/xpdf/cyrillic/KOI8-R.unicodeMap ++nameToUnicode /usr/sharexpdf/cyrillic/Bulgarian.nameToUnicode ++unicodeMap KOI8-R /usr/sharexpdf/cyrillic/KOI8-R.unicodeMap + #----- end Cyrillic support package +diff -up xpdf-3.04/xpdf-japanese/add-to-xpdfrc.orig xpdf-3.04/xpdf-japanese/add-to-xpdfrc +--- xpdf-3.04/xpdf-japanese/add-to-xpdfrc.orig 2014-05-29 14:50:23.700974511 -0400 ++++ xpdf-3.04/xpdf-japanese/add-to-xpdfrc 2014-05-29 14:53:15.340783550 -0400 +@@ -1,9 +1,9 @@ + #----- begin Japanese support package (2011-sep-02) +-cidToUnicode Adobe-Japan1 /usr/local/share/xpdf/japanese/Adobe-Japan1.cidToUnicode +-unicodeMap ISO-2022-JP /usr/local/share/xpdf/japanese/ISO-2022-JP.unicodeMap +-unicodeMap EUC-JP /usr/local/share/xpdf/japanese/EUC-JP.unicodeMap +-unicodeMap Shift-JIS /usr/local/share/xpdf/japanese/Shift-JIS.unicodeMap +-cMapDir Adobe-Japan1 /usr/local/share/xpdf/japanese/CMap +-toUnicodeDir /usr/local/share/xpdf/japanese/CMap ++cidToUnicode Adobe-Japan1 /usr/sharexpdf/japanese/Adobe-Japan1.cidToUnicode ++unicodeMap ISO-2022-JP /usr/sharexpdf/japanese/ISO-2022-JP.unicodeMap ++unicodeMap EUC-JP /usr/sharexpdf/japanese/EUC-JP.unicodeMap ++unicodeMap Shift-JIS /usr/sharexpdf/japanese/Shift-JIS.unicodeMap ++cMapDir Adobe-Japan1 /usr/sharexpdf/japanese/CMap ++toUnicodeDir /usr/sharexpdf/japanese/CMap + #fontFileCC Adobe-Japan1 /usr/..../kochi-mincho.ttf + #----- end Japanese support package +diff -up xpdf-3.04/xpdf-korean/add-to-xpdfrc.orig xpdf-3.04/xpdf-korean/add-to-xpdfrc +--- xpdf-3.04/xpdf-korean/add-to-xpdfrc.orig 2014-05-29 14:50:23.700974511 -0400 ++++ xpdf-3.04/xpdf-korean/add-to-xpdfrc 2014-05-29 14:53:15.345783515 -0400 +@@ -1,8 +1,8 @@ + #----- begin Korean support package (2011-sep-02) +-cidToUnicode Adobe-Korea1 /usr/local/share/xpdf/korean/Adobe-Korea1.cidToUnicode +-unicodeMap ISO-2022-KR /usr/local/share/xpdf/korean/ISO-2022-KR.unicodeMap +-cMapDir Adobe-Korea1 /usr/local/share/xpdf/korean/CMap +-toUnicodeDir /usr/local/share/xpdf/korean/CMap ++cidToUnicode Adobe-Korea1 /usr/sharexpdf/korean/Adobe-Korea1.cidToUnicode ++unicodeMap ISO-2022-KR /usr/sharexpdf/korean/ISO-2022-KR.unicodeMap ++cMapDir Adobe-Korea1 /usr/sharexpdf/korean/CMap ++toUnicodeDir /usr/sharexpdf/korean/CMap + #fontFileCC Adobe-Korea1 /usr/..../batang.ttf" + #fontFileCC Unidocs-Korea1 /usr/..../batang.ttf" + #----- end Korean support package +diff -up xpdf-3.04/xpdf-thai/add-to-xpdfrc.orig xpdf-3.04/xpdf-thai/add-to-xpdfrc +--- xpdf-3.04/xpdf-thai/add-to-xpdfrc.orig 2014-05-29 14:50:23.703974490 -0400 ++++ xpdf-3.04/xpdf-thai/add-to-xpdfrc 2014-05-29 14:53:15.355783445 -0400 +@@ -1,4 +1,4 @@ + #----- begin Thai support package (2011-aug-15) +-nameToUnicode /usr/local/share/xpdf/thai/Thai.nameToUnicode +-unicodeMap TIS-620 /usr/local/share/xpdf/thai/TIS-620.unicodeMap ++nameToUnicode /usr/sharexpdf/thai/Thai.nameToUnicode ++unicodeMap TIS-620 /usr/sharexpdf/thai/TIS-620.unicodeMap + #----- end Thai support package diff --git a/xpdf.spec b/xpdf.spec index 8b6c9df..7c90f97 100644 --- a/xpdf.spec +++ b/xpdf.spec @@ -1,52 +1,46 @@ Summary: A PDF file viewer for the X Window System Name: xpdf -Version: 3.03 -Release: 8%{?dist} +Version: 3.04 +Release: 1%{?dist} License: GPLv2 or GPLv3 Epoch: 1 Url: http://www.foolabs.com/xpdf/ Group: Applications/Publishing -# There are some troublesome files named vms_*. We pull them out of the -# tarball since we're not even using them on Linux. -# Source0: ftp://ftp.foolabs.com/pub/xpdf/%{name}-%{version}.tar.gz -Source0: %{name}-%{version}-novms.tar.gz +Source0: ftp://ftp.foolabs.com/pub/xpdf/%{name}-%{version}.tar.gz # We have to pull the CMap files out due to non-free license. -# Source3: ftp://ftp.foolabs.com/pub/xpdf/xpdf-chinese-simplified-2004-jul-27.tar.gz -Source3: xpdf-chinese-simplified-2004-jul-27-NOCMAP.tar.gz -# Source4: ftp://ftp.foolabs.com/pub/xpdf/xpdf-chinese-traditional-2004-jul-27.tar.gz -Source4: xpdf-chinese-traditional-2004-jul-27-NOCMAP.tar.gz -# Source5: ftp://ftp.foolabs.com/pub/xpdf/xpdf-japanese-2004-jul-27.tar.gz -Source5: xpdf-japanese-2004-jul-27-NOCMAP.tar.gz -# Source6: ftp://ftp.foolabs.com/pub/xpdf/xpdf-korean-2005-jul-07.tar.gz -Source6: xpdf-korean-2005-jul-07-NOCMAP.tar.gz +# Source3: ftp://ftp.foolabs.com/pub/xpdf/xpdf-chinese-simplified-2011-sep-02.tar.gz +Source3: xpdf-chinese-simplified-2011-sep-02-NOCMAP.tar.gz +# Source4: ftp://ftp.foolabs.com/pub/xpdf/xpdf-chinese-traditional-2011-sep-02.tar.gz +Source4: xpdf-chinese-traditional-2011-sep-02-NOCMAP.tar.gz +# Source5: ftp://ftp.foolabs.com/pub/xpdf/xpdf-japanese-2011-sep-02.tar.gz +Source5: xpdf-japanese-2011-sep-02-NOCMAP.tar.gz +# Source6: ftp://ftp.foolabs.com/pub/xpdf/xpdf-korean-2011-sep-02.tar.gz +Source6: xpdf-korean-2011-sep-02-NOCMAP.tar.gz # cyrillic and thai don't have CMap files to worry about. -Source7: ftp://ftp.foolabs.com/pub/xpdf/xpdf-cyrillic-2003-jun-28.tar.gz -Source8: ftp://ftp.foolabs.com/pub/xpdf/xpdf-thai-2002-jan-16.tar.gz +Source7: ftp://ftp.foolabs.com/pub/xpdf/xpdf-cyrillic-2011-aug-15.tar.gz +Source8: ftp://ftp.foolabs.com/pub/xpdf/xpdf-thai-2011-aug-15.tar.gz Source10: xpdf.desktop Source11: xpdf.png -Source12: ftp://ftp.foolabs.com/pub/xpdf/xpdf-arabic-2003-feb-16.tar.gz -Source13: ftp://ftp.foolabs.com/pub/xpdf/xpdf-greek-2003-jun-28.tar.gz -Source14: ftp://ftp.foolabs.com/pub/xpdf/xpdf-hebrew-2003-feb-16.tar.gz -Source15: ftp://ftp.foolabs.com/pub/xpdf/xpdf-latin2-2002-oct-22.tar.gz -Source16: ftp://ftp.foolabs.com/pub/xpdf/xpdf-turkish-2002-apr-10.tar.gz +Source12: ftp://ftp.foolabs.com/pub/xpdf/xpdf-arabic-2011-aug-15.tar.gz +Source13: ftp://ftp.foolabs.com/pub/xpdf/xpdf-greek-2011-aug-15.tar.gz +Source14: ftp://ftp.foolabs.com/pub/xpdf/xpdf-hebrew-2011-aug-15.tar.gz +Source15: ftp://ftp.foolabs.com/pub/xpdf/xpdf-latin2-2011-aug-15.tar.gz +Source16: ftp://ftp.foolabs.com/pub/xpdf/xpdf-turkish-2011-aug-15.tar.gz -Patch0: xpdf-3.01-redhat-new.patch +Patch0: xpdf-3.04-redhat-new.patch Patch3: xpdf-3.03-ext.patch Patch6: xpdf-3.00-core.patch Patch7: xpdf-3.00-xfont.patch Patch9: xpdf-3.00-papersize.patch -Patch10: xpdf-3.00-gcc4.patch -Patch11: xpdf-3.03-crash.patch -Patch12: xpdf-3.03-64bit.patch -# Patch13: xpdf-3.01-resize.patch# Patch14: xpdf-3.01-freetype-internals.patch -Patch15: xpdf-3.01-nocmap.patch +Patch11: xpdf-3.04-crash.patch +Patch12: xpdf-3.04-64bit.patch +Patch15: xpdf-3.04-nocmap.patch Patch16: xpdf-3.02-fontlist.patch Patch19: xpdf-3.02-additionalzoom.patch -Patch20: xpdf-3.03-compile-fix.patch +Patch20: xpdf-3.04-pdftopng.patch # Security patches -Patch100: xpdf-3.03-CVE-2012-2142.diff # Debian patches Patch200: 02_permissions.dpatch @@ -63,11 +57,13 @@ Requires: xorg-x11-fonts-ISO8859-1-100dpi %if 0%{?rhel} BuildRequires: openmotif-devel %else -BuildRequires: lesstif-devel +# Used to use lesstif-devel here. If you are trying to build on Fedora < 17, try that. +BuildRequires: motif-devel %endif BuildRequires: freetype-devel >= 2.1.7 BuildRequires: desktop-file-utils BuildRequires: libpaper-devel +BuildRequires: libpng-devel Provides: %{name}-chinese-simplified = %{version}-%{release} Obsoletes: %{name}-chinese-simplified @@ -92,20 +88,14 @@ standard X fonts. %patch6 -p1 -b .core %patch7 -p1 -b .fonts %patch9 -p1 -b .papersize -%patch10 -p1 -b .gcc4 %patch11 -p1 -b .crash %patch12 -p1 -b .alloc -# Upstreamed -#%%patch13 -p1 -b .resize -#%%patch14 -p1 -b .freetype-internals %patch15 -p1 %patch16 -p1 -b .fontlist %patch19 -p1 -# invalid conversion from 'const char*' to 'char*' -%patch20 -p1 -b .charfix +%patch20 -p1 -b .pdftopng # security patches -%patch100 -p1 -b .CVE-2012-2142 # debian patches %patch200 -p1 -b .permissions @@ -156,7 +146,11 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/xpdf/arabic \ make install DESTDIR=$RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications/ +%if 0%{?rhel} > 5 || 0%{?fedora} desktop-file-install \ +%else +desktop-file-install --vendor "fedora" \ +%endif --dir $RPM_BUILD_ROOT%{_datadir}/applications \ --add-category X-Fedora \ %{SOURCE10} @@ -177,7 +171,9 @@ cp -pr xpdf-turkish/* $RPM_BUILD_ROOT%{_datadir}/xpdf/turkish/ # poppler provides all utilities now # http://bugzilla.redhat.com/bugzillA/SHow_bug.cgi?id=177446 # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=219032 +%if 0%{?fedora} rm $RPM_BUILD_ROOT%{_bindir}/pdfdetach +%endif rm $RPM_BUILD_ROOT%{_bindir}/pdffonts rm $RPM_BUILD_ROOT%{_bindir}/pdfimages rm $RPM_BUILD_ROOT%{_bindir}/pdfinfo @@ -187,7 +183,9 @@ rm $RPM_BUILD_ROOT%{_bindir}/pdftotext rm $RPM_BUILD_ROOT%{_bindir}/pdftoppm rm $RPM_BUILD_ROOT%{_mandir}/man1/pdftoppm.1* %endif +%if 0%{?fedora} rm $RPM_BUILD_ROOT%{_mandir}/man1/pdfdetach.1* +%endif rm $RPM_BUILD_ROOT%{_mandir}/man1/pdffonts.1* rm $RPM_BUILD_ROOT%{_mandir}/man1/pdfimages.1* rm $RPM_BUILD_ROOT%{_mandir}/man1/pdfinfo.1* @@ -222,6 +220,8 @@ update-desktop-database &> /dev/null ||: %files %doc CHANGES README README.* %{_bindir}/xpdf +%{_bindir}/pdftopng +%{_mandir}/man?/pdftopng* %{_mandir}/man?/xpdf* %if 0%{?rhel} > 5 || 0%{?fedora} > 6 # Do Nothing. @@ -229,6 +229,10 @@ update-desktop-database &> /dev/null ||: %{_bindir}/pdftoppm %{_mandir}/man?/pdftoppm* %endif +%if 0%{?rhel} +%{_bindir}/pdfdetach +%{_mandir}/man?/pdfdetach* +%endif %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/xpdfrc %dir %{_sysconfdir}/xpdf %lang(ar) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/xpdf/add-to-xpdfrc.arabic @@ -259,6 +263,15 @@ update-desktop-database &> /dev/null ||: %{_datadir}/xpdf/latin2 %changelog +* Thu May 29 2014 Tom Callaway - 1:3.04-1 +- update to 3.04 +- update all patches, langpacks +- use motif instead of lesstif where possible +- fix pdftopng to install (not in poppler right now) + +* Sun Sep 22 2013 Tom Callaway - 1:3.03-8.1 +- rhel still needs pdfdetach in xpdf + * Sun Sep 22 2013 Tom Callaway - 1:3.03-8 - fix CVE-2012-2142 - fix issue with icon name in .desktop file (except on el5) @@ -646,7 +659,7 @@ update-desktop-database &> /dev/null ||: * Sun Mar 17 2002 Than Ngo 1.00-3 - rebuild -* Wed Feb 21 2002 Than Ngo 1.00-2 +* Thu Feb 21 2002 Than Ngo 1.00-2 - fix Bad 'urlCommand' (bug #59730) * Tue Feb 05 2002 Than Ngo 1.00-1 @@ -701,7 +714,7 @@ update-desktop-database &> /dev/null ||: * Thu Jul 13 2000 Prospector - automatic rebuild -* Tue Jul 2 2000 Jakub Jelinek +* Sun Jul 2 2000 Jakub Jelinek - Rebuild with new C++ * Fri Jun 16 2000 Than Ngo From f3f5e19012dfbf8881a0e307f438078881541b82 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Tue, 3 Jun 2014 14:53:27 -0400 Subject: [PATCH 3/5] fix sharexpdf typo in lang configs --- xpdf-3.04-nocmap.patch | 44 +++++++++++++++++++------------------- xpdf-3.04-redhat-new.patch | 40 +++++++++++++++++----------------- xpdf.spec | 5 ++++- 3 files changed, 46 insertions(+), 43 deletions(-) diff --git a/xpdf-3.04-nocmap.patch b/xpdf-3.04-nocmap.patch index d5ffc7f..1c381ae 100644 --- a/xpdf-3.04-nocmap.patch +++ b/xpdf-3.04-nocmap.patch @@ -1,14 +1,14 @@ diff -up xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc.orig xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc --- xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc.orig 2014-05-29 15:01:29.238318492 -0400 +++ xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc 2014-05-29 15:02:30.453883329 -0400 -@@ -3,7 +3,7 @@ cidToUnicode Adobe-GB1 /usr/sharexpdf/ch - unicodeMap ISO-2022-CN /usr/sharexpdf/chinese-simplified/ISO-2022-CN.unicodeMap - unicodeMap EUC-CN /usr/sharexpdf/chinese-simplified/EUC-CN.unicodeMap - unicodeMap GBK /usr/sharexpdf/chinese-simplified/GBK.unicodeMap --cMapDir Adobe-GB1 /usr/sharexpdf/chinese-simplified/CMap --toUnicodeDir /usr/sharexpdf/chinese-simplified/CMap -+#cMapDir Adobe-GB1 /usr/sharexpdf/chinese-simplified/CMap -+#toUnicodeDir /usr/sharexpdf/chinese-simplified/CMap +@@ -3,7 +3,7 @@ cidToUnicode Adobe-GB1 /usr/share/xpdf/ch + unicodeMap ISO-2022-CN /usr/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap + unicodeMap EUC-CN /usr/share/xpdf/chinese-simplified/EUC-CN.unicodeMap + unicodeMap GBK /usr/share/xpdf/chinese-simplified/GBK.unicodeMap +-cMapDir Adobe-GB1 /usr/share/xpdf/chinese-simplified/CMap +-toUnicodeDir /usr/share/xpdf/chinese-simplified/CMap ++#cMapDir Adobe-GB1 /usr/share/xpdf/chinese-simplified/CMap ++#toUnicodeDir /usr/share/xpdf/chinese-simplified/CMap #fontFileCC Adobe-GB1 /usr/..../gkai00mp.ttf #----- end Chinese Simplified support package diff -up xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc.orig xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc @@ -27,14 +27,14 @@ diff -up xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc.orig xpdf-3.04/xpdf-ch diff -up xpdf-3.04/xpdf-japanese/add-to-xpdfrc.orig xpdf-3.04/xpdf-japanese/add-to-xpdfrc --- xpdf-3.04/xpdf-japanese/add-to-xpdfrc.orig 2014-05-29 15:01:29.238318492 -0400 +++ xpdf-3.04/xpdf-japanese/add-to-xpdfrc 2014-05-29 15:02:43.814788329 -0400 -@@ -3,7 +3,7 @@ cidToUnicode Adobe-Japan1 /usr/sharexpdf - unicodeMap ISO-2022-JP /usr/sharexpdf/japanese/ISO-2022-JP.unicodeMap - unicodeMap EUC-JP /usr/sharexpdf/japanese/EUC-JP.unicodeMap - unicodeMap Shift-JIS /usr/sharexpdf/japanese/Shift-JIS.unicodeMap --cMapDir Adobe-Japan1 /usr/sharexpdf/japanese/CMap --toUnicodeDir /usr/sharexpdf/japanese/CMap -+#cMapDir Adobe-Japan1 /usr/sharexpdf/japanese/CMap -+#toUnicodeDir /usr/sharexpdf/japanese/CMap +@@ -3,7 +3,7 @@ cidToUnicode Adobe-Japan1 /usr/share/xpdf + unicodeMap ISO-2022-JP /usr/share/xpdf/japanese/ISO-2022-JP.unicodeMap + unicodeMap EUC-JP /usr/share/xpdf/japanese/EUC-JP.unicodeMap + unicodeMap Shift-JIS /usr/share/xpdf/japanese/Shift-JIS.unicodeMap +-cMapDir Adobe-Japan1 /usr/share/xpdf/japanese/CMap +-toUnicodeDir /usr/share/xpdf/japanese/CMap ++#cMapDir Adobe-Japan1 /usr/share/xpdf/japanese/CMap ++#toUnicodeDir /usr/share/xpdf/japanese/CMap #fontFileCC Adobe-Japan1 /usr/..../kochi-mincho.ttf #----- end Japanese support package diff -up xpdf-3.04/xpdf-korean/add-to-xpdfrc.orig xpdf-3.04/xpdf-korean/add-to-xpdfrc @@ -42,12 +42,12 @@ diff -up xpdf-3.04/xpdf-korean/add-to-xpdfrc.orig xpdf-3.04/xpdf-korean/add-to-x +++ xpdf-3.04/xpdf-korean/add-to-xpdfrc 2014-05-29 15:02:16.581981953 -0400 @@ -1,8 +1,8 @@ #----- begin Korean support package (2011-sep-02) - cidToUnicode Adobe-Korea1 /usr/sharexpdf/korean/Adobe-Korea1.cidToUnicode - unicodeMap ISO-2022-KR /usr/sharexpdf/korean/ISO-2022-KR.unicodeMap --cMapDir Adobe-Korea1 /usr/sharexpdf/korean/CMap --toUnicodeDir /usr/sharexpdf/korean/CMap -+#cMapDir Adobe-Korea1 /usr/sharexpdf/korean/CMap -+#toUnicodeDir /usr/sharexpdf/korean/CMap + cidToUnicode Adobe-Korea1 /usr/share/xpdf/korean/Adobe-Korea1.cidToUnicode + unicodeMap ISO-2022-KR /usr/share/xpdf/korean/ISO-2022-KR.unicodeMap +-cMapDir Adobe-Korea1 /usr/share/xpdf/korean/CMap +-toUnicodeDir /usr/share/xpdf/korean/CMap ++#cMapDir Adobe-Korea1 /usr/share/xpdf/korean/CMap ++#toUnicodeDir /usr/share/xpdf/korean/CMap #fontFileCC Adobe-Korea1 /usr/..../batang.ttf" #fontFileCC Unidocs-Korea1 /usr/..../batang.ttf" #----- end Korean support package diff --git a/xpdf-3.04-redhat-new.patch b/xpdf-3.04-redhat-new.patch index fda1662..d19d9b0 100644 --- a/xpdf-3.04-redhat-new.patch +++ b/xpdf-3.04-redhat-new.patch @@ -54,12 +54,12 @@ diff -up xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc.orig xpdf-3.04/xpdf-chi -unicodeMap GBK /usr/local/share/xpdf/chinese-simplified/GBK.unicodeMap -cMapDir Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/CMap -toUnicodeDir /usr/local/share/xpdf/chinese-simplified/CMap -+cidToUnicode Adobe-GB1 /usr/sharexpdf/chinese-simplified/Adobe-GB1.cidToUnicode -+unicodeMap ISO-2022-CN /usr/sharexpdf/chinese-simplified/ISO-2022-CN.unicodeMap -+unicodeMap EUC-CN /usr/sharexpdf/chinese-simplified/EUC-CN.unicodeMap -+unicodeMap GBK /usr/sharexpdf/chinese-simplified/GBK.unicodeMap -+cMapDir Adobe-GB1 /usr/sharexpdf/chinese-simplified/CMap -+toUnicodeDir /usr/sharexpdf/chinese-simplified/CMap ++cidToUnicode Adobe-GB1 /usr/share/xpdf/chinese-simplified/Adobe-GB1.cidToUnicode ++unicodeMap ISO-2022-CN /usr/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap ++unicodeMap EUC-CN /usr/share/xpdf/chinese-simplified/EUC-CN.unicodeMap ++unicodeMap GBK /usr/share/xpdf/chinese-simplified/GBK.unicodeMap ++cMapDir Adobe-GB1 /usr/share/xpdf/chinese-simplified/CMap ++toUnicodeDir /usr/share/xpdf/chinese-simplified/CMap #fontFileCC Adobe-GB1 /usr/..../gkai00mp.ttf #----- end Chinese Simplified support package diff -up xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc.orig xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc @@ -86,8 +86,8 @@ diff -up xpdf-3.04/xpdf-cyrillic/add-to-xpdfrc.orig xpdf-3.04/xpdf-cyrillic/add- #----- begin Cyrillic support package (2011-aug-15) -nameToUnicode /usr/local/share/xpdf/cyrillic/Bulgarian.nameToUnicode -unicodeMap KOI8-R /usr/local/share/xpdf/cyrillic/KOI8-R.unicodeMap -+nameToUnicode /usr/sharexpdf/cyrillic/Bulgarian.nameToUnicode -+unicodeMap KOI8-R /usr/sharexpdf/cyrillic/KOI8-R.unicodeMap ++nameToUnicode /usr/share/xpdf/cyrillic/Bulgarian.nameToUnicode ++unicodeMap KOI8-R /usr/share/xpdf/cyrillic/KOI8-R.unicodeMap #----- end Cyrillic support package diff -up xpdf-3.04/xpdf-japanese/add-to-xpdfrc.orig xpdf-3.04/xpdf-japanese/add-to-xpdfrc --- xpdf-3.04/xpdf-japanese/add-to-xpdfrc.orig 2014-05-29 14:50:23.700974511 -0400 @@ -100,12 +100,12 @@ diff -up xpdf-3.04/xpdf-japanese/add-to-xpdfrc.orig xpdf-3.04/xpdf-japanese/add- -unicodeMap Shift-JIS /usr/local/share/xpdf/japanese/Shift-JIS.unicodeMap -cMapDir Adobe-Japan1 /usr/local/share/xpdf/japanese/CMap -toUnicodeDir /usr/local/share/xpdf/japanese/CMap -+cidToUnicode Adobe-Japan1 /usr/sharexpdf/japanese/Adobe-Japan1.cidToUnicode -+unicodeMap ISO-2022-JP /usr/sharexpdf/japanese/ISO-2022-JP.unicodeMap -+unicodeMap EUC-JP /usr/sharexpdf/japanese/EUC-JP.unicodeMap -+unicodeMap Shift-JIS /usr/sharexpdf/japanese/Shift-JIS.unicodeMap -+cMapDir Adobe-Japan1 /usr/sharexpdf/japanese/CMap -+toUnicodeDir /usr/sharexpdf/japanese/CMap ++cidToUnicode Adobe-Japan1 /usr/share/xpdf/japanese/Adobe-Japan1.cidToUnicode ++unicodeMap ISO-2022-JP /usr/share/xpdf/japanese/ISO-2022-JP.unicodeMap ++unicodeMap EUC-JP /usr/share/xpdf/japanese/EUC-JP.unicodeMap ++unicodeMap Shift-JIS /usr/share/xpdf/japanese/Shift-JIS.unicodeMap ++cMapDir Adobe-Japan1 /usr/share/xpdf/japanese/CMap ++toUnicodeDir /usr/share/xpdf/japanese/CMap #fontFileCC Adobe-Japan1 /usr/..../kochi-mincho.ttf #----- end Japanese support package diff -up xpdf-3.04/xpdf-korean/add-to-xpdfrc.orig xpdf-3.04/xpdf-korean/add-to-xpdfrc @@ -117,10 +117,10 @@ diff -up xpdf-3.04/xpdf-korean/add-to-xpdfrc.orig xpdf-3.04/xpdf-korean/add-to-x -unicodeMap ISO-2022-KR /usr/local/share/xpdf/korean/ISO-2022-KR.unicodeMap -cMapDir Adobe-Korea1 /usr/local/share/xpdf/korean/CMap -toUnicodeDir /usr/local/share/xpdf/korean/CMap -+cidToUnicode Adobe-Korea1 /usr/sharexpdf/korean/Adobe-Korea1.cidToUnicode -+unicodeMap ISO-2022-KR /usr/sharexpdf/korean/ISO-2022-KR.unicodeMap -+cMapDir Adobe-Korea1 /usr/sharexpdf/korean/CMap -+toUnicodeDir /usr/sharexpdf/korean/CMap ++cidToUnicode Adobe-Korea1 /usr/share/xpdf/korean/Adobe-Korea1.cidToUnicode ++unicodeMap ISO-2022-KR /usr/share/xpdf/korean/ISO-2022-KR.unicodeMap ++cMapDir Adobe-Korea1 /usr/share/xpdf/korean/CMap ++toUnicodeDir /usr/share/xpdf/korean/CMap #fontFileCC Adobe-Korea1 /usr/..../batang.ttf" #fontFileCC Unidocs-Korea1 /usr/..../batang.ttf" #----- end Korean support package @@ -131,6 +131,6 @@ diff -up xpdf-3.04/xpdf-thai/add-to-xpdfrc.orig xpdf-3.04/xpdf-thai/add-to-xpdfr #----- begin Thai support package (2011-aug-15) -nameToUnicode /usr/local/share/xpdf/thai/Thai.nameToUnicode -unicodeMap TIS-620 /usr/local/share/xpdf/thai/TIS-620.unicodeMap -+nameToUnicode /usr/sharexpdf/thai/Thai.nameToUnicode -+unicodeMap TIS-620 /usr/sharexpdf/thai/TIS-620.unicodeMap ++nameToUnicode /usr/share/xpdf/thai/Thai.nameToUnicode ++unicodeMap TIS-620 /usr/share/xpdf/thai/TIS-620.unicodeMap #----- end Thai support package diff --git a/xpdf.spec b/xpdf.spec index 7c90f97..fac658d 100644 --- a/xpdf.spec +++ b/xpdf.spec @@ -1,7 +1,7 @@ Summary: A PDF file viewer for the X Window System Name: xpdf Version: 3.04 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 or GPLv3 Epoch: 1 Url: http://www.foolabs.com/xpdf/ @@ -263,6 +263,9 @@ update-desktop-database &> /dev/null ||: %{_datadir}/xpdf/latin2 %changelog +* Tue Jun 3 2014 Tom Callaway - 1:3.04-2 +- fix "sharexpdf" typo in lang configs + * Thu May 29 2014 Tom Callaway - 1:3.04-1 - update to 3.04 - update all patches, langpacks From b13554395cf01c6cd673ef283fa1387a5fde2026 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Fri, 12 Sep 2014 15:08:08 -0400 Subject: [PATCH 4/5] fix desktop file --- xpdf.desktop | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xpdf.desktop b/xpdf.desktop index 9ad44d3..8cd4dd9 100644 --- a/xpdf.desktop +++ b/xpdf.desktop @@ -1,6 +1,5 @@ [Desktop Entry] -Encoding=UTF-8 -Categories=Application;Graphics; +Categories=Graphics; X-Desktop-File-Install-Version=0.2 Name=Xpdf PDF Viewer Name[sv]=Xpdf PDF-visare @@ -9,7 +8,7 @@ Comment=View Adobe PDF (acrobat) files Comment[sv]=Visar Adobe PDF-filer (acrobat-filer) Comment[de]=PDF-Betrachter Exec=xpdf %f -Terminal=0 +Terminal=false Type=Application Icon=xpdf -MimeType=application/pdf +MimeType=application/pdf; From 99b9a16939c9a5127f966e6d562481de559ac753 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Tue, 2 Dec 2014 14:16:01 -0500 Subject: [PATCH 5/5] fix proper display of international strings in the title (bz 1169301) --- xpdf-3.04-localized.patch | 11 +++++++++++ xpdf.spec | 16 +++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 xpdf-3.04-localized.patch diff --git a/xpdf-3.04-localized.patch b/xpdf-3.04-localized.patch new file mode 100644 index 0000000..504d3be --- /dev/null +++ b/xpdf-3.04-localized.patch @@ -0,0 +1,11 @@ +diff -up xpdf-3.04/xpdf/XPDFApp.cc.localized xpdf-3.04/xpdf/XPDFApp.cc +--- xpdf-3.04/xpdf/XPDFApp.cc.localized 2014-12-02 13:54:56.720680945 -0500 ++++ xpdf-3.04/xpdf/XPDFApp.cc 2014-12-02 13:55:10.257585002 -0500 +@@ -125,6 +125,7 @@ static int xErrorHandler(Display *displa + #endif + + XPDFApp::XPDFApp(int *argc, char *argv[]) { ++ XtSetLanguageProc(NULL, (XtLanguageProc)NULL, NULL); + appShell = XtAppInitialize(&appContext, xpdfAppName, xOpts, nXOpts, + argc, argv, fallbackResources, NULL, 0); + display = XtDisplay(appShell); diff --git a/xpdf.spec b/xpdf.spec index fac658d..a7541d9 100644 --- a/xpdf.spec +++ b/xpdf.spec @@ -1,7 +1,7 @@ Summary: A PDF file viewer for the X Window System Name: xpdf Version: 3.04 -Release: 2%{?dist} +Release: 6%{?dist} License: GPLv2 or GPLv3 Epoch: 1 Url: http://www.foolabs.com/xpdf/ @@ -39,6 +39,7 @@ Patch15: xpdf-3.04-nocmap.patch Patch16: xpdf-3.02-fontlist.patch Patch19: xpdf-3.02-additionalzoom.patch Patch20: xpdf-3.04-pdftopng.patch +Patch21: xpdf-3.04-localized.patch # Security patches @@ -94,6 +95,7 @@ standard X fonts. %patch16 -p1 -b .fontlist %patch19 -p1 %patch20 -p1 -b .pdftopng +%patch21 -p1 -b .localized # security patches @@ -263,6 +265,18 @@ update-desktop-database &> /dev/null ||: %{_datadir}/xpdf/latin2 %changelog +* Tue Dec 2 2014 Tom Callaway - 1:3.04-6 +- fix proper display of international strings in the title (bz 1169301) + +* Fri Sep 12 2014 Tom Callaway - 1:3.04-5 +- fix .desktop file + +* Mon Aug 18 2014 Fedora Release Engineering - 1:3.04-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sun Jun 08 2014 Fedora Release Engineering - 1:3.04-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + * Tue Jun 3 2014 Tom Callaway - 1:3.04-2 - fix "sharexpdf" typo in lang configs