diff -up texlive-2011/tl11/common.sh.vine texlive-2011/tl11/common.sh
--- texlive-2011/tl11/common.sh.vine	2011-11-20 15:49:23.000000000 +0900
+++ texlive-2011/tl11/common.sh	2011-11-23 16:32:00.545511134 +0900
@@ -7,29 +7,48 @@
 TLSRCDIR=/opt/home-supp/tl11
 
 # temporaly working directory
-TMPDIR=/tmp
+TMPDIR=$(dirname ${TLSRCDIR})/build
 #TMPDIR=/var/tmp
 
 # the place of installed TeX Live
-TLINSTDIR=/opt/texlive/2011
+TLINSTDIR=/usr/share/texlive-sources
 #TLINSTDIR=/mnt/cd0a
 
 # install directory
-PREFIX=/opt/texlive/p2011
+PREFIX=$(dirname ${TLSRCDIR})/work
 
 # toolkit for [p]xdvi
-#TL_CONF_XDVI_TOOLKIT=--with-xdvi-x-toolkit=motif
-TL_CONF_XDVI_TOOLKIT=--with-xdvi-x-toolkit=xaw
+TL_CONF_XDVI_TOOLKIT=--with-xdvi-x-toolkit=motif
+#TL_CONF_XDVI_TOOLKIT=--with-xdvi-x-toolkit=xaw
 
-TL_MAKE_FLAGS=-j3
+TL_MAKE_FLAGS=-j$(/usr/bin/getconf _NPROCESSORS_ONLN)
 
 TL_CONFIGURE_ARGS=
-## The following args are for generating binaries for tlptexlive
-#TL_CONFIGURE_ARGS="--disable-all-pkgs --enable-web2c \
-#                   --disable-xdvipdfmx --disable-xetex \
-#                   --enable-web-progs --enable-dvipdfmx --enable-mendexk \
-#                   --enable-makejvf --enable-pxdvik --enable-dvipsk \
-#                   --enable-tetex --enable-texlive "
+## The following args are for generating binaries for Vine Linux
+TL_CONFIGURE_ARGS=" \
+  --enable-shared --disable-static \
+  --enable-compiler-warnings=max \
+  --without-cxx-runtime-hack \
+  \
+  --enable-web2c \
+  --enable-web-progs --enable-dvipdfmx --enable-mendexk \
+  --enable-makejvf --enable-pxdvik --enable-dvipsk \
+  --enable-tetex --enable-texlive \
+  \
+  --with-system-xpdf \
+  --with-system-gd \
+  --with-system-t1lib \
+  --with-system-libpng \
+  --with-system-zlib \
+  --with-system-freetype2 --with-freetype2-include=`freetype-config --cflags | sed -e 's/-I//' -e 's/ .*//'` \
+  --with-pic \
+  --with-xdvi-x-toolkit=motif \
+  \
+  --disable-xindy --disable-xindy-docs --disable-xindy-make-rules \
+  --disable-dvi2tty \
+  --disable-t1utils --disable-psutils --disable-detex \
+  --disable-dvipng --disable-lcdf-typetools \
+"
 
 # for Ubuntu?
 # CONFIG_SHELL=$BASH
@@ -38,16 +57,17 @@ TL_CONFIGURE_ARGS=
 # --------------------------------
 unset TEXINPUTS
 unset PTEX_KANJI_ENC
+[ -d $TMPDIR ] || mkdir -p $TMPDIR
 TLV=`basename $TLSRCDIR/texlive-*-source.tar.xz |sed "s/texlive-\(........\).*/\1/"`
 SRCDIR=$TMPDIR/texlive-$TLV-source
 echo -e "\e[0;32m *** TeX Live source: texlive-$TLV-source.tar.xz ***\e[0m"
-ARCH=`ls $SRCDIR/inst/bin/ 2> /dev/null`
+##ARCH=`ls $SRCDIR/inst/bin/ 2> /dev/null`
 PTEX_IN_FILTER=no
 TEXMF=$SRCDIR/inst/texmf
 XMAP=$TEXMF/fonts/map/dvipdfmx
 export TEXMFMAIN=$TEXMF
 export ORIGPATH=$PATH
-export PATH=$SRCDIR/inst/bin/$ARCH:$PATH
+export PATH=$SRCDIR/inst/bin:$PATH
 export TL_CONF_XDVI_TOOLKIT TL_CONFIGURE_ARGS TL_MAKE_FLAGS
 
 sedwrite(){

Diff finished.  Wed Nov 23 16:32:14 2011
diff -up texlive-2011/tl11/scripts/texmf.sh.vine texlive-2011/tl11/scripts/texmf.sh
--- texlive-2011/tl11/scripts/texmf.sh.vine	2011-11-20 15:48:57.000000000 +0900
+++ texlive-2011/tl11/scripts/texmf.sh	2011-11-26 15:33:53.791319730 +0900
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -x
 
 . ./common.sh $*
 
@@ -29,26 +29,26 @@ mv sample.* ../../../doc/platex/japanese
 mv README ../../../doc/platex/japanese/
 cd ../../../..
 
-# otf package
-tarz $TLSRCDIR/ptex/otfbeta.zip
-#if [ "$FLG_UP" = "TRUE" ] ;then
-#    tar zxf $TLSRCDIR/uptex/otfstable-uptex-0.05.tar.gz
-#fi
-cd otfbeta
-sedwrite mkjvf "s/ovp2ovf/wovp2ovf/" && chmod +x mkjvf
-#if [ "$FLG_UP" = "TRUE" ] ;then
-#    sedwrite umkjvf "s/'ovp2ovf/'wovp2ovf/" && chmod +x umkjvf
-#fi
-for x in script/*.pl; do sedwrite $x "s/ovp2ovf/wovp2ovf/"; chmod +x $x; done
-./makeotf
-#if [ "$FLG_UP" = "TRUE" ] ;then
-#    ./umakeotf
-#fi
-mkdir -p ../texmf/fonts/tfm/otf && cp tfm/*.tfm ../texmf/fonts/tfm/otf/
-mkdir -p ../texmf/fonts/vf/otf && cp vf/*.vf ../texmf/fonts/vf/otf/
-mkdir -p ../texmf/tex/latex/otf && cp sty/* ../texmf/tex/latex/otf
-cd ..
-rm -rf otfbeta
+# # otf package
+# tarz $TLSRCDIR/ptex/otfbeta.zip
+# #if [ "$FLG_UP" = "TRUE" ] ;then
+# #    tar zxf $TLSRCDIR/uptex/otfstable-uptex-0.05.tar.gz
+# #fi
+# cd otfbeta
+# sedwrite mkjvf "s/ovp2ovf/wovp2ovf/" && chmod +x mkjvf
+# #if [ "$FLG_UP" = "TRUE" ] ;then
+# #    sedwrite umkjvf "s/'ovp2ovf/'wovp2ovf/" && chmod +x umkjvf
+# #fi
+# for x in script/*.pl; do sedwrite $x "s/ovp2ovf/wovp2ovf/"; chmod +x $x; done
+# ./makeotf
+# #if [ "$FLG_UP" = "TRUE" ] ;then
+# #    ./umakeotf
+# #fi
+# mkdir -p ../texmf/fonts/tfm/otf && cp tfm/*.tfm ../texmf/fonts/tfm/otf/
+# mkdir -p ../texmf/fonts/vf/otf && cp vf/*.vf ../texmf/fonts/vf/otf/
+# mkdir -p ../texmf/tex/latex/otf && cp sty/* ../texmf/tex/latex/otf
+# cd ..
+# rm -rf otfbeta
 fi
 
 echo -e "\e[0;33m[rewriting] \e[0m updmap.cfg"
@@ -56,7 +56,7 @@ echo "KanjiMap otf-cktx.map" >> texmf/we
 (cd $XMAP && tarz $TLSRCDIR/ptex/ptexlive-maps-????????.tar.xz)
 
 # xdvi
-if [ -f bin/$ARCH/pxdvi ]; then
+if [ -f bin/pxdvi ]; then
     cp ../texk/pxdvik/texmf/XDvi texmf/xdvi/XDvi
     cp ../texk/pxdvik/texmf/pxdvi.cfg texmf/xdvi/pxdvi.cfg
     cp $TLSRCDIR/xdvi-ptex.map.sample texmf/xdvi/

Diff finished.  Sat Nov 26 15:34:13 2011
diff -up texlive-2011/tl11/scripts/build.sh.vine texlive-2011/tl11/scripts/build.sh
--- texlive-2011/tl11/scripts/build.sh.vine	2011-11-08 15:56:41.000000000 +0900
+++ texlive-2011/tl11/scripts/build.sh	2011-11-23 19:08:55.313053090 +0900
@@ -7,8 +7,11 @@ if [ "$FLG_RP" = "TRUE" ] ;then
   zpatch 0 $TLSRCDIR/reautoconf-parallel.diff
 fi
 ./reautoconf || exit 1 # ここで時間がかかる
-TL_MAKE=$MAKE ./Build --enable-multiplatform --disable-native-texlive-build || exit 1
+##TL_MAKE=$MAKE ./Build --enable-multiplatform --disable-native-texlive-build || exit 1
+TL_MAKE=$MAKE ./Build --disable-multiplatform --disable-native-texlive-build || exit 1
 
+exit 0
+## We run the following processes as scripts/build-post.sh. 
 #
 . $TLSRCDIR/common.sh $*
 

Diff finished.  Wed Nov 23 19:09:01 2011
diff -up /dev/null texlive-2011/tl11/scripts/build-post.sh
--- /dev/null	2011-11-23 23:03:59.948000077 +0900
+++ texlive-2011/tl11/scripts/build-post.sh	2011-11-23 19:10:27.848058399 +0900
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+. ./common.sh $*
+
+cd $SRCDIR/inst
+cp -r texmf texmf.orig
+cp -r $TLINSTDIR/texmf . 
+cp -r ../texk/tetex/updmap.pl texmf/scripts/tetex/
+cp texmf.orig/web2c/fmtutil.cnf texmf/web2c/fmtutil.cnf 
+cp texmf.orig/web2c/texmf.cnf texmf/web2c/texmf.cnf
+rm -rf texmf.orig
+
+# if [ "$FLG_UP" = "TRUE" ] ;then
+#   cd texmf
+#   zpatch 0 $TLSRCDIR/uptex/uptex-*-texmf-texlive2010.diff
+#   tarz $TLSRCDIR/uptex_font-*.tar.gz
+#   cd fonts/uptex_min/pl
+#   echo -e "\e[0;33m[building]  \e[0m umin7.tfm etc."
+#   $MAKE pl5 tfm5 vf5 &>/dev/null || exit 1
+#   cp u*.tfm ../../tfm/uptex/
+#   cp u*.vf ../../vf/uptex/
+#   cd ../../..
+#   rm -rf fonts/uptex_jis fonts/uptex_upjis fonts/uptex_map  fonts/uptex_min 
+#   cd ..
+# fi
+
+# map for dvipdfmx
+sedwrite texmf/dvipdfmx/dvipdfmx.cfg "s/cid-x.map/kanjix.map/"
+echo -e "\e[0;33m[rewriting] \e[0m updmap.cfg"
+cat <<EOF >> texmf/web2c/updmap.cfg || exit
+#
+# map for pTeX
+KanjiMap morisawa.map
+EOF
+
+
+ln -s $TLINSTDIR/tlpkg tlpkg
+
+exit 0
+
+
+######
+if [ "$FLG_UP" = "TRUE" ] ;then
+  echo -e "\e[0;33m[rewriting] \e[0m updmap.cfg"
+  echo "KanjiMap uptex-ckt.map" >> texmf/web2c/updmap.cfg || exit
+  echo -e "\e[0;33m[writing]   \e[0m uptex-ckt.map"
+  cat <<EOF > $XMAP/uptex-ckt.map
+%%
+%% Chinese/Korean fonts for upTeX
+%%
+upstsl-h        UniGB-UTF16-H           !STSong-Light
+upstsl-v        UniGB-UTF16-V           !STSong-Light
+upstht-h        UniGB-UTF16-H           !STHeiti-Regular
+upstht-v        UniGB-UTF16-V           !STHeiti-Regular
+upmsl-h         UniCNS-UTF16-H          !MSung-Light
+upmsl-v         UniCNS-UTF16-V          !MSung-Light
+upmhm-h         UniCNS-UTF16-H          !MHei-Medium
+upmhm-v         UniCNS-UTF16-V          !MHei-Medium
+uphysmjm-h      UniKS-UTF16-H           !HYSMyeongJo-Medium
+uphysmjm-v      UniKS-UTF16-V           !HYSMyeongJo-Medium
+uphygt-h        UniKS-UTF16-H           !HYGoThic-Medium
+uphygt-v        UniKS-UTF16-V           !HYGoThic-Medium
+EOF
+  cp $TLSRCDIR/uptex/convbkmk.rb $SRCDIR/inst/bin/$ARCH/
+fi

Diff finished.  Wed Nov 23 19:10:58 2011
diff -up texlive-2011/tl11/scripts/build-post.sh.vine texlive-2011/tl11/scripts/build-post.sh
--- texlive-2011/tl11/scripts/build-post.sh.vine	2011-11-23 19:10:27.848058399 +0900
+++ texlive-2011/tl11/scripts/build-post.sh	2011-11-23 19:13:50.011070042 +0900
@@ -1,14 +1,15 @@
-#!/bin/bash
+#!/bin/bash -x
 
 . ./common.sh $*
 
 cd $SRCDIR/inst
-cp -r texmf texmf.orig
-cp -r $TLINSTDIR/texmf . 
-cp -r ../texk/tetex/updmap.pl texmf/scripts/tetex/
-cp texmf.orig/web2c/fmtutil.cnf texmf/web2c/fmtutil.cnf 
-cp texmf.orig/web2c/texmf.cnf texmf/web2c/texmf.cnf
-rm -rf texmf.orig
+[ -d texmf ] && tar cpf texmf-orig.tar texmf && mv texmf texmf.orig || exit 1
+[ -d $TLINSTDIR/texmf ] && cp -far $TLINSTDIR/texmf . || exit 1
+## cp -r ../texk/tetex/updmap.pl texmf/scripts/tetex/
+## cp texmf.orig/web2c/fmtutil.cnf texmf/web2c/fmtutil.cnf 
+## cp texmf.orig/web2c/texmf.cnf texmf/web2c/texmf.cnf
+[ -d texmf -a -d texmf.orig -a -f texmf-orig.tar ] && tar xpf texmf-orig.tar && rm -f texmf-orig.tar || exit 1
+## rm -rf texmf.orig
 
 # if [ "$FLG_UP" = "TRUE" ] ;then
 #   cd texmf
@@ -34,7 +35,8 @@ KanjiMap morisawa.map
 EOF
 
 
-ln -s $TLINSTDIR/tlpkg tlpkg
+## ln -s $TLINSTDIR/tlpkg tlpkg
+cp -ra $TLINSTDIR/tlpkg tlpkg || exit 1
 
 exit 0
 
@@ -61,5 +63,5 @@ uphysmjm-v      UniKS-UTF16-V           
 uphygt-h        UniKS-UTF16-H           !HYGoThic-Medium
 uphygt-v        UniKS-UTF16-V           !HYGoThic-Medium
 EOF
-  cp $TLSRCDIR/uptex/convbkmk.rb $SRCDIR/inst/bin/$ARCH/
+  cp $TLSRCDIR/uptex/convbkmk.rb $SRCDIR/inst/bin/
 fi

Diff finished.  Wed Nov 23 19:13:53 2011
diff -up texlive-2011/tl11/scripts/install.sh.vine texlive-2011/tl11/scripts/install.sh
--- texlive-2011/tl11/scripts/install.sh.vine	2011-11-08 15:56:41.000000000 +0900
+++ texlive-2011/tl11/scripts/install.sh	2011-11-13 16:14:42.809982841 +0900
@@ -30,8 +30,8 @@ cat <<EOF
 Installation is finished.
 Please set \$PATH: 
 
-  (sh/bash user):  export PATH=$PREFIX/bin/$ARCH:\$PATH
-  (csh/tcsh user): setenv PATH $PREFIX/bin/$ARCH:\$PATH
+  (sh/bash user):  export PATH=$PREFIX/bin:\$PATH
+  (csh/tcsh user): setenv PATH $PREFIX/bin:\$PATH
 EOF
 
 exit 0

Diff finished.  Sun Nov 13 16:14:45 2011
