diff options
author | Mamoru Komachi <usata@gentoo.org> | 2004-10-16 17:19:12 +0000 |
---|---|---|
committer | Mamoru Komachi <usata@gentoo.org> | 2004-10-16 17:19:12 +0000 |
commit | 50be7a86df9c3a586bcc568f2b2e7be48243ef5f (patch) | |
tree | 309a951c707aa045f1fe5833d2f64e73eb923ab2 /eclass/tetex.eclass | |
parent | use java-pkg_dohtml instead of dohtml to also install the package-list in cas... (diff) | |
download | gentoo-2-50be7a86df9c3a586bcc568f2b2e7be48243ef5f.tar.gz gentoo-2-50be7a86df9c3a586bcc568f2b2e7be48243ef5f.tar.bz2 gentoo-2-50be7a86df9c3a586bcc568f2b2e7be48243ef5f.zip |
* Added doc IUSE flag.
* Make xdvi optional.
* Fixed texi2html manpage.
* Added tetex-beta support.
Diffstat (limited to 'eclass/tetex.eclass')
-rw-r--r-- | eclass/tetex.eclass | 278 |
1 files changed, 178 insertions, 100 deletions
diff --git a/eclass/tetex.eclass b/eclass/tetex.eclass index 8e1a1b9a4c3a..7df93ac10114 100644 --- a/eclass/tetex.eclass +++ b/eclass/tetex.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/tetex.eclass,v 1.15 2004/09/08 20:07:56 usata Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/tetex.eclass,v 1.16 2004/10/16 17:19:12 usata Exp $ # # Author: Jaromir Malenko <malenko@email.cz> # Author: Mamoru KOMACHI <usata@gentoo.org> @@ -17,7 +17,7 @@ if [ -z "${TETEX_PV}" ] ; then TETEX_PV=${PV} fi -IUSE="X" +IUSE="X doc" S=${WORKDIR}/tetex-src-${TETEX_PV} TETEX_SRC="tetex-src-${TETEX_PV}.tar.gz" @@ -48,6 +48,7 @@ RDEPEND="${DEPEND} !app-text/dvipdfm >=dev-lang/perl-5.2 dev-util/dialog" +PDEPEND="X? ( app-text/xdvik )" PROVIDE="virtual/tetex" tetex_src_unpack() { @@ -55,8 +56,8 @@ tetex_src_unpack() { [ -z "$1" ] && tetex_src_unpack all while [ "$1" ]; do - case $1 in - unpack) + case $1 in + unpack) unpack ${TETEX_SRC} mkdir ${S}/texmf; cd ${S}/texmf @@ -64,20 +65,24 @@ tetex_src_unpack() { unpack ${TETEX_TEXMF_SRC} unpack ${TETEX_TEXMF} ;; - patch) + patch) # Do not run config. Also fix local texmf tree. cd ${S} epatch ${FILESDIR}/../../tetex/files/tetex-${TETEX_PV}-dont-run-config.diff epatch ${FILESDIR}/../../tetex/files/tetex-${TETEX_PV}.diff epatch ${FILESDIR}/../../tetex/files/tetex-texdoctk-gentoo.patch - # fix up misplaced listings.sty in the 2.0.2 archive. - # this should be fixed in the next release <obz@gentoo.org> - mv texmf/source/latex/listings/listings.sty texmf/tex/latex/listings/ - - # need to fix up the hyperref driver, see bug #31967 - sed -i -e "/providecommand/s/hdvips/hypertex/" \ - ${S}/texmf/tex/latex/config/hyperref.cfg + if [ "${TETEX_PV}" == "2.0.2" ] ; then + # fix up misplaced listings.sty in the 2.0.2 archive. + # this should be fixed in the next release <obz@gentoo.org> + mv texmf/source/latex/listings/listings.sty texmf/tex/latex/listings/ + # need to fix up the hyperref driver, see bug #31967 + sed -i -e "/providecommand/s/hdvips/hypertex/" \ + ${S}/texmf/tex/latex/config/hyperref.cfg + else + sed -i -e "/providecommand/s/hdvips/hypertex/" \ + ${S}/texmf/tex/latex/hyperref/hyperref.cfg + fi ;; all) tetex_src_unpack unpack patch @@ -91,14 +96,6 @@ tetex_src_compile() { filter-flags "-fstack-protector" - local xdvik - - if [ "${P%%-*}" = "ptex" ] ; then - xdvik="--without-xdvik" - else - xdvik="--with-xdvik" - fi - einfo "Building teTeX" econf --bindir=/usr/bin \ @@ -119,92 +116,173 @@ tetex_src_compile() { --with-ps=gs \ --enable-ipc \ --with-etex \ + --without-xdvik \ + --without-oxdvik \ `use_with X x` \ ${xdvik} \ ${myconf} || die - make texmf=/usr/share/texmf || die "make teTeX failed" + emake -j1 texmf=/usr/share/texmf || die "make teTeX failed" } tetex_src_install() { - dodir /usr/share/ - # Install texmf files - einfo "Installing texmf..." - cp -Rv texmf ${D}/usr/share - - # bug #47004 - insinto /usr/share/texmf/tex/latex/a0poster - doins ${S}/texmf/source/latex/a0poster/a0poster.cls || die - doins ${S}/texmf/source/latex/a0poster/a0size.sty || die - - # Install teTeX files - einfo "Installing teTeX..." - einstall bindir=${D}/usr/bin texmf=${D}/usr/share/texmf || die - - dodoc PROBLEMS README - docinto texk - dodoc texk/ChangeLog texk/README - docinto kpathesa - cd ${S}/texk/kpathsea - dodoc README* NEWS PROJECTS HIER - docinto dviljk - cd ${S}/texk/dviljk - dodoc AUTHORS README NEWS - docinto dvipsk - cd ${S}/texk/dvipsk - dodoc AUTHORS ChangeLog INSTALLATION README - docinto makeindexk - cd ${S}/texk/makeindexk - dodoc CONTRIB COPYING NEWS NOTES PORTING README - docinto ps2pkm - cd ${S}/texk/ps2pkm - dodoc ChangeLog CHANGES.type1 INSTALLATION README* - docinto web2c - cd ${S}/texk/web2c - dodoc AUTHORS ChangeLog NEWS PROJECTS README - #docinto xdvik - #cd ${S}/texk/xdvik - #dodoc BUGS FAQ README* - - #fix for conflicting readlink binary: - rm -f ${D}/bin/readlink - rm -f ${D}/usr/bin/readlink - #add /var/cache/fonts directory - dodir /var/cache/fonts - - #fix for cnflicting texi2html perl script: - local texi2html_PV - texi2html_PV=`grep '^\$THISVERSION' ${D}/usr/bin/texi2html | cut -d'"' -f2` - mv ${D}/usr/bin/texi2html ${D}/usr/bin/texi2html-${texi2html_PV} - - #fix for lousy upstream permisssions on /usr/share/texmf files - #NOTE: do not use fowners, as its not recursive ... - einfo "Fixing permissions..." - chown -R root:root ${D}/usr/share/texmf - dodir /etc/env.d/ - echo 'CONFIG_PROTECT="/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/xdvi/"' > ${D}/etc/env.d/98tetex - - #fix for texlinks - local src dst - sed -e '/^#/d' -e '/^$/d' -e 's/^ *//' \ - ${D}/usr/share/texmf/web2c/fmtutil.cnf > ${T}/fmtutil.cnf || die - while read l; do - dst=/usr/bin/`echo $l | awk '{ print $1 }'` - src=/usr/bin/`echo $l | awk '{ print $2 }'` - if [ ! -f ${D}$dst -a "$dst" != "$src" ] ; then - einfo "Making symlinks from $src to $dst" - dosym $src $dst - fi - done < ${T}/fmtutil.cnf + if [ -z "$1" ]; then + tetex_src_install all + fi + + while [ "$1" ]; do + case $1 in + base) + dodir /usr/share/ + # Install texmf files + einfo "Installing texmf..." + cp -Rv texmf ${D}/usr/share + + if [ "${TETEX_PV}" == "2.0.2" ] ; then + # bug #47004 + insinto /usr/share/texmf/tex/latex/a0poster + doins ${S}/texmf/source/latex/a0poster/a0poster.cls || die + doins ${S}/texmf/source/latex/a0poster/a0size.sty || die + fi + + # Install teTeX files + einfo "Installing teTeX..." + einstall bindir=${D}/usr/bin texmf=${D}/usr/share/texmf || die + ;; + doc) + dodoc PROBLEMS README + docinto texk + dodoc texk/ChangeLog texk/README + docinto kpathesa + cd ${S}/texk/kpathsea + dodoc README* NEWS PROJECTS HIER + docinto dviljk + cd ${S}/texk/dviljk + dodoc AUTHORS README NEWS + docinto dvipsk + cd ${S}/texk/dvipsk + dodoc AUTHORS ChangeLog INSTALLATION README + docinto makeindexk + cd ${S}/texk/makeindexk + dodoc CONTRIB COPYING NEWS NOTES PORTING README + docinto ps2pkm + cd ${S}/texk/ps2pkm + dodoc ChangeLog CHANGES.type1 INSTALLATION README* + docinto web2c + cd ${S}/texk/web2c + dodoc AUTHORS ChangeLog NEWS PROJECTS README + #docinto xdvik + #cd ${S}/texk/xdvik + #dodoc BUGS FAQ README* + + # move docs to /usr/share/doc/${PF} + if use doc ; then + dodir /usr/share/doc + mv ${D}/usr/share/texmf/doc/* \ + ${D}/usr/share/doc/${PF} \ + || die "mv doc failed." + cd ${D}/usr/share/texmf + ln -s ../doc/${PF} doc \ + || die "ln -s doc failed." + cd - + else + rm -rf ${D}/usr/share/texmf/doc + fi + ;; + fixup) + #fix for conflicting readlink binary: + rm -f ${D}/bin/readlink + rm -f ${D}/usr/bin/readlink + + #fix for conflicting texi2html perl script: + local v + v=$(${D}/usr/bin/texi2html --version) + mv ${D}/usr/bin/texi2html{,-${v}} + mv ${D}/usr/share/man/man1/texi2html{,-${v}}.1 + + #add /var/cache/fonts directory + dodir /var/cache/fonts + + #fix for lousy upstream permisssions on /usr/share/texmf files + #NOTE: do not use fowners, as its not recursive ... + einfo "Fixing permissions..." + chown -R root:root ${D}/usr/share/texmf + ;; + link) # link is for tetex-beta + # populate /etc/texmf + dodir /etc/texmf /etc/texmf/tex + for f in texmf.cnf updmap.cfg ; do + mv ${D}/usr/share/texmf/web2c/$f \ + ${D}/etc/texmf \ + || die "mv $f failed." + cd ${D}/usr/share/texmf/web2c + ln -s ../../../../etc/texmf/$f . \ + || die "ln -s $f failed." + cd - + done + for cfg in context dvipdfm metafont metapost ; do + einfo "Symlinking from /etc/texmf/${cfg}..." + mv ${D}/usr/share/texmf/${cfg}/config \ + ${D}/etc/texmf/${cfg} \ + || die "mv ${cfg} failed." + cd ${D}/usr/share/texmf/${cfg} + ln -s ../../../../etc/texmf/${cfg} config \ + || die "ln -s ${cfg} failed." + cd - + done + for cfg in tex/{amstex,context,cyrplain,generic,lambda,latex,mex,plain,platex} ; do + einfo "Symlinking from /etc/texmf/${cfg}..." + mv ${D}/usr/share/texmf/${cfg}/config \ + ${D}/etc/texmf/${cfg} \ + || die "mv ${cfg} failed." + cd ${D}/usr/share/texmf/${cfg} + ln -s ../../../../../etc/texmf/${cfg} config \ + || die "ln -s ${cfg} failed." + cd - + done + ;; + cnf) # cnf is for tetex-2.0.2 + dodir /etc/env.d/ + echo 'CONFIG_PROTECT="/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/xdvi/"' > ${D}/etc/env.d/98tetex + + #fix for texlinks + local src dst + sed -e '/^#/d' -e '/^$/d' -e 's/^ *//' \ + ${D}/usr/share/texmf/web2c/fmtutil.cnf > ${T}/fmtutil.cnf || die + while read l; do + dst=/usr/bin/`echo $l | awk '{ print $1 }'` + src=/usr/bin/`echo $l | awk '{ print $2 }'` + if [ ! -f ${D}$dst -a "$dst" != "$src" ] ; then + einfo "Making symlinks from $src to $dst" + dosym $src $dst + fi + done < ${T}/fmtutil.cnf + ;; + all) + tetex_src_install base doc fixup cnf + #tetex_src_install base doc fixup link + ;; + esac + shift + done } tetex_pkg_preinst() { - if [ -d "/usr/share/texmf/dvipdfm/config" ] - then - ewarn "Removing /usr/share/texmf/dvipdfm/config/" - rm -rf /usr/share/texmf/dvipdfm/config + for d in context dvipdfm metafont metapost tex/{amstex,context,cyrplain,generic,lambda,latex,mex,plain,platex} ; do + if [ -d "${ROOT}usr/share/texmf/$d/config" ] + then + # Portage doesn't handle symbolic links well. + ewarn "Removing ${ROOT}usr/share/texmf/$d/config" + #tar -C ${ROOT}usr/share/texmf -cf - $d/config | ( cd ${T} ; tar -xpf - ) + rm -rf "${ROOT}usr/share/texmf/$d/config" + fi + done + + if [ "${PV}" != "2.0.2" ] ; then + ewarn "Removing ${ROOT}usr/share/texmf/web2c" + rm -rf "${ROOT}usr/share/texmf/web2c" fi # Let's take care of config protecting. @@ -215,12 +293,12 @@ tetex_pkg_postinst() { if [ -z "$1" ]; then tetex_pkg_postinst all - alternatives_auto_makesym "/usr/bin/texi2html" "/usr/bin/texi2html-*" + use ppc-macos || alternatives_auto_makesym "/usr/bin/texi2html" "/usr/bin/texi2html-*" fi while [ "$1" ]; do - case $1 in - configure) + case $1 in + configure) if [ $ROOT = "/" ] then einfo "Configuring teTeX..." @@ -233,7 +311,7 @@ tetex_pkg_postinst() { updmap &>/dev/null fi ;; - generate) + generate) if [ $ROOT = "/" ] then einfo "Generating format files..." @@ -243,8 +321,8 @@ tetex_pkg_postinst() { einfo fi ;; - all) - tetex_pkg_postinst configure generate + all) + tetex_pkg_postinst configure generate ;; esac shift |