# Lua 5.4.6
# =========
# Below are instructions for installing Lua. Some things that support Lua
# that I have HOWTOs for are:
# kdelibs
# links-lua
# swig
# Nmap
# xapian-bindings
# For a list of lots more, see this page at the Lua site.
# Get the source
cd
test -f installed/lua-5.4.6.tar.gz && mv installed/lua-5.4.6.tar.gz .
test ! -f lua-5.4.6.tar.gz &&
wget https://www.lua.org/ftp/lua-5.4.6.tar.gz
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "lua-*" -exec rm -r {} \;
tar xzvf ~/lua-5.4.6.tar.gz
cd lua-5.4.6
test $UID = 0 && chown -R root:root .
# Read these:
# less ./README
# lynx doc/readme.html
# Change lib to lib64 in a few places to avoid having to use
# a text editor and INSTALL_LIB, INSTALL_CMOD
wget https://englanders.us/pub/linux/patches/lua-5.4.6.patch &&
patch -p1 < lua-5.4.6.patch
# Build it for Linux with readline support
make linux-readline MYLIBS=-ltermcap
# Become root to install it
su
# Install it
make install
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/lua-*.tar.*
mv lua-5.4.6.tar.gz installed/
# If you ever want to uninstall Lua, this should do it:
su
( /usr/local/bin ; rm -f lua luac )
( cd /usr/local/include
rm -f lua.h luaconf.h lualib.h lauxlib.h lua.hpp )
( cd /usr/local/lib ; rm -f liblua.* liblualib.* )
( cd /usr/local/lib64 ; rm -f liblua.* liblualib.* )
test -d /usr/local/lib/lua && rm -r /usr/local/lib/lua
test -d /usr/local/lib64/lua && rm -r /usr/local/lib64/lua
( cd /usr/local/man/man1 ; rm -f lua.1 luac.1 )
test -d /usr/local/share/lua && rm -r /usr/local/share/lua
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "lua-*" -exec rm -r {} \;
rm -f ~/installed/lua-*.tar.*