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

deprecated.eol_version yes

name                aspnetcore-runtime-2.1
version             2.1.30
revision            1
categories          dotnet
license             MIT
maintainers         {@judaew judaew} openmaintainer

description         ASP.NET Core is a cross-platform .NET framework for building modern \
                    cloud-based web applications on Windows, Mac, or Linux.

long_description    .NET is a free, cross-platform, open source developer platform \
                    for building many different types of applications. \
                    \
                    With .NET, you can use multiple languages, editors, and libraries \
                    to build for web, mobile, desktop, games, and IoT.

homepage            https://dotnet.microsoft.com/
platforms           {darwin any} {darwin >= 16}
supported_archs     x86_64
distname            aspnetcore-runtime-${version}-osx-x64
master_sites        https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/${version}/

checksums           rmd160  81ab5d19c9214c28e332548bc24ed5aa13c12331 \
                    sha256  ce0128b83be40489ec6d4a31064f124dd03eeb7be3702807968ccdbed83964dd \
                    size    58527631

worksrcdir          ${name}-${version}
extract.mkdir       yes

use_configure       no

depends_run         port:dotnet-cli \
                    port:dotnet-runtime-2.1

build {}

destroot {
    set dotnet_home ${prefix}/share/dotnet
    set extra_rt_dir /shared/Microsoft.AspNetCore.All
    set runtime_dir /shared/Microsoft.AspNetCore.App
    xinstall -d ${destroot}${dotnet_home}${extra_rt_dir}
    xinstall -d ${destroot}${dotnet_home}${runtime_dir}

    move ${worksrcpath}${extra_rt_dir}/${version} ${destroot}${dotnet_home}${extra_rt_dir}
    move ${worksrcpath}${runtime_dir}/${version} ${destroot}${dotnet_home}${runtime_dir}
}

livecheck.type      regex
livecheck.url       https://dotnet.microsoft.com/download/dotnet/2.1
livecheck.regex     "ASP.NET Core Runtime (\\d+(?:\\.\\d+)*)"
