# $Id: Portfile 50980 2009-05-14 19:41:55Z and.damore@macports.org $

PortSystem 1.0

name                lua-luasec
version             0.3.1
categories          devel
maintainers         and.damore openmaintainer
platforms			darwin
description         LuaSec is a binding for OpenSSL library to provide TLS/SSL communication
long_description    LuaSec is a binding for OpenSSL library to provide TLS/SSL \
					communication. This version delegates to LuaSocket the TCP connection \
					establishment between the client and server. Then LuaSec uses this \
					connection to start a secure TLS/SSL session.
homepage            http://luasec.luaforge.net/

master_sites        http://luaforge.net/frs/download.php/4013/					
distname            luasec-${version}
checksums           md5     aacd011996f79d625c5551a33c410411 \
                    sha1    13435ec486a5eef09d5e20907703a393447c5ff9 \
                    rmd160  4aaeb53c2351212a6e9345d875aca8f8f7662df7

patch.pre_args		-p1
patchfiles          patch-Makefile.diff
post-patch {
    reinplace "s|%%PREFIX%%|${prefix}|g" ${worksrcpath}/Makefile
}

use_configure       no

depends_lib         port:lua
build.target		macosx
build.env			INCDIR=-I${prefix}/include LIBDIR=-L${prefix}/lib
pre-destroot {
	xinstall	-d ${destroot}${prefix}/lib/lua/5.1
	xinstall	-d ${destroot}${prefix}/share/lua/5.1
}