# $Id: Portfile 36651 2008-05-09 11:30:05Z nox@macports.org $

PortSystem      1.0

name            ccache
version         2.4
revision        2
categories      devel
maintainers     nox
description     object-file caching compiler wrapper

long_description \
    ccache is a compiler cache.  It acts as a caching pre-processor to C/C++ \
    compilers, using the -E compiler switch and a hash to detect when a \
    compilation can be satisfied from cache.  This often results in a 5 to 10 \
    times speedup in common compilations.

homepage        http://ccache.samba.org/
platforms       darwin freebsd
master_sites    http://samba.org/ftp/ccache/

checksums       md5 73c1ed1e767c1752dd0f548ec1e66ce7 \
                sha1 9833ec13de9b90d5409e60d679ac681115ef465e \
                rmd160 43a0647c7faf659121a53a92ec45d245b8140124

configure.args  --mandir=${prefix}/share/man

use_parallel_build  yes

set symlinks_dir    ${prefix}/libexec/ccache

post-destroot {
    file mkdir ${destroot}${symlinks_dir}

    foreach {bin} {
	    cc
	    gcc gcc2    gcc3    gcc-3.3 gcc-4.0
	    c++ c++3    c++-3.3 c++-4.0
	    g++ g++2    g++3    g++-3.3 g++-4.0
    } {
        ln -sf ${prefix}/bin/ccache ${destroot}${symlinks_dir}/${bin}
    }

    set docdir ${prefix}/share/doc/${name}-${version}
    xinstall -d ${destroot}${docdir}/html
    xinstall -m 0644 -W ${worksrcpath} COPYING README ${destroot}${docdir}
    eval xinstall -m 0644 [glob ${worksrcpath}/web/*.html] ${destroot}${docdir}/html
}

post-activate {
    ui_msg "The ccache symlinks are installed in ${symlinks_dir}"
}
