Hi, I would appreciate if someone could give this diff a look.
Thanks, -p. Index: Makefile =================================================================== RCS file: /cvs/ports/security/luacrypto/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- Makefile 11 Jun 2008 05:04:37 -0000 1.7 +++ Makefile 9 Nov 2008 02:17:40 -0000 @@ -1,13 +1,12 @@ # $OpenBSD: Makefile,v 1.7 2008/06/11 05:04:37 landry Exp $ -COMMENT= Lua binding for the OpenSSL crypto libraries +COMMENT= Lua binding for the OpenSSL libraries SHARED_ONLY= Yes -DISTNAME= luacrypto-0.1.1 -PKGNAME= ${DISTNAME}p3 +DISTNAME= luacrypto-0.2.0 CATEGORIES= security -MASTER_SITES= http://luaforge.net/frs/download.php/1395/ +MASTER_SITES= http://luaforge.net/frs/download.php/1722/ HOMEPAGE= http://luacrypto.luaforge.net/ # MIT @@ -16,11 +15,25 @@ PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes -USE_GMAKE= Yes WANTLIB= crypto -REGRESS_TARGET= tests CFLAGS+= -fPIC -DPIC MODULES= lang/lua + +do-build: + ${CC} -I${LOCALBASE}/include ${CFLAGS} ${WRKSRC}/src/lcrypto.c \ + -o ${WRKBUILD}/crypto.so -lcrypto -shared + +do-install: + ${INSTALL_DATA_DIR} ${PREFIX}/lib/lua/5.1 + ${INSTALL_DATA} ${WRKBUILD}/crypto.so ${PREFIX}/lib/lua/5.1 + ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/luacrypto + ${INSTALL_DATA} ${WRKSRC}/doc/us/* ${PREFIX}/share/doc/luacrypto + +do-regress: + cd ${WRKSRC}/tests && env LUA_CPATH=${WRKBUILD}/?.so \ + ${LOCALBASE}/bin/lua ${WRKSRC}/tests/rand.lua + env LUA_CPATH=${WRKBUILD}/?.so ${LOCALBASE}/bin/lua \ + ${WRKSRC}/tests/test.lua ${WRKSRC}/tests/message .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/security/luacrypto/distinfo,v retrieving revision 1.2 diff -u -r1.2 distinfo --- distinfo 5 Apr 2007 17:26:07 -0000 1.2 +++ distinfo 9 Nov 2008 02:17:40 -0000 @@ -1,5 +1,5 @@ -MD5 (luacrypto-0.1.1.tar.gz) = gxFZXmm8rznqKFtTzMO1Vg== -RMD160 (luacrypto-0.1.1.tar.gz) = UZwSYz+lkYsGkOa9rBj7uXbIcCU= -SHA1 (luacrypto-0.1.1.tar.gz) = KVres0PglJAFU27eiAyO13YZ0ws= -SHA256 (luacrypto-0.1.1.tar.gz) = GsQYbtkZ3zUEvbi662dzuOMSwu1ItIfp7pUcaeXuwuk= -SIZE (luacrypto-0.1.1.tar.gz) = 11427 +MD5 (luacrypto-0.2.0.tar.gz) = HhMZ2WDwdgsROz562aNgfQ== +RMD160 (luacrypto-0.2.0.tar.gz) = QvzM/IjCTjeqhL7w4caETMpIxwg= +SHA1 (luacrypto-0.2.0.tar.gz) = ozbRu7zfdFSd/3W79+nW+xeXaT4= +SHA256 (luacrypto-0.2.0.tar.gz) = TefXWbcFDj77uPFvEa6qywvRpe0b6VCV//Xh5ViQQko= +SIZE (luacrypto-0.2.0.tar.gz) = 22478 Index: patches/patch-Makefile =================================================================== RCS file: patches/patch-Makefile diff -N patches/patch-Makefile --- patches/patch-Makefile 20 Sep 2006 14:08:47 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,38 +0,0 @@ -$OpenBSD: patch-Makefile,v 1.1.1.1 2006/09/20 14:08:47 pedro Exp $ ---- Makefile.orig Sun Jan 22 21:16:35 2006 -+++ Makefile Fri Aug 11 16:20:49 2006 -@@ -18,7 +18,7 @@ SHELL = /bin/sh - MODULES = evp hmac - COMPAT_DIR = contrib/compat-5.1r4 - COMPAT_O = $(if $(USE_COMPAT),$(outdir)/compat-5.1.o) --CFLAGS = $(CRYPTOINC) $(LUAINC) $(if $(USE_COMPAT),-I$(COMPAT_DIR) -DUSE_COMPAT) -ansi -pedantic -Wall -O2 -+CFLAGS += $(CRYPTOINC) $(LUAINC) - SOOBJS = $(outdir)/crypto/core.so $(foreach module,$(MODULES),$(outdir)/crypto/$(module)/core.so) - LCOBJS = $(outdir)/crypto.$(LUATYPE) $(foreach module,$(MODULES),$(outdir)/crypto/$(module).$(LUATYPE)) - LDFLAGS = $(CRYPTOLIB) -@@ -76,8 +76,8 @@ mostlyclean: - define INSTALL_TEMPLATE - $(1)_install: $(outdir)/crypto/$(1)/core.so $(outdir)/crypto/$(1).$(LUATYPE) - $(INSTALL) -d $(LUA_CPATH)/crypto/$(1) -- $(INSTALL) -D $(outdir)/crypto/$(1)/core.so $(LUA_CPATH)/crypto/$(1)/core.so -- $(INSTALL) -D $(outdir)/crypto/$(1).$(LUATYPE) $(LUA_PATH)/crypto/$(1).$(LUATYPE) -+ $(INSTALL) $(outdir)/crypto/$(1)/core.so $(LUA_CPATH)/crypto/$(1)/core.so -+ $(INSTALL) $(outdir)/crypto/$(1).$(LUATYPE) $(LUA_PATH)/crypto/$(1).$(LUATYPE) - - $(1)_uninstall: - -rm $(LUA_CPATH)/crypto/$(1)/core.so -@@ -93,11 +93,11 @@ $(foreach module,$(MODULES),$(eval $(cal - crypto_install: - $(INSTALL) -d $(LUA_PATH)/crypto/ - $(INSTALL) -d $(LUA_CPATH)/crypto/ -- $(INSTALL) -D $(outdir)/crypto/core.so $(LUA_CPATH)/crypto/core.so -- $(INSTALL) -D $(outdir)/crypto.$(LUATYPE) $(LUA_CPATH)/crypto.$(LUATYPE) -+ $(INSTALL) $(outdir)/crypto/core.so $(LUA_CPATH)/crypto/core.so -+ $(INSTALL) $(outdir)/crypto.$(LUATYPE) $(LUA_PATH)/crypto.$(LUATYPE) - - compat_install: -- $(INSTALL) -D $(COMPAT_DIR)/compat-5.1.lua $(LUA_PATH)/compat-5.1.lua -+ $(INSTALL) $(COMPAT_DIR)/compat-5.1.lua $(LUA_PATH)/compat-5.1.lua - - install: crypto_install $(foreach module,$(MODULES),$(module)_install) $(if $(INSTALL_COMPAT),compat_install) ; - Index: patches/patch-config =================================================================== RCS file: patches/patch-config diff -N patches/patch-config --- patches/patch-config 20 Sep 2006 14:08:47 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,33 +0,0 @@ -$OpenBSD: patch-config,v 1.1.1.1 2006/09/20 14:08:47 pedro Exp $ ---- config.orig Sun Jan 22 21:16:35 2006 -+++ config Fri Aug 11 16:31:35 2006 -@@ -3,9 +3,9 @@ - # and the Lua include files (LUAINC) are required to compile and install. Set - # USE_COMPAT to 1 if you building for a Lua 5.0 environment, or leave it blank - # if you are building for a Lua 5.1 environment. --LUA_PATH = /usr/share/lua --LUA_CPATH = /usr/local/lua --LUAINC = -I/usr/include/lua -+LUA_PATH = $(PREFIX)/share/lua/5.1 -+LUA_CPATH = $(PREFIX)/lib/lua/5.1 -+LUAINC = -I$(PREFIX)/include - - # If your target environment is Lua 5.1, leave both of these COMPAT flags unset. - # If your target environment is Lua 5.0, the USE_COMPAT flag must be set to 1 -@@ -19,8 +19,8 @@ INSTALL_COMPAT = - # The location of the Lua interpreter and Lua compiler are required to run the - # test suite and to generate precompiled Lua libraries instead of source Lua - # libraries for install. --LUA = /usr/bin/lua --LUAC = /usr/bin/luac -+LUA = $(PREFIX)/bin/lua -+LUAC = $(PREFIX)/bin/luac - - # This provides the necessary flags for linking against your OpenSSL libcrypto - # installation. Change it to suit your system if necessary. -@@ -29,4 +29,4 @@ CRYPTOINC = - - # Set this to lc to install the precompiled Lua libraries (compiled with luac), - # or to lua to install the source Lua libraries. --LUATYPE = lc -+LUATYPE = lua Index: patches/patch-src_evp_c =================================================================== RCS file: patches/patch-src_evp_c diff -N patches/patch-src_evp_c --- patches/patch-src_evp_c 20 Sep 2006 14:08:47 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ -$OpenBSD: patch-src_evp_c,v 1.1.1.1 2006/09/20 14:08:47 pedro Exp $ ---- src/evp.c.orig Fri Aug 11 22:50:16 2006 -+++ src/evp.c Fri Aug 11 22:51:05 2006 -@@ -97,7 +97,7 @@ static int Ldigest(lua_State *L) /** di - EVP_MD_CTX *c = Pget(L, 1); - EVP_MD_CTX *d = NULL; - unsigned char digest[EVP_MAX_MD_SIZE]; -- size_t written = 0; -+ unsigned int written = 0; - - if (lua_isstring(L, 2)) - { -@@ -149,7 +149,7 @@ static int Lfdigest(lua_State *L) /** d - const char *s = luaL_checkstring(L, 2); - const EVP_MD *type = EVP_get_digestbyname(type_name); - unsigned char digest[EVP_MAX_MD_SIZE]; -- size_t written = 0; -+ unsigned int written = 0; - - if (type == NULL) { - luaL_argerror(L, 1, "invalid digest type"); Index: patches/patch-src_hmac_c =================================================================== RCS file: patches/patch-src_hmac_c diff -N patches/patch-src_hmac_c --- patches/patch-src_hmac_c 20 Sep 2006 14:08:47 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ -$OpenBSD: patch-src_hmac_c,v 1.1.1.1 2006/09/20 14:08:47 pedro Exp $ ---- src/hmac.c.orig Fri Aug 11 22:50:19 2006 -+++ src/hmac.c Fri Aug 11 22:51:26 2006 -@@ -92,7 +92,7 @@ static int Ldigest(lua_State *L) /** di - { - HMAC_CTX *c = Pget(L, 1); - unsigned char digest[EVP_MAX_MD_SIZE]; -- size_t written = 0; -+ unsigned int written = 0; - - if (lua_isstring(L, 2)) - { -@@ -138,7 +138,7 @@ static int Lfdigest(lua_State *L) /** di - { - HMAC_CTX c; - unsigned char digest[EVP_MAX_MD_SIZE]; -- size_t written = 0; -+ unsigned int written = 0; - const char *t = luaL_checkstring(L, 1); - const char *s = luaL_checkstring(L, 2); - const char *k = luaL_checkstring(L, 3); Index: pkg/DESCR =================================================================== RCS file: /cvs/ports/security/luacrypto/pkg/DESCR,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 DESCR --- pkg/DESCR 20 Sep 2006 14:08:47 -0000 1.1.1.1 +++ pkg/DESCR 9 Nov 2008 02:17:40 -0000 @@ -1,4 +1,3 @@ -LuaCrypto provides digest functions, such as MD5, SHA-1, and HMAC; -cipher functions, such as RC5 and Blowfish; public key crypto, such as -RSA and Diffie-Hellman; and some other assorted tools (i.e. random -number generation). +LuaCrypto provides a Lua frontend to the OpenSSL cryptographic library. +The OpenSSL features that are currently exposed are digests (MD5, SHA-1, +HMAC, and more) and crypto-grade random number generators. Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/security/luacrypto/pkg/PLIST,v retrieving revision 1.2 diff -u -r1.2 PLIST --- pkg/PLIST 4 Jul 2007 19:18:46 -0000 1.2 +++ pkg/PLIST 9 Nov 2008 02:17:40 -0000 @@ -1,11 +1,8 @@ @comment $OpenBSD: PLIST,v 1.2 2007/07/04 19:18:46 jasper Exp $ -lib/lua/5.1/crypto/ -lib/lua/5.1/crypto/core.so -lib/lua/5.1/crypto/evp/ -lib/lua/5.1/crypto/evp/core.so -lib/lua/5.1/crypto/hmac/ -lib/lua/5.1/crypto/hmac/core.so -share/lua/5.1/crypto/ -share/lua/5.1/crypto.lua -share/lua/5.1/crypto/evp.lua -share/lua/5.1/crypto/hmac.lua +lib/lua/5.1/crypto.so +share/doc/luacrypto/ +share/doc/luacrypto/examples.html +share/doc/luacrypto/index.html +share/doc/luacrypto/license.html +share/doc/luacrypto/luacrypto-128.png +share/doc/luacrypto/manual.html