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

name                postfixadmin
version             3.2
categories          www mail php
license             GPL-2+
maintainers         nomaintainer

set php_version     73

description         Web Based Management tool for Postfix
long_description    Postfix Admin is a Web Based Management tool created for Postfix. It is \
                    a PHP based application that handles Postfix Style Virtual Domains and \
                    Users that are stored in MySQL.
homepage            http://postfixadmin.sourceforge.net/
master_sites        sourceforge:project/${name}/${name}/${name}-${version}

platforms           any
depends_run         port:apache2 \
                    port:php${php_version} \
                    port:postfix

checksums           rmd160  fb7160411fc2ea3e2da41271e03e45bb73103b02 \
                    sha256  866d4c0ca870b2cac184e5837a4d201af8fcefecef09bc2c887a6e017a00cefe \
                    size    1324335

use_configure       no

build               {}
supported_archs     noarch

destroot {
    set docpath ${destroot}${prefix}/www/${name}
    xinstall -m 0755 -d ${docpath}/html
    file copy {*}[glob ${workpath}/${distname}/*] ${docpath}/html
}

default_variants    +mysql8

variant mysql8 description "use mysql8 for the db backend" {
    depends_run-append \
                    port:mysql8 \
                    port:php${php_version}-mysql
} 

variant mariadb102 description "use mariadb-10.2 for the db backend" {
    depends_run-append \
                    port:mariadb-10.2 \
                    port:php${php_version}-mysql
} 

variant postgresql11 description "use postgresql11 for the db backend" {
    depends_run-append \
                    port:php${php_version}-postgresql \
                    port:postgresql11
} 

notes "
When upgrading from any earlier version, you'll need to adjust your
webserver config, because the public facing stuff has been moved 
one directory deeper into public/, in order to stop exposing
templates_c/ etc. to the world.
"
