# $Id: Portfile 85459 2011-10-14 01:17:22Z dports@macports.org $

PortSystem          1.0

name                dejavu-fonts
version             2.33
categories          x11 fonts
license             BitstreamVera
maintainers         takanori openmaintainer
description         The DejaVu fonts are a font family based on the Vera Fonts.
long_description    ${description} \
                    Its purpose is to provide a wider range of characters while \
                    maintaining the original look and feel through the process of \
                    collaborative development (see authors), under a Free license.
platforms           darwin
homepage            http://dejavu-fonts.org/
master_sites        sourceforge:dejavu:
distname            ${name}-ttf-${version}
use_bzip2           yes
checksums           rmd160 5eb52dff65acc3eb85b1c5a8239dc575d1a3ac74

depends_run         port:fontconfig

supported_archs     noarch

use_configure       no

build {}

destroot {
    set fontsdir ${destroot}${prefix}/share/fonts/${name}
    xinstall -d -m 755 ${fontsdir}
    eval xinstall -m 644 [glob ${worksrcpath}/ttf/*.ttf] ${fontsdir}

    xinstall -d -m 755 ${destroot}${prefix}/etc/fonts/conf.avail
    xinstall -d -m 755 ${destroot}${prefix}/etc/fonts/conf.d
    foreach f { 20-unhint-small-dejavu-sans-mono.conf
                20-unhint-small-dejavu-sans.conf
                20-unhint-small-dejavu-serif.conf
                57-dejavu-sans-mono.conf
                57-dejavu-sans.conf
                57-dejavu-serif.conf } {
        xinstall -m 644 ${worksrcpath}/fontconfig/${f} ${destroot}${prefix}/etc/fonts/conf.avail
        ln -s ../conf.avail/${f} ${destroot}${prefix}/etc/fonts/conf.d/${f}
    }
}
post-destroot {
    xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} AUTHORS BUGS LICENSE NEWS README langcover.txt status.txt unicover.txt ${destroot}${prefix}/share/doc/${name}
}

post-activate {
    system "${prefix}/bin/fc-cache -fv ${prefix}/share/fonts"
}
