mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-21 04:06:46 +00:00
Turn into a slave port.
Reported by: lifanof
This commit is contained in:
parent
24769936dc
commit
891bc8e56f
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=434312
@ -1,45 +1,13 @@
|
||||
# Created by: Jan Hornyak <pav@oook.cz>
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= luasocket
|
||||
DISTVERSIONPREFIX= v
|
||||
DISTVERSION= 3.0-rc1
|
||||
PORTREVISION= 3
|
||||
PORTEPOCH= 1
|
||||
CATEGORIES= net
|
||||
PKGNAMEPREFIX= ${LUA_PKGNAMEPREFIX}
|
||||
COMMENT= Luasocket for Lua 5.1
|
||||
|
||||
MAINTAINER= lx@FreeBSD.org
|
||||
COMMENT= IPv4 and IPv6 socket support for the Lua language
|
||||
SLAVE_PORT= luasocket
|
||||
|
||||
LICENSE= MIT
|
||||
LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||
USES= gmake lua:51 pkgconfig
|
||||
|
||||
USE_GITHUB= yes
|
||||
GH_ACCOUNT= diegonehab
|
||||
MASTERDIR= ${.CURDIR}/../luasocket
|
||||
PLIST= ${MASTERDIR}/pkg-plist
|
||||
|
||||
MAKE_ARGS= LUAV=${LUA_VER}
|
||||
USES= gmake lua:51 pkgconfig
|
||||
INSTALL_TARGET= install-unix
|
||||
|
||||
CFLAGS+= `pkgconf --cflags lua-${LUA_VER}`
|
||||
LDFLAGS+= -shared `pkgconf --libs lua-${LUA_VER}`
|
||||
|
||||
OPTIONS_DEFINE= DOCS
|
||||
|
||||
post-extract:
|
||||
@${MV} ${WRKSRC}/makefile ${WRKSRC}/Makefile
|
||||
@${MV} ${WRKSRC}/src/makefile ${WRKSRC}/src/Makefile
|
||||
@${REINPLACE_CMD} -e 's|gcc|${CC}|g' ${WRKSRC}/src/Makefile
|
||||
@${REINPLACE_CMD} -e 's|CFLAGS=|CFLAGS\+=|g' ${WRKSRC}/src/Makefile
|
||||
@${REINPLACE_CMD} -e 's|LDFLAGS=|LDFLAGS\+=|g' ${WRKSRC}/src/Makefile
|
||||
@${REINPLACE_CMD} -e 's/prefix/PREFIX/g' ${WRKSRC}/src/Makefile
|
||||
|
||||
post-install:
|
||||
@${STRIP_CMD} ${STAGEDIR}${LUA_MODLIBDIR:S|^${LOCALBASE}|${PREFIX}|}/*/*.so
|
||||
|
||||
post-install-DOCS-on:
|
||||
@${MKDIR} ${STAGEDIR}/${DOCSDIR}
|
||||
${INSTALL_DATA} ${WRKSRC}/doc/* ${STAGEDIR}/${DOCSDIR}
|
||||
|
||||
.include <bsd.port.mk>
|
||||
.include "${MASTERDIR}/Makefile"
|
||||
|
@ -1,3 +0,0 @@
|
||||
TIMESTAMP = 1487003644
|
||||
SHA256 (diegonehab-luasocket-v3.0-rc1_GH0.tar.gz) = 8b67d9b5b545e1b694753dab7bd6cdbc24c290f2b21ba1e14c77b32817ea1249
|
||||
SIZE (diegonehab-luasocket-v3.0-rc1_GH0.tar.gz) = 328598
|
@ -1,30 +0,0 @@
|
||||
--- Makefile.orig 2013-06-14 11:27:32 UTC
|
||||
+++ Makefile
|
||||
@@ -23,21 +23,15 @@ print:
|
||||
test:
|
||||
lua test/hello.lua
|
||||
|
||||
-install-both:
|
||||
- $(MAKE) clean
|
||||
- @cd src; $(MAKE) $(PLAT) LUAV=5.1
|
||||
- @cd src; $(MAKE) install LUAV=5.1
|
||||
+install:
|
||||
$(MAKE) clean
|
||||
- @cd src; $(MAKE) $(PLAT) LUAV=5.2
|
||||
- @cd src; $(MAKE) install LUAV=5.2
|
||||
+ @cd src; $(MAKE) $(PLAT) LUAV=$(LUA_VER)
|
||||
+ @cd src; $(MAKE) install LUAV=$(LUA_VER)
|
||||
|
||||
-install-both-unix:
|
||||
- $(MAKE) clean
|
||||
- @cd src; $(MAKE) $(PLAT) LUAV=5.1
|
||||
- @cd src; $(MAKE) install-unix LUAV=5.1
|
||||
+install-unix:
|
||||
$(MAKE) clean
|
||||
- @cd src; $(MAKE) $(PLAT) LUAV=5.2
|
||||
- @cd src; $(MAKE) install-unix LUAV=5.2
|
||||
+ @cd src; $(MAKE) $(PLAT) LUAV=$(LUA_VER)
|
||||
+ @cd src; $(MAKE) install-unix LUAV=$(LUA_VER)
|
||||
|
||||
.PHONY: test
|
||||
|
@ -1,283 +0,0 @@
|
||||
--- src/buffer.c.orig 2014-02-11 11:38:27.000000000 -0800
|
||||
+++ src/buffer.c 2014-02-11 11:42:32.000000000 -0800
|
||||
@@ -31,7 +31,7 @@
|
||||
/*-------------------------------------------------------------------------*\
|
||||
* Initializes module
|
||||
\*-------------------------------------------------------------------------*/
|
||||
-int buffer_open(lua_State *L) {
|
||||
+int ls_buffer_open(lua_State *L) {
|
||||
(void) L;
|
||||
return 0;
|
||||
}
|
||||
@@ -39,7 +39,7 @@
|
||||
/*-------------------------------------------------------------------------*\
|
||||
* Initializes C structure
|
||||
\*-------------------------------------------------------------------------*/
|
||||
-void buffer_init(p_buffer buf, p_io io, p_timeout tm) {
|
||||
+void ls_buffer_init(p_buffer buf, p_io io, p_timeout tm) {
|
||||
buf->first = buf->last = 0;
|
||||
buf->io = io;
|
||||
buf->tm = tm;
|
||||
@@ -50,7 +50,7 @@
|
||||
/*-------------------------------------------------------------------------*\
|
||||
* object:getstats() interface
|
||||
\*-------------------------------------------------------------------------*/
|
||||
-int buffer_meth_getstats(lua_State *L, p_buffer buf) {
|
||||
+int ls_buffer_meth_getstats(lua_State *L, p_buffer buf) {
|
||||
lua_pushnumber(L, (lua_Number) buf->received);
|
||||
lua_pushnumber(L, (lua_Number) buf->sent);
|
||||
lua_pushnumber(L, timeout_gettime() - buf->birthday);
|
||||
@@ -60,7 +60,7 @@
|
||||
/*-------------------------------------------------------------------------*\
|
||||
* object:setstats() interface
|
||||
\*-------------------------------------------------------------------------*/
|
||||
-int buffer_meth_setstats(lua_State *L, p_buffer buf) {
|
||||
+int ls_buffer_meth_setstats(lua_State *L, p_buffer buf) {
|
||||
buf->received = (long) luaL_optnumber(L, 2, (lua_Number) buf->received);
|
||||
buf->sent = (long) luaL_optnumber(L, 3, (lua_Number) buf->sent);
|
||||
if (lua_isnumber(L, 4)) buf->birthday = timeout_gettime() - lua_tonumber(L, 4);
|
||||
@@ -71,7 +71,7 @@
|
||||
/*-------------------------------------------------------------------------*\
|
||||
* object:send() interface
|
||||
\*-------------------------------------------------------------------------*/
|
||||
-int buffer_meth_send(lua_State *L, p_buffer buf) {
|
||||
+int ls_buffer_meth_send(lua_State *L, p_buffer buf) {
|
||||
int top = lua_gettop(L);
|
||||
int err = IO_DONE;
|
||||
size_t size = 0, sent = 0;
|
||||
@@ -106,7 +106,7 @@
|
||||
/*-------------------------------------------------------------------------*\
|
||||
* object:receive() interface
|
||||
\*-------------------------------------------------------------------------*/
|
||||
-int buffer_meth_receive(lua_State *L, p_buffer buf) {
|
||||
+int ls_buffer_meth_receive(lua_State *L, p_buffer buf) {
|
||||
int err = IO_DONE, top = lua_gettop(L);
|
||||
luaL_Buffer b;
|
||||
size_t size;
|
||||
@@ -157,7 +157,7 @@
|
||||
/*-------------------------------------------------------------------------*\
|
||||
* Determines if there is any data in the read buffer
|
||||
\*-------------------------------------------------------------------------*/
|
||||
-int buffer_isempty(p_buffer buf) {
|
||||
+int ls_buffer_isempty(p_buffer buf) {
|
||||
return buf->first >= buf->last;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@
|
||||
static void buffer_skip(p_buffer buf, size_t count) {
|
||||
buf->received += count;
|
||||
buf->first += count;
|
||||
- if (buffer_isempty(buf))
|
||||
+ if (ls_buffer_isempty(buf))
|
||||
buf->first = buf->last = 0;
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@
|
||||
int err = IO_DONE;
|
||||
p_io io = buf->io;
|
||||
p_timeout tm = buf->tm;
|
||||
- if (buffer_isempty(buf)) {
|
||||
+ if (ls_buffer_isempty(buf)) {
|
||||
size_t got;
|
||||
err = io->recv(io->ctx, buf->data, BUF_SIZE, &got, tm);
|
||||
buf->first = 0;
|
||||
--- src/buffer.h.orig 2014-02-11 11:43:12.000000000 -0800
|
||||
+++ src/buffer.h 2014-02-11 11:43:46.000000000 -0800
|
||||
@@ -34,12 +34,12 @@
|
||||
} t_buffer;
|
||||
typedef t_buffer *p_buffer;
|
||||
|
||||
-int buffer_open(lua_State *L);
|
||||
-void buffer_init(p_buffer buf, p_io io, p_timeout tm);
|
||||
-int buffer_meth_send(lua_State *L, p_buffer buf);
|
||||
-int buffer_meth_receive(lua_State *L, p_buffer buf);
|
||||
-int buffer_meth_getstats(lua_State *L, p_buffer buf);
|
||||
-int buffer_meth_setstats(lua_State *L, p_buffer buf);
|
||||
-int buffer_isempty(p_buffer buf);
|
||||
+int ls_buffer_open(lua_State *L);
|
||||
+void ls_buffer_init(p_buffer buf, p_io io, p_timeout tm);
|
||||
+int ls_buffer_meth_send(lua_State *L, p_buffer buf);
|
||||
+int ls_buffer_meth_receive(lua_State *L, p_buffer buf);
|
||||
+int ls_buffer_meth_getstats(lua_State *L, p_buffer buf);
|
||||
+int ls_buffer_meth_setstats(lua_State *L, p_buffer buf);
|
||||
+int ls_buffer_isempty(p_buffer buf);
|
||||
|
||||
#endif /* BUF_H */
|
||||
--- src/luasocket.c.orig 2014-02-11 11:44:11.000000000 -0800
|
||||
+++ src/luasocket.c 2014-02-11 11:44:37.000000000 -0800
|
||||
@@ -46,7 +46,7 @@
|
||||
{"auxiliar", auxiliar_open},
|
||||
{"except", except_open},
|
||||
{"timeout", timeout_open},
|
||||
- {"buffer", buffer_open},
|
||||
+ {"buffer", ls_buffer_open},
|
||||
{"inet", inet_open},
|
||||
{"tcp", tcp_open},
|
||||
{"udp", udp_open},
|
||||
--- src/tcp.c.orig 2014-02-11 11:45:12.000000000 -0800
|
||||
+++ src/tcp.c 2014-02-11 11:46:27.000000000 -0800
|
||||
@@ -124,22 +124,22 @@
|
||||
\*-------------------------------------------------------------------------*/
|
||||
static int meth_send(lua_State *L) {
|
||||
p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
|
||||
- return buffer_meth_send(L, &tcp->buf);
|
||||
+ return ls_buffer_meth_send(L, &tcp->buf);
|
||||
}
|
||||
|
||||
static int meth_receive(lua_State *L) {
|
||||
p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
|
||||
- return buffer_meth_receive(L, &tcp->buf);
|
||||
+ return ls_buffer_meth_receive(L, &tcp->buf);
|
||||
}
|
||||
|
||||
static int meth_getstats(lua_State *L) {
|
||||
p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
|
||||
- return buffer_meth_getstats(L, &tcp->buf);
|
||||
+ return ls_buffer_meth_getstats(L, &tcp->buf);
|
||||
}
|
||||
|
||||
static int meth_setstats(lua_State *L) {
|
||||
p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
|
||||
- return buffer_meth_setstats(L, &tcp->buf);
|
||||
+ return ls_buffer_meth_setstats(L, &tcp->buf);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*\
|
||||
@@ -178,7 +178,7 @@
|
||||
static int meth_dirty(lua_State *L)
|
||||
{
|
||||
p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
|
||||
- lua_pushboolean(L, !buffer_isempty(&tcp->buf));
|
||||
+ lua_pushboolean(L, !ls_buffer_isempty(&tcp->buf));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
io_init(&clnt->io, (p_send) socket_send, (p_recv) socket_recv,
|
||||
(p_error) socket_ioerror, &clnt->sock);
|
||||
timeout_init(&clnt->tm, -1, -1);
|
||||
- buffer_init(&clnt->buf, &clnt->io, &clnt->tm);
|
||||
+ ls_buffer_init(&clnt->buf, &clnt->io, &clnt->tm);
|
||||
clnt->family = server->family;
|
||||
return 1;
|
||||
} else {
|
||||
@@ -375,7 +375,7 @@
|
||||
io_init(&tcp->io, (p_send) socket_send, (p_recv) socket_recv,
|
||||
(p_error) socket_ioerror, &tcp->sock);
|
||||
timeout_init(&tcp->tm, -1, -1);
|
||||
- buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
|
||||
+ ls_buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
|
||||
tcp->family = family;
|
||||
return 1;
|
||||
} else {
|
||||
@@ -454,7 +454,7 @@
|
||||
io_init(&tcp->io, (p_send) socket_send, (p_recv) socket_recv,
|
||||
(p_error) socket_ioerror, &tcp->sock);
|
||||
timeout_init(&tcp->tm, -1, -1);
|
||||
- buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
|
||||
+ ls_buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
|
||||
tcp->sock = SOCKET_INVALID;
|
||||
tcp->family = PF_UNSPEC;
|
||||
/* allow user to pick local address and port */
|
||||
--- src/unix.c.orig 2014-02-11 11:46:51.000000000 -0800
|
||||
+++ src/unix.c 2014-02-11 11:47:38.000000000 -0800
|
||||
@@ -109,22 +109,22 @@
|
||||
\*-------------------------------------------------------------------------*/
|
||||
static int meth_send(lua_State *L) {
|
||||
p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1);
|
||||
- return buffer_meth_send(L, &un->buf);
|
||||
+ return ls_buffer_meth_send(L, &un->buf);
|
||||
}
|
||||
|
||||
static int meth_receive(lua_State *L) {
|
||||
p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1);
|
||||
- return buffer_meth_receive(L, &un->buf);
|
||||
+ return ls_buffer_meth_receive(L, &un->buf);
|
||||
}
|
||||
|
||||
static int meth_getstats(lua_State *L) {
|
||||
p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1);
|
||||
- return buffer_meth_getstats(L, &un->buf);
|
||||
+ return ls_buffer_meth_getstats(L, &un->buf);
|
||||
}
|
||||
|
||||
static int meth_setstats(lua_State *L) {
|
||||
p_unix un = (p_unix) auxiliar_checkclass(L, "unix{client}", 1);
|
||||
- return buffer_meth_setstats(L, &un->buf);
|
||||
+ return ls_buffer_meth_setstats(L, &un->buf);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*\
|
||||
@@ -153,7 +153,7 @@
|
||||
|
||||
static int meth_dirty(lua_State *L) {
|
||||
p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1);
|
||||
- lua_pushboolean(L, !buffer_isempty(&un->buf));
|
||||
+ lua_pushboolean(L, !ls_buffer_isempty(&un->buf));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
io_init(&clnt->io, (p_send)socket_send, (p_recv)socket_recv,
|
||||
(p_error) socket_ioerror, &clnt->sock);
|
||||
timeout_init(&clnt->tm, -1, -1);
|
||||
- buffer_init(&clnt->buf, &clnt->io, &clnt->tm);
|
||||
+ ls_buffer_init(&clnt->buf, &clnt->io, &clnt->tm);
|
||||
return 1;
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
@@ -336,7 +336,7 @@
|
||||
io_init(&un->io, (p_send) socket_send, (p_recv) socket_recv,
|
||||
(p_error) socket_ioerror, &un->sock);
|
||||
timeout_init(&un->tm, -1, -1);
|
||||
- buffer_init(&un->buf, &un->io, &un->tm);
|
||||
+ ls_buffer_init(&un->buf, &un->io, &un->tm);
|
||||
return 1;
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
--- src/serial.c.orig 2014-02-11 11:53:16.000000000 -0800
|
||||
+++ src/serial.c 2014-02-11 11:54:45.000000000 -0800
|
||||
@@ -90,22 +90,22 @@
|
||||
\*-------------------------------------------------------------------------*/
|
||||
static int meth_send(lua_State *L) {
|
||||
p_unix un = (p_unix) auxiliar_checkclass(L, "serial{client}", 1);
|
||||
- return buffer_meth_send(L, &un->buf);
|
||||
+ return ls_buffer_meth_send(L, &un->buf);
|
||||
}
|
||||
|
||||
static int meth_receive(lua_State *L) {
|
||||
p_unix un = (p_unix) auxiliar_checkclass(L, "serial{client}", 1);
|
||||
- return buffer_meth_receive(L, &un->buf);
|
||||
+ return ls_buffer_meth_receive(L, &un->buf);
|
||||
}
|
||||
|
||||
static int meth_getstats(lua_State *L) {
|
||||
p_unix un = (p_unix) auxiliar_checkclass(L, "serial{client}", 1);
|
||||
- return buffer_meth_getstats(L, &un->buf);
|
||||
+ return ls_buffer_meth_getstats(L, &un->buf);
|
||||
}
|
||||
|
||||
static int meth_setstats(lua_State *L) {
|
||||
p_unix un = (p_unix) auxiliar_checkclass(L, "serial{client}", 1);
|
||||
- return buffer_meth_setstats(L, &un->buf);
|
||||
+ return ls_buffer_meth_setstats(L, &un->buf);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*\
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
static int meth_dirty(lua_State *L) {
|
||||
p_unix un = (p_unix) auxiliar_checkgroup(L, "serial{any}", 1);
|
||||
- lua_pushboolean(L, !buffer_isempty(&un->buf));
|
||||
+ lua_pushboolean(L, !ls_buffer_isempty(&un->buf));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -183,6 +183,6 @@
|
||||
io_init(&un->io, (p_send) socket_write, (p_recv) socket_read,
|
||||
(p_error) socket_ioerror, &un->sock);
|
||||
timeout_init(&un->tm, -1, -1);
|
||||
- buffer_init(&un->buf, &un->io, &un->tm);
|
||||
+ ls_buffer_init(&un->buf, &un->io, &un->tm);
|
||||
return 1;
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
LuaSocket is a Lua extension library that provides support for the TCP and UDP
|
||||
transport layers.
|
||||
|
||||
Extra Lua modules implementing SMTP, HTTP and FTP protocols are installed
|
||||
to /usr/local/lib/lua/luasocket.
|
||||
|
||||
WWW: https://github.com/diegonehab/luasocket
|
@ -1,30 +0,0 @@
|
||||
%%LUA_MODLIBDIR%%/mime/core.so
|
||||
%%LUA_MODLIBDIR%%/socket/core.so
|
||||
%%LUA_MODLIBDIR%%/socket/serial.so
|
||||
%%LUA_MODLIBDIR%%/socket/unix.so
|
||||
%%LUA_MODSHAREDIR%%/ltn12.lua
|
||||
%%LUA_MODSHAREDIR%%/mime.lua
|
||||
%%LUA_MODSHAREDIR%%/socket.lua
|
||||
%%LUA_MODSHAREDIR%%/socket/ftp.lua
|
||||
%%LUA_MODSHAREDIR%%/socket/headers.lua
|
||||
%%LUA_MODSHAREDIR%%/socket/http.lua
|
||||
%%LUA_MODSHAREDIR%%/socket/smtp.lua
|
||||
%%LUA_MODSHAREDIR%%/socket/tp.lua
|
||||
%%LUA_MODSHAREDIR%%/socket/url.lua
|
||||
%%PORTDOCS%%%%DOCSDIR%%/dns.html
|
||||
%%PORTDOCS%%%%DOCSDIR%%/ftp.html
|
||||
%%PORTDOCS%%%%DOCSDIR%%/http.html
|
||||
%%PORTDOCS%%%%DOCSDIR%%/index.html
|
||||
%%PORTDOCS%%%%DOCSDIR%%/installation.html
|
||||
%%PORTDOCS%%%%DOCSDIR%%/introduction.html
|
||||
%%PORTDOCS%%%%DOCSDIR%%/ltn12.html
|
||||
%%PORTDOCS%%%%DOCSDIR%%/lua05.ppt
|
||||
%%PORTDOCS%%%%DOCSDIR%%/luasocket.png
|
||||
%%PORTDOCS%%%%DOCSDIR%%/mime.html
|
||||
%%PORTDOCS%%%%DOCSDIR%%/reference.css
|
||||
%%PORTDOCS%%%%DOCSDIR%%/reference.html
|
||||
%%PORTDOCS%%%%DOCSDIR%%/smtp.html
|
||||
%%PORTDOCS%%%%DOCSDIR%%/socket.html
|
||||
%%PORTDOCS%%%%DOCSDIR%%/tcp.html
|
||||
%%PORTDOCS%%%%DOCSDIR%%/udp.html
|
||||
%%PORTDOCS%%%%DOCSDIR%%/url.html
|
Loading…
Reference in New Issue
Block a user