# -*- 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
# $Id: Portfile 119136 2014-04-18 01:03:11Z ryandesign@macports.org $

PortSystem      1.0

name            tmux
version         1.9a
revision        1
categories      sysutils
maintainers     evermeet.cx:tessarek
description     terminal multiplexer
long_description \
    tmux is a \"terminal multiplexer\", it enables a number of terminals \
    (or windows) to be accessed and controlled from a single terminal. \
    tmux is intended to be a simple, modern, BSD-licensed alternative \
    to programs such as GNU screen.
homepage        http://tmux.sourceforge.net/
platforms       darwin
license         BSD
master_sites    sourceforge:project/tmux/tmux/tmux-1.9

checksums       rmd160  29ae5f12aa71ee800643fb2df23573bee83f5965 \
                sha256  c5e3b22b901cf109b20dab54a4a651f0471abd1f79f6039d79b250d21c2733f5

depends_lib     port:libevent port:ncurses

post-destroot {
    xinstall -m 0755 -d ${destroot}${prefix}/share/doc/tmux
    foreach file [glob ${worksrcpath}/examples/*.conf] {
        xinstall -m 0644 $file ${destroot}${prefix}/share/doc/tmux
    }
    xinstall -m 0755 -d ${destroot}${prefix}/share/vim/vimfiles/syntax
    xinstall -m 0644 ${worksrcpath}/examples/tmux.vim ${destroot}${prefix}/share/vim/vimfiles/syntax
    xinstall -m 0755 -d ${destroot}${prefix}/share/vim/vimfiles/ftdetect
    xinstall -m 0644 ${filespath}/ftdetect-tmux.vim ${destroot}${prefix}/share/vim/vimfiles/ftdetect/tmux.vim
}

variant screen description "behave more like screen" {
    post-destroot {
        xinstall -m 0644 ${worksrcpath}/examples/screen-keys.conf ${destroot}${prefix}/etc/tmux.conf
    }
}

notes "If you want integration with system pasteboard consider installing port tmux-pasteboard as well"

livecheck.type  regex
livecheck.url   ${homepage}
livecheck.regex ${name}-(\[0-9\]+\\.\[0-9a-z\]+)${extract.suffix}
