# -*- 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 88421 2012-01-02 01:09:15Z ryandesign@macports.org $

PortSystem              1.0

name                    php5-code-coverage
set real_name           phpcov
set cap_name            PHP_CodeCoverage
version                 1.0.4
categories              php devel
maintainers             singingwolfboy openmaintainer
supported_archs         noarch
license                 BSD

homepage                https://github.com/sebastianbergmann/php-code-coverage/
master_sites            http://pear.phpunit.de/get/
distname                ${cap_name}-${version}
extract.suffix          .tgz
platforms               darwin freebsd
checksums               md5     c745b86a2eb43c06a52b813e0553c8ee \
                        sha1    eec17abdef0a580f53eb80795795c087680dd1ad \
                        rmd160  d97c80a367160c34305038ac48bcfcaf02f06dac
description             code coverage information for PHP
long_description \
    PHP_CodeCoverage is a library that provides collection, processing, and rendering \
    functionality for PHP code coverage information.

depends_lib             path:bin/php:php5 port:php5-file-iterator port:php5-token-stream \
                        port:php5-text-template

use_configure           no
build                   {}
destroot {
    reinplace "s|@php_bin@|${prefix}/bin/php|" ${worksrcpath}/${real_name}.php    
    reinplace "s|#!/usr/bin/env php|#!${prefix}/bin/php|" ${worksrcpath}/${real_name}.php
    xinstall -m 755 ${worksrcpath}/${real_name}.php ${destroot}${prefix}/bin/${real_name}

    xinstall -d ${destroot}${prefix}/lib/php
    file copy ${worksrcpath}/PHP ${destroot}${prefix}/lib/php/PHP

    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} ChangeLog.markdown ${docdir}
}

livecheck.type          regex
livecheck.url           ${homepage}/downloads
livecheck.regex         {/([0-9.]+)"}
