# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-tex/cjk-latex/cjk-latex-4.6.0.ebuild,v1.00 2005/09/11 03:54:58 clotho Exp $ inherit latex-package elisp-common toolchain-funcs MY_P="${P/-latex/}" DESCRIPTION="A LaTeX 2e macro package which enables the use of CJK scripts in various encodings" HOMEPAGE="http://cjk.ffii.org/" # fonts are taken from ftp://ftp.ctan.org/tex-archive/fonts/CJK.tar.gz SRC_URI="http://cjk.ffii.org/${MY_P}.tar.gz mirror://gentoo/${MY_P}-fonts.tar.gz doc? ( http://cjk.ffii.org/${MY_P}-doc.tar.gz )" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="doc emacs" DEPEND="virtual/tetex emacs? ( virtual/emacs )" S=${WORKDIR}/${MY_P} src_unpack() { unpack ${MY_P}.tar.gz use doc && unpack ${MY_P}-doc.tar.gz cd ${S} unpack ${MY_P}-fonts.tar.gz rm CJK/han*.300.tar.gz || die for f in ${S}/CJK/*.tar.gz; do tar --no-same-owner -xzf $f || die find texmf/fonts/hbf -type f -exec cp {} ${T} \; || die done sed -i -e "/^pk_files/s/no/yes/" \ -e "/^dpi_x/s/300/500/" \ texmf/hbf2gf/*.cfg || die } src_compile() { cd utils for d in *conv; do cd $d local f=`echo $d | tr '[:upper:]' '[:lower:]'` $(tc-getCC) ${CFLAGS} -o $f $f.c || die if [ $d = CEFconv ] ; then $(tc-getCC) ${CFLAGS} -o cef5conv cef5conv.c || die $(tc-getCC) ${CFLAGS} -o cefsconv cefsconv.c || die fi cd - done cd hbf2gf econf --with-kpathsea-lib=/usr/lib \ --with-kpathsea-include=/usr/include/kpathsea || die make || die cd - if use emacs ; then cd lisp elisp-compile *.el cd emacs elisp-compile *.el fi cd ${T} for f in ${S}/texmf/hbf2gf/*.cfg ; do env HBF_TARGET=${S}/texmf/fonts ${S}/utils/hbf2gf/hbf2gf $f || die done for gf in *.gf ; do gftopk $gf || die done } src_install() { cd utils for d in *conv; do cd $d local f=`echo $d | tr '[:upper:]' '[:lower:]'` dobin *latex *conv doman *.1 cd - done cd hbf2gf einstall || die cd ${S} dodir ${TEXMF}/tex/latex/${PN} cp -pPR texinput/* ${D}/${TEXMF}/tex/latex/${PN} || die cp -pPR contrib/wadalab ${D}/${TEXMF}/tex/latex/${PN} || die if use emacs ; then cd utils/lisp elisp-install ${PN} *.el{,c} emacs/*.el{,c} cd - fi cd ${S} for d in texmf/fonts/pk/modeless/*/* ; do insinto /usr/share/${d} for f in ${T}/${d##*/}*.pk ; do newins $f `basename ${f/.pk/.500pk}` \ || die "newins failed" done done mv texmf/fonts/hbf texmf/fonts/misc || die "mv font failed" cp -pPR texmf/fonts/* ${D}/${TEXMF}/fonts || die "cp failed" cp -pPR texmf/hbf2gf ${D}/${TEXMF}/ || die "cp failed" insinto /usr/share/texmf/scripts/subfonts doins utils/subfonts/* dodoc ChangeLog README doc/COPYING doc/INSTALL doc/history.2_5 rm -rf ChangeLog README doc/COPYING doc/INSTALL doc/history.2_5 docinto chinese; dodoc doc/chinese/README rm -rf doc/chinese/README docinto japanese; dodoc doc/japanese/README rm -rf doc/japanese/README if use doc ; then docinto cjk; dodoc doc/cjk/README rm -rf doc/cjk/README fi dodir /usr/share/doc/${P} cp -pPR doc/* ${D}/usr/share/doc/${P} || die "cp failed" docinto examples; dodoc examples/README rm -rf examples/README dodir /usr/share/doc/${P}/examples cp -pPR examples/* ${D}/usr/share/doc/${P}/examples || die "cp failed" dodir /usr/share/texmf/doc/latex/ dosym /usr/share/doc/${P} /usr/share/texmf/doc/latex/${PN} }