# -*- 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 118762 2014-04-10 20:46:01Z cal@macports.org $

PortSystem          1.0
PortGroup           cmake 1.0

name                libssh
epoch               1
version             0.6.3
set major           [join [lrange [split ${version} .] 0 1] .]
categories          devel security net
platforms           darwin
maintainers         cal openmaintainer
license             LGPL-2.1

description         an SSH library

long_description    The ssh library was designed to be used by \
                    programmers needing a working SSH implementation \
                    by the mean of a library.

homepage            http://www.libssh.org
use_xz              yes
master_sites        https://red.libssh.org/attachments/download/87

checksums           rmd160  d3128d39264d86044617ab8f2dd9d43ba22f00ac \
                    sha256  2bb5d7c595059f990a8915c190169257328ffa828ced0c05b09bbe186092cacb

depends_build-append \
                    port:pkgconfig

depends_lib         port:openssl \
                    port:zlib

post-extract {
    file mkdir ${workpath}/build
}

# standard post-arg, where to find the primary CMakeLists.txt file.
configure.post_args ../${distname}
configure.dir       ${workpath}/build
# clear configure.cppflags to prevent the cmake portgroup from adding them to
# cflags, which breaks the build in presence of an older version, because it
# puts -I$prefix/include before the local include directories of the port
configure.cppflags
configure.args-append \
                    -DWITH_GCRYPT=OFF \
                    -DWITH_INTERNAL_DOC=OFF \
                    -DWITH_LIBZ=ON
build.dir           ${workpath}/build

livecheck.type      regex
livecheck.url       http://git.libssh.org/projects/libssh.git/refs/
livecheck.regex     ${name}-(\\d+\\.\\d+(\\.\\d+)+)
