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

38 lines
1.2 KiB
Bash
Raw Normal View History

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