Lua: installing luarocks as RPM in Fedora 15

Ruby has gem, Python has pip and Lua has luarocks. Unfortunately, in Fedora 15 there is no rpm package of luarocks, so if you need it and don’t want to install it from sources, you will have to build it. Fortunately, there is a spec file written by Duboucher Thomas, so we don’t need to write it from scratch. There is also package review request for Fedora 12, but bugs weren’t solved still so you might not want use it on production servers. At the moment last version of luarocks is 2.0.5. Download luarocks sources to you SOURCES directory:

wget http://luarocks.org/releases/luarocks-2.0.5.tar.gz

Change luarocks version in spec file to “2.0.5”:

Version: 2.0.5

Build:

rpmbuild -bb ~/rpmbuild/SPECS/luarocks-1.0-1.spec

Install:

rpm -ivh ~/rpmbuild/RPMS/x86_64/luarocks-2.0.5-1.fc15.x86_64.rpm

And use:

[root@playground ~]# luarocks search geo
Search results:
===============
Rockspecs and source rocks:
---------------------------
lua-geoip
0.1-1 (rockspec) - http://luarocks.org/repositories/rocks
0.1-1 (src) - http://luarocks.org/repositories/rocks
[root@playground ~]#

Now all Lua modules (a.k.a. rocks) from luarocks are available for installation and use.

Didn’t find the answer to your question? Ask it our administrators to reply we will publish on website.

Leave a Reply

Your email address will not be published. Required fields are marked *