- Configuration
From the top dir of RRDtool package, run "./configure", or
- "./configure --enable-lua-site-install" if you prefer to install it
- in Lua's search path.
+ "./configure --enable-lua-site-install" if you prefer to install in
+ Lua's search path.
- You should have lua and lua-dev packages installed before executing
- configure.
+ You should have lua 5.0, or superior, and respective lua-dev packages
+ installed before executing configure.
- Compilation and installation
Run 'make' and 'sudo make install'. If you don't enable lua-site-install,
- the Lua module will be installed together with RRDtool, under the subdir
- lib/lua/<lua_version>.
+ the Lua modules will be installed together with RRDtool, under the subdir
+ <INSTALL_PREFIX>lib/lua/<lua_version>.
- Testing
Start your programs with:
- ---------------------------------------------------------------
- package.cpath = '/usr/local/rrdtool-1.3.2/lib/lua/5.1/?.so;' ..
+ ------..-----------------------------------------------------------
+ package.cpath = '<INSTALL_PREFIX/lib/lua/5.1/?.so;' ..
package.cpath
require 'rrd'
- ---------------------------------------------------------------
+ -------------------------------------------------------------------
OBS: If you use the option --enable-lua-site-install you won't need
to change package.cpath like above.
tell your Lua programs where to find it by changing the Lua var
LUA_PATH:
- --- compat-5.1.lua is only necessary for Lua 5.0 ----------------
+ --- compat-5.1.lua is only necessary for Lua 5.0 ------------------
original_LUA_PATH = LUA_PATH
-- try only compat-5.1 installed with RRDtool package
- LUA_PATH = '/usr/local/rrdtool-1.3.2/lib/lua/5.0/?.lua'
+ LUA_PATH = '<INSTALL_PREFIX>/lib/lua/5.0/?.lua'
require 'compat-5.1'
LUA_PATH = original_LUA_PATH
original_LUA_PATH = nil
- --- end of code to require compat-5.1 ---------------------------
+ --- end of code to require compat-5.1 -----------------------------
- Now we can require the rrd module in the same way we did for 5.1 above:
+ Now we can require the rrd module just like we did for 5.1 above:
- ---------------------------------------------------------------
- package.cpath = '/usr/local/rrdtool-1.3.2/lib/lua/5.0/?.so;' ..
+ -------------------------------------------------------------------
+ package.cpath = '<INSTALL_PREFIX>/lib/lua/5.0/?.so;' ..
package.cpath
require 'rrd'
- ---------------------------------------------------------------
-
+ -------------------------------------------------------------------