# $Id: Portfile,v 1.5 2006/04/12 05:23:54 pguyot Exp $

PortSystem			1.0
name            	dvipdfmx
version         	20050831
revision			1
description     	Multi-byte aware replacement for dvipdf
long_description	The DVIPDFMx project provides an eXtended version of the \
					dvipdfm, a DVI format to PDF translator developed by Mark \
					A. Wicks. The primary goal of this project is to support \
					multi-byte character encodings and large character sets \
					for East Asian languages by CID-keyed font technology. The \
					secondary goal is to support as many features as pdfTeX \
					developed by Hn Th Thnh. This project is a combined \
					work of the dvipdfm-jpn project by Shunsaku Hirata and \
					its modified one, dvipdfm-kor by Jin-Hwan Cho. \
					\
					This port includes Omega font metric for Japanese Adobe \
					fonts.
platforms       	darwin
categories      	print
maintainers     	pguyot@kallisys.net
homepage			http://project.ktug.or.kr/dvipdfmx/
master_sites		${homepage}snapshot/current/:dvipdfmx \
					http://oku.edu.mie-u.ac.jp/~okumura/texfaq/japanese/:omrml \
					http://project.ktug.or.kr/omega-cjk/cjk-otp/:omhysm
distfiles			[suffix ${distname}]:dvipdfmx \
					omrml.ofm:omrml \
					omhysm.ofm:omhysm
checksums			[suffix ${distname}] \
						md5 23659eff85cc515666f528f16e1a0876 \
						sha1 331b41a7d139a166e7646c180e018463e2e54298 \
						rmd160 43c559fa663307998069ce79b49049d276484be4 \
					omrml.ofm \
						md5 20802bf39ec990eadb9e349c64a47595 \
						sha1 eb91eb976a645f5975edfb27d9e3026728954c06 \
						rmd160 d16d53ff6651c6977898ac3830cdacfcb707da94 \
					omhysm.ofm \
						md5 0b3bdd8fa303eb7dac5599ca50b13ab9 \
						sha1 e4ca64147214ddd46ae51c59c4337cc4a9d52fe2 \
						rmd160 41fc10b5c603efcf8661f14e6551a048bfe550af
patchfiles			patch-data-config-cid-x.map \
					patch-src-pdfobj.c
depends_lib			lib:libkpathsea:teTeX \
					lib:libpng:libpng \
					lib:libz:zlib
depends_run			port:ghostscript
configure.env		CFLAGS=-I${prefix}/include \
					LDFLAGS=-L${prefix}/lib

# only extract the tarball.
extract.only [suffix ${distname}]

post-destroot {
	# copy omrml.ofm where it belongs (as omrml.ofm & omgbm.ofm)
	file mkdir ${destroot}${prefix}/share/texmf-dist/fonts/ofm/public/japanese/
	xinstall ${distpath}/omrml.ofm \
		${destroot}${prefix}/share/texmf-dist/fonts/ofm/public/japanese/
	xinstall ${distpath}/omrml.ofm \
		${destroot}${prefix}/share/texmf-dist/fonts/ofm/public/japanese/omgbm.ofm
	# copy omhysm.ofm where it belongs (as omhysm.ofm & omhygt.ofm)
	file mkdir ${destroot}${prefix}/share/texmf-dist/fonts/ofm/public/korean/
	xinstall ${distpath}/omhysm.ofm \
		${destroot}${prefix}/share/texmf-dist/fonts/ofm/public/korean/
	xinstall ${distpath}/omhysm.ofm \
		${destroot}${prefix}/share/texmf-dist/fonts/ofm/public/korean/omhygt.ofm
	# copy ghostscript encodings
	foreach encoding [glob ${prefix}/share/ghostscript/*/Resource/CMap/*] {
		set encname [file tail $encoding]
		if {![file exists ${destroot}${prefix}/share/texmf/dvipdfm/CMap/$encname]} {
			xinstall $encoding ${destroot}${prefix}/share/texmf/dvipdfm/CMap/
		}
	}
}
post-activate {
	system "mktexlsr"
}
