This repository has been archived on 2021-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
Mikubot-2/install-dependencies.sh
topkecleon 87ebf19336 whoops
2016-09-06 20:39:39 -04:00

38 lines
1.2 KiB
Bash
Executable File

# Install Lua, Luarocks, and otouto dependencies. Works in Ubuntu, maybe Debian.
# Installs Lua 5.3 if Ubuntu 16.04. Otherwise, 5.2.
#!/bin/sh
if [ $(lsb_release -r | cut -f 2) == "16.04" ]; then
luaver="5.3"
rocklist="luasocket luasec multipart-post lpeg dkjson"
else
luaver="5.2"
rocklist="luasocket luasec multipart-post lpeg dkjson luautf8"
fi
echo "This script is intended for Ubuntu. It may work in Debian."
echo "This script will request root privileges to install the following packages:"
echo "lua$luaver liblua$luaver-dev git libssl-dev fortune-mod fortunes unzip make"
echo "It will also request root privileges to install Luarocks to to /usr/local/"
echo "along with the following rocks:"
echo $rocklist
echo "Press enter to continue. Use Ctrl-C to exit."
read
sudo apt-get update
sudo apt-get install -y lua$luaver liblua$luaver-dev git libssl-dev fortune-mod fortunes unzip make
git clone http://github.com/keplerproject/luarocks
cd luarocks
./configure --lua-version=$luaver --versioned-rocks-dir --lua-suffix=$luaver
make build
sudo make install
for rock in $rocklist; do
sudo luarocks-$luaver install $rock
done
sudo -k
cd ..
echo "Finished. Use ./launch to start otouto."
echo "Be sure to set your bot token in config.lua."