# -*- 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
PortGroup           elisp 1.0

github.setup        cask cask 0.9.0 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            1
description         Project management tool for Emacs
long_description    Cask is a project management tool for Emacs that helps \
                    automate the package development cycle\; development, \
                    dependencies, testing, building, packaging and more. \
                    Cask can also be used to manage dependencies for your \
                    local Emacs configuration.
platforms           any
supported_archs     noarch
categories          devel
license             GPL-3+
maintainers         {amake @amake} openmaintainer

checksums           rmd160  0eac71f2c4aef38769c9792f48657dacf037126b \
                    sha256  012c63ed08e43c9e6d0d5fb63118ce21905d88ccddf17274e49a41639af2de8f \
                    size    280631

use_configure       no

build {}

destroot {
    set trgdir ${destroot}${prefix}/share/${name}

    xinstall -d ${trgdir}

    xinstall -d ${trgdir}/bin
    xinstall -m 0755 ${worksrcpath}/bin/cask ${trgdir}/bin/cask
    xinstall {*}[glob ${worksrcpath}/*.el] ${trgdir}
    xinstall -d ${trgdir}/package-build
    xinstall {*}[glob ${worksrcpath}/package-build/*.el] ${trgdir}/package-build

    ln -s ${prefix}/share/${name}/bin/cask ${destroot}${prefix}/bin

    xinstall -d ${destroot}${emacs_lispdir}
    ln -s ${prefix}/share/${name}/cask.el ${destroot}${emacs_lispdir}/cask.el
    ln -s ${prefix}/share/${name}/cask-bootstrap.el ${destroot}${emacs_lispdir}/cask-bootstrap.el

    # Prevent from self-updating
    touch ${trgdir}/.no-upgrade
}