# -*- 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/cloudflare/utahfs 1.0 v
# Delete this on next update to use golang PortGroup's default ('archive')
github.tarball_from tarball

description         UtahFS is an encrypted storage system that provides a \
                    user-friendly FUSE drive backed by cloud storage.

long_description    UtahFS is a state-of-the art encrypted storage solution, \
                    meant to be similar to Dropbox. It has a FUSE binding \
                    that creates a synthetic drive on the user's computer \
                    that they can interact with like an external hard-drive. \
                    Files stored in the drive are uploaded to a cloud storage \
                    provider, which means the drive will never run out of \
                    space and minimizes the likelihood of any files being \
                    lost. However the files are encrypted such that the cloud \
                    storage provider knows almost nothing about what's being \
                    stored.

maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  ab2be9503748d5fd9469b2e6159cdb1316c8db8b \
                    sha256  923faaf13d25a530ca9dd27a4e962789b0585696a0509c946b18e08378b6cad6 \
                    size    8112370

categories          fuse net
license             BSD
platforms           darwin
installs_libs       no

set utahfs_targets  { utahfs-client utahfs-server utahfs-web }

set utahfs_doc_dir  ${prefix}/share/doc/${name}

build.cmd           "for target in ${utahfs_targets}; do
                        ${build.cmd} -v -o ./\${target} github.com/cloudflare/utahfs/cmd/\${target}
                    done"

destroot {
    foreach build_target $utahfs_targets {
        xinstall -m 755 ${worksrcpath}/${build_target} ${destroot}${prefix}/bin/${build_target}
    }

    xinstall -d -m 755 ${destroot}${utahfs_doc_dir}
    copy {*}[glob ${worksrcpath}/docs/*] ${destroot}${utahfs_doc_dir}
}

notes "
    Refer to ${utahfs_doc_dir}/README.md for instructions on setting up UtahFS.
"
