aboutsummaryrefslogtreecommitdiffstats
path: root/security/luasec/Makefile
blob: 34f148c7aff60d1b079cc45cf9fefcf92d3f060b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Created by: Andrew Lewis <freeghb@gmail.com>
# $FreeBSD$

PORTNAME=   luasec
PORTVERSION=    0.6
DISTVERSIONPREFIX=  ${PORTNAME}-
CATEGORIES= security
PKGNAMEPREFIX=  ${LUA_PKGNAMEPREFIX}

MAINTAINER= lx@FreeBSD.org
COMMENT=    Lua binding for the OpenSSL library to provide TLS/SSL communication

LICENSE=    MIT

BROKEN_SSL= openssl-devel

USE_GITHUB= yes
GH_ACCOUNT= brunoos

ALL_TARGET= bsd
LIBDIR=     -L${LUA_LIBDIR} -L${WRKSRC}/src/luasocket
MAKE_ENV+=  INCDIR="-I${LUA_INCDIR} -I${WRKSRC}/src" LUAPATH=${LUA_MODSHAREDIR} \
        CPATH=${LUA_MODLIBDIR} LD=${CC}
.if !defined(SLAVE_PORT)
USES=       lua ssl
.endif
CFLAGS+=    -I${OPENSSLINC} -DOPENSSL_NO_SSL3
LDFLAGS+=   -L${OPENSSLLIB}

post-patch: .SILENT
    ${REINPLACE_CMD} -Ee '/\(INSTALL\)/s/-D //' \
        -e '/^LDFLAGS/s/\+=/=/' \
        -e 's/LUAPATH/LUA_MODSHAREDIR/' \
        -e 's/LUACPATH/LUA_MODLIBDIR/' \
        ${WRKSRC}/src/Makefile
    ${REINPLACE_CMD} -Ee '/^(INC|LIB)DIR/s/[^?]=/?=/' \
        ${WRKSRC}/Makefile

do-install:
    ${MKDIR} ${STAGEDIR}${LUA_MODSHAREDIR}/ssl ${STAGEDIR}${LUA_MODLIBDIR}
    ${INSTALL_LIB} ${WRKSRC}/src/ssl.so ${STAGEDIR}${LUA_MODLIBDIR}
    ${INSTALL_DATA} ${WRKSRC}/src/ssl.lua ${STAGEDIR}${LUA_MODSHAREDIR}
    ${INSTALL_DATA} ${WRKSRC}/src/https.lua ${STAGEDIR}${LUA_MODSHAREDIR}/ssl

.include <bsd.port.mk>