# -*- 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           perl5 1.0

name                shelldap
version             1.3.2
revision            3

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!

supported_archs     noarch
platforms           any
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  f21c8b7e7fb358363a45632f27d5f62f08438e48 \
                    sha256  f863c5abe1b2411d6eac14d0754f7fa1466d17e1f1db2373a092b3dece972d60

perl5.branches      5.34
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>}
