# -*- Mode: Tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:et:sw=4:ts=4:sts=4
# $Id: Portfile 67444 2010-05-10 09:52:30Z ryandesign@macports.org $

PortSystem 1.0

name            libgcrypt
version         1.4.5
categories      devel security
maintainers     sfiera openmaintainer
description     Crypto library
homepage        http://www.gnupg.org/
platforms       darwin

long_description \
    This is a general purpose cryptographic library based \
    on the code from GnuPG. It provides functions for all \
    cryptograhic building blocks: symmetric ciphers (AES, \
    DES, Blowfish, CAST5, Twofish, Arcfour), hash algorithms \
    (MD4, MD5, RIPE-MD160, SHA-1, TIGER-192), MACs (HMAC for \
    all hash algorithms), public key algorithms (RSA, ElGamal, \
    DSA), large integer functions, random numbers and a lot of \
    supporting functions.

master_sites    gnupg
use_bzip2       yes

checksums       md5     cc2017ad09b4543f8b3b5e9a53cfd89d \
                sha1    ef7ecbd3a03a7978094366bcd1257b3654608d28 \
                rmd160  5f43147cb40beb903cc1a620d2706eb08c66a889

depends_lib     port:libgpg-error

configure.args  --disable-asm

post-configure {
    if {[variant_isset universal]} {
        system "cd ${worksrcpath} && ed - ${worksrcpath}/config.h < ${filespath}/config.h.ed && touch stamp-h1"
    }
}

use_parallel_build  yes

post-destroot {
    set docdir ${prefix}/share/doc/${name}-${version}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING COPYING.LIB ChangeLog \
        NEWS README THANKS TODO VERSION ${destroot}${docdir}
}

test.run        yes
test.target     check

livecheck.type  regex
livecheck.url   ftp://ftp.gnupg.org/gcrypt/${name}/
livecheck.regex ${name}-(\\d+\\.\\d+\\.\\d+)
