# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem                      1.0
PortGroup                       github 1.0
PortGroup                       php 1.1

name                            php-APCu
categories-append               devel
maintainers                     {ryandesign @ryandesign} {mathiesen.info:macintosh @BjarneDMat} openmaintainer
license                         PHP-3.01

# Compatible with PHP 8.4 as of 5.1.24
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

description                     APC User Cache
long_description                APCu contains the user-level functionality from APC

github.tarball_from archive

if {[vercmp ${php.branch} >= 7.0]} {
    github.setup                krakjoe apcu 5.1.28 v
    revision                    0
    checksums                   rmd160  21401dcd454cba71481a0f744b974961623ea7b9 \
                                sha256  0e60ba9d0fa4021c57a70c071f3d8f71de236275d084e560d5959fec4edd8c32 \
                                size    95484
} else {
    github.setup                krakjoe apcu 4.0.11 v
    revision                    0
    checksums                   rmd160  dd5dfdf8768e7af9803d6e2409b954d6a40af202 \
                                sha256  bf1d78d4211c6fde6d29bfa71947999efe0ba0c50bdc99af3f646e080f74e3a4 \
                                size    126760
}

if {${name} ne ${subport}} {
    # remove w/ next update
    dist_subdir                 ${name}/${version}_1

    if {${php.branch} in {5.3 5.4 5.5 5.6}} {
        conflicts-append        ${php}-xcache
    }
    if {${php.branch} in {5.3 5.4}} {
        conflicts-append        ${php}-APC
    }
    if {${php.branch} in {5.3}} {
        conflicts-append        ${php}-eaccelerator
    }

    distname        apcu-${version}

    configure.args-append       --enable-apcu-spinlocks

    use_parallel_build          yes
}
