# -*- 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.1 v
github.tarball_from archive
revision            0
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  2dea4d1baa35a7a8485d49c40505c11cd9d94467 \
                    sha256  755e71b7291678787afd497e34724004459add3e438d367e83891080f6d545a3 \
                    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
}
