# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 86268 2011-10-24 06:14:04Z ryandesign@macports.org $

PortSystem 1.0

name            zsh
version         4.2.7
revision            1
categories      shells
maintainers     nomaintainer
license         Permissive
description     Zsh is a UNIX command interpreter (shell)
long_description \
    Zsh is a UNIX command interpreter (shell) which of the standard     \
    shells most resembles the Korn shell (ksh), although it is not      \
    completely compatible. It includes enhancements of many types,      \
    notably in the command-line editor, options for customising its     \
    behaviour, filename globbing, features to make C-shell (csh) users  \
    feel more at home and extra features drawn from tcsh (another       \
    `custom' shell).

homepage        http://www.zsh.org
platforms       darwin
use_bzip2       yes
master_sites    sourceforge:project/zsh/zsh/${version} \
                  http://www.zsh.org/pub/ \
                  ftp://ftp.zsh.org/zsh/ \
                  ftp://ftp.sterling.com/zsh/ \
                  ftp://ftp.fu-berlin.de/pub/unix/shells/zsh/ \
                  ftp://ftp.iij.ad.jp/pub/misc/zsh/ \
                  ftp://ftp.icm.edu.pl/vol/wojsyl/zsh/

checksums           ${distname}${extract.suffix} \
                    rmd160  454339205c78393cbb9460aa10f37fa341a40b59 \
                    sha256  9e9987c77039677250b0383528fed9f75b1ccf5df4b9e55446a321922facc98a

depends_lib     port:libiconv port:ncurses port:gdbm
configure.args  --enable-libs="-lncurses" \
                --with-tcsetpgrp

platform darwin 8 {
    post-configure {
        reinplace "s|#define HAVE_POLL 1|#undef HAVE_POLL|" ${worksrcpath}/config.h
    }
}

variant mp_completion description {Include automatic completion of MacPorts commands} {
    post-destroot   {
        file copy -force ${filespath}/_port \
          ${destroot}${prefix}/share/${name}/${version}/functions
    }
}

variant dp_completion requires mp_completion description {Obsolete, synonymous with mp_completion} {}

variant doc description {Install documentation} {
    distfiles-append ${distname}-doc${extract.suffix}
    checksums-append ${distname}-doc${extract.suffix} \
                       md5 31e12a3e23f464a3ce3f51b45928bc44 \
                       sha1 2aef0d011abc9586f7bb9e0f2379fa48bc0dc17b \
                       rmd160 a049d7369ed3389e805a9f6b884597c2219334a0
    post-destroot {
        xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
        eval xinstall -m 644 [glob ${worksrcpath}/Doc/*.html] \
          ${destroot}${prefix}/share/doc/${name}
        eval xinstall -m 644 [glob ${worksrcpath}/Doc/*.pdf] \
          ${destroot}${prefix}/share/doc/${name}
    }
}
