PortSystem 1.0

name            monafont
version         2.90
revision        2
checksums       rmd160  1b5dbd521581f05bd26e8339b316e0207be3c7a1 \
                sha256  26e608598edb2c9f1a662acd8bf4e06dc75910a69fc76698e4e062113a401978 \
                size    808897

categories      x11 fonts
platforms       any
supported_archs noarch
license         public-domain
maintainers     nomaintainer
description     Japanese proportional font to show Japanese text arts correctly
long_description \
   Mona Font is a Japanese proportional font which allows you to view Japanese \
   text arts correctly. Mona Font is based on Shinonome Font, a Japanese font \
   developed by /efont/ Project.
homepage        http://monafont.sourceforge.net/
master_sites    sourceforge:project/${name}/${name}/${name}-${version}/
use_bzip2       yes

depends_build   port:mkfontscale
post-patch {
    reinplace "s|/usr/X11R6|${prefix}|" ${worksrcpath}/Makefile \
                                        ${worksrcpath}/ttfsrc/Makefile
}
use_configure   no

build.target
# Fix "sed: RE error: illegal byte sequence"
build.args      SED_CMD="LC_CTYPE=C sed"

set myfontdir   ${prefix}/share/fonts/${name}
destroot.destdir X11FONTDIR=${destroot}${myfontdir}
pre-destroot {
  xinstall -d -m 755 ${destroot}${myfontdir} \
    ${destroot}${prefix}/share/doc/monafont
  xinstall -m 644 {*}[glob ${worksrcpath}/README*] \
    ${destroot}${prefix}/share/doc/monafont
}

post-activate {
   system "mkfontscale ${myfontdir}"
   system "mkfontdir ${myfontdir}"
}

post-deactivate {
   system "mkfontscale ${myfontdir}"
   system "mkfontdir ${myfontdir}"
}
