PortSystem 1.0

name			xpdf-chinese-traditional
version			2004-jul-27
description		Xpdf character mapping for traditional Chinese
long_description \
	Xpdf character mapping for traditional Chinese

maintainers		nomaintainer
categories		graphics print
license			Restrictive/Distributable GPL-2
platforms		darwin
supported_archs	noarch
homepage		http://www.foolabs.com/xpdf/

master_sites \
    ftp://ftp.funet.fi/pub/TeX/CTAN/support/xpdf/ \
    ftp://ctan.unsw.edu.au/tex-archive/support/xpdf/ \
    ftp://ftp.tex.ac.uk/tex-archive/support/xpdf/ \
    ftp://ftp.kddlabs.co.jp/CTAN/support/xpdf/ \
    ftp://ftp.meiji.ac.jp/pub/TeX/CTAN/support/xpdf/ \
    ftp://ctan.tug.org/tex-archive/support/xpdf/ \
    ftp://ftp.dante.de/tex-archive/support/xpdf/ \
    ftp://gd.tuwien.ac.at/publishing/tex/CTAN/support/xpdf/ \
    ftp://ftp.ntnu.no/pub/tex/CTAN/support/xpdf/ \
    ftp://www.dnsbalance.ring.gr.jp/pub/text/CTAN/support/xpdf/ \
    http://www.t.ring.gr.jp/archives/text/CTAN/support/xpdf/ \
    ftp://ftp.chg.ru/pub/TeX/CTAN/support/xpdf/ \
    ftp://ftp.foolabs.com/pub/xpdf/

worksrcdir	${name}

checksums    md5 b7fa7f1850f7cfa28498701507079abb

depends_lib	 port:xpdf

use_configure	no

build {
    reinplace "s|/usr/local/share/xpdf/|${prefix}/share/xpdf/xpdf-|g" ${worksrcpath}/add-to-xpdfrc
}

destroot {
	xinstall -m 755 -d ${destroot}${prefix}/share/xpdf/${name}
	xinstall -m 755 -d ${destroot}${prefix}/share/xpdf/${name}/CMap
	xinstall -m 644 {*}[glob ${worksrcpath}/CMap/*] ${destroot}${prefix}/share/xpdf/${name}/CMap
	xinstall -m 644                            \
		${worksrcpath}/Adobe-CNS1.cidToUnicode      \
        ${worksrcpath}/Big5.unicodeMap              \
        ${worksrcpath}/Big5ascii.unicodeMap         \
        ${worksrcpath}/README                       \
        ${worksrcpath}/add-to-xpdfrc                \
		${destroot}${prefix}/share/xpdf/${name}/
}

variant autoactivate description automatically activate the character mappings {
	## used in post-activate (below)
}


post-activate {
	if {[variant_isset autoactivate]} {
		system "cat ${prefix}/share/xpdf/${name}/add-to-xpdfrc >> ${prefix}/etc/xpdfrc"
		ui_msg "\"Added ${prefix}/share/xpdf/${name}/add-to-xpdfrc\" to \"${prefix}/etc/xpdfrc\". \
			NOTE: uninstall does not attempt to remove these lines"
	} else {
	ui_msg " \
		Activate these character mappings by adding \"${prefix}/share/xpdf/${name}/add-to-xpdfrc\" to ${prefix}/etc/xpdfrc or ~/.xpdfrc \
		The \"autoactivate\" variant does this automatically"
	}
}