# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 85234 2011-10-12 01:55:51Z jmr@macports.org $

PortSystem          1.0

name                imlib
version             1.9.15
revision            6
set branch          [join [lrange [split ${version} .] 0 1] .]
categories          graphics devel
# libs are LGPL, executables and examples are GPL
license             {LGPL GPL-2+}
platforms           darwin
maintainers         nomaintainer

description         Graphics library related to the enlightenment window manager

long_description    Imlib is an advanced graphics library meant to replace \
                    existing libraries like libXpm, and provides many more \
                    features with much greater flexibility and speed.

homepage            http://www.enlightenment.org/pages/imlib.html
master_sites        gnome:sources/imlib/${branch}
use_bzip2           yes

checksums           md5     7db987e6c52e4daf70d7d0f471238eae

depends_lib         port:gtk1 \
                    port:jpeg \
                    port:tiff \
                    path:include/gif_lib.h:giflib \
                    port:libpng

patchfiles          patch-imlib.m4

# build for correct archs; fix mandir
use_autoreconf      yes

post-build {
    reinplace -E {s|-arch [a-z0-9_]+||g} \
        ${worksrcpath}/imlib-config \
        ${worksrcpath}/imlib.pc
}

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    eval xinstall -m 644 -W ${worksrcpath}/doc \
        [glob ${worksrcpath}/doc/*.gif] index.html \
        ${destroot}${prefix}/share/doc/${name}
}

livecheck.type      regex
livecheck.url       http://ftp.gnome.org/pub/gnome/sources/${name}/${branch}/
livecheck.regex     {LATEST-IS-(\d+(?:\.\d+)*)}
