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

go.setup            github.com/francoismichel/ssh3 0.1.7 v
categories          net
maintainers         {i0ntempest @i0ntempest} openmaintainer
license             Apache-2

description         faster and rich secure shell using HTTP/3
if {${name} eq ${subport}} {
    description-append \
                    - client program
}
long_description    ${name} is a complete revisit of the SSH protocol, mapping its semantics on top of the HTTP mechanisms.\
                    In a nutshell, ${name} uses QUIC+TLS1.3 for secure channel establishment and the HTTP Authorization mechanisms\
                    for user authentication.

checksums           ${distname}${extract.suffix} \
                        rmd160  2158c1f976ad4db62e0cbe12304adde155799913 \
                        sha256  8c579d48b9847cf3f0fcc4902e90cf8a942824215c5af0bccf4c9e02f5f3cf57 \
                        size    1847063

go.vendors          gopkg.in/yaml.v3 \
                        lock    v3.0.1 \
                        rmd160  e85ac1368fb7f9ef945b7fd7bd608a1f0d261c12 \
                        sha256  f3ea6be3f405ec25f8799773355aba54f8831d11f5315a01155bdc69b92eca7b \
                        size    91208 \
                    gopkg.in/check.v1 \
                        lock    788fd7840127 \
                        rmd160  b63165c8909a27edc15dda210df66a1b49efb49e \
                        sha256  7e5547c6471cc48da89a7c87f965b20ca5311f43fc4d883ca62f9fccf7551630 \
                        size    31597 \
                    google.golang.org/protobuf \
                        repo    github.com/protocolbuffers/protobuf-go \
                        lock    v1.31.0 \
                        rmd160  2a79f7c0fd76cecaf9c25e53ad925b9e8fb5f8dc \
                        sha256  57f5c0096053ab69a9a74f2d815d23a25d6a1efcfc2f21ed92d7d8acf38bbfb1 \
                        size    1312091 \
                    google.golang.org/appengine \
                        repo    github.com/golang/appengine \
                        lock    v1.6.8 \
                        rmd160  ae71ed03d1b453ad1561ef937c69a909da53525e \
                        sha256  add6a354e7031705b39bdb1795ca064107038011f060460a23001dd339b41aac \
                        size    628767 \
                    golang.org/x/tools \
                        lock    v0.12.0 \
                        rmd160  6af4f538fa7fadf295cd03e9c53842f84f1a97c0 \
                        sha256  c7052df5ed927894e61d94b19632473c834ed2a9a42fc176ba97d4755bedf2f0 \
                        size    3456539 \
                    golang.org/x/text \
                        lock    v0.14.0 \
                        rmd160  e26a72d542901d19f6dde4e07746f72206fb8701 \
                        sha256  ef54709caaafdd8b27ce3d5f7c53408f11bc5fd1688c1c4f328de8ed268b3188 \
                        size    8972503 \
                    golang.org/x/term \
                        lock    v0.15.0 \
                        rmd160  55c1bd4787d58c6d2ea19a1ba3a3ccd6b091fa14 \
                        sha256  747ef42b61096cc3e763ec084a821c789b464cbe51e043bebf0d9af75a062972 \
                        size    14740 \
                    golang.org/x/sys \
                        lock    v0.15.0 \
                        rmd160  84270c5ffe3cd1540ccf8b8f19120cbdb117f848 \
                        sha256  183f3870369e62e0ecaf378b5ef3d335e7fcebfd3ebfb81a0576b424a941476f \
                        size    1443915 \
                    golang.org/x/oauth2 \
                        lock    v0.13.0 \
                        rmd160  876010270a936a1df6893b2e616aaeac996bb6a7 \
                        sha256  2f4c22ab6f164d516b7de944c6ab14c3b26f522ee412ec6a424695376288809d \
                        size    94741 \
                    golang.org/x/net \
                        lock    v0.17.0 \
                        rmd160  3e1d150fbede0be1af1b248e536930de2446ef0e \
                        sha256  6bb73c8f9eef753cab2b18d4af7893ff955b4427c6d34c8f4d7c9127d09abcc0 \
                        size    1456371 \
                    golang.org/x/mod \
                        lock    v0.12.0 \
                        rmd160  cb4748b4ac933d04f5b0fbbcea18704996acf815 \
                        sha256  862b0f7fade1457270ea33b26cebe3c2c6918f15f5fe40f9ee32335440ef05fe \
                        size    123221 \
                    golang.org/x/exp \
                        lock    47842c84f3db \
                        rmd160  b9ca1292f45aa137251dd52c3cc8a90c3571bf77 \
                        sha256  b6849c2b037b72c14854454f36bf455d0f723dcc129ba3fd6fd3959a824cf22c \
                        size    1606951 \
                    golang.org/x/crypto \
                        lock    v0.17.0 \
                        rmd160  b42d588c4aa930e1d70d67b75a9a3f20a613536e \
                        sha256  a559bc5b604090ff2ad6040e8207d79a969ff3017f9e61d2eb0df774ae3b47f4 \
                        size    1809435 \
                    go.uber.org/zap \
                        repo    github.com/uber-go/zap \
                        lock    v1.24.0 \
                        rmd160  16338afaf0e1337cf190307118fdfeeda62fa95b \
                        sha256  33974afe73302d90cd2176c8e91fa0f9b983274a82228612f7be8a6b4b88d728 \
                        size    168349 \
                    go.uber.org/multierr \
                        repo    github.com/uber-go/multierr \
                        lock    v1.11.0 \
                        rmd160  ae2a9f099696f51fd43d3f3815f75dab4b31f43b \
                        sha256  31a69a354aa218d2dc999fa7d22a68bbb67fe98c8b0b673046abfcef6502f6cb \
                        size    16914 \
                    go.uber.org/mock \
                        repo    github.com/uber-go/mock \
                        lock    v0.3.0 \
                        rmd160  7b9b9c0ed439ec2b808aeb310ebc4d289b9393e0 \
                        sha256  30a2ef2baa396e828967ba03174ce59abb2ea71b7fa37f8dcd10656854b46dfd \
                        size    85881 \
                    go.uber.org/atomic \
                        repo    github.com/uber-go/atomic \
                        lock    v1.11.0 \
                        rmd160  3d0bf943875bc8172e614fd385b8bba0d131c419 \
                        sha256  d89da116bf6fed99263a25d53108760263bf79d6b1a18fc7ea02b29851cafa7d \
                        size    24312 \
                    github.com/zeebo/blake3 \
                        lock    v0.2.3 \
                        rmd160  9786a3b0afcaeccb9fd1c602cc464f83a06ef556 \
                        sha256  9d19ce0e1513c70b179f98fe9f84b6cbf0fda25236ff8cdb6b2c80b73c74f9e3 \
                        size    110886 \
                    github.com/stretchr/testify \
                        lock    v1.7.0 \
                        rmd160  adae5096e8c4cfcc8e3f6d096646d1165b5ef49a \
                        sha256  f7dde97d0c9634483ae6ea273968f80f3105c22382a1f841886cd20d57586642 \
                        size    91096 \
                    github.com/rs/zerolog \
                        lock    v1.31.0 \
                        rmd160  e71230e910aceaa86f3eeafb5194086ef91a58ea \
                        sha256  31c6480b2c626c2691875d89ba4193bb947a077536ba7dfba753a01524621860 \
                        size    170453 \
                    github.com/rogpeppe/go-internal \
                        lock    v1.9.0 \
                        rmd160  acb8f644e5634bdae632cdb61ea736422aeb88f0 \
                        sha256  65b0852e5c78fa920fef2176fa17180bf1f7f32a1163baacb44c2aa480845a16 \
                        size    133682 \
                    github.com/quic-go/quic-go \
                        lock    1083d1fb8f98 \
                        rmd160  3865c82635342416e2c39e661535213a9c87d20a \
                        sha256  e2a7f3f1da7966d6107d93606ad85e04ef97d86bc94425d14fbde6b37245b06f \
                        size    592339 \
                    github.com/quic-go/qpack \
                        lock    v0.4.0 \
                        rmd160  6332ffe83d94fc508a7298ae176db4b2205e7c9e \
                        sha256  7db52856f1245233d23a54de874bd2d2f79fb8f959c7af15ad07c777b2967bf0 \
                        size    41810 \
                    github.com/pmezard/go-difflib \
                        lock    v1.0.0 \
                        rmd160  fc879bfbdef9e3ff50844def58404e2b5a613ab8 \
                        sha256  7cd492737641847266115f3060489a67f63581e521a8ec51efbc280c33fc991f \
                        size    11409 \
                    github.com/onsi/gomega \
                        lock    v1.29.0 \
                        rmd160  76859a916cc98e2a5fcb0263ff0f91d8e172ec39 \
                        sha256  4adc9fbb115669086b504da9392b9d6ad846ed11b638fceed1c68928bde9b2c4 \
                        size    314820 \
                    github.com/onsi/ginkgo \
                        lock    v2.13.0 \
                        rmd160  d8ff53f9360cba651ee1197bdbbc6a73bed85094 \
                        sha256  01267dceef2d52e342fb5e658d7af5f44f4a9cfb8a355263a972bf836a9a5965 \
                        size    628541 \
                    github.com/miekg/dns \
                        lock    v1.1.55 \
                        rmd160  74fcf61d430158d43deebad5a3ba5469522b444f \
                        sha256  989d30c90e45d7ddd8290b084ab71ca9542819aeb2f8ad214674c0fd51b81056 \
                        size    212453 \
                    github.com/mholt/acmez \
                        lock    v1.2.0 \
                        rmd160  305d374a785f2e9721c2bb5c96ff25dc59cfaa17 \
                        sha256  dbfe6297d65e6a03383041c9b8a6589e708c799c21e27cb50b4cc209d6f89a3a \
                        size    58315 \
                    github.com/mattn/go-isatty \
                        lock    v0.0.19 \
                        rmd160  8f61f923ba80435627c12d4fca2f6c58b27067ae \
                        sha256  22af5e131d9b7a23dd6fef5a6bc78b229942583ce2581dade4bada0a65741289 \
                        size    4686 \
                    github.com/mattn/go-colorable \
                        lock    v0.1.13 \
                        rmd160  c9e8ab9d0773c0984f36235e3c9f8c033552ac1a \
                        sha256  0cd9a951799c1a9f999df56e4b020170fa887456049c274aae6262d9ae3f7424 \
                        size    9778 \
                    github.com/libdns/libdns \
                        lock    v0.2.1 \
                        rmd160  7cd2eb2452f9767d17aac199550e8fd4b2076ffb \
                        sha256  66022788fd014e2d6da6ef43eb7360d5adc6d59b635f93f601b3415c6720a9be \
                        size    5833 \
                    github.com/kr/text \
                        lock    v0.2.0 \
                        rmd160  48558c7e8ff67d510f83c66883907e95f4783163 \
                        sha256  2f2e21ac8a9d523e88cbba4039441defc4a66bfaa78811c900a88fcf28729c4c \
                        size    8702 \
                    github.com/kr/pretty \
                        lock    v0.3.1 \
                        rmd160  8c08579b4c56cdc958794e77afe3413e80aa67c3 \
                        sha256  7fcea475d6280976cf4a838e75d2b3a4105827316e588a80e49e8063d950c999 \
                        size    10232 \
                    github.com/klauspost/cpuid \
                        lock    v2.2.5 \
                        rmd160  89c4d44312008cdcb6dc4bde13f584cf4090712d \
                        sha256  9f5b91aca8bda49eedfaba2a420497d44e65e6969794e156b7de74ce72398d2f \
                        size    456004 \
                    github.com/kevinburke/ssh_config \
                        lock    v1.2.0 \
                        rmd160  e78b94adc76e62669ba18a035e00a82522589503 \
                        sha256  310397a3642b93ef18f6e081e3cdb8c4e9843562fc0bea94e434b618b811fb9a \
                        size    20596 \
                    github.com/google/pprof \
                        lock    94a9f03dee38 \
                        rmd160  e728af72a4110b42a442fe29bf8cd4967386639e \
                        sha256  7116f40c307a24d35322ac240b05232762c01b9c3488012b8f08b723f417e29c \
                        size    1718487 \
                    github.com/google/go-cmp \
                        lock    v0.6.0 \
                        rmd160  2c9f5dab93f8a0895591466fe4a07c5dd9166ae2 \
                        sha256  0d550825fae514f8a947ab7e42fcb874f509d9cbfa3ad2711d7570a25f31571a \
                        size    104795 \
                    github.com/golang/protobuf \
                        lock    v1.5.3 \
                        rmd160  b4e09ad842f6dcd3aea36b28ec64d6d9563fd1d8 \
                        sha256  12e830fab630cabd279fca57e7089eeb1556e2c22b58eee64bb21bd3c8dfc706 \
                        size    171856 \
                    github.com/golang-jwt/jwt \
                        lock    v5.0.0 \
                        rmd160  edaf32668493eef7d9f57ce8ccb3d162ffa0f90c \
                        sha256  0cac6b69e1e4c6998fdb1fc549e60ba19bc87019f1b260b2881fa25e0a60fbf1 \
                        size    60319 \
                    github.com/go-task/slim-sprig \
                        lock    52ccab3ef572 \
                        rmd160  12ad1a072801a204a68c464918417611ec20f218 \
                        sha256  0f2045c6c2eb3042b20de955018ca01c0165ed205345312a5e7cb4d6f5254a36 \
                        size    39951 \
                    github.com/go-logr/logr \
                        lock    v1.2.4 \
                        rmd160  94910286621a7f24eba0cd12b63eead604ab601d \
                        sha256  2d804ca08d9e9d281dad5aa95e0a6595dc9f5b5e21cb5a923ba3356225d59e2d \
                        size    40539 \
                    github.com/go-jose/go-jose \
                        lock    v3.0.1 \
                        rmd160  7c4464b71c600e7aca5e18258866718885e4cdce \
                        sha256  91c23274488c2863e73265c245a341cd4f50a29d08655bfa4e0383939c1cd5d6 \
                        size    315553 \
                    github.com/davecgh/go-spew \
                        lock    v1.1.1 \
                        rmd160  7c02883aa81f81aca14e13a27fdca9e7fbc136f7 \
                        sha256  e85d6afa83e64962e0d63dd4812971eccf2b9b5445eda93f46a4406f0c177d5f \
                        size    42171 \
                    github.com/creack/pty \
                        lock    v1.1.18 \
                        rmd160  7ba5c3871eab7e529a05dc65ddc2a68c9daa6017 \
                        sha256  19cd1eaadd9f3218dc3e71483833a979c245090b5e64512a9d4cf4acf22f3112 \
                        size    10671 \
                    github.com/coreos/go-oidc \
                        lock    v3.7.0 \
                        rmd160  d98f4b602d1fc263f21775670d06f06f2b162328 \
                        sha256  45516dde0a44d467405f001f0cdd7e39e33202df7d1deff43d364dc94a513923 \
                        size    32925 \
                    github.com/caddyserver/certmagic \
                        lock    v0.20.0 \
                        rmd160  ddc648a6ffdbfb2fc795cf344d92af296315b369 \
                        sha256  c097a6aa9c054fcb43d1bdba0e9e2eb5287adfe529f0dd1d0baad5d8be79dbce \
                        size    116904

# Notes for updating this port:
# Replace github.com/uber/mock with github.com/uber-go/mock

build.env-append    CGO_ENABLED=0
build.args          -o ./${subport}
build.dir           ${worksrcpath}/cmd/${subport}

notes-append "
    This port does not implement SSH version 3. Upstream is aware of the naming issue and is working on a new name.
    See https://github.com/francoismichel/ssh3/issues/61 for more info.
"

subport ${name}-server {
    description-append  - server program
    build.env-replace   CGO_ENABLED=0 CGO_ENABLED=1

    startupitem.create  yes
    startupitem.install no
    startupitem.name    ${subport}-example
    startupitem.executable \
                        ${prefix}/bin/${subport} -bind \[::\]:8443 -cert ${prefix}/etc/certs/cert.pem -key ${prefix}/etc/certs/priv.key

    notes-append ""
    notes-append "
        Launchd script created at ${prefix}/etc/LaunchDaemons/org.macports.${subport}-example/org.macports.${subport}-example.plist\
        is meant to be an example and is therefore not installed.
        Copy this file to /Library/LaunchDaemons, and edit it to suit your needs.
    "
}

destroot {
    xinstall -m 0755 ${build.dir}/${subport} ${destroot}${prefix}/bin/
}
