# $Id: Portfile 68201 2010-05-28 23:18:41Z takanori@macports.org $

PortSystem          1.0

name                dejavu-fonts
version             2.31
categories          x11 fonts
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 6ebae58d2a913f5690f0be6a8dd92a42a5ef45e5

depends_run         port:fontconfig

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"
}

universal_variant no
