# $Id: Portfile 83587 2011-09-06 20:55:48Z jeremyhu@macports.org $

PortSystem          1.0

name                font-misc-ethiopic
version             1.0.3
categories          x11 x11-font graphics
maintainers         jeremyhu openmaintainer
description         X.org Ethiopic TrueType fonts
long_description    ${description}

platforms           darwin

homepage            http://www.x.org/
master_sites        xorg:individual/font/
use_bzip2           yes

checksums           rmd160 d1efa477c72f2522d3213544c838f774275d4c11 \
                    sha256 53cb1fd83afdbe7939c0eac34003676ee0e6023216892d98054db90b703c98a5

depends_build       port:pkgconfig bin:bdftopcf:bdftopcf port:xorg-font-util \
                    bin:mkfontscale:mkfontscale bin:mkfontdir:mkfontdir bin:gzip:gzip

set myfontbasedir   ${prefix}/share/fonts

configure.args      --with-ttf-fontdir=${myfontbasedir}/TTF \
                    --with-otf-fontdir=${myfontbasedir}/OTF

post-destroot {
   foreach fontsFile {fonts.alias fonts.dir fonts.list fonts.scale fonts.cache-1} {
      foreach fontType {OTF TTF} {
         if {[file exists ${destroot}${myfontbasedir}/${fontType}/${fontsFile}]} {
            delete ${destroot}${myfontbasedir}/${fontType}/${fontsFile}
         }
      }
   }
}

post-activate {
   foreach fontType {OTF TTF} {
      system "mkfontscale ${myfontbasedir}/${fontType}"
      system "mkfontdir ${myfontbasedir}/${fontType}"
   }
}

post-deactivate {
   foreach fontType {OTF TTF} {
      system "mkfontscale ${myfontbasedir}/${fontType}"
      system "mkfontdir ${myfontbasedir}/${fontType}"
   }
}

livecheck.type      regex
livecheck.regex     ${name}-(\[\\d.\]+)${extract.suffix}
livecheck.url       http://xorg.freedesktop.org/archive/individual/font/?C=M&O=D
