# $Id: Portfile 68927 2010-06-18 02:36:47Z jmr@macports.org $

PortSystem 1.0

name			mplus-fonts
version			2.2.4
revision		1
categories		x11 fonts
platforms		darwin
maintainers		nifty.com:pelopor
description		simple and highly readable bitmap Japanese fonts
long_description	\
	M+ BITMAP FONTS were designed to be simple and highly readable.\
	It incorporates all Kanji (Chinese character in Japanese) until\
	level 2 (the one described in JISX0208).

homepage	 	http://mplus-fonts.sourceforge.jp
master_sites	http://downloads.sourceforge.jp/mplus-fonts/5030/
distname		mplus_bitmap_fonts-${version}
checksums		md5 a97a99acbee54976407dec828d03850c
depends_lib		bin:mkfontdir:mkfontdir
patchfiles 		patch-install_mplus_fonts.diff
set fontsdir	/share/fonts
set docs		{LICENSE_E LICENSE_J README_E README_J}
configure		{}
build.cmd		${worksrcpath}/install_mplus_fonts
build.target
destroot		{xinstall -d -m 755 \
						  ${destroot}${prefix}${fontsdir}/mplus
				eval xinstall -m 644 [glob ${worksrcpath}/fonts_e/*.pcf.gz] \
					 ${destroot}${prefix}${fontsdir}/mplus
				eval xinstall -m 644 [glob ${worksrcpath}/fonts_e/euro/*.pcf.gz] \
					 ${destroot}${prefix}${fontsdir}/mplus
				eval xinstall -m 644 [glob ${worksrcpath}/fonts_j/*.pcf.gz] \
					 ${destroot}${prefix}${fontsdir}/mplus
				# font alias
				xinstall -m 644 ${worksrcpath}/fonts_e/fonts.alias \
					 ${destroot}${prefix}${fontsdir}/mplus
				system "cat ${worksrcpath}/fonts_e/euro/fonts.alias \
					 >> ${destroot}${prefix}${fontsdir}/mplus/fonts.alias"
				system "cat ${worksrcpath}/fonts_j/fonts.alias \
					 >> ${destroot}${prefix}${fontsdir}/mplus/fonts.alias"
				#docs
				xinstall -d -m 755 \
						  ${destroot}${prefix}/share/doc/${name}
				foreach D ${docs} {
					xinstall -m 644 ${worksrcpath}/${D} ${destroot}${prefix}/share/doc/${name}
					}
				}

post-activate {
   system "mkfontscale ${prefix}${fontsdir}/mplus"
   system "mkfontdir ${prefix}${fontsdir}/mplus"
}

post-deactivate {
   system "mkfontscale ${prefix}${fontsdir}/mplus"
   system "mkfontdir ${prefix}${fontsdir}/mplus"
}
