aboutsummaryrefslogtreecommitdiffstats
path: root/lang/lua/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lang/lua/Makefile')
-rw-r--r--lang/lua/Makefile52
1 files changed, 45 insertions, 7 deletions
diff --git a/lang/lua/Makefile b/lang/lua/Makefile
index 35540a42841c..96de7f0e5f3a 100644
--- a/lang/lua/Makefile
+++ b/lang/lua/Makefile
@@ -19,20 +19,58 @@ MASTER_SITES= http://www.lua.org/ftp/ \
MAINTAINER= him@richardkiss.com
COMMENT= Small, compilable scripting language providing easy access to C code
-MAN1= lua.1 luac.1
+USE_LUA= 5.1
+LUA_COMPS= # only define variables
+ALL_TARGET= bsd
-MAKE_ARGS= bsd
+MAN1= lua-${LUA_VER}.1 luac-${LUA_VER}.1
+DOCSDIR= ${PREFIX}/share/doc/${LUA_SUBDIR}
+LATEST_LINK= ${LUA_SUBDIR}
-CONFLICTS= lua-4* lua-5.0*
+LUA_BIN= lua luac
+LUA_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
+LUA_MAN= ${LUA_BIN:S/$/.1/}
post-patch:
- @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/Makefile
+ @${REINPLACE_CMD} -Ee \
+ 's|^(CC=).*|\1 ${CC}| ; \
+ s|^(CFLAGS=)|\1 ${CFLAGS}| ; \
+ s|/usr/local|${PREFIX}|' \
+ ${WRKSRC}/Makefile ${WRKSRC}/src/Makefile
-post-install:
+post-build:
+ @${RM} -f ${WRKSRC}/test/lua ${WRKSRC}/test/luac
+
+do-install:
+# Programs.
+ ${MKDIR} ${LUA_BINDIR}
+.for f in ${LUA_BIN}
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/${f} ${LUA_BINDIR}
+ ${LN} -sf ${LUA_SUBDIR}/${f} ${PREFIX}/bin/${f}-${LUA_VER}
+.endfor
+# Include files.
+ ${MKDIR} ${LUA_INCDIR}
+.for f in ${LUA_INC}
+ ${INSTALL_DATA} ${WRKSRC}/src/${f} ${LUA_INCDIR}
+.endfor
+# Libraries.
+ ${MKDIR} ${LUA_LIBDIR}
+ ${INSTALL_DATA} ${WRKSRC}/src/liblua.a ${LUA_LIBDIR}
+# Manual pages.
+.for f in ${LUA_MAN}
+ ${INSTALL_MAN} ${WRKSRC}/doc/${f} \
+ ${PREFIX}/man/man1/${f:C/.1$//}-${LUA_VER}.1
+.endfor
+# Documentation.
.if !defined(NOPORTDOCS)
- @${MKDIR} ${DOCSDIR}
- @cd ${WRKSRC}/doc && ${INSTALL_DATA} *.html *.css *.gif ${DOCSDIR}
+ ${MKDIR} ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
+ cd ${WRKSRC}/doc && ${INSTALL_DATA} *.html *.gif ${DOCSDIR}
+ ${CP} -r ${WRKSRC}/etc ${WRKSRC}/test ${DOCSDIR}
.endif
+# Module directories.
+ ${MKDIR} ${LUA_MODLIBDIR}
+ ${MKDIR} ${LUA_MODSHAREDIR}
.if ${MACHINE_ARCH:L} == "amd64"
CFLAGS+= -fPIC