--- /dev/null
+# ChangeLog for app-text/xetex
+# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/xetex/ChangeLog,v 1.1 2006/10/28 11:38:16 joslwah Exp $
+
+ 18 Oct 2006; Joslwah <joslwah@gentoo.org> ChangeLog:
+ Initial ebuild for XeTeX, the extended unicode and more version of TeX.
+
--- /dev/null
+AUX xetex-0.995-install.patch 779 RMD160 c2119799177184ada9da3b20867afcaa2c447ef4 SHA1 c9b858502ee94b0c4aeb34b9e46acd60d28fcefe SHA256 360bfebce9b515d639f7e3c9f453bb9ca51f19e226244af08e7c21ce51be2c41
+MD5 b439f23d5561bbca223cce6b83554d4e files/xetex-0.995-install.patch 779
+RMD160 c2119799177184ada9da3b20867afcaa2c447ef4 files/xetex-0.995-install.patch 779
+SHA256 360bfebce9b515d639f7e3c9f453bb9ca51f19e226244af08e7c21ce51be2c41 files/xetex-0.995-install.patch 779
+AUX xetex-0.995-rebuild.patch 1829 RMD160 daf3fd22e444e46718087a42d82501c529cc4cec SHA1 c7a784ff42f644345af2720df269a637dc45f2c8 SHA256 8caf8ae3d34b1fb950a4b3136cbf02489e503bc9f1444e477f009323504087b5
+MD5 7336ca2accc78c22bf48b3548347fa83 files/xetex-0.995-rebuild.patch 1829
+RMD160 daf3fd22e444e46718087a42d82501c529cc4cec files/xetex-0.995-rebuild.patch 1829
+SHA256 8caf8ae3d34b1fb950a4b3136cbf02489e503bc9f1444e477f009323504087b5 files/xetex-0.995-rebuild.patch 1829
+DIST xetex-0.995.tar.gz 19482520 RMD160 d556b65a4fb7038589386a0cfe4f16d2d015f40e SHA1 f38b9efb031b978fb8f77653db71526c3d1f32f3 SHA256 eb9c997996ea0abe1d08e9f345d91a9e33079ff32b0496a124cb2e5614096977
+EBUILD xetex-0.995.ebuild 2169 RMD160 29b0bff1594661b80aeaddeddfc75c2ae1328d28 SHA1 69927df2b2aa911ccaba141f12ff5775f967826d SHA256 488e1272cd743b132771f620747a0fa1ef6e66aca260a2291c9964af9ab32b8b
+MD5 49f6f0ae493ffaa5176adaf84e52f408 xetex-0.995.ebuild 2169
+RMD160 29b0bff1594661b80aeaddeddfc75c2ae1328d28 xetex-0.995.ebuild 2169
+SHA256 488e1272cd743b132771f620747a0fa1ef6e66aca260a2291c9964af9ab32b8b xetex-0.995.ebuild 2169
+MISC ChangeLog 332 RMD160 492d57ffc6c10d919c3d159b93b4d5f5ccc2c79c SHA1 49d766e63fab9ea6ac65ebc510e55b06b26d36a1 SHA256 904ddc16f63d9f2a21539b29174aa7cce895069df95fd6bd5c7ba1e36e9a36e2
+MD5 49f76434ce96a5c29b267d52904a9028 ChangeLog 332
+RMD160 492d57ffc6c10d919c3d159b93b4d5f5ccc2c79c ChangeLog 332
+SHA256 904ddc16f63d9f2a21539b29174aa7cce895069df95fd6bd5c7ba1e36e9a36e2 ChangeLog 332
+MISC metadata.xml 560 RMD160 2ec5e484c96d93a2135235577b5673fda33570fd SHA1 66d5bdc3ca7da322e4f1f9a58fd305f51e8808cc SHA256 a2e13b5149748c1f319150e6cc4c5ffc4d49d41b2e53490af34c8d7b14b4c656
+MD5 d60096908c5154c2fe428c8d1524bfd9 metadata.xml 560
+RMD160 2ec5e484c96d93a2135235577b5673fda33570fd metadata.xml 560
+SHA256 a2e13b5149748c1f319150e6cc4c5ffc4d49d41b2e53490af34c8d7b14b4c656 metadata.xml 560
+MD5 f1db48cece96f7f4c65a53a72957191f files/digest-xetex-0.995 241
+RMD160 a35ce3ec7fff49a9ec6f0686cd2db4402d8b0af1 files/digest-xetex-0.995 241
+SHA256 96b3d78141e6dc960387b20f7ab2e48ce3ddf087e6c1db2f6cc5a340ca97faaf files/digest-xetex-0.995 241
--- /dev/null
+MD5 9ce454a4b1a33710b66b4e18f650e34e xetex-0.995.tar.gz 19482520
+RMD160 d556b65a4fb7038589386a0cfe4f16d2d015f40e xetex-0.995.tar.gz 19482520
+SHA256 eb9c997996ea0abe1d08e9f345d91a9e33079ff32b0496a124cb2e5614096977 xetex-0.995.tar.gz 19482520
--- /dev/null
+--- install-xetex 2006-08-23 03:41:00.000000000 +0800
++++ install-xetex.gentoo 2006-10-28 18:15:12.000000000 +0800
+@@ -30,9 +30,10 @@
+ if [ -L ${texbin} ]; then
+ texbin=`readlink ${texbin}`
+ fi
+-texbindir=`dirname ${texbin}`
++texbindir=${D}`dirname ${texbin}`
+
+ # copy the xetex binary to the same dir as standard tex
++mkdir -p ${texbindir}
+ cp -pf Work/texk/web2c/xetex ${texbindir}/xetex
+ echo ${texbindir}/xetex >> ${filelist}
+ if [ -e Work/texk/xdv2pdf/xdv2pdf ]; then
+@@ -48,7 +49,7 @@
+ fi
+
+ # copy our texmf additions into the local texmf tree
+-texmflocal=`kpsewhich --var-value TEXMFLOCAL`
++texmflocal=${D}usr/share/texmf
+ if [ "x${texmflocal}" == "x" ]; then
+ # if --var-value didn't work, try to find the definition in the texmf.cnf file
+ CNF=`kpsewhich texmf.cnf`
--- /dev/null
+--- rebuild-formats 2006-08-23 03:41:00.000000000 +0800
++++ rebuild-formats.gentoo 2006-10-28 18:15:12.000000000 +0800
+@@ -6,8 +6,9 @@
+
+ # ensure our entries are present in fmtutil.cnf
+ fmtutil_cnf=`kpsewhich --format="web2c files" fmtutil.cnf`
++cp ${fmtutil_cnf} ${D}${fmtutil_cnf}
+ if [ "`fgrep -c xetex ${fmtutil_cnf}`" == "0" ]; then
+- cat >> ${fmtutil_cnf} <<-__EOT__;
++ cat >>${D}${fmtutil_cnf} <<-__EOT__;
+
+ # XeTeX formats
+ xetex xetex - *xetex.ini
+@@ -21,7 +22,7 @@
+ if [ -L ${texbin} ]; then
+ texbin=`readlink ${texbin}`
+ fi
+-texbindir=`dirname ${texbin}`
++texbindir=${D}`dirname ${texbin}`
+
+ # ensure ${texbindir} is in the PATH so that fmtutil can find new xetex
+ # (normal usage may rely on a symlink, which doesn't yet exist)
+@@ -29,7 +30,8 @@
+
+ # patch fmtutil from teTeX 2.x so it doesn't confuse xetex with an etex engine
+ # (discarding any error message in case we have teTeX 3 or an already-patched teTeX 2)
+-patch -N -r /tmp/fmtutilpatch.rej -p0 `which fmtutil` < fmtutil.tetex-2.patch >/dev/null 2>&1
++cp `which fmtutil` .
++patch -N -r /tmp/fmtutilpatch.rej -p0 fmtutil < fmtutil.tetex-2.patch >/dev/null 2>&1
+
+ # use system-wide setup if available
+ fmtutil=`type -p fmtutil-sys` || fmtutil=`type -p fmtutil`
+@@ -37,9 +39,9 @@
+ formats="xetex xelatex"
+ for f in ${formats}; do
+ # enable our entries if necessary (in case of pre-existing disabled ones)
+- ${fmtutil} --enablefmt ${f}
+- ${fmtutil} --byfmt ${f}
++ TEXMFLOCAL=${D}usr/share/texmf ./fmtutil --fmtdir ${D}usr/share/texmf/web2c --cnffile ${D}${fmtutil_cnf} --enablefmt ${f}
++ TEXMFLOCAL=${D}usr/share/texmf ./fmtutil --fmtdir ${D}usr/share/texmf/web2c --cnffile ${D}${fmtutil_cnf} --byfmt ${f}
+ done
+
+ # create symlinks for the newly-built formats
+-texlinks --silent
++texlinks --silent --cnffile ${D}${fmtutil_cnf} ${D}usr/share/texmf/web2c
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+ <pkgmetadata>
+ <herd>text-markup</herd>
+ <maintainer>
+ <email>joslwah@gentoo.org</email>
+ <name>Joslwah</name>
+ </maintainer>
+ <longdescription lang="en">
+ Extended version of unicode (La)TeX written by Jonathan Kew
+ at SIL. Allows many more languages to be typeset including
+ those requiring vertical layout and mixed direction layouts.
+ </longdescription>
+ </pkgmetadata>
+
--- /dev/null
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/xetex/xetex-0.995.ebuild,v 1.1 2006/10/28 11:38:16 joslwah Exp $
+
+inherit eutils
+
+DESCRIPTION="Unicode version of tex with other enhancements."
+HOMEPAGE="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=xetex"
+SRC_URI="http://scripts.sil.org/svn-view/xetex/TAGS/${P}.tar.gz"
+
+LICENSE="XeTeX"
+SLOT="0"
+KEYWORDS="~ppc64"
+IUSE=""
+
+RDEPEND="app-text/xdvipdfmx app-text/tetex"
+DEPEND="app-text/tetex"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}/${P}-install.patch"
+ epatch "${FILESDIR}/${P}-rebuild.patch"
+}
+
+src_compile() {
+ sh build-xetex || die
+}
+
+src_install() {
+ # Short term hack instead of patching. Change to a patch later.
+# sed -e 's/texbindir=`/texbindir=${D}`/' \
+# -e '/cp -pf Work\/texk\/web2c\/xetex ${texbindir}\/xetex/i mkdir -p ${texbindir}' \
+# -e 's/texmflocal=`kpsewhich --var-value TEXMFLOCAL`/texmflocal=${D}usr\/share\/texmf/' \
+# -e 's/.\/rebuild-formats/-x .\/rebuild-formats.gentoo/' install-xetex >install-xetex.gentoo
+# sed -e '/ fmtutil.cnf`/a cp ${fmtutil_cnf} ${D}${fmtutil_cnf}' \
+# -e 's/cat >> ${fmtutil_cnf}/cat >>${D}${fmtutil_cnf}/' \
+# -e 's/texbindir=`/texbindir=${D}`/' \
+# -e '/patch -N -r/i cp `which fmtutil` .' \
+# -e 's/-p0 `which fmtutil`/-p0 fmtutil/' \
+# -e 's/${fmtutil} --enablefmt ${f}/TEXMFLOCAL=${D}usr\/share\/texmf .\/fmtutil --fmtdir ${D}usr\/share\/texmf\/web2c --cnffile ${D}${fmtutil_cnf} --enablefmt ${f}/' \
+# -e 's/${fmtutil} --byfmt ${f}/TEXMFLOCAL=${D}usr\/share\/texmf .\/fmtutil --fmtdir ${D}usr\/share\/texmf\/web2c --cnffile ${D}${fmtutil_cnf} --byfmt ${f}/' \
+# -e 's/texlinks --silent/texlinks --silent --cnffile ${D}${fmtutil_cnf} ${D}usr\/share\/texmf\/web2c/' rebuild-formats >rebuild-formats.gentoo
+ sh -x install-xetex || die
+
+ # Need to softlink xelatex to xetex.
+ cd ${D}/usr/bin
+ ln -s xetex xelatex
+
+ # Do we need to worry about /usr/share/texmf being explicit?
+ # What happens if this doesn't match the tex install place?
+}
+
+pkg_postinst()
+{
+ texhash
+ return
+}
+
+pkg_postrm()
+{
+ texhash
+ return
+}