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


github.setup        sttz expresso 1.3.0
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0
categories          sysutils net
maintainers         {i0ntempest @i0ntempest} openmaintainer
license             MIT

description         ${name} is a command line interface to control the ExpressVPN app

long_description    {*}${description}. It uses the same native messaging interface as the \
                    open-source ExpressVPN browser extension.

checksums           rmd160  d72ec5e5da46eb3a8535369b099be016f35327e1 \
                    sha256  5cc00ffb222387c0dc19d3251b338607ccda47869af5659475779c07ad71171e \
                    size    858176

depends_build       port:msbuild
depends_lib         port:mono \
                    port:zlib

use_configure       no
build.cmd           ${prefix}/bin/msbuild
build.target        expresso.csproj
build.args          -r \
                    -p:Configuration=Release \
                    -p:TargetFrameworks=net472

post-build {
    system -W ${worksrcpath} "${prefix}/bin/mkbundle\
    -o expresso\
    --simple bin/Release/net472/expresso.exe\
    --machine-config ${prefix}/etc/mono/4.5/machine.config\
    -L bin/Release/net472/\
    -L ${prefix}/lib/mono/4.5/Facades/"
}

destroot {
    copy ${worksrcpath}/expresso ${destroot}${prefix}/bin/
    file mkdir ${destroot}${prefix}/etc/bash_completion.d/
    copy ${filespath}/expresso ${destroot}${prefix}/etc/bash_completion.d/
}
