HI all,
Rockspec [1] provides a higher-level way of generating rockspecs. For
instance, the rockspec at [2] was built from the following script:
-- rspec.lua
require 'rockspec'
package('rockspec','0.1')
depends 'penlight'
Lua.directory '.'
Lua.module.rockspec()
rockspec.write()
So 'lua rspec.lua' generates a rockspec template that can be edited
and refined - it is a very specialized build tool that targets
rockfiles.
These specifications really take off when expressing per-platform
overrides. This generates a rockspec for LuaSocket using the builtin
backend:
package('luasocket','2.0.2','3')
C.module.socket.core [[
luasocket.c auxiliar.c buffer.c except.c io.c tcp.c
timeout.c udp.c options.c select.c inet.c
]]
:defines 'LUASOCKET_DEBUG'
:when 'unix' :add 'usocket.c'
:when 'win32'
:add 'wsocket.c'
:libraries 'wsock32'
C.module.mime.core 'mime.c'
Lua.directory 'src'
function socket(name)
Lua.module.socket[name] (name..'.lua')
end
socket 'http'
socket 'url'
socket 'tp'
socket 'ftp'
socket 'smtp'
Lua.module.ltn12()
Lua.module.socket()
Lua.module.mime()
steve d.
[1] https://github.com/stevedonovan/LuaRocksTools/tree/master/rockspec
[2] luarocks install
http://stevedonovan.github.com/files/rockspec-0.1-1.rockspec
_______________________________________________
Luarocks-developers mailing list
[email protected]
http://lists.luaforge.net/cgi-bin/mailman/listinfo/luarocks-developers