--- ./2extract-src.sh.orig	2008-06-16 13:50:47.000000000 +0900
+++ ./2extract-src.sh	2010-02-18 22:41:43.000000000 +0900
@@ -14,7 +14,6 @@
 fi
 
 PTEXENC=$SRC/texk/ptexenc/patches
-GSNOEMBED="-dNOKANJI -c '.setpdfwrite << /NeverEmbed [/Courier /Courier-Bold /Courier-Oblique /Courier-BoldOblique /Helvetica /Helvetica-Bold /Helvetica-Oblique /Helvetica-BoldOblique /Times-Roman /Times-Bold /Times-Italic /Times-BoldItalic /Symbol /ZapfDingbats /Ryumin-Light /GothicBBB-Medium] >> setdistillerparams'"
 
 ## start
 test -z "$TEXSRC_EXTRACTED" \
@@ -46,11 +45,6 @@
     || perlprint 's/LRa/LRat/' $SRC/texk/kpathsea/mktexlsr
 rm $PTETEX_TMP
 
-# epstopdf no embed fonts
-perlprint "s/OutputFilename -/OutputFilename \\\$GSNOEMBED -/;
-	print \"### no embed fonts\nmy \\\$GSNOEMBED=\\\"$GSNOEMBED\\\";\n\n\"
-	if /option BoundingBox types/" \
-    $SRC/texk/tetex/epstopdf
 # add --nostop option: don't stop even if a map file is not found
 cpatch archive/updmap-nostop.patch     0 $SRC/texk/tetex
 # ebb patch (+ArtBox)
@@ -99,6 +93,11 @@
 tarx archive/ptex-src-3.1.10.tar.gz $SRC/texk/web2c
 mv $SRC/texk/web2c/ptex-src-* $SRC/texk/web2c/ptex || exit
 cpatch $PTEXENC/ptex-src-3.1.10-ptexenc.patch     1 $SRC/texk/web2c/ptex
+cpatch archive/ptex-src-3.1.10-forum327.patch     0 $SRC/texk/web2c/ptex
+cpatch archive/ptex-src-3.1.10-forum407.patch     0 $SRC/texk/web2c/ptex
+cpatch archive/ptex-src-3.1.10-forum416.patch     0 $SRC/texk/web2c/ptex
+cpatch archive/ptex-src-3.1.10-forum422.patch     0 $SRC/texk/web2c/ptex
+cpatch archive/ptex-src-3.1.10-forum431.patch     0 $SRC/texk/web2c/ptex
 # comment out TEXINPUTS.platex (not to be erased by mkconf)
 perlprint 's/^(TEXINPUTS.platex)/% \1/g' $SRC/texk/kpathsea/texmf.in
 # rewrite 'platex2e_inputs' macro
@@ -133,12 +128,10 @@
 cpatch $PTEXENC/makejvf-1.1a-ptexenc.patch 1 $SRC/texk/makejvf
 
 ## for dvipdfmx
-tarx archive/dvipdfmx-20070409.tar.gz $SRC/texk
+tarx archive/dvipdfmx-20100328.tar.gz $SRC/texk
 mv $SRC/texk/dvipdfmx-* $SRC/texk/dvipdfmx || exit
-perlprint "s/ cid-x.map\$/ kanjix.map/g;
-	s|^%(D  \"gs .*%o) (%i .*\")|\1 $GSNOEMBED -f \2|" \
-    $SRC/texk/dvipdfmx/data/config/dvipdfmx.cfg
-$RM $SRC/texk/dvipdfmx/data/config/cid-x.map
+perlprint "s/ cid-x.map\$/ kanjix.map/g" $SRC/texk/dvipdfmx/data/dvipdfmx.cfg
+$RM $SRC/texk/dvipdfmx/data/cid-x.map
 perlnoprint "print unless /cid-x/" $SRC/texk/dvipdfmx/data/Makefile.in
 
 
@@ -152,8 +145,8 @@
 #tarx archive/dvipsk-jpatch-p1.7a.tar.gz          $SRC/texk/${P}dvipsk
 #cpatch $SRC/texk/${P}dvipsk/dvipsk-p1.7a.patch 1 $SRC/texk/${P}dvipsk
 $CP $SRC/texk/${P}dvipsk/Makefile.in $SRC/texk/${P}dvipsk/Makefile.in.tetex
-tarx archive/dvipsk-5.96-p1.7b.tar.gz                $SRC/texk/${P}dvipsk
-cpatch $SRC/texk/${P}dvipsk/dvipsk-5.96-p1.7b.diff 1 $SRC/texk/${P}dvipsk
+tarx archive/dvipsk-5.97-p1.7b-20090509.tar.gz       $SRC/texk/${P}dvipsk
+cpatch $SRC/texk/${P}dvipsk/dvipsk-5.97-p1.7b.diff 1 $SRC/texk/${P}dvipsk
 ## disable installing 'config.ps'
 $CP $SRC/texk/${P}dvipsk/Makefile.in       $SRC/texk/${P}dvipsk/Makefile.in.jp
 $CP $SRC/texk/${P}dvipsk/Makefile.in.tetex $SRC/texk/${P}dvipsk/Makefile.in
@@ -255,6 +248,11 @@
 # Fix xpdf integer overflow CVE-2007-3387 (impoted from tetex-3.0-35.fc6)
 cpatch security/tetex-3.0-CVE-2007-3387.patch      1 $SRC
 
+cpatch security/bibtex-CVE-2009-1284.diff          1 $SRC
+cpatch security/jbibtex-CVE-2009-1284.diff         1 $SRC
+cpatch security/dvipsk-CVE-2010-0739.diff          1 $SRC
+cpatch security/dvipsk-CVE-2010-0827.diff          1 $SRC
+
 #exit # uncomment if 'mktemp' command doesn't exist
 # Don't use PID for temporary file names in scripts. (impoted from FC4)
 cpatch security/tetex-3.0-badscript.patch          1 $SRC
@@ -263,7 +258,13 @@
 
 
 ## check
-cat md5sum/texsrc.$JAPANESE | (cd $SRC; md5check) && exit
+if cat md5sum/texsrc.$JAPANESE | (cd $SRC; md5check); then
+    cpatch archive/dvipng-tiger-#18254.diff        1 $SRC
+    cpatch archive/xdvik-tiger-#18254.diff         1 $SRC
+    cpatch archive/xdvi-jisb.diff                  1 $SRC
+    cpatch archive/dvipdfm-png14.diff              1 $SRC
+    exit
+fi
 cat <<EOF
 
 $0: Some processes were performed improperly.
