# $Id: Portfile,v 1.1 2005/03/27 20:53:47 mww Exp $

PortSystem 1.0

name           efont-unicode
version        0.4.2
categories     x11 fonts
maintainers    pelopor@nifty.com
description    efont Unicode Bitmap Fonts
long_description ${description}
homepage       http://openlab.ring.gr.jp/efont/unicode/
master_sites   http://openlab.ring.gr.jp/efont/dist/unicode-bdf/
distname       ${name}-bdf-${version}
depends_lib    bin:mkfontdir:XFree86 bin:mkfontscale:XFree86
use_bzip2      yes
checksums      md5 0c0acbb40e44d899472001302b1c9e48
depends_lib    bin:mkfontdir:XFree86 bin:mkfontscale:XFree86
set bdf_src    {b10 b10_i b10_b b10_bi b12 b12_i b12_b b12_bi \
                b14 b14_i b14_b b14_bi b16 b16_i b16_b b16_bi \
                b24 b24_i b24_b b24_bi f10 f10_i f10_b f10_bi \
                f12 f12_i f12_b f12_bi f16 f16_i f16_b f16_bi \
                f24 f24_i f24_b f24_bi}

configure      {}
build {
	cd ${worksrcpath}
	foreach BDF ${bdf_src} {
		system "bdftopcf -o ${BDF}.pcf ${BDF}.bdf"
		system "gzip -9 ${BDF}.pcf"
	}
}
destroot {
	set fontsdir ${destroot}${prefix}/share/fonts/${name}
	xinstall -d -m 755 ${fontsdir} ${destroot}${prefix}/share/doc/${name}
	foreach BDF ${bdf_src} {
		xinstall -m 644 ${worksrcpath}/${BDF}.pcf.gz ${fontsdir}
	}
	xinstall -m 644 -W ${worksrcpath} COPYRIGHT ChangeLog List.html README \
		README.baekmuk README.contrib README.etl-unicode README.naga10 \
		README.shinonome README.ucs-fonts ${destroot}${prefix}/share/doc/${name}
	system "mkfontscale ${fontsdir} && mkfontdir ${fontsdir}"
}
