# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 72575 2010-10-21 12:18:53Z michaelld@macports.org $

PortSystem          1.0
PortGroup           qt4 1.0

name                qca-ossl
version             2.0.0-beta3
revision            3
categories          devel crypto security
maintainers         michaelld openmaintainer
description         Qt Cryptographic Architecture - openssl plugin
long_description \
    This library provides an easy API for the following features: SSL/TLS, \
    X509, SASL, RSA, Hashing (SHA1, MD5), Ciphers (BlowFish, 3DES, AES), \
    Functionality is supplied via plugins. \
    \
    This plugin provides support for OpenSSL related ciphers.

platforms           darwin

homepage            http://delta.affinix.com/qca/
master_sites        http://delta.affinix.com/download/qca/2.0/plugins/
use_bzip2           yes

checksums           md5 bdc62c01321385c7da8d27b3902910ce \
                    sha1 dd925e8732ff76f24f9f90f4094abaf2f0ac27bf \
                    rmd160 c979c3c3427eb45e8866e28746f83966e8bcf3c2

depends_lib-append  port:qca \
                    port:openssl

# Without the patch to "qca-ossl.cpp", if MD2 isn't part of OpenSSL
# (which it is not by default as of at least version 0.9.7) then
# compiling will error out.  Upstream has already fixed this issue for
# this port; just waiting for a new release.  The patch to "configure"
# uses QCA's 'crypto.prf' file to correctly include its libraries (no
# matter how QCA is installed), instead of forcing patching of
# multiple files.
patchfiles          patch-qca-ossl.cpp.diff \
                    patch-configure.diff

# qca-ossl does not use --prefix
configure.pre_args
configure.args       --verbose             \
                     --qtdir=${qt_dir}

post-destroot {
    # fix library path of installed library/ies
    foreach fixfile [exec find ${destroot}${qt_dir} -name "*.dylib" | \
                         sed -e "s@${destroot}@@g"] {
        system "install_name_tool -id ${fixfile} ${destroot}${fixfile}"
    }
}

variant debug description \
{Build both release and debug library} \
{
    configure.args-delete --release
    configure.args-append --debug-and-release
}

variant universal {
    configure.universal_args-append --universal
}
