# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 # $Id: Portfile 74421 2010-12-16 21:15:10Z dports@macports.org $ PortSystem 1.0 PortGroup texlive 1.0 name texlive-common version 2010 revision 1 categories tex maintainers dports description TeX Live common infrastructure. long_description This port provides files that support a MacPorts \ installation of TeX Live, such as configuration \ files and the scripts that generate them. homepage http://www.tug.org/texlive/ platforms darwin supported_archs noarch master_sites http://flute.csail.mit.edu/texlive/ worksrcdir ${distname} use_xz yes checksums sha1 4bbab1829c4218b51e00eb07d7bd741cf29fce55 \ rmd160 fc20939680399ec60e2ff80c312f994f975cfd83 livecheck.type regex livecheck.url ${master_sites} livecheck.regex ${name}-(\[\\d-\]+)\\.tar post-patch { foreach x {texmf.cnf.d/10paths.cnf texlive-update-cnf} { reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/${x} reinplace "s|@@TEXMFMAIN@@|${texlive_texmfmain}|g" ${worksrcpath}/${x} reinplace "s|@@TEXMFDIST@@|${texlive_texmfdist}|g" ${worksrcpath}/${x} reinplace "s|@@TEXMFPORTS@@|${texlive_texmfports}|g" ${worksrcpath}/${x} reinplace "s|@@TEXMFLOCAL@@|${texlive_texmflocal}|g" ${worksrcpath}/${x} reinplace "s|@@TEXMFSYSVAR@@|${texlive_texmfsysvar}|g" ${worksrcpath}/${x} reinplace "s|@@TEXMFSYSCONFIG@@|${texlive_texmfsysconfig}|g" ${worksrcpath}/${x} } } use_configure no build { } destroot { # Create texmf directories xinstall -d ${destroot}${texlive_texmfmain} xinstall -d ${destroot}${texlive_texmfdist} xinstall -d ${destroot}${texlive_texmfports} xinstall -d ${destroot}${texlive_texmflocal} xinstall -d ${destroot}${texlive_texmfsysvar} xinstall -d ${destroot}${texlive_texmfsysconfig} # Create empty ls-R files so that they're marked as owned by this # port. The contents will be generated/updated by mktexlsr. touch ${destroot}${texlive_texmfmain}/ls-R touch ${destroot}${texlive_texmfdist}/ls-R touch ${destroot}${texlive_texmfports}/ls-R touch ${destroot}${texlive_texmflocal}/ls-R touch ${destroot}${texlive_texmfsysvar}/ls-R touch ${destroot}${texlive_texmfsysconfig}/ls-R # Create fmt/updmap/hyphen files, directories, and install update script xinstall -d ${destroot}${texlive_texmfsysconfig}/fmtutil.d xinstall -d ${destroot}${texlive_texmfsysconfig}/language.d xinstall -d ${destroot}${texlive_texmfsysconfig}/updmap.d xinstall -m 644 ${worksrcpath}/updmap-hdr.cfg \ ${destroot}${texlive_texmfsysconfig}/updmap.d/00updmap-hdr.cfg xinstall -m 644 ${worksrcpath}/fmtutil-hdr.cnf \ ${destroot}${texlive_texmfsysconfig}/fmtutil.d/00fmtutil-hdr.cnf xinstall -m 644 ${worksrcpath}/language.us \ ${destroot}${texlive_texmfsysconfig}/language.d/00language.us.dat xinstall -m 644 ${worksrcpath}/language.us.def \ ${destroot}${texlive_texmfsysconfig}/language.d/00language.us.def xinstall -d ${destroot}${texlive_texmfsysvar}/web2c touch ${destroot}${texlive_texmfsysvar}/web2c/updmap.cfg touch ${destroot}${texlive_texmfsysvar}/web2c/fmtutil.cnf xinstall -d ${destroot}${texlive_texmfsysvar}/tex/generic/config touch ${destroot}${texlive_texmfsysvar}/tex/generic/config/language.dat xinstall -m 755 ${worksrcpath}/texlive-update-cnf \ ${destroot}${prefix}/libexec/texlive-update-cnf # Install texmf.cnf files touch ${destroot}${texlive_texmfsysconfig}/texmf.cnf xinstall -d ${destroot}${texlive_texmfsysconfig}/texmf.cnf.d foreach cnffile [glob -directory ${worksrcpath}/texmf.cnf.d *.cnf] { xinstall -m 644 $cnffile \ ${destroot}${texlive_texmfsysconfig}/texmf.cnf.d/ } # Symlink texmf.cnf to its usual expected location, just in case # anything tries to look for it there xinstall -d ${destroot}${texlive_texmfports}/web2c ln -s ${texlive_texmfsysconfig}/texmf.cnf \ ${destroot}${texlive_texmfports}/web2c/texmf.cnf } pre-activate { # Delete ls-R index file if it exists if [file exists ${texlive_texmfports}/ls-R] { delete ${texlive_texmfports}/ls-R } # Deactivate any of the texlive 2007 ports. replaced_by does not # accomplish this because not all of these ports conflict with # this one (although they will cause problems later). foreach oldport {texlive_base texlive_texmf-full texlive_texmf-minimal texlive_texmf-docs} { if {![catch {registry_active $oldport}]} { registry_deactivate $oldport "" [list ports_nodepcheck 1] } } } post-activate { system "${prefix}/libexec/texlive-update-cnf texmf.cnf" system "${prefix}/libexec/texlive-update-cnf fmtutil.cnf" system "${prefix}/libexec/texlive-update-cnf language.dat" system "${prefix}/libexec/texlive-update-cnf language.def" system "${prefix}/libexec/texlive-update-cnf updmap.cfg" # run mktexlsr if it exists (i.e. if we are upgrading an existing # installation) if [file exists ${prefix}/bin/mktexlsr] { system "${prefix}/bin/mktexlsr" } }