How to install Luarocks from sources in Debian
In this article we are going to install luarocks software in a Debian box.
Luarocks is a system to manage and deploy lua modules ("rocks").
It also tracks and installs needed dependencies when installing a new lua rock.
luarocks.org official web site.
Install lua
First we need lua scripting language to be installed. (I get lua 5.2 version)
$ sudo aptitude install lua5.2Lua development files will also be necessary to compile sources afterwards.
$ sudo aptitude install liblua5.2-devGet and compile luarocks source code
Get luarocks source code
(Current version was 2.0.13 when writing this article)
$ wget luarocks.org/releases/luarocks-2.0.13.tar.gz$ tar xvzf luarocks-2.0.13.tar.gz$ cd luarocks-2.0.13/Build the sources.
$ ./configureor to select a specific lua version:
$ ./configure --lua-version=5.2 # Use specific Lua version: 5.1 or 5.2. Default is "5.1" $ make$ sudo make installExecute luarocks
If /usr/local/bin is not set in PATH env variable.
$ export PATH=$PATH:/usr/local/binShow help
General help:
$ luarocks$ luarocks helpShows help about list command.
$ luarocks help listList currently installed rocks:
$ luarocks listInstalled rocks: ---------------- luasec 0.4-4 (installed) - /usr/local/lib/luarocks/rocks luasocket 2.0.2-5 (installed) - /usr/local/lib/luarocks/rocks sha2 0.2.0-1 (installed) - /usr/local/lib/luarocks/rocks
Search among available rocks:
$ luarocks search socketInstall a rock in global system tree:
$ sudo luarocks install luasocketor in a local tree:
$ luarocks --local install luasocketShow info about an installed rock:
$ luarocks show luasocketLuaSocket 3.0rc1-1 - Network support for the Lua language LuaSocket is a Lua extension library that is composed by two parts: a C core that provides support for the TCP and UDP transport layers, and a set of Lua modules that add support for functionality commonly needed by applications that deal with the Internet. License: MIT Homepage: http://luaforge.net/projects/luasocket/ Installed in: /usr/local Modules: ltn12 (/usr/local/share/lua/5.2/ltn12.lua) mime (/usr/local/share/lua/5.2/mime.lua) mime.core (/usr/local/lib/lua/5.2/mime/core.so) socket (/usr/local/share/lua/5.2/socket.lua) socket.core (/usr/local/lib/lua/5.2/socket/core.so) socket.ftp (/usr/local/share/lua/5.2/socket/ftp.lua) socket.headers (/usr/local/share/lua/5.2/socket/headers.lua) socket.http (/usr/local/share/lua/5.2/socket/http.lua) socket.serial (/usr/local/lib/lua/5.2/socket/serial.so) socket.smtp (/usr/local/share/lua/5.2/socket/smtp.lua) socket.tp (/usr/local/share/lua/5.2/socket/tp.lua) socket.unix (/usr/local/lib/lua/5.2/socket/unix.so) socket.url (/usr/local/share/lua/5.2/socket/url.lua)
Remove an installed rock:
$ sudo luarocks remove luasocketReference
http://luarocks.org
http://luarocks.org/en/Documentation
http://luarocks.org/en/Using_LuaRocks
http://luarocks.org/en/Installation_instructions_for_Unix
0 comentarios:
Post a Comment