diff --git a/devel/luafs/Makefile b/devel/luafs/Makefile new file mode 100644 index 00000000000..0decb225a85 --- /dev/null +++ b/devel/luafs/Makefile @@ -0,0 +1,38 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2005/05/15 00:42:52 jolan Exp $ +SHARED_ONLY= Yes + +COMMENT= "file system library for the lua language" +DISTNAME= luafilesystem-1.0 +PKGNAME= luafs-1.0 +CATEGORIES= devel +MASTER_SITES= http://luaforge.net/frs/download.php/430/ + +HOMEPAGE= http://www.keplerproject.org/luafilesystem/ + +MAINTAINER= Pedro Martelletto + +# MIT +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes + +NO_REGRESS= Yes +BUILD_DEPENDS= ::lang/lua ::devel/luacompat +RUN_DEPENDS= ${BUILD_DEPENDS} + +post-extract: + @sed -e "s:@fspath@:${PREFIX}/lua/luafs/?.lua:g" \ + -e "s:@fscpath@:${PREFIX}/lib/?.so:g" \ + ${FILESDIR}/init.lua > ${WRKSRC}/init.lua + +do-install: + ${INSTALL_DATA_DIR} ${PREFIX}/lua/luafs + ${INSTALL_DATA} ${WRKSRC}/*.so ${PREFIX}/lib/luafs.so + ${INSTALL_DATA} ${WRKSRC}/init.lua ${PREFIX}/lua/luafs + ${INSTALL_DATA} ${FILESDIR}/lfs.lua ${PREFIX}/lua/luafs + ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/luafs + ${INSTALL_DATA} ${WRKSRC}/*.html ${WRKSRC}/*.png \ + ${PREFIX}/share/doc/luafs + +.include diff --git a/devel/luafs/distinfo b/devel/luafs/distinfo new file mode 100644 index 00000000000..b992ff57274 --- /dev/null +++ b/devel/luafs/distinfo @@ -0,0 +1,4 @@ +MD5 (luafilesystem-1.0.tar.gz) = 35eb7c97a4ca21719ea345bb81c005fc +RMD160 (luafilesystem-1.0.tar.gz) = 7144967b6eb3c7d6f1372e68a6783e292dff41a5 +SHA1 (luafilesystem-1.0.tar.gz) = e21e9d88b5509dd16cdefd7a8edf9ba8c0556cb8 +SIZE (luafilesystem-1.0.tar.gz) = 17619 diff --git a/devel/luafs/files/init.lua b/devel/luafs/files/init.lua new file mode 100644 index 00000000000..75c1884943b --- /dev/null +++ b/devel/luafs/files/init.lua @@ -0,0 +1,3 @@ +-- $OpenBSD: init.lua,v 1.1.1.1 2005/05/15 00:42:52 jolan Exp $ +-- luafs' initialization steps +lua_addpath("@fspath@") diff --git a/devel/luafs/files/lfs.lua b/devel/luafs/files/lfs.lua new file mode 100644 index 00000000000..4aa05e86b29 --- /dev/null +++ b/devel/luafs/files/lfs.lua @@ -0,0 +1,2 @@ +-- $OpenBSD: lfs.lua,v 1.1.1.1 2005/05/15 00:42:52 jolan Exp $ +assert(loadlib("luafs.so", "luaopen_lfs"))() diff --git a/devel/luafs/patches/patch-Makefile b/devel/luafs/patches/patch-Makefile new file mode 100644 index 00000000000..94a340065ac --- /dev/null +++ b/devel/luafs/patches/patch-Makefile @@ -0,0 +1,18 @@ +$OpenBSD: patch-Makefile,v 1.1.1.1 2005/05/15 00:42:52 jolan Exp $ +--- Makefile.orig Wed Jan 19 15:20:04 2005 ++++ Makefile Sat May 14 21:11:36 2005 +@@ -8,11 +8,12 @@ V= 1.0 + DIST_DIR= luafilesystem-$V + TAR_FILE= $(DIST_DIR).tar.gz + ZIP_FILE= $(DIST_DIR).zip +-LIBNAME= lib$T.$V$(LIB_EXT) ++LIBNAME= luafs.so + + SRCS= $T.c +-OBJS= $T.o compat-5.1.o ++OBJS= $T.o + ++all: lib + + lib: $(LIBNAME) + diff --git a/devel/luafs/patches/patch-config b/devel/luafs/patches/patch-config new file mode 100644 index 00000000000..c08ba1a65a6 --- /dev/null +++ b/devel/luafs/patches/patch-config @@ -0,0 +1,41 @@ +$OpenBSD: patch-config,v 1.1.1.1 2005/05/15 00:42:52 jolan Exp $ +--- config.orig Wed Jan 19 15:20:04 2005 ++++ config Sat May 14 21:06:43 2005 +@@ -1,25 +1,22 @@ + # Installation directories + # System's libraries directory (where binary libraries are installed) +-LUA_LIBDIR= /usr/local/lib/lua/5.0 ++LUA_LIBDIR= $(LOCALBASE)/lib + # System's lua directory (where Lua libraries are installed) +-LUA_DIR= /usr/local/share/lua/5.0 ++#LUA_DIR= /usr/local/share/lua/5.0 + # Lua includes directory +-LUA_INC= /usr/local/include/lua5 ++LUA_INC= $(LOCALBASE)/include + + # OS dependent +-LIB_EXT= .dylib +-#LIB_EXT= .so +-LIB_OPTION= -dynamiclib #for MacOS X +-#LIB_OPTION= -shared #for Linux ++#LIB_EXT= .dylib ++LIB_EXT= .so ++#LIB_OPTION= -dynamiclib #for MacOS X ++LIB_OPTION= -shared #for Linux + +-COMPAT_DIR= . +- + # Compilation directives + # On FreeBSD systems, the following line should be commented +-DLLIB= -ldl +-WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings +-INCS= -I$(LUA_INC) -I$(COMPAT_DIR) ++#DLLIB= -ldl ++#WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings ++INCS= -I$(LUA_INC) + LIBS= -L$(LUA_LIBDIR) -llua -llualib -lm $(DLLIB) +-CFLAGS= $(WARN) $(INCS) +-CC= gcc +- ++CFLAGS+= $(WARN) $(INCS) -fPIC ++#CC= gcc diff --git a/devel/luafs/patches/patch-lfs_c b/devel/luafs/patches/patch-lfs_c new file mode 100644 index 00000000000..6755a62fe20 --- /dev/null +++ b/devel/luafs/patches/patch-lfs_c @@ -0,0 +1,29 @@ +$OpenBSD: patch-lfs_c,v 1.1.1.1 2005/05/15 00:42:52 jolan Exp $ +--- lfs.c.orig Wed Jan 19 15:20:04 2005 ++++ lfs.c Wed May 11 08:31:54 2005 +@@ -26,13 +26,12 @@ + #include + #include + #include +-#include ++#include + #endif + + #include "lua.h" + #include "lauxlib.h" + #include "lualib.h" +-#include "compat-5.1.h" + + #include "lfs.h" + +@@ -81,8 +80,8 @@ static int change_dir (lua_State *L) { + ** and a string describing the error + */ + static int get_dir (lua_State *L) { +- char path[255+2]; +- if (getcwd(path, 255) == NULL) { ++ char path[MAXPATHLEN]; ++ if (getcwd(path, sizeof(path)) == NULL) { + lua_pushnil(L); + lua_pushstring(L, getcwd_error); + return 2; diff --git a/devel/luafs/pkg/DESCR b/devel/luafs/pkg/DESCR new file mode 100644 index 00000000000..2c800d6bba1 --- /dev/null +++ b/devel/luafs/pkg/DESCR @@ -0,0 +1,3 @@ +LuaFileSystem is a Lua library developed to complement the set of +functions related to file systems offered by the standard Lua +distribution. diff --git a/devel/luafs/pkg/PFRAG.shared b/devel/luafs/pkg/PFRAG.shared new file mode 100644 index 00000000000..259d49dabf9 --- /dev/null +++ b/devel/luafs/pkg/PFRAG.shared @@ -0,0 +1,2 @@ +@comment $OpenBSD: PFRAG.shared,v 1.1.1.1 2005/05/15 00:42:52 jolan Exp $ +lib/luafs.so diff --git a/devel/luafs/pkg/PLIST b/devel/luafs/pkg/PLIST new file mode 100644 index 00000000000..28bd8007c1c --- /dev/null +++ b/devel/luafs/pkg/PLIST @@ -0,0 +1,12 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2005/05/15 00:42:52 jolan Exp $ +@unexec lua ${SYSCONFDIR}/lua/luapkg.lua del luafs +%%SHARED%% +lua/luafs/ +lua/luafs/init.lua +lua/luafs/lfs.lua +@exec lua ${SYSCONFDIR}/lua/luapkg.lua add luafs ${PREFIX}/lua/luafs/init.lua +share/doc/luafs/ +share/doc/luafs/index.html +share/doc/luafs/license.html +share/doc/luafs/luafilesystem.png +share/doc/luafs/manual.html