# -*- 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 101646 2013-01-16 04:02:42Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           github 1.0
PortGroup           php 1.1

github.setup        iliaal php_excel 0.9.8
name                php-excel
categories-append   textproc
platforms           darwin
maintainers         ryandesign openmaintainer
license             PHP-3.01

php.branches        5.3 5.4 5.5

description         PHP interface to LibXL for reading and writing \
                    Microsoft Excel spreadsheets

long_description    ${name} is a ${description}.

master_sites        http://ilia.ws/patch/
use_bzip2           yes
distfiles           [suffix php-excel-${version}]
worksrcdir          excel-${version}

checksums           rmd160  c3157ad62f77f291c99d2f641205d03834f3bd20 \
                    sha256  d5bb1e1c2d1b612770081a716d4e8cac25e8b31be6918eb1e310b836cac6bbe4

if {${name} != ${subport}} {
    depends_lib-append  port:libxl
    
    # libxl is Intel-only
    supported_archs     i386 x86_64
    configure.universal_archs i386 x86_64
    
    configure.args      --with-libxl-incdir=${prefix}/include/libxl-c \
                        --with-libxl-libdir=${prefix}/lib
    
    post-destroot {
        xinstall -d ${destroot}${prefix}/share/doc
        copy ${worksrcpath}/docs ${destroot}${prefix}/share/doc/${subport}
        xinstall -m 644 -W ${worksrcpath} CREDITS ChangeLog README.markdown ${destroot}${prefix}/share/doc/${subport}
    }
}

livecheck.url       ${github.raw}/master/ChangeLog
livecheck.regex     {Version ([0-9.]+)}
