diff options
author | Daniel Gryniewicz <dang@gentoo.org> | 2006-01-05 19:59:50 +0000 |
---|---|---|
committer | Daniel Gryniewicz <dang@gentoo.org> | 2006-01-05 19:59:50 +0000 |
commit | 35e749e78d0a8a1268e1b399df01f5e8dc4654cc (patch) | |
tree | c187caeb5afcaddf9adf4a9f058f726fa5606770 | |
parent | Removing unnecessary RDEPEND. (diff) | |
download | gentoo-2-35e749e78d0a8a1268e1b399df01f5e8dc4654cc.tar.gz gentoo-2-35e749e78d0a8a1268e1b399df01f5e8dc4654cc.tar.bz2 gentoo-2-35e749e78d0a8a1268e1b399df01f5e8dc4654cc.zip |
Bump for bug #117496
(Portage version: 2.1_pre3-r1)
-rw-r--r-- | app-text/xpdf/ChangeLog | 10 | ||||
-rw-r--r-- | app-text/xpdf/Manifest | 14 | ||||
-rw-r--r-- | app-text/xpdf/files/digest-xpdf-3.01-r5 | 12 | ||||
-rw-r--r-- | app-text/xpdf/files/xpdf-3.01-sec-rollup.patch | 266 | ||||
-rw-r--r-- | app-text/xpdf/files/xpdf-3.01pl1.patch | 168 | ||||
-rw-r--r-- | app-text/xpdf/xpdf-3.01-r5.ebuild | 122 |
6 files changed, 411 insertions, 181 deletions
diff --git a/app-text/xpdf/ChangeLog b/app-text/xpdf/ChangeLog index 6aaf8c3a7d27..30d2d136149f 100644 --- a/app-text/xpdf/ChangeLog +++ b/app-text/xpdf/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-text/xpdf -# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/xpdf/ChangeLog,v 1.112 2005/12/28 17:03:33 dang Exp $ +# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-text/xpdf/ChangeLog,v 1.113 2006/01/05 19:59:50 dang Exp $ + +*xpdf-3.01-r5 (05 Jan 2006) + + 05 Jan 2006; <dang@gentoo.org> +files/xpdf-3.01-sec-rollup.patch, + -files/xpdf-3.01pl1.patch, +xpdf-3.01-r5.ebuild: + Bump for bug #117496 28 Dec 2005; <dang@gentoo.org> xpdf-3.01-r4.ebuild: Remove message about needing motif for xpdf. diff --git a/app-text/xpdf/Manifest b/app-text/xpdf/Manifest index 23c45830f8fa..9390b8328dc1 100644 --- a/app-text/xpdf/Manifest +++ b/app-text/xpdf/Manifest @@ -1,6 +1,3 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - MD5 765f61d61d09689caec10f4c48a5c801 ChangeLog 13762 MD5 ec978d9450f061ea49ee697b39d545bf files/digest-xpdf-3.00-r10 767 MD5 ec978d9450f061ea49ee697b39d545bf files/digest-xpdf-3.00-r8 767 @@ -8,6 +5,7 @@ MD5 fb31167789c80b1a01d773fc5108c356 files/digest-xpdf-3.01 767 MD5 fb31167789c80b1a01d773fc5108c356 files/digest-xpdf-3.01-r1 767 MD5 fb31167789c80b1a01d773fc5108c356 files/digest-xpdf-3.01-r3 767 MD5 fb31167789c80b1a01d773fc5108c356 files/digest-xpdf-3.01-r4 767 +MD5 fb31167789c80b1a01d773fc5108c356 files/digest-xpdf-3.01-r5 767 MD5 24d9ec970f2b8178c64f7150be0d7ace files/xpdf-3.00-64bit.patch 1304 MD5 41c050cd5c7ccdcf1676a6852c7a35ed files/xpdf-3.00-PathScanner.patch.bz2 1003 MD5 3df9058a9971c09627e71dad6b056244 files/xpdf-3.00-core.patch.bz2 271 @@ -26,7 +24,7 @@ MD5 8bcdee9af356073f2e0dd88071379148 files/xpdf-3.01-crash.patch 1057 MD5 34c377b9f408fcfccb9b5513c98a6b1f files/xpdf-3.01-onlyx.patch 3099 MD5 145b821ca07a9e6a110dfe0088a39dc0 files/xpdf-3.01-pdftoppm.patch 1911 MD5 934ccc815f9aecaa94152266f8fb29d8 files/xpdf-3.01-resize.patch 1232 -MD5 4184783da2885ecde3c2256de5144555 files/xpdf-3.01pl1.patch 4936 +MD5 362d1ebc96229b3ce0bf07fd0f2132d8 files/xpdf-3.01-sec-rollup.patch 7717 MD5 2fce5bedd61300fad1566a41f991a782 files/xpdf-goo-sizet.patch 1424 MD5 a21a0caeb7356fb3e68e5db195a505e9 files/xpdfrc.1 1587 MD5 26b4b081d538c195dc39bcb2ec8e6f3a metadata.xml 161 @@ -35,11 +33,5 @@ MD5 0e303cf49620828eff323b0251d0141c xpdf-3.00-r8.ebuild 3622 MD5 3045b88b069de08b88a1c5c25b8caea6 xpdf-3.01-r1.ebuild 3562 MD5 a563cb37418209e3fac5f026184a916f xpdf-3.01-r3.ebuild 3912 MD5 b8ab9f515f3b5126dcc64ff0a428f30c xpdf-3.01-r4.ebuild 3683 +MD5 8a76d46029cc665187471afb3864f7a9 xpdf-3.01-r5.ebuild 3691 MD5 763deff18a7e6e7125aca1f3d6be3229 xpdf-3.01.ebuild 3529 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.2 (GNU/Linux) - -iD8DBQFDs3nx2+ySkm8kpY0RAtOsAJwOXMHFI/pLpxs0mFsuKAt7jwbTQACgxTfn -tlo0L4kIB8EIfauijjbTZCk= -=HBzj ------END PGP SIGNATURE----- diff --git a/app-text/xpdf/files/digest-xpdf-3.01-r5 b/app-text/xpdf/files/digest-xpdf-3.01-r5 new file mode 100644 index 000000000000..a9aeca0c2984 --- /dev/null +++ b/app-text/xpdf/files/digest-xpdf-3.01-r5 @@ -0,0 +1,12 @@ +MD5 e004c69c7dddef165d768b1362b44268 xpdf-3.01.tar.gz 599778 +MD5 67f05f65bc64bf022b36138c7c26746d xpdf-arabic.tar.gz 1058 +MD5 713659f0282b9e3d169390e246e5eb74 xpdf-chinese-simplified.tar.gz 756127 +MD5 5be730b859f8b01de569eb1bad188426 xpdf-chinese-traditional.tar.gz 698902 +MD5 21f57122247e2e2a63bfed4dc4f6c199 xpdf-cyrillic.tar.gz 1286 +MD5 2240a364b9c28ce09fd8c3107784ce40 xpdf-greek.tar.gz 1124 +MD5 438dd417517641cbb78a94facf2d938e xpdf-hebrew.tar.gz 1314 +MD5 57bb9359437583479b6670e75fa06c31 xpdf-japanese.tar.gz 430478 +MD5 10cd92e4eef065a6a26341d9a2a1b5c2 xpdf-korean.tar.gz 419081 +MD5 ac19ef990cd63afd2837c10dc7e1c3ab xpdf-latin2.tar.gz 1435 +MD5 9af495766ee4eaf3411d1fa74560f0ec xpdf-thai.tar.gz 1876 +MD5 f9233880805e3d8d2cf15a4fe679f25b xpdf-turkish.tar.gz 1140 diff --git a/app-text/xpdf/files/xpdf-3.01-sec-rollup.patch b/app-text/xpdf/files/xpdf-3.01-sec-rollup.patch new file mode 100644 index 000000000000..04d2f5673e90 --- /dev/null +++ b/app-text/xpdf/files/xpdf-3.01-sec-rollup.patch @@ -0,0 +1,266 @@ +diff --exclude-from=/home/dang/.diffrc -u -ruN xpdf-3.01.orig/xpdf/JBIG2Stream.cc xpdf-3.01/xpdf/JBIG2Stream.cc +--- xpdf-3.01.orig/xpdf/JBIG2Stream.cc 2005-08-17 01:34:31.000000000 -0400 ++++ xpdf-3.01/xpdf/JBIG2Stream.cc 2006-01-05 14:48:26.000000000 -0500 +@@ -7,6 +7,7 @@ + //======================================================================== + + #include <aconf.h> ++#include <limits.h> + + #ifdef USE_GCC_PRAGMAS + #pragma implementation +@@ -681,6 +682,13 @@ + w = wA; + h = hA; + line = (wA + 7) >> 3; ++ ++ if (h < 0 || line <= 0 || h >= (INT_MAX - 1) / line) { ++ error(-1, "invalid width/height"); ++ data = NULL; ++ return; ++ } ++ + // need to allocate one extra guard byte for use in combine() + data = (Guchar *)gmalloc(h * line + 1); + data[h * line] = 0; +@@ -692,6 +700,13 @@ + w = bitmap->w; + h = bitmap->h; + line = bitmap->line; ++ ++ if (h < 0 || line <= 0 || h >= (INT_MAX - 1) / line) { ++ error(-1, "invalid width/height"); ++ data = NULL; ++ return; ++ } ++ + // need to allocate one extra guard byte for use in combine() + data = (Guchar *)gmalloc(h * line + 1); + memcpy(data, bitmap->data, h * line); +@@ -720,7 +735,10 @@ + } + + void JBIG2Bitmap::expand(int newH, Guint pixel) { +- if (newH <= h) { ++ if (newH <= h || line <= 0 || newH >= (INT_MAX - 1) / line) { ++ error(-1, "invalid width/height"); ++ gfree(data); ++ data = NULL; + return; + } + // need to allocate one extra guard byte for use in combine() +@@ -2305,6 +2323,15 @@ + error(getPos(), "Bad symbol dictionary reference in JBIG2 halftone segment"); + return; + } ++ if (gridH == 0 || gridW >= INT_MAX / gridH) { ++ error(getPos(), "Bad size in JBIG2 halftone segment"); ++ return; ++ } ++ if (w == 0 || h >= INT_MAX / w) { ++ error(getPos(), "Bad size in JBIG2 bitmap segment"); ++ return; ++ } ++ + patternDict = (JBIG2PatternDict *)seg; + bpp = 0; + i = 1; +@@ -2936,6 +2963,11 @@ + JBIG2BitmapPtr tpgrCXPtr0, tpgrCXPtr1, tpgrCXPtr2; + int x, y, pix; + ++ if (w < 0 || h <= 0 || w >= INT_MAX / h) { ++ error(-1, "invalid width/height"); ++ return NULL; ++ } ++ + bitmap = new JBIG2Bitmap(0, w, h); + bitmap->clearToZero(); + +diff --exclude-from=/home/dang/.diffrc -u -ruN xpdf-3.01.orig/xpdf/JPXStream.cc xpdf-3.01/xpdf/JPXStream.cc +--- xpdf-3.01.orig/xpdf/JPXStream.cc 2005-08-17 01:34:31.000000000 -0400 ++++ xpdf-3.01/xpdf/JPXStream.cc 2006-01-05 14:49:33.000000000 -0500 +@@ -7,6 +7,7 @@ + //======================================================================== + + #include <aconf.h> ++#include <limits.h> + + #ifdef USE_GCC_PRAGMAS + #pragma implementation +@@ -783,7 +784,7 @@ + int segType; + GBool haveSIZ, haveCOD, haveQCD, haveSOT; + Guint precinctSize, style; +- Guint segLen, capabilities, comp, i, j, r; ++ Guint segLen, capabilities, nTiles, comp, i, j, r; + + //----- main header + haveSIZ = haveCOD = haveQCD = haveSOT = gFalse; +@@ -818,8 +819,19 @@ + / img.xTileSize; + img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1) + / img.yTileSize; +- img.tiles = (JPXTile *)gmallocn(img.nXTiles * img.nYTiles, +- sizeof(JPXTile)); ++ // check for overflow before allocating memory ++ if (img.nXTiles <= 0 || img.nYTiles <= 0 || ++ img.nXTiles >= INT_MAX/img.nYTiles) { ++ error(getPos(), "Bad tile count in JPX SIZ marker segment"); ++ return gFalse; ++ } ++ nTiles = img.nXTiles * img.nYTiles; ++ if (nTiles >= INT_MAX/sizeof(JPXTile)) { ++ error(getPos(), "Bad tile count in JPX SIZ marker segment"); ++ return gFalse; ++ } ++ img.tiles = (JPXTile *)gmalloc(nTiles * sizeof(JPXTile)); ++ + for (i = 0; i < img.nXTiles * img.nYTiles; ++i) { + img.tiles[i].tileComps = (JPXTileComp *)gmallocn(img.nComps, + sizeof(JPXTileComp)); +diff --exclude-from=/home/dang/.diffrc -u -ruN xpdf-3.01.orig/xpdf/Stream.cc xpdf-3.01/xpdf/Stream.cc +--- xpdf-3.01.orig/xpdf/Stream.cc 2005-08-17 01:34:31.000000000 -0400 ++++ xpdf-3.01/xpdf/Stream.cc 2006-01-05 14:50:31.000000000 -0500 +@@ -15,6 +15,7 @@ + #include <stdio.h> + #include <stdlib.h> + #include <stddef.h> ++#include <limits.h> + #ifndef WIN32 + #include <unistd.h> + #endif +@@ -406,13 +407,28 @@ + width = widthA; + nComps = nCompsA; + nBits = nBitsA; ++ predLine = NULL; ++ ok = gFalse; + ++ if (width <= 0 || nComps <= 0 || nBits <= 0 || ++ nComps >= INT_MAX/nBits || ++ width >= INT_MAX/nComps/nBits) { ++ return; ++ } + nVals = width * nComps; ++ if (nVals * nBits + 7 <= 0) { ++ return; ++ } + pixBytes = (nComps * nBits + 7) >> 3; + rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes; ++ if (rowBytes < 0) { ++ return; ++ } + predLine = (Guchar *)gmalloc(rowBytes); + memset(predLine, 0, rowBytes); + predIdx = rowBytes; ++ ++ ok = gTrue; + } + + StreamPredictor::~StreamPredictor() { +@@ -1004,6 +1020,10 @@ + FilterStream(strA) { + if (predictor != 1) { + pred = new StreamPredictor(this, predictor, columns, colors, bits); ++ if (!pred->isOk()) { ++ delete pred; ++ pred = NULL; ++ } + } else { + pred = NULL; + } +@@ -1256,8 +1276,9 @@ + endOfLine = endOfLineA; + byteAlign = byteAlignA; + columns = columnsA; +- if (columns < 1) { +- columns = 1; ++ if (columns < 1 || columns >= INT_MAX / sizeof(short)) { ++ error(-1, "invalid number of columns: %d", columns); ++ exit(1); + } + rows = rowsA; + endOfBlock = endOfBlockA; +@@ -2899,6 +2920,11 @@ + height = read16(); + width = read16(); + numComps = str->getChar(); ++ if (numComps <= 0 || numComps > 4) { ++ numComps = 0; ++ error(getPos(), "Bad number of components in DCT stream"); ++ return gFalse; ++ } + if (prec != 8) { + error(getPos(), "Bad DCT precision %d", prec); + return gFalse; +@@ -2925,6 +2951,11 @@ + height = read16(); + width = read16(); + numComps = str->getChar(); ++ if (numComps <= 0 || numComps > 4) { ++ numComps = 0; ++ error(getPos(), "Bad number of components in DCT stream"); ++ return gFalse; ++ } + if (prec != 8) { + error(getPos(), "Bad DCT precision %d", prec); + return gFalse; +@@ -2947,6 +2978,11 @@ + + length = read16() - 2; + scanInfo.numComps = str->getChar(); ++ if (scanInfo.numComps <= 0 || scanInfo.numComps > 4) { ++ scanInfo.numComps = 0; ++ error(getPos(), "Bad number of components in DCT stream"); ++ return gFalse; ++ } + --length; + if (length != 2 * scanInfo.numComps + 3) { + error(getPos(), "Bad DCT scan info block"); +@@ -3031,12 +3067,12 @@ + while (length > 0) { + index = str->getChar(); + --length; +- if ((index & 0x0f) >= 4) { ++ if ((index & ~0x10) >= 4 || (index & ~0x10) < 0) { + error(getPos(), "Bad DCT Huffman table"); + return gFalse; + } + if (index & 0x10) { +- index &= 0x0f; ++ index &= 0x03; + if (index >= numACHuffTables) + numACHuffTables = index+1; + tbl = &acHuffTables[index]; +@@ -3827,6 +3863,10 @@ + FilterStream(strA) { + if (predictor != 1) { + pred = new StreamPredictor(this, predictor, columns, colors, bits); ++ if (!pred->isOk()) { ++ delete pred; ++ pred = NULL; ++ } + } else { + pred = NULL; + } +diff --exclude-from=/home/dang/.diffrc -u -ruN xpdf-3.01.orig/xpdf/Stream.h xpdf-3.01/xpdf/Stream.h +--- xpdf-3.01.orig/xpdf/Stream.h 2005-08-17 01:34:31.000000000 -0400 ++++ xpdf-3.01/xpdf/Stream.h 2006-01-05 14:44:31.000000000 -0500 +@@ -232,6 +232,8 @@ + + ~StreamPredictor(); + ++ GBool isOk() { return ok; } ++ + int lookChar(); + int getChar(); + +@@ -249,6 +251,7 @@ + int rowBytes; // bytes per line + Guchar *predLine; // line buffer + int predIdx; // current index in predLine ++ GBool ok; + }; + + //------------------------------------------------------------------------ diff --git a/app-text/xpdf/files/xpdf-3.01pl1.patch b/app-text/xpdf/files/xpdf-3.01pl1.patch deleted file mode 100644 index 8b038ad56f0d..000000000000 --- a/app-text/xpdf/files/xpdf-3.01pl1.patch +++ /dev/null @@ -1,168 +0,0 @@ -diff -c -r xpdf-3.01-orig/xpdf/JPXStream.cc xpdf-3.01/xpdf/JPXStream.cc -*** xpdf-3.01-orig/xpdf/JPXStream.cc Tue Aug 16 22:34:31 2005 ---- xpdf-3.01/xpdf/JPXStream.cc Thu Nov 3 16:50:39 2005 -*************** -*** 783,789 **** - int segType; - GBool haveSIZ, haveCOD, haveQCD, haveSOT; - Guint precinctSize, style; -! Guint segLen, capabilities, comp, i, j, r; - - //----- main header - haveSIZ = haveCOD = haveQCD = haveSOT = gFalse; ---- 783,789 ---- - int segType; - GBool haveSIZ, haveCOD, haveQCD, haveSOT; - Guint precinctSize, style; -! Guint segLen, capabilities, nTiles, comp, i, j, r; - - //----- main header - haveSIZ = haveCOD = haveQCD = haveSOT = gFalse; -*************** -*** 818,825 **** - / img.xTileSize; - img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1) - / img.yTileSize; -! img.tiles = (JPXTile *)gmallocn(img.nXTiles * img.nYTiles, -! sizeof(JPXTile)); - for (i = 0; i < img.nXTiles * img.nYTiles; ++i) { - img.tiles[i].tileComps = (JPXTileComp *)gmallocn(img.nComps, - sizeof(JPXTileComp)); ---- 818,830 ---- - / img.xTileSize; - img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1) - / img.yTileSize; -! nTiles = img.nXTiles * img.nYTiles; -! // check for overflow before allocating memory -! if (nTiles == 0 || nTiles / img.nXTiles != img.nYTiles) { -! error(getPos(), "Bad tile count in JPX SIZ marker segment"); -! return gFalse; -! } -! img.tiles = (JPXTile *)gmallocn(nTiles, sizeof(JPXTile)); - for (i = 0; i < img.nXTiles * img.nYTiles; ++i) { - img.tiles[i].tileComps = (JPXTileComp *)gmallocn(img.nComps, - sizeof(JPXTileComp)); -diff -c -r xpdf-3.01-orig/xpdf/Stream.cc xpdf-3.01/xpdf/Stream.cc -*** xpdf-3.01-orig/xpdf/Stream.cc Tue Aug 16 22:34:31 2005 ---- xpdf-3.01/xpdf/Stream.cc Thu Nov 3 16:50:39 2005 -*************** -*** 401,418 **** - - StreamPredictor::StreamPredictor(Stream *strA, int predictorA, - int widthA, int nCompsA, int nBitsA) { - str = strA; - predictor = predictorA; - width = widthA; - nComps = nCompsA; - nBits = nBitsA; - - nVals = width * nComps; - pixBytes = (nComps * nBits + 7) >> 3; -! rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes; - predLine = (Guchar *)gmalloc(rowBytes); - memset(predLine, 0, rowBytes); - predIdx = rowBytes; - } - - StreamPredictor::~StreamPredictor() { ---- 401,433 ---- - - StreamPredictor::StreamPredictor(Stream *strA, int predictorA, - int widthA, int nCompsA, int nBitsA) { -+ int totalBits; -+ - str = strA; - predictor = predictorA; - width = widthA; - nComps = nCompsA; - nBits = nBitsA; -+ predLine = NULL; -+ ok = gFalse; - - nVals = width * nComps; -+ totalBits = nVals * nBits; -+ if (totalBits == 0 || -+ (totalBits / nBits) / nComps != width || -+ totalBits + 7 < 0) { -+ return; -+ } - pixBytes = (nComps * nBits + 7) >> 3; -! rowBytes = ((totalBits + 7) >> 3) + pixBytes; -! if (rowBytes < 0) { -! return; -! } - predLine = (Guchar *)gmalloc(rowBytes); - memset(predLine, 0, rowBytes); - predIdx = rowBytes; -+ -+ ok = gTrue; - } - - StreamPredictor::~StreamPredictor() { -*************** -*** 1004,1009 **** ---- 1019,1028 ---- - FilterStream(strA) { - if (predictor != 1) { - pred = new StreamPredictor(this, predictor, columns, colors, bits); -+ if (!pred->isOk()) { -+ delete pred; -+ pred = NULL; -+ } - } else { - pred = NULL; - } -*************** -*** 2899,2904 **** ---- 2918,2931 ---- - height = read16(); - width = read16(); - numComps = str->getChar(); -+ if (numComps <= 0 || numComps > 4) { -+ error(getPos(), "Bad number of components in DCT stream", prec); -+ return gFalse; -+ } -+ if (numComps <= 0 || numComps > 4) { -+ error(getPos(), "Bad number of components in DCT stream", prec); -+ return gFalse; -+ } - if (prec != 8) { - error(getPos(), "Bad DCT precision %d", prec); - return gFalse; -*************** -*** 3827,3832 **** ---- 3854,3863 ---- - FilterStream(strA) { - if (predictor != 1) { - pred = new StreamPredictor(this, predictor, columns, colors, bits); -+ if (!pred->isOk()) { -+ delete pred; -+ pred = NULL; -+ } - } else { - pred = NULL; - } -diff -c -r xpdf-3.01-orig/xpdf/Stream.h xpdf-3.01/xpdf/Stream.h -*** xpdf-3.01-orig/xpdf/Stream.h Tue Aug 16 22:34:31 2005 ---- xpdf-3.01/xpdf/Stream.h Thu Nov 3 16:50:39 2005 -*************** -*** 232,237 **** ---- 232,239 ---- - - ~StreamPredictor(); - -+ GBool isOk() { return ok; } -+ - int lookChar(); - int getChar(); - -*************** -*** 249,254 **** ---- 251,257 ---- - int rowBytes; // bytes per line - Guchar *predLine; // line buffer - int predIdx; // current index in predLine -+ GBool ok; - }; - - //------------------------------------------------------------------------ diff --git a/app-text/xpdf/xpdf-3.01-r5.ebuild b/app-text/xpdf/xpdf-3.01-r5.ebuild new file mode 100644 index 000000000000..a8227bfea6c8 --- /dev/null +++ b/app-text/xpdf/xpdf-3.01-r5.ebuild @@ -0,0 +1,122 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-text/xpdf/xpdf-3.01-r5.ebuild,v 1.1 2006/01/05 19:59:50 dang Exp $ + +inherit eutils flag-o-matic + +DESCRIPTION="An X Viewer for PDF Files" +HOMEPAGE="http://www.foolabs.com/xpdf/" +SRC_URI="ftp://ftp.foolabs.com/pub/xpdf/${P}.tar.gz + linguas_ar? ( ftp://ftp.foolabs.com/pub/xpdf/xpdf-arabic.tar.gz ) + linguas_zh_CN? ( ftp://ftp.foolabs.com/pub/xpdf/xpdf-chinese-simplified.tar.gz ) + linguas_zh_TW? ( ftp://ftp.foolabs.com/pub/xpdf/xpdf-chinese-traditional.tar.gz ) + linguas_ru? ( ftp://ftp.foolabs.com/pub/xpdf/xpdf-cyrillic.tar.gz ) + linguas_el? ( ftp://ftp.foolabs.com/pub/xpdf/xpdf-greek.tar.gz ) + linguas_he? ( ftp://ftp.foolabs.com/pub/xpdf/xpdf-hebrew.tar.gz ) + linguas_ja? ( ftp://ftp.foolabs.com/pub/xpdf/xpdf-japanese.tar.gz ) + linguas_ko? ( ftp://ftp.foolabs.com/pub/xpdf/xpdf-korean.tar.gz ) + linguas_la? ( ftp://ftp.foolabs.com/pub/xpdf/xpdf-latin2.tar.gz ) + linguas_th? ( ftp://ftp.foolabs.com/pub/xpdf/xpdf-thai.tar.gz ) + linguas_tr? ( ftp://ftp.foolabs.com/pub/xpdf/xpdf-turkish.tar.gz )" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +IUSE="X" + +DEPEND=" + X? ( + !s390? ( virtual/motif ) + >=media-libs/freetype-2.0.5 + media-libs/t1lib + virtual/ghostscript + || ( ( x11-libs/libXt + x11-libs/libXpm + x11-libs/libICE + x11-libs/libSM + x11-libs/libXp + ) + virtual/x11 + ) + )" + +RDEPEND="${DEPEND} + linguas_ja? ( >=media-fonts/kochi-substitute-20030809-r3 ) + linguas_zh_CN? ( >=media-fonts/arphicfonts-0.1-r2 ) + linguas_zh_TW? ( >=media-fonts/arphicfonts-0.1-r2 ) + linguas_ko? ( >=media-fonts/baekmuk-fonts-2.2 ) + !app-text/xpdf-chinese-simplified + !app-text/xpdf-chinese-traditional + !app-text/xpdf-cyrillic + !app-text/xpdf-greek + !app-text/xpdf-japanese + !app-text/xpdf-korean + !app-text/xpdf-latin2 + !app-text/xpdf-thai + !app-text/xpdf-turkish + >=app-text/poppler-0.4.3-r1" +PROVIDE="virtual/pdfviewer" + +src_unpack() { + unpack ${A} + cd ${S} + epatch ${FILESDIR}/${PN}-3.00-gcc41.patch + epatch ${FILESDIR}/${PN}-3.00-64bit.patch + epatch ${FILESDIR}/${P}-crash.patch + epatch ${FILESDIR}/${P}-pdftoppm.patch + epatch ${FILESDIR}/${P}-resize.patch + epatch ${FILESDIR}/${P}-sec-rollup.patch + epatch ${FILESDIR}/${P}-onlyx.patch + autoconf +} + +src_compile() { + replace-flags "-Os" "-O2" + + local myconf + if use X; then + myconf="${myconf} --with-x --enable-freetype2 \ + --with-freetype2-includes=/usr/include/freetype2" + else + myconf="${myconf} --without-x --without-freetype2-library" + fi + + econf \ + ${myconf} \ + --enable-opi -enable-multithreaded || die "Configure Failed" + + emake || die "make failed" +} + +src_install() { + make DESTDIR=${D} install || die "make install failed" + prepallman + dodoc README ANNOUNCE CHANGES + insinto /etc + newins ${FILESDIR}/xpdfrc.1 xpdfrc + + # install languages, but not on ppc64 (produces crashes...) + if use !ppc64; then + use linguas_ar && install_lang turkish + use linguas_zh_CN && install_lang chinese-simplified + use linguas_zh_TW && install_lang chinese-traditional + use linguas_ru && install_lang cyrillic + use linguas_el && install_lang greek + use linguas_he && install_lang hebrew + use linguas_ja && install_lang japanese + use linguas_ko && install_lang korean + use linguas_la && install_lang latin2 + use linguas_th && install_lang thai + use linguas_tr && install_lang turkish + fi +} + +install_lang() { + cd ../xpdf-$1 + sed 's,/usr/local/share/xpdf/,/usr/share/xpdf/,g' add-to-xpdfrc >> ${D}/etc/xpdfrc + insinto /usr/share/xpdf/$1 + doins *.unicodeMap + doins *.cid* + insinto /usr/share/xpdf/$1/CMap + doins CMap/* +} |