Fri Oct 11 20:25:34 2013 UTC ()
More fixes for lua-5.2. From https://github.com/arunpersaud/osbf-lua
with the help of John R. Shannon.
Bump PKGREVISION.


(wiz)
diff -r1.9 -r1.10 pkgsrc/mail/OSBF-lua/Makefile
diff -r1.2 -r1.3 pkgsrc/mail/OSBF-lua/PLIST
diff -r1.4 -r1.5 pkgsrc/mail/OSBF-lua/distinfo
diff -r1.1.1.1 -r1.2 pkgsrc/mail/OSBF-lua/patches/patch-aa
diff -r1.1 -r1.2 pkgsrc/mail/OSBF-lua/patches/patch-losbflib.c

cvs diff -r1.9 -r1.10 pkgsrc/mail/OSBF-lua/Makefile (expand / switch to context diff)
--- pkgsrc/mail/OSBF-lua/Makefile 2013/07/04 21:27:57 1.9
+++ pkgsrc/mail/OSBF-lua/Makefile 2013/10/11 20:25:34 1.10
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.9 2013/07/04 21:27:57 adam Exp $
+# $NetBSD: Makefile,v 1.10 2013/10/11 20:25:34 wiz Exp $
 #
 
 DISTNAME=	osbf-lua-2.0.4
-PKGREVISION=	2
+PKGREVISION=	3
 CATEGORIES=	mail
 MASTER_SITES=	http://luaforge.net/frs/download.php/2094/
 
@@ -17,24 +17,25 @@
 
 INSTALL_TARGET=	install install_spamfilter
 
-SUBST_CLASSES+=         path
-SUBST_STAGE.path=       post-patch
-SUBST_MESSAGE.path=     Fixing paths in config
-SUBST_FILES.path=       config
-SUBST_FILES.path+=      spamfilter/cache_report.lua
-SUBST_FILES.path+=      spamfilter/classify.sample
-SUBST_FILES.path+=      spamfilter/create_databases.lua
-SUBST_FILES.path+=      spamfilter/database_status.lua
-SUBST_FILES.path+=      spamfilter/getopt.lua
-SUBST_FILES.path+=      spamfilter/promailrc.sample
-SUBST_FILES.path+=      spamfilter/random.lua
-SUBST_FILES.path+=      spamfilter/roc.lua
-SUBST_FILES.path+=      spamfilter/spamfilter.lua
-SUBST_FILES.path+=      spamfilter/spamfilter_commands.lua
-SUBST_FILES.path+=      spamfilter/toer.lua
-SUBST_FILES.path+=      spamfilter/train.sample
-SUBST_FILES.path+=      docs/index.html
-SUBST_SED.path=         -e 's,/usr/local,${PREFIX},g'
+SUBST_CLASSES+=		path
+SUBST_STAGE.path=	post-patch
+SUBST_MESSAGE.path=	Fixing paths in config
+SUBST_FILES.path=	config
+SUBST_FILES.path+=	spamfilter/cache_report.lua
+SUBST_FILES.path+=	spamfilter/classify.sample
+SUBST_FILES.path+=	spamfilter/create_databases.lua
+SUBST_FILES.path+=	spamfilter/database_status.lua
+SUBST_FILES.path+=	spamfilter/getopt.lua
+SUBST_FILES.path+=	spamfilter/promailrc.sample
+SUBST_FILES.path+=	spamfilter/random.lua
+SUBST_FILES.path+=	spamfilter/roc.lua
+SUBST_FILES.path+=	spamfilter/spamfilter.lua
+SUBST_FILES.path+=	spamfilter/spamfilter_commands.lua
+SUBST_FILES.path+=	spamfilter/toer.lua
+SUBST_FILES.path+=	spamfilter/train.sample
+SUBST_FILES.path+=	docs/index.html
+SUBST_SED.path=		-e 's,/usr/local,${PREFIX},g'
+SUBST_SED.path+=	-e 's,lib/lua/5.1,lib/lua/5.2,g'
 
 .include "../../lang/lua/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"

cvs diff -r1.2 -r1.3 pkgsrc/mail/OSBF-lua/PLIST (expand / switch to context diff)
--- pkgsrc/mail/OSBF-lua/PLIST 2009/06/14 18:04:26 1.2
+++ pkgsrc/mail/OSBF-lua/PLIST 2013/10/11 20:25:34 1.3
@@ -1,6 +1,6 @@
-@comment $NetBSD: PLIST,v 1.2 2009/06/14 18:04:26 joerg Exp $
-lib/lua/5.1/libosbf.so.${PKGVERSION}
-lib/lua/5.1/osbf.so
+@comment $NetBSD: PLIST,v 1.3 2013/10/11 20:25:34 wiz Exp $
+lib/lua/5.2/libosbf.so.${PKGVERSION}
+lib/lua/5.2/osbf.so
 osbf-lua/cache_report.lua
 osbf-lua/classify.sample
 osbf-lua/create_databases.lua

cvs diff -r1.4 -r1.5 pkgsrc/mail/OSBF-lua/distinfo (expand / switch to context diff)
--- pkgsrc/mail/OSBF-lua/distinfo 2013/07/05 14:31:40 1.4
+++ pkgsrc/mail/OSBF-lua/distinfo 2013/10/11 20:25:34 1.5
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.4 2013/07/05 14:31:40 wiz Exp $
+$NetBSD: distinfo,v 1.5 2013/10/11 20:25:34 wiz Exp $
 
 SHA1 (osbf-lua-2.0.4.tar.gz) = 6fd4fb6496c20e9340cdcff4820c50a793e2ea27
 RMD160 (osbf-lua-2.0.4.tar.gz) = ba808072739de2bcb40ce81f0177ef7588508670
 Size (osbf-lua-2.0.4.tar.gz) = 82343 bytes
-SHA1 (patch-aa) = 25fe0abc6543893d88d147e418027cee9a544502
+SHA1 (patch-aa) = 318255203a7ce8dda28200d9405fa0e948e3d2ef
 SHA1 (patch-bb) = ead9d141481c2eabd510dd26eb39b5f88ede9e04
-SHA1 (patch-losbflib.c) = 53ef00a5db3e8f892d4edd41204dc13b8d17f32e
+SHA1 (patch-losbflib.c) = 9ee6438b61d6702d2faa6d5a3fdcf88f57555339

cvs diff -r1.1.1.1 -r1.2 pkgsrc/mail/OSBF-lua/patches/patch-aa (expand / switch to context diff)
--- pkgsrc/mail/OSBF-lua/patches/patch-aa 2008/10/13 11:29:53 1.1.1.1
+++ pkgsrc/mail/OSBF-lua/patches/patch-aa 2013/10/11 20:25:34 1.2
@@ -1,6 +1,6 @@
-$NetBSD: patch-aa,v 1.1.1.1 2008/10/13 11:29:53 shannonjr Exp $
+$NetBSD: patch-aa,v 1.2 2013/10/11 20:25:34 wiz Exp $
 
---- config.orig	2007-01-14 11:57:19.000000000 -0700
+--- config.orig	2007-01-14 18:57:19.000000000 +0000
 +++ config
 @@ -20,20 +20,8 @@ LIB_DIR= /usr/local/lib
  # OS dependent

cvs diff -r1.1 -r1.2 pkgsrc/mail/OSBF-lua/patches/patch-losbflib.c (expand / switch to context diff)
--- pkgsrc/mail/OSBF-lua/patches/patch-losbflib.c 2013/07/05 14:31:40 1.1
+++ pkgsrc/mail/OSBF-lua/patches/patch-losbflib.c 2013/10/11 20:25:34 1.2
@@ -1,9 +1,27 @@
-$NetBSD: patch-losbflib.c,v 1.1 2013/07/05 14:31:40 wiz Exp $
+$NetBSD: patch-losbflib.c,v 1.2 2013/10/11 20:25:34 wiz Exp $
 
 Fix build with lua-5.2.
 
 --- losbflib.c.orig	2007-01-14 18:57:19.000000000 +0000
 +++ losbflib.c
+@@ -170,7 +170,7 @@ lua_osbf_createdb (lua_State * L)
+   luaL_checktype (L, 1, LUA_TTABLE);
+ 
+   /* get the number of classes to create */
+-  num_classes = luaL_getn (L, 1);
++  num_classes = (int) lua_rawlen (L, 1);
+ 
+   /* get number of buckets */
+   buckets = luaL_checknumber (L, 2);
+@@ -214,7 +214,7 @@ lua_osbf_removedb (lua_State * L)
+   luaL_checktype (L, 1, LUA_TTABLE);
+ 
+   /* get the number of classes to remove */
+-  num_classes = luaL_getn (L, 1);
++  num_classes = (int) lua_rawlen (L, 1);
+   removed = 0;
+   lua_pushnil (L);		/* first key */
+   while (lua_next (L, 1) != 0)
 @@ -743,7 +743,7 @@ dir_gc (lua_State * L)
  
  /**********************************************************/
@@ -13,3 +31,27 @@
    {"create_db", lua_osbf_createdb},
    {"remove_db", lua_osbf_removedb},
    {"config", lua_osbf_config},
+@@ -767,6 +767,8 @@ static const struct luaL_reg osbf[] = {
+ int
+ luaopen_osbf (lua_State * L)
+ {
++  size_t n_funcs;
++
+   /* Open dir function */
+   luaL_newmetatable (L, "LuaBook.dir");
+   /* set its __gc field */
+@@ -774,7 +776,13 @@ luaopen_osbf (lua_State * L)
+   lua_pushcfunction (L, dir_gc);
+   lua_settable (L, -3);
+ 
+-  luaL_register (L, "osbf", osbf);
++  n_funcs = sizeof(osbf)/sizeof(*osbf) - 1;
++  lua_createtable( L, 0, n_funcs );
++  luaL_setfuncs( L, osbf, 0 );
++
++  lua_pushvalue( L, -1 );
++  lua_setglobal( L, "osbf" );
++
+   set_info (L);
+   return 1;
+ }