# -*- 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-zip
categories-append   archivers
maintainers         {ryandesign @ryandesign} {mathiesen.info:macintosh BjarneDMat}
license             PHP-3.01

# Compatible with PHP 8.4 as of 1.22.4
php.branches        5.2 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} >= 5.4]} {
    epoch           3
    version         1.22.8
    revision        0
    checksums       rmd160  8815e27fdaa6c5fed9bc8e46076b9c76f4aedca7 \
                    sha256  9fab1f8653d40249bd433ad2c3ca02431f9a5ab06d50f988c8ec53fc6a846eef \
                    size    400881
} elseif {[vercmp ${php.branch} >= 4.3]} {
    epoch           3
    version         1.16.1
    revision        0
    checksums       rmd160  3ed87e3f8200452c0db76a6ae24de49c8dfe9176 \
                    sha256  9802a2e3941e5cb3aed1bf60b434654af520dd0ad096934d81f2d3826ff86f7e \
                    size    289776
}

description         PHP zip functions

long_description    This PHP extension lets you create, read and modify zip \
                    files.

if {${name} ne ${subport}} {
    depends_lib-append      port:libzip \
                            port:zlib

    if {[vercmp ${php.branch} < 7.4]} {
        configure.args-append --enable-zip \
                              --with-libzip=${prefix} \
                              --with-zlib-dir=${prefix}
    } else {
        depends_build-append    path:bin/pkg-config:pkgconfig

        configure.args-append --with-zip
    }
}
