aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--luasocket-3.0-1.rockspec105
-rw-r--r--luasocket-3.0.rockspec67
2 files changed, 105 insertions, 67 deletions
diff --git a/luasocket-3.0-1.rockspec b/luasocket-3.0-1.rockspec
new file mode 100644
index 0000000..c3fa080
--- /dev/null
+++ b/luasocket-3.0-1.rockspec
@@ -0,0 +1,105 @@
1package = "LuaSocket"
2version = "3.0-1"
3source = {
4 url = "git://github.com/diegonehab/luasocket.git",
5 branch = "master"
6}
7description = {
8 summary = "Network support for the Lua language",
9 detailed = [[
10 LuaSocket is a Lua extension library that is composed by two parts: a C core
11 that provides support for the TCP and UDP transport layers, and a set of Lua
12 modules that add support for functionality commonly needed by applications
13 that deal with the Internet.
14 ]],
15 homepage = "http://luaforge.net/projects/luasocket/",
16 license = "MIT"
17}
18dependencies = {
19 "lua >= 5.1"
20}
21
22local function make_plat(plat)
23 local defines = {
24 unix = {
25 "LUASOCKET_DEBUG",
26 "LUASOCKET_API=__attribute__((visibility(\"default\")))",
27 "UNIX_API=__attribute__((visibility(\"default\")))",
28 "MIME_API=__attribute__((visibility(\"default\")))"
29 },
30 macosx = {
31 "LUASOCKET_DEBUG",
32 "UNIX_HAS_SUN_LEN",
33 "LUASOCKET_API=__attribute__((visibility(\"default\")))",
34 "UNIX_API=__attribute__((visibility(\"default\")))",
35 "MIME_API=__attribute__((visibility(\"default\")))"
36 },
37 win32 = {
38 "LUASOCKET_DEBUG",
39 "NDEBUG",
40 "LUASOCKET_API=__declspec(dllexport)",
41 "UNIX_API=__declspec(dllexport)",
42 "MIME_API=__declspec(dllexport)"
43 },
44 mingw32 = {
45 "LUASOCKET_DEBUG",
46 "LUASOCKET_INET_PTON",
47 "WINVER=0x0501",
48 "LUASOCKET_API=__declspec(dllexport)",
49 "UNIX_API=__declspec(dllexport)",
50 "MIME_API=__declspec(dllexport)"
51 }
52 }
53 local modules = {
54 ["socket.core"] = {
55 sources = { "src/luasocket.c", "src/timeout.c", "src/buffer.c", "src/io.c", "src/auxiliar.c",
56 "src/options.c", "src/inet.c", "src/except.c", "src/select.c", "src/tcp.c", "src/udp.c" },
57 defines = defines[plat],
58 incdir = "/src"
59 },
60 ["mime.core"] = {
61 sources = { "src/mime.c" },
62 defines = defines[plat],
63 incdir = "/src"
64 },
65 ["socket.http"] = "src/http.lua",
66 ["socket.url"] = "src/url.lua",
67 ["socket.tp"] = "src/tp.lua",
68 ["socket.ftp"] = "src/ftp.lua",
69 ["socket.headers"] = "src/headers.lua",
70 ["socket.smtp"] = "src/smtp.lua",
71 ltn12 = "src/ltn12.lua",
72 socket = "src/socket.lua",
73 mime = "src/mime.lua"
74 }
75 if plat == "unix" or plat == "macosx" then
76 modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/usocket.c"
77 modules["socket.unix"] = {
78 sources = { "src/buffer.c", "src/auxiliar.c", "src/options.c", "src/timeout.c", "src/io.c",
79 "src/usocket.c", "src/unix.c" },
80 defines = defines[plat],
81 incdir = "/src"
82 }
83 modules["socket.serial"] = {
84 sources = { "src/buffer.c", "src/auxiliar.c", "src/options.c", "src/timeout.c",
85 "src/io.c", "src/usocket.c", "src/serial.c" },
86 defines = defines[plat],
87 incdir = "/src"
88 }
89 else
90 modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/wsocket.c"
91 modules["socket.core"].libraries = { "ws2_32" }
92 end
93 return { modules = modules }
94end
95
96build = {
97 type = "builtin",
98 platforms = {
99 unix = make_plat("unix"),
100 macosx = make_plat("macosx"),
101 win32 = make_plat("win32"),
102 mingw32 = make_plat("mingw32")
103 },
104 copy_directories = { "doc", "samples", "etc", "test" }
105}
diff --git a/luasocket-3.0.rockspec b/luasocket-3.0.rockspec
deleted file mode 100644
index 9c59abe..0000000
--- a/luasocket-3.0.rockspec
+++ /dev/null
@@ -1,67 +0,0 @@
1package = "LuaSocket"
2version = "2.1-1"
3source = {
4 url = "git://github.com/diegonehab/luasocket.git",
5 branch = "unstable"
6}
7description = {
8 summary = "Network support for the Lua language",
9 detailed = [[
10 LuaSocket is a Lua extension library that is composed by two parts: a C core
11 that provides support for the TCP and UDP transport layers, and a set of Lua
12 modules that add support for functionality commonly needed by applications
13 that deal with the Internet.
14 ]],
15 homepage = "http://luaforge.net/projects/luasocket/",
16 license = "MIT"
17}
18dependencies = {
19 "lua >= 5.1"
20}
21build = {
22 type = "make",
23 build_variables = {
24 PLAT="linux",
25 LUAINC_linux="$(LUA_INCDIR)"
26 },
27 install_variables = {
28 INSTALL_TOP_SHARE = "$(LUADIR)",
29 INSTALL_TOP_LIB = "$(LIBDIR)"
30 },
31 platforms = {
32 macosx = {
33 build_variables = {
34 PLAT="macosx",
35 LUAINC_macosx="$(LUA_INCDIR)"
36 }
37 },
38 windows={
39 type= "command",
40 build_command=
41 "set INCLUDE=$(LUA_INCDIR);%INCLUDE% &"..
42 "set LIB=$(LUA_LIBDIR);%LIB% &"..
43 "msbuild /p:\"VCBuildAdditionalOptions= /useenv\" luasocket.sln &"..
44 "mkdir mime & mkdir socket &"..
45 "cp src/mime.dll mime/core.dll &"..
46 "cp src/socket.dll socket/core.dll",
47 install= {
48 lib = {
49 ["mime.core"] = "mime/core.dll",
50 ["socket.core"] = "socket/core.dll"
51 },
52 lua = {
53 "src/ltn12.lua",
54 "src/mime.lua",
55 "src/socket.lua",
56 ["socket.headers"] = "src/headers.lua",
57 ["socket.ftp"] = "src/ftp.lua",
58 ["socket.http"] = "src/http.lua",
59 ["socket.smtp"] = "src/smtp.lua",
60 ["socket.tp"] = "src/tp.lua",
61 ["socket.url"] = "src/url.lua",
62 }
63 }
64 }
65 },
66 copy_directories = { "doc", "samples", "etc", "test" }
67}