# -*- 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$

PortSystem          1.0
PortGroup           perl5 1.0

name                shelldap
version             1.3.1
revision            1

categories          net sysutils
license             BSD
maintainers         nomaintainer
description         a handy shell-like interface for browsing and editing LDAP entries
long_description    Shelldap is a handy shell-like interface for browsing \
                    LDAP servers and editing their content. Among its features: history, sane \
                    autocompletes, credential caching, site-wide and individual config, \
                    it's in perl, it's fun to say!  shelldap! shelldap! shelldap!

platforms           darwin
supported_archs     noarch
master_sites        http://code.martini.nu/shelldap/archive/
homepage            http://projects.martini.nu/shelldap/

# some ugly hack to fetch tarballs from mercurial
use_bzip2           yes
distname            v${version}
worksrcdir          ${name}-v${version}

checksums           rmd160  d6bd91dd4ccdbd4f98d77dd80f0e2a479cd85113 \
                    sha256  a637a3a941338b5dd6cf184e5a3d640b880ebbea7a9c90edb252f893601aea0d

perl5.branches      5.24
depends_build       port:perl${perl5.major}
depends_run         port:perl${perl5.major} \
                    port:p${perl5.major}-algorithm-diff \
                    port:p${perl5.major}-digest-md5 \
                    port:p${perl5.major}-perl-ldap \
                    port:p${perl5.major}-term-readkey \
                    port:p${perl5.major}-term-readline-gnu \
                    port:p${perl5.major}-term-shell \
                    port:p${perl5.major}-yaml-syck

post-patch {
    reinplace "s|#!.*perl|#!${perl5.bin}|" ${worksrcpath}/shelldap
}

use_configure       no

build {
    system "pod2man-${perl5.major} ${worksrcpath}/shelldap ${worksrcpath}/shelldap.1"
}

destroot {
    xinstall -m 755 ${worksrcpath}/shelldap ${destroot}${prefix}/bin/
    xinstall -m 0755 -d ${destroot}${prefix}/share/man/man1
    xinstall -m 0644 ${worksrcpath}/shelldap.1 ${destroot}${prefix}/share/man/man1
}

livecheck.url       http://code.martini.nu/shelldap/tags
livecheck.regex     {<b>v([\d.]+)</b>}