# -*- 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

PortSystem      1.0
PortGroup       php 1.1

name            php-oauth
license         BSD
categories      php devel
maintainers     {ryandesign @ryandesign} {mathiesen.info:macintosh BjarneDMat}

# Compatible with PHP 8.4 as of 2.0.9
# Compatible with PHP 8.5 as of 2.0.10
php.branches    5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5
php.pecl        yes

if {[vercmp ${php.branch} >= 7.1]} {
    version     2.0.10
    revision    0
    checksums   rmd160  a4a08cf006592baf333a90d5b7f1d6d6dfeabd87 \
                sha256  1fd5e074dacf5149603493c454b476d69850bec0a71d7ea69a36a00db728a0fb \
                size    79513
} elseif {[vercmp ${php.branch} >= 7.0]} {
    version     2.0.9
    revision    0
    checksums   rmd160  cee05b0348ea4c05787c6a4e95f6d096e9ed953d \
                sha256  05fe20322256db62e7bcb5a45693ebc59829eae264f855d5b1438003ab34efe1 \
                size    79419
    patchfiles  pcre.patch
} else {
    version     1.2.3
    revision    0
    checksums   rmd160  506f0644b22323a4d1ad6794433768d83357b5ba \
                sha256  86bb5ee37afe672d4532ad784c7f711855c79f0dabf0acacafd5344ab6cf0195 \
                size    45531
}

description     oauth consumer extension

long_description \
    OAuth is an authorization protocol built on top of HTTP which allows \
    applications to securely access data without having to store usernames and \
    passwords.

if {${name} ne ${subport}} {
    depends_lib-append \
        port:gettext \
        port:curl

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        set exampledir ${prefix}/share/examples
        xinstall -d ${destroot}${docdir} ${destroot}${exampledir}
        xinstall -m 0644 -W ${worksrcpath} LICENSE ${destroot}${docdir}
        copy ${worksrcpath}/examples ${destroot}${exampledir}/${subport}
    }
}
