.gear/rules | 2 + .../tags/0709826a34ba8a7d29f58163af5bb6fe2a2ceee1 | 13 +++++ .gear/tags/list | 1 + lposix-2006-alt-apt-mkstemp.patch | 49 ++++++++++++++++++++ lua5-posix.spec | 48 +++++++++++++++++++ 5 files changed, 113 insertions(+), 0 deletions(-) diff --git a/.gear/rules b/.gear/rules new file mode 100644 index 0000000..b5693b2 --- /dev/null +++ b/.gear/rules @@ -0,0 +1,2 @@ +tar: @version@:. name=luaposix-@version@ +diff: @version@:. . diff --git a/.gear/tags/0709826a34ba8a7d29f58163af5bb6fe2a2ceee1 b/.gear/tags/0709826a34ba8a7d29f58163af5bb6fe2a2ceee1 new file mode 100644 index 0000000..0feded6 --- /dev/null +++ b/.gear/tags/0709826a34ba8a7d29f58163af5bb6fe2a2ceee1 @@ -0,0 +1,13 @@ +object 190985018f1f7ed4f0fd9144e6ba3cf971b8d0d6 +type commit +tag 5.1.1 +tagger Alexey Tourbin 1254099108 +0400 + +5.1.1 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + +iEYEABECAAYFAkrACKQACgkQfBKgtDjnu0YTYQCgorEZSXLPVmB1RR3HbkMW5ZVe +o9oAn3inUp5dcNoFDNdllFViapaZRi0g +=M8Mc +-----END PGP SIGNATURE----- diff --git a/.gear/tags/list b/.gear/tags/list new file mode 100644 index 0000000..795c4c8 --- /dev/null +++ b/.gear/tags/list @@ -0,0 +1 @@ +0709826a34ba8a7d29f58163af5bb6fe2a2ceee1 5.1.1 diff --git a/lposix-2006-alt-apt-mkstemp.patch b/lposix-2006-alt-apt-mkstemp.patch new file mode 100644 index 0000000..14fa86a --- /dev/null +++ b/lposix-2006-alt-apt-mkstemp.patch @@ -0,0 +1,49 @@ +--- lposix.c- 2006-05-16 16:58:17 +0400 ++++ lposix.c 2006-05-16 17:29:12 +0400 +@@ -867,6 +867,38 @@ static int Psysconf(lua_State *L) /** s + return doselection(L, 1, Ssysconf, Fsysconf, NULL); + } + ++static int Pmkstemp(lua_State *L) ++{ ++ const char *path; ++ char *dynpath; ++ int fd; ++ FILE **f; ++ ++ path = luaL_checkstring(L, 1); ++ if (path == NULL) ++ return 0; ++ dynpath = strdup(path); ++ fd = mkstemp(dynpath); ++ f = (FILE**)lua_newuserdata(L, sizeof(FILE*)); ++ if (f == NULL) { ++ close(fd); ++ free(dynpath); ++ return 0; ++ } ++ *f = fdopen(fd, "a+"); ++ lua_pushstring(L, dynpath); ++ free(dynpath); ++ luaL_getmetatable(L, "FILE*"); ++ if (lua_isnil(L, -1)) { ++ lua_pop(L, 1); ++ luaL_error(L, "FILE* metatable not available " ++ "(io not loaded?)"); ++ } else { ++ lua_setmetatable(L, -3); ++ } ++ return 2; ++} ++ + + static const luaL_reg R[] = + { +@@ -908,6 +940,7 @@ static const luaL_reg R[] = + {"uname", Puname}, + {"utime", Putime}, + {"wait", Pwait}, ++ {"mkstemp", Pmkstemp}, + + {NULL, NULL} + }; diff --git a/lua5-posix.spec b/lua5-posix.spec new file mode 100644 index 0000000..258a239 --- /dev/null +++ b/lua5-posix.spec @@ -0,0 +1,48 @@ +Name: lua5-posix +Version: 5.1.1 +Release: alt1 +Epoch: 1 + +Summary: POSIX library for Lua +License: MIT +Group: Development/Other + +URL: http://luaforge.net/projects/luaposix/ +Source: luaposix-%version.tar +Patch: %name-%version-%release.patch + +# Automatically added by buildreq on Mon Sep 28 2009 +BuildRequires: liblua5-devel lua5 + +%description +This is a POSIX library for Lua which provides access to many POSIX features +to Lua programs. + +%prep +%setup -q -n luaposix-%version +%patch -p1 + +%build +gcc -shared %optflags %optflags_shared lposix.c -o posix.so -llua -Wl,-z,defs +lua -e 'require "posix"; print(posix.version)' + +%install +install -pD -m755 posix.so %buildroot%_libdir/lua5/posix.so + +%files +%doc ChangeLog README +%_libdir/lua5/posix.so + +%changelog +* Mon Sep 28 2009 Alexey Tourbin 1:5.1.1-alt1 +- updated to 5.1.1 +- disabled mkstemp patch for now + +* Tue May 16 2006 Alexey Tourbin 2006-alt1 +- new version for lua-5.1 from http://lua-users.org/lists/lua-l/2006-04/msg00162.html + +* Mon May 09 2005 Alexey Tourbin 2003.11.07-alt2 +- removed posix.lua, compat-5.1.lua should be used instead + +* Sat Sep 18 2004 Alexey Tourbin 2003.11.07-alt1 +- initial revision