# -*- 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 67273 2010-05-04 06:12:51Z raphael@macports.org $

PortSystem 1.0

name		    libcryptopp
version             5.6.0
categories          devel security
platforms           darwin
maintainers         raphael openmaintainer
description         C++ class library of cryptographic schemes
long_description    Crypto++ Library is a free C++ class library of \
                    cryptographic schemes.

homepage            http://www.cryptopp.com/
master_sites        sourceforge:cryptopp \
                    ${homepage}
distname            cryptopp[strsed ${version} {g/\.//}]

checksums           md5 36f35789ad60489d58003d3c849807e8 \
                    sha1 b836783ebd72d5bc6a916620ab2b1ecec316fef1 \
                    rmd160 82e5061ec76f23643ba5477ab28bbee6eebd393a

use_zip             yes
extract.mkdir	    yes

patchfiles          patch-GNUmakefile.diff

use_configure       no

build.type          gnu
build.env-append    CXXFLAGS="${configure.cxx_archflags}"

test.run            yes
test.cmd            ./cryptest.exe
test.target         v

destroot {
    xinstall -m 755 -d ${destroot}${prefix}/include/cryptopp \
        ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 ${worksrcpath}/libcryptopp.a ${destroot}${prefix}/lib
    eval xinstall -m 644 [glob ${worksrcpath}/*.h] \
        ${destroot}${prefix}/include/cryptopp/
    xinstall -m 644 -W ${worksrcpath} Readme.txt License.txt \
        ${destroot}${prefix}/share/doc/${name}/
}

variant universal {
    build.env-delete    CXXFLAGS="${configure.cxx_archflags}"
    build.env-append    CXXFLAGS="${configure.universal_cxxflags}"
}
