# -*- tcl -*-
# $Id: Portfile 52919 2009-06-25 20:42:23Z toby@macports.org $

PortSystem 1.0

name            freeimage
version         3.12.0
categories      graphics
maintainers     toby
description     Library for FreeImage, a dependency-less graphics library
long_description \
    FreeImage is a library for developers who would like to \
    support most popular graphics image formats. Some \
    highlights are: extremely simple in use, not limited to \
    the local PC (unique FreeImageIO) and Plugin driven!
platforms       macosx
homepage        http://freeimage.sourceforge.net/
master_sites    sourceforge
distname        FreeImage[strsed ${version} {g/\.//}]
use_zip         yes
worksrcdir      FreeImage

checksums       md5 47b259102f776a4bcd7affc00942f3b4 \
                sha1 d9a5efc9590cb45e176c7e5552afef961594a1cb \
                rmd160 421ddbd81343d14561ade844c67c31802ab444ad

patchfiles      patch-Makefile.gnu

configure {
    reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/Makefile.gnu

    reinplace "s|__LDFLAGS__|${configure.ldflags}|" ${worksrcpath}/Makefile.gnu

    reinplace "s|__CC__|${configure.cc}|" ${worksrcpath}/Makefile.gnu
    reinplace "s|__CFLAGS__|${configure.cflags}|" ${worksrcpath}/Makefile.gnu

    reinplace "s|__CXX__|${configure.cxx}|" ${worksrcpath}/Makefile.gnu
    reinplace "s|__CXXFLAGS__|${configure.cxxflags}|" ${worksrcpath}/Makefile.gnu
}

build.target    FreeImage
build.args      -f Makefile.gnu

destroot.args   -f Makefile.gnu

livecheck.regex <title>Source Distribution (.*) released.*</title>
