I noticed that lua.port.mk is setting MODLUA_EXAMPLEDIR and MODLUA_DOCDIR to ${PREFIX}/share/examples/${FULLPKGNAME}/ and ${PREFIX}/share/doc/${FULLPKGNAME}/ respectively.
We must use ${DISTNAME:C/-([0-9]+\.[0-9]+).*$//g} instead of ${FULLPKGNAME} It will strip the name correctly as expected. I don't like FULLPKGNAME in PLIST and portcheck either. requires a bump for all lua* ports that uses this MODULE and using MODLUA_EXAMPLEDIR and MODLUA_DOCDIR, since it changes the package, comments? Index: lua.port.mk =================================================================== RCS file: /cvs/ports/lang/lua/lua.port.mk,v retrieving revision 1.33 diff -u -p -r1.33 lua.port.mk --- lua.port.mk 18 Oct 2015 20:20:50 -0000 1.33 +++ lua.port.mk 19 May 2016 04:18:34 -0000 @@ -93,10 +93,10 @@ _MODLUA_TEST_DEPENDS +=${x},${MODLUA_FLA MODLUA_INCL_DIR = ${LOCALBASE}/include/lua-${MODLUA_VERSION}/ # Where the example will be installed -MODLUA_EXAMPLEDIR = ${PREFIX}/share/examples/${FULLPKGNAME}/ +MODLUA_EXAMPLEDIR = ${PREFIX}/share/examples/${DISTNAME:C/-([0-9]+\.[0-9]+).*$//g} # Where the docs will be installed -MODLUA_DOCDIR = ${PREFIX}/share/doc/${FULLPKGNAME}/ +MODLUA_DOCDIR = ${PREFIX}/share/doc/${DISTNAME:C/-([0-9]+\.[0-9]+).*$//g} # Where the lua libraries will be installed to MODLUA_LIBDIR = ${PREFIX}/lib/lua/${MODLUA_VERSION}/