summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatsuu Takuto <matsuu@gentoo.org>2005-01-19 23:15:48 +0000
committerMatsuu Takuto <matsuu@gentoo.org>2005-01-19 23:15:48 +0000
commitc5ef874de001b8638db7c2fed888de299fae1b25 (patch)
treef6ce59423a5a19a11247e74e398b1011541d3421 /app-text/ptex
parentRemove amavisd-new-20041222.ebuild. (diff)
downloadgentoo-2-c5ef874de001b8638db7c2fed888de299fae1b25.tar.gz
gentoo-2-c5ef874de001b8638db7c2fed888de299fae1b25.tar.bz2
gentoo-2-c5ef874de001b8638db7c2fed888de299fae1b25.zip
Security bump; Bug #75801.
Diffstat (limited to 'app-text/ptex')
-rw-r--r--app-text/ptex/Manifest28
-rw-r--r--app-text/ptex/files/digest-ptex-3.1.4-r210
-rw-r--r--app-text/ptex/files/xdvizilla.patch30
-rw-r--r--app-text/ptex/files/xpdf-3.00pl2-CAN-2004-1125.patch37
-rw-r--r--app-text/ptex/files/xpdf-3.00pl3-CAN-2005-0064.patch14
-rw-r--r--app-text/ptex/files/xpdf-CESA-2004-007-xpdf2-newer.diff78
-rw-r--r--app-text/ptex/files/xpdf-goo-sizet.patch57
-rw-r--r--app-text/ptex/files/xpdf2-underflow.patch81
-rw-r--r--app-text/ptex/ptex-3.1.4-r2.ebuild126
9 files changed, 451 insertions, 10 deletions
diff --git a/app-text/ptex/Manifest b/app-text/ptex/Manifest
index c8143b4455f5..a84ac8b58ab8 100644
--- a/app-text/ptex/Manifest
+++ b/app-text/ptex/Manifest
@@ -1,16 +1,24 @@
-MD5 1580dd9122bb8ec53f08633218687e06 ChangeLog 3958
-MD5 d2fd604b88f163116f23670ca84b1815 metadata.xml 531
+MD5 c811cc83f83eb8f3ecce9b19ddfb2c1e ptex-3.1.4-r1.ebuild 3039
MD5 1211f37d7142ad93737b08e4da0c1b97 ptex-3.1.3.ebuild 1887
MD5 b9e808caac2506e56403d3e3ae4dceb4 ptex-3.1.3-r1.ebuild 3039
-MD5 c811cc83f83eb8f3ecce9b19ddfb2c1e ptex-3.1.4-r1.ebuild 3039
-MD5 eeac4f3f89986b2a78bf753f8e9d16f0 ptex-3.1.4.20041109-r1.ebuild 4759
MD5 ea4119bed244b4a3ea4c37c8aeced41c ptex-3.1.4.20041109.ebuild 4854
+MD5 a11fd63ec98a68227ed1ebdac9d30d96 ptex-3.1.4-r2.ebuild 3555
+MD5 eeac4f3f89986b2a78bf753f8e9d16f0 ptex-3.1.4.20041109-r1.ebuild 4759
+MD5 1580dd9122bb8ec53f08633218687e06 ChangeLog 3958
+MD5 d2fd604b88f163116f23670ca84b1815 metadata.xml 531
MD5 75b6015c4ec058f264eb767326626843 files/digest-ptex-3.1.3 484
-MD5 d15f2d9ab04bcfa15c3e737f106d1625 files/psfonts-ja.map 1158
-MD5 4d1956517ccb98e9be75cdf83f9b7ac0 files/20fmtutil-platex.cnf 121
-MD5 a1829990d625a3607cc38b99a27b9574 files/20texmf-cmap.cnf 65
-MD5 d4d469b2a8b88c4d97440979fd5c2a41 files/20updmap-ja.cfg 43
-MD5 04ffb231db607a3a8ce7168600fee9b1 files/digest-ptex-3.1.4.20041109 317
+MD5 77107ec8ba31c93b0e1bc35a9e4c9c4b files/xdvizilla.patch 912
+MD5 04ffb231db607a3a8ce7168600fee9b1 files/digest-ptex-3.1.4.20041109-r1 317
MD5 3cbdb92af75d2424acadf9037f0f8977 files/digest-ptex-3.1.3-r1 718
MD5 424cf5900fe6b1af9867cd2e8c952292 files/digest-ptex-3.1.4-r1 718
-MD5 04ffb231db607a3a8ce7168600fee9b1 files/digest-ptex-3.1.4.20041109-r1 317
+MD5 424cf5900fe6b1af9867cd2e8c952292 files/digest-ptex-3.1.4-r2 718
+MD5 04ffb231db607a3a8ce7168600fee9b1 files/digest-ptex-3.1.4.20041109 317
+MD5 d4d469b2a8b88c4d97440979fd5c2a41 files/20updmap-ja.cfg 43
+MD5 362296e34a1a04a6e5e2a7d9e97547c6 files/xpdf2-underflow.patch 2363
+MD5 4d1956517ccb98e9be75cdf83f9b7ac0 files/20fmtutil-platex.cnf 121
+MD5 d15f2d9ab04bcfa15c3e737f106d1625 files/psfonts-ja.map 1158
+MD5 5d40ba9d885af84bcc917ad17e2bf8e0 files/xpdf-3.00pl2-CAN-2004-1125.patch 1136
+MD5 c32a612ce419b9930ff273cf382558bf files/xpdf-3.00pl3-CAN-2005-0064.patch 346
+MD5 a1829990d625a3607cc38b99a27b9574 files/20texmf-cmap.cnf 65
+MD5 2fce5bedd61300fad1566a41f991a782 files/xpdf-goo-sizet.patch 1424
+MD5 87d20c86d1451638e4b7adc2f7ac8067 files/xpdf-CESA-2004-007-xpdf2-newer.diff 2718
diff --git a/app-text/ptex/files/digest-ptex-3.1.4-r2 b/app-text/ptex/files/digest-ptex-3.1.4-r2
new file mode 100644
index 000000000000..b57769814eb6
--- /dev/null
+++ b/app-text/ptex/files/digest-ptex-3.1.4-r2
@@ -0,0 +1,10 @@
+MD5 a16f6bba227d55e79aeee46fbbd82d28 tetex-src-2.0.2.tar.gz 11745933
+MD5 d3bdb96f9077e43b2115d3cc471743b3 tetex-texmf-2.0.2.tar.gz 52424280
+MD5 40d4b2c5582eccbee4b6ec692c3cc253 tetex-texmfsrc-2.0.2.tar.gz 22909537
+MD5 0a0ba30552331663f496d41b8ca2a299 tetex-2.0.2-gentoo.tar.gz 1704
+MD5 ffdcb5b304f3014077bfc227343e2ef1 ptex-src-3.1.4.tar.gz 121053
+MD5 9171f289677684d97f28e95026e75426 ptex-texmf-2.2.tar.gz 1866278
+MD5 cf7c5744c27d585384e414cf3e5ca4cd dvipsk-jpatch-p1.6a.tar.gz 29428
+MD5 291f5bd0cb68f2bcfdc289cdff24dd84 tetex-src-2.0.2-xdvik-y1.patch.gz 16294
+MD5 f1ab77fcd0bbc54415b88ce7d6ad557c tetex-src-2.0.2-xdvik-y1-j1.19.patch.gz 10936
+MD5 9ce0615764079502f3b76692127a068a xdvik-22.40y1-j1.21.patch.gz 166908
diff --git a/app-text/ptex/files/xdvizilla.patch b/app-text/ptex/files/xdvizilla.patch
new file mode 100644
index 000000000000..bc925280a198
--- /dev/null
+++ b/app-text/ptex/files/xdvizilla.patch
@@ -0,0 +1,30 @@
+--- tetex-bin-2.0.2/texk/xdvik/xdvizilla 2002-10-12 15:28:50.000000000 +0200
++++ tetex-bin-2.0.2.new/texk/xdvik/xdvizilla 2004-12-23 12:58:35.010332504 +0100
+@@ -33,7 +33,7 @@
+ case "$FILETYPE" in
+
+ *"gzip compressed data"*)
+- FILE=/tmp/xdvizilla$$
++ FILE=`mktemp -t xdvizilla.XXXXXX` || exit 1
+ gunzip -c "$1" > $FILE
+ [ -n "$NO_RM" ] || rm -f -- "$1"
+ NO_RM=
+@@ -41,7 +41,7 @@
+ ;;
+
+ *"compressed data"* | *"compress'd data"*)
+- FILE=/tmp/xdvizilla$$
++ FILE=`mktemp -t xdvizilla.XXXXXX` || exit 1
+ uncompress -c "$1" > $FILE
+ [ -n "$NO_RM" ] || rm -f -- "$1"
+ NO_RM=
+@@ -60,8 +60,7 @@
+ case "$FILETYPE" in
+
+ *" tar archive")
+- TARDIR=/tmp/xdvitar$$
+- mkdir $TARDIR
++ TARDIR=`mktemp -t -d xdvitar.XXXXXX` || exit 1
+ cat "$FILE" | (cd $TARDIR; tar xf -)
+ DVINAME=`tar tf "$FILE" | grep '\.dvi$' | head -1`
+ [ -n "$NO_RM" ] || rm -f -- "$FILE"
diff --git a/app-text/ptex/files/xpdf-3.00pl2-CAN-2004-1125.patch b/app-text/ptex/files/xpdf-3.00pl2-CAN-2004-1125.patch
new file mode 100644
index 000000000000..119de236d50b
--- /dev/null
+++ b/app-text/ptex/files/xpdf-3.00pl2-CAN-2004-1125.patch
@@ -0,0 +1,37 @@
+*** Gfx.cc.orig Sun Dec 12 16:04:43 2004
+--- Gfx.cc Sun Dec 12 16:05:16 2004
+***************
+*** 2654,2660 ****
+ haveMask = gFalse;
+ dict->lookup("Mask", &maskObj);
+ if (maskObj.isArray()) {
+! for (i = 0; i < maskObj.arrayGetLength(); ++i) {
+ maskObj.arrayGet(i, &obj1);
+ maskColors[i] = obj1.getInt();
+ obj1.free();
+--- 2654,2662 ----
+ haveMask = gFalse;
+ dict->lookup("Mask", &maskObj);
+ if (maskObj.isArray()) {
+! for (i = 0;
+! i < maskObj.arrayGetLength() && i < 2*gfxColorMaxComps;
+! ++i) {
+ maskObj.arrayGet(i, &obj1);
+ maskColors[i] = obj1.getInt();
+ obj1.free();
+*** GfxState.cc.orig Sun Dec 12 16:04:48 2004
+--- GfxState.cc Sun Dec 12 16:06:38 2004
+***************
+*** 708,713 ****
+--- 708,718 ----
+ }
+ nCompsA = obj2.getInt();
+ obj2.free();
++ if (nCompsA > gfxColorMaxComps) {
++ error(-1, "ICCBased color space with too many (%d > %d) components",
++ nCompsA, gfxColorMaxComps);
++ nCompsA = gfxColorMaxComps;
++ }
+ if (dict->lookup("Alternate", &obj2)->isNull() ||
+ !(altA = GfxColorSpace::parse(&obj2))) {
+ switch (nCompsA) {
diff --git a/app-text/ptex/files/xpdf-3.00pl3-CAN-2005-0064.patch b/app-text/ptex/files/xpdf-3.00pl3-CAN-2005-0064.patch
new file mode 100644
index 000000000000..d7d2294c8527
--- /dev/null
+++ b/app-text/ptex/files/xpdf-3.00pl3-CAN-2005-0064.patch
@@ -0,0 +1,14 @@
+*** XRef.cc.orig Wed Jan 12 17:10:53 2005
+--- XRef.cc Wed Jan 12 17:11:22 2005
+***************
+*** 793,798 ****
+--- 793,801 ----
+ } else {
+ keyLength = 5;
+ }
++ if (keyLength > 16) {
++ keyLength = 16;
++ }
+ permFlags = permissions.getInt();
+ if (encVersion >= 1 && encVersion <= 2 &&
+ encRevision >= 2 && encRevision <= 3) {
diff --git a/app-text/ptex/files/xpdf-CESA-2004-007-xpdf2-newer.diff b/app-text/ptex/files/xpdf-CESA-2004-007-xpdf2-newer.diff
new file mode 100644
index 000000000000..55a24458c9a4
--- /dev/null
+++ b/app-text/ptex/files/xpdf-CESA-2004-007-xpdf2-newer.diff
@@ -0,0 +1,78 @@
+--- XRef.cc.orig 2004-09-17 23:54:38.000000000 -0700
++++ XRef.cc 2004-09-25 17:59:36.000000000 -0700
+@@ -76,6 +76,12 @@
+
+ // trailer is ok - read the xref table
+ } else {
++ if (size*sizeof(XRefEntry)/sizeof(XRefEntry) != size) {
++ error(-1, "Invalid 'size' inside xref table.");
++ ok = gFalse;
++ errCode = errDamaged;
++ return;
++ }
+ entries = (XRefEntry *)gmalloc(size * sizeof(XRefEntry));
+ for (i = 0; i < size; ++i) {
+ entries[i].offset = 0xffffffff;
+@@ -267,6 +273,10 @@
+ // table size
+ if (first + n > size) {
+ newSize = size + 256;
++ if (newSize*sizeof(XRefEntry)/sizeof(XRefEntry) != newSize) {
++ error(-1, "Invalid 'newSize'");
++ goto err2;
++ }
+ entries = (XRefEntry *)grealloc(entries, newSize * sizeof(XRefEntry));
+ for (i = size; i < newSize; ++i) {
+ entries[i].offset = 0xffffffff;
+@@ -410,6 +420,10 @@
+ if (!strncmp(p, "obj", 3)) {
+ if (num >= size) {
+ newSize = (num + 1 + 255) & ~255;
++ if (newSize*sizeof(XRefEntry)/sizeof(XRefEntry) != newSize) {
++ error(-1, "Invalid 'obj' parameters.");
++ return gFalse;
++ }
+ entries = (XRefEntry *)
+ grealloc(entries, newSize * sizeof(XRefEntry));
+ for (i = size; i < newSize; ++i) {
+@@ -431,6 +445,11 @@
+ } else if (!strncmp(p, "endstream", 9)) {
+ if (streamEndsLen == streamEndsSize) {
+ streamEndsSize += 64;
++ if (streamEndsSize*sizeof(int)/sizeof(int) != streamEndsSize) {
++ error(-1, "Invalid 'endstream' parameter.");
++ return gFalse;
++ }
++
+ streamEnds = (Guint *)grealloc(streamEnds,
+ streamEndsSize * sizeof(int));
+ }
+--- Catalog.cc.orig 2004-10-18 16:26:39.388666476 +0200
++++ Catalog.cc 2004-10-18 16:27:28.004749073 +0200
+@@ -62,6 +62,12 @@
+ }
+ pagesSize = numPages0 = obj.getInt();
+ obj.free();
++ if (pagesSize*sizeof(Page *)/sizeof(Page *) != pagesSize ||
++ pagesSize*sizeof(Ref)/sizeof(Ref) != pagesSize) {
++ error(-1, "Invalid 'pagesSize'");
++ ok = gFalse;
++ return;
++ }
+ pages = (Page **)gmalloc(pagesSize * sizeof(Page *));
+ pageRefs = (Ref *)gmalloc(pagesSize * sizeof(Ref));
+ for (i = 0; i < pagesSize; ++i) {
+@@ -186,6 +192,11 @@
+ }
+ if (start >= pagesSize) {
+ pagesSize += 32;
++ if (pagesSize*sizeof(Page *)/sizeof(Page *) != pagesSize ||
++ pagesSize*sizeof(Ref)/sizeof(Ref) != pagesSize) {
++ error(-1, "Invalid 'pagesSize' parameter.");
++ goto err3;
++ }
+ pages = (Page **)grealloc(pages, pagesSize * sizeof(Page *));
+ pageRefs = (Ref *)grealloc(pageRefs, pagesSize * sizeof(Ref));
+ for (j = pagesSize - 32; j < pagesSize; ++j) {
+
+
diff --git a/app-text/ptex/files/xpdf-goo-sizet.patch b/app-text/ptex/files/xpdf-goo-sizet.patch
new file mode 100644
index 000000000000..5d90c5120bd4
--- /dev/null
+++ b/app-text/ptex/files/xpdf-goo-sizet.patch
@@ -0,0 +1,57 @@
+diff -ru xpdf-2.02pl1/goo/gmem.c xpdf-2.02pl1/goo/gmem.c
+--- xpdf-2.02pl1/goo/gmem.c 2003-06-16 22:01:26.000000000 +0200
++++ xpdf-2.02pl1/goo/gmem.c 2004-10-29 15:13:34.866919791 +0200
+@@ -53,9 +53,9 @@
+
+ #endif /* DEBUG_MEM */
+
+-void *gmalloc(int size) {
++void *gmalloc(size_t size) {
+ #ifdef DEBUG_MEM
+- int size1;
++ size_t size1;
+ char *mem;
+ GMemHdr *hdr;
+ void *data;
+@@ -94,11 +94,11 @@
+ #endif
+ }
+
+-void *grealloc(void *p, int size) {
++void *grealloc(void *p, size_t size) {
+ #ifdef DEBUG_MEM
+ GMemHdr *hdr;
+ void *q;
+- int oldSize;
++ size_t oldSize;
+
+ if (size == 0) {
+ if (p)
+@@ -137,7 +137,7 @@
+
+ void gfree(void *p) {
+ #ifdef DEBUG_MEM
+- int size;
++ size_t size;
+ GMemHdr *hdr;
+ GMemHdr *prevHdr, *q;
+ int lst;
+diff -ru xpdf-2.02pl1/goo/gmem.h xpdf-2.02pl1/goo/gmem.h
+--- xpdf-2.02pl1/goo/gmem.h 2003-06-16 22:01:26.000000000 +0200
++++ xpdf-2.02pl1/goo/gmem.h 2004-10-29 15:13:50.864027201 +0200
+@@ -19,13 +19,13 @@
+ * Same as malloc, but prints error message and exits if malloc()
+ * returns NULL.
+ */
+-extern void *gmalloc(int size);
++extern void *gmalloc(size_t size);
+
+ /*
+ * Same as realloc, but prints error message and exits if realloc()
+ * returns NULL. If <p> is NULL, calls malloc instead of realloc().
+ */
+-extern void *grealloc(void *p, int size);
++extern void *grealloc(void *p, size_t size);
+
+ /*
+ * Same as free, but checks for and ignores NULL pointers.
diff --git a/app-text/ptex/files/xpdf2-underflow.patch b/app-text/ptex/files/xpdf2-underflow.patch
new file mode 100644
index 000000000000..9371be84352e
--- /dev/null
+++ b/app-text/ptex/files/xpdf2-underflow.patch
@@ -0,0 +1,81 @@
+diff -ru xpdf-2.02pl1/xpdf/XRef.cc xpdf-2.02pl1/xpdf/XRef.cc
+--- xpdf-2.02pl1/xpdf/XRef.cc 2004-10-29 15:16:45.790089001 +0200
++++ xpdf-2.02pl1/xpdf/XRef.cc 2004-10-29 15:11:54.132168025 +0200
+@@ -66,6 +66,8 @@
+ start = str->getStart();
+ pos = readTrailer();
+
++ entries = NULL;
++
+ // if there was a problem with the trailer,
+ // try to reconstruct the xref table
+ if (pos == 0) {
+@@ -76,7 +78,7 @@
+
+ // trailer is ok - read the xref table
+ } else {
+- if (size*sizeof(XRefEntry)/sizeof(XRefEntry) != size) {
++ if ((size < 0) || (size*sizeof(XRefEntry)/sizeof(XRefEntry) != size)) {
+ error(-1, "Invalid 'size' inside xref table.");
+ ok = gFalse;
+ errCode = errDamaged;
+@@ -181,7 +183,7 @@
+ n = atoi(p);
+ while ('0' <= *p && *p <= '9') ++p;
+ while (isspace(*p)) ++p;
+- if (p == buf)
++ if ((p == buf) || (n < 0)) /* must make progress */
+ return 0;
+ pos1 += (p - buf) + n * 20;
+ }
+@@ -255,6 +257,10 @@
+ }
+ s[i] = '\0';
+ first = atoi(s);
++ if (first < 0) {
++ error(-1, "Invalid 'first'");
++ goto err2;
++ }
+ while ((c = str->lookChar()) != EOF && isspace(c)) {
+ str->getChar();
+ }
+@@ -266,6 +272,10 @@
+ }
+ s[i] = '\0';
+ n = atoi(s);
++ if (n<=0) {
++ error(-1, "Invalid 'n'");
++ goto err2;
++ }
+ while ((c = str->lookChar()) != EOF && isspace(c)) {
+ str->getChar();
+ }
+@@ -273,7 +283,7 @@
+ // table size
+ if (first + n > size) {
+ newSize = size + 256;
+- if (newSize*sizeof(XRefEntry)/sizeof(XRefEntry) != newSize) {
++ if ((newSize < 0) || (newSize*sizeof(XRefEntry)/sizeof(XRefEntry) != newSize)) {
+ error(-1, "Invalid 'newSize'");
+ goto err2;
+ }
+@@ -406,6 +416,10 @@
+ // look for object
+ } else if (isdigit(*p)) {
+ num = atoi(p);
++ if (num < 0) {
++ error(-1, "Invalid 'num' parameters.");
++ return gFalse;
++ }
+ do {
+ ++p;
+ } while (*p && isdigit(*p));
+@@ -425,7 +439,7 @@
+ if (!strncmp(p, "obj", 3)) {
+ if (num >= size) {
+ newSize = (num + 1 + 255) & ~255;
+- if (newSize*sizeof(XRefEntry)/sizeof(XRefEntry) != newSize) {
++ if ((newSize < 0) || (newSize*sizeof(XRefEntry)/sizeof(XRefEntry) != newSize)) {
+ error(-1, "Invalid 'obj' parameters.");
+ return gFalse;
+ }
diff --git a/app-text/ptex/ptex-3.1.4-r2.ebuild b/app-text/ptex/ptex-3.1.4-r2.ebuild
new file mode 100644
index 000000000000..530b9145fbf8
--- /dev/null
+++ b/app-text/ptex/ptex-3.1.4-r2.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/ptex/ptex-3.1.4-r2.ebuild,v 1.1 2005/01/19 23:15:47 matsuu Exp $
+
+PTEX_TEXMF_PV=2.2
+TETEX_PV=2.0.2
+
+inherit tetex eutils
+
+DESCRIPTION="The ASCII publishing TeX distribution"
+HOMEPAGE="http://www.ascii.co.jp/pb/ptex/"
+
+PTEX_SRC="ptex-src-${PV}.tar.gz"
+PTEX_TEXMF="ptex-texmf-${PTEX_TEXMF_PV}.tar.gz"
+
+SRC_PATH_PTEX="ftp://ftp.ascii.co.jp/pub/TeX/ascii-ptex"
+SRC_URI="${SRC_URI}
+ ${SRC_PATH_PTEX}/tetex/${PTEX_SRC}
+ ${SRC_PATH_PTEX}/tetex/${PTEX_TEXMF}
+ ${SRC_PATH_PTEX}/dvips/dvipsk-jpatch-p1.6a.tar.gz
+ X? ( http://tutimura.ath.cx/~nob/tex/xdvi/tetex-src-2.0.2-xdvik-y1.patch.gz
+ http://tutimura.ath.cx/~nob/tex/xdvi/tetex-src-2.0.2-xdvik-y1-j1.19.patch.gz
+ http://www.nn.iij4u.or.jp/~tutimura/tex/xdvik-22.40y1-j1.21.patch.gz )"
+
+LICENSE="GPL-2 BSD"
+SLOT="0"
+KEYWORDS="~x86 ~alpha ~amd64 ~ppc ~sparc ~ppc64 ~ppc-macos"
+IUSE="X"
+
+DEPEND="X? ( >=media-libs/freetype-2
+ >=media-fonts/kochi-substitute-20030809-r3 )
+ !app-text/xdvik"
+
+src_unpack() {
+ tetex_src_unpack
+
+ einfo "Unpacking pTeX sources..."
+ cd ${S}/texmf
+ unpack ${PTEX_TEXMF}
+
+ cd ${S}/texk/web2c
+ unpack ${PTEX_SRC}
+
+ cd ${S}/texk
+ unpack dvipsk-jpatch-p1.6a.tar.gz
+ epatch dvipsk-5.92b-p1.6a.patch
+
+ if use X ; then
+ cd ${S}
+ epatch ${DISTDIR}/tetex-src-2.0.2-xdvik-y1.patch.gz
+ epatch ${DISTDIR}/xdvik-22.40y1-j1.21.patch.gz
+ epatch ${DISTDIR}/tetex-src-2.0.2-xdvik-y1-j1.19.patch.gz
+ sed -i -e "/\/usr\/local/s:^:%:g" \
+ -e "/kochi-.*-subst/s:%::g" \
+ -e "s:/usr/local:/usr:g" \
+ -e "s:/usr/X11R6/lib/X11/fonts/truetype:/usr/share/fonts/kochi-substitute:g" \
+ ${S}/texk/xdvik/vfontmap.freetype || die
+ cd texk/oxdvik
+ ln -s ../xdvik/*.{c,h} ./
+ cp -f ../xdvik/Makefile.in.oxdvi Makefile.in
+ cp -f ../xdvik/c-auto.in ./
+ fi
+
+ # bug 75801
+ EPATCH_OPTS="-d ${S}/libs/xpdf/xpdf -p0" epatch ${FILESDIR}/xpdf-CESA-2004-007-xpdf2-newer.diff
+ EPATCH_OPTS="-d ${S}/libs/xpdf -p1" epatch ${FILESDIR}/xpdf-goo-sizet.patch
+ EPATCH_OPTS="-d ${S}/libs/xpdf -p1" epatch ${FILESDIR}/xpdf2-underflow.patch
+ EPATCH_OPTS="-d ${S}/libs/xpdf/xpdf -p0" epatch ${FILESDIR}/xpdf-3.00pl2-CAN-2004-1125.patch
+ EPATCH_OPTS="-d ${S}/libs/xpdf/xpdf -p0" epatch ${FILESDIR}/xpdf-3.00pl3-CAN-2005-0064.patch
+ EPATCH_OPTS="-d ${S} -p1" epatch ${FILESDIR}/xdvizilla.patch
+}
+
+src_compile() {
+ if use X ; then
+ export CPPFLAGS="${CPPFLAGS} -I/usr/include/freetype2"
+ TETEX_ECONF="--with-vflib=vf2ft"
+ fi
+
+ tetex_src_compile
+
+ cat >>${S}/texk/web2c/fmtutil.cnf<<-EOF
+
+ # Japanese pLaTeX:
+ ptex ptex - ptex.ini
+ platex ptex language.dat platex.ini
+ platex209 ptex language.dat plplain.ini
+ EOF
+
+ cat >>${S}/texk/web2c/texmf.cnf<<-EOF
+
+ CMAPINPUTS = .;/opt/Acrobat5/Resource/Font//;/usr/share/xpdf//
+ EOF
+
+ cd ${S}/texk/web2c/${PN}-src-${PV} || die
+ ./configure EUC || die "configure pTeX failed"
+
+ make programs || die "make pTeX failed"
+}
+
+src_install() {
+ tetex_src_install
+
+ einfo "Installing pTeX..."
+ cd ${S}/texk/web2c/${PN}-src-${PV} || die
+ einstall bindir=${D}/usr/bin texmf=${D}/usr/share/texmf || die
+
+ insinto /usr/share/texmf/dvips/config
+ newins ${FILESDIR}/psfonts-novflib-ja.map psfonts-ja.map
+ cat >>${D}/usr/share/texmf/web2c/updmap.cfg<<-EOF
+
+ # Japanese fonts
+ MixedMap psfonts-ja.map
+ EOF
+
+ docinto dvipsk
+ cd ${S}/texk/dvipsk
+ dodoc ../ChangeLog.jpatch ../README.jpatch
+
+ if use X ; then
+ cd ${S}/texk/xdvik
+ docinto xdvik
+ dodoc ANNOUNCE BUGS CHANGES.xdvik-jp FAQ README.*
+ docinto xdvik/READMEs
+ dodoc READMEs/*
+ fi
+}