Sergey,

I’ve edited those parts:

# -*- 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            unit
version         1.25.0
categories      www
platforms       darwin
license         Apache-2
maintainers     osokin

description     Dynamic web application server

long_description \
    NGINX Unit is a dynamic web application server, designed \
    to run applications in multiple languages.  Unit is lightweight, \
    polyglot, and dynamically configured via API.  The design of the \
    server allows reconfiguration of specific application parameters \
    as needed by the engineering or operations.

homepage        https://unit.nginx.org/

master_sites    https://unit.nginx.org/download/

checksums       sha256  
4ab4f05a934dd00628c0e067f7d0c5ba62bb55e9e2e7a333fa3764a180b9765d \
                size    853280 \
                rmd160  d08da7f6404e3fad4a69f31ba203cc9a3b69024c

depends_lib     port:pcre2 \
                port:zlib

set unit_vardir         ${prefix}/var
set unit_dbdir          ${unit_vardir}/db/${name}
set unit_logdir         ${unit_vardir}/log/${name}
set unit_logfile        ${unit_logdir}/${name}.log
set unit_rundir         ${unit_vardir}/run/${name}
set unit_pidfile        ${unit_rundir}/${name}.pid
set unit_sockfile       ${unit_rundir}/control.unit.sock
set unit_tmpdir         ${unit_vardir}/tmp/${name}
set unit_moddir         ${prefix}/libexec/${name}/modules

configure.args  --prefix=${prefix} \
                --log=${unit_logfile} \
                --modules=libexec/${name}/modules \
                --pid=${unit_pidfile} \
                --state=${unit_dbdir} \
                --tmp=${unit_tmpdir} \
                --user=_www \
                --group=_www

default_variants        +debug +ssl

destroot.keepdirs       ${destroot}${unit_moddir}

subport ${name} {
    post-destroot {
        xinstall -d -m 755 ${destroot}${unit_dbdir}
        xinstall -d -m 755 ${destroot}${unit_logdir}
        xinstall -d -m 755 ${destroot}${unit_rundir}
        xinstall -d -m 755 ${destroot}${unit_tmpdir}
    }
}
    
subport ${name}-perl {
    description         Perl module for NGINX Unit

    long_description    {*}${description}

    depends_run         port:unit

    post-configure {
        system -W ${worksrcpath} "${configure.cmd} perl"
    }

    build {
        system -W ${worksrcpath} "${build.cmd} perl"
    }

    destroot {
        xinstall -d -m 755 ${destroot}${unit_moddir}
        xinstall    -m 644 ${worksrcpath}/build/perl.unit.so 
${destroot}${unit_moddir}/
    }
}

subport ${name}-python {
    description         Python module for NGINX Unit

    long_description    {*}${description}

    depends_run         port:unit

    post-configure {
        system -W ${worksrcpath} "${configure.cmd} python"
    }

    build {
        system -W ${worksrcpath} "${build.cmd} python"
    }

    destroot {
        xinstall -d -m 755 ${destroot}${unit_moddir}
        xinstall -m 644 ${worksrcpath}/build/python.unit.so 
${destroot}${unit_moddir}/
    }
}

subport ${name}-ruby {
    description         Ruby module for NGINX Unit

    long_description    {*}${description}

    depends_run         port:unit

    post-configure {
        system -W ${worksrcpath} "${configure.cmd} ruby"
    }

    build {
        system -W ${worksrcpath} "${build.cmd} ruby"
    }

    destroot {
        xinstall -d -m 755 ${destroot}${unit_moddir}
        xinstall -m 644 ${worksrcpath}/build/ruby.unit.so 
${destroot}${unit_moddir}/
    }
}

startupitem.create      yes
startupitem.pidfile     auto ${unit_pidfile}
startupitem.executable  ${prefix}/sbin/unitd

variant debug description "Enable debug logging" {
    configure.args-append   --debug
}

variant ssl description "Support secure connections using OpenSSL" {
    depends_lib-append      path:lib/libssl.dylib:openssl
    configure.args-append   --openssl
}


On Sep 24, 2021, at 1:49 PM, Sergey A. Osokin <[email protected]> wrote:

Hi Marius,

thanks for your comments, the Portfile has been updated, attached.

On Fri, Sep 24, 2021 at 01:13:15PM -0500, Marius Schamschula wrote:
Sergey,

A quick scan of the Portfile shows some whitespace inconsistencies: We prefer to use spaces, rather than tab stops.

Instead of using ${description},  use {*}${description}, it’s a tcl thing!

This suggestion is unclear to me, could you provide an example how to
utilize that, thanks.

No need for "post-destroot {}” in the various supports, if you put post-destroot inside a subport ${name} block. Same for “startupitem.create no"

Fixed, thanks.

On Sep 24, 2021, at 12:49 PM, Sergey A. Osokin <[email protected]> wrote:

Hi,

hope you're doing well these days.

I'm working on the NGINX Unit port and created my first version
of the Portfile, and it's attached.

NGINX Unit supports mostly all versions of:
- perl
- php
- python
- ruby
and other languages, so I'm interested how to support all of
those with macports.

Could you please provide your comments and guidance.

--
Sergey Osokin
<Portfile.txt>

Marius
--
Marius Schamschula



Reply via email to