# -*- 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 84550 2011-09-27 21:05:11Z snc@macports.org $

PortSystem          1.0
PortGroup           qt4 1.0

name                qca-cyrus-sasl
version             2.0.0-beta3
revision            2
categories          devel crypto security
maintainers         michaelld openmaintainer
description         Qt Cryptographic Architecture - cyrus-sasl 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 cyrus sasl2 related chipers

platforms           darwin

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

checksums           md5 db51df751478f60416659809e11990fd \
                    sha1 b3c1153d91c5de52c58dd403ddde43cb022b599a \
                    rmd160 5cadeb9234932ea6442ea696a9451b1f060d50b9

depends_lib         port:qca \
                    port:cyrus-sasl2

# 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-configure.diff

# qca-gnupg does not use --prefix
configure.pre_args
configure.args       --verbose             \
                     --qtdir=${qt_dir}     \
                     --with-sasl-inc=${prefix}/include

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
}
