Compiling and using luarocks

#See https://adrhc.go.ro/wordpress/common-commands-when-building/ for building environment, x.sh script and other things not defined here.
#Before starting do declare the environment variables specified to the link above.

NEW_BUILD_NAME=luarocks
NEW_BUILD_VER=2.2.2
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0

cd /ffp/home/root/compile/luarocks-2.2.2
~/x.sh ffpg
./configure --help > configure.help.txt
./configure --prefix=/ffp
make build

rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
make install DESTDIR=$HOME/temp/$NEW_BUILD_NAME_AND_VER
cd $HOME/temp/$NEW_BUILD_NAME_AND_VER
makepkg $NEW_BUILD_NAME $NEW_BUILD_VER $NEW_BUILD_NR
cp -v /tmp/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz ~/ffp_0.7_armv5/packages/
funpkg -q $NEW_BUILD_NAME
funpkg -i ~/apache-htdocs/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz

#using luarocks
luarocks search cjson
luarocks install lua-cjson --deps-mode all
luarocks install router --deps-mode all
#*.lua rocks are installed to /ffp/share/lua/5.1/
#*.so rocks are installed to /ffp/lib/lua/5.1/

#nginx configuration
lua_package_cpath   '/ffp/lib/lua/5.1/?.so;;';
lua_package_path    '/ffp/share/lua/5.1/?.lua;;';

#using router; for some versions ngx.var.request_method must be lower-case: 
router:execute(string.lower(ngx.var.request_method), ngx.var.restPaths)

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.