# -*- 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
description basic cryptographic facilities for Lua 5.1
long_description MD5 offers basic cryptographic facilities for Lua 5.1: a hash (digest) \
function, a pair crypt/decrypt based on MD5 and CFB, and a pair \
crypt/decrypt based on DES with 56-bit keys.
homepage http://www.keplerproject.org/md5
master_sites http://luaforge.net/frs/download.php/3355/
checksums md5 68874cff64547f2157d5ecdc3572b544 \
sha1 f6c2ee21faf94c6ee95fc767ef2fdf0cf0382dc9 \
rmd160 bd74bc5eddf3167ff0d64b72be0ad428331399a7
patchfiles patch-config.diff \
patch-tests-DES56-Makefile.diff
file copy {*}[glob -directory ${worksrcpath}/src des56.{h,c}] ${worksrcpath}/tests/DES56
# clang doesn't support -O6
if {[vercmp $xcodeversion 4.1] >= 0} {
reinplace "s| -O6||" ${worksrcpath}/tests/DES56/makefile
build.args CC=${configure.cc} \
# configure script is not from autotools, it only searches for lua binary prefix
# it is needed to manually set flags env variable in build phase
build.env-append CFLAGS="${configure.cflags} [get_canonical_archflags cc]" \
LDFLAGS="${configure.ldflags} [get_canonical_archflags ld] -llua -lm"
# fdemo example is broken, it's using libcrypt
system -W ${worksrcpath}/tests/DES56 "[join ${build.env}] ${build.cmd} [join ${build.args}] fdemo"
xinstall -d ${destroot}${prefix}/share/doc/${name}
xinstall -m 644 ${worksrcpath}/README {*}[glob ${worksrcpath}/doc/us/*] \
${destroot}${prefix}/share/doc/${name}
xinstall -d ${destroot}${prefix}/share/examples/${name}
xinstall -m 755 ${worksrcpath}/tests/DES56/fdemo \
${destroot}${prefix}/share/examples/${name}
xinstall -m 644 -W ${worksrcpath}/tests DES56/fdemo.c test.lua \
${destroot}${prefix}/share/examples/${name}