You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tedflex/installfull.sh

53 lines
1.7 KiB
Bash

#!/bin/bash
2 years ago
FILE=Makefile
work_dir="${PWD}"
cores="$(nproc)"
curses_url="https://invisible-mirror.net/archives/ncurses/current/ncurses.tar.gz"
2 years ago
if [ -d "ncurses" ]
then
echo "You have already fetched the ncurses source code. Skipping this step..."
else
mkdir ncurses
wget -q -O- "${curses_url}" | tar -xz -C ncurses
echo "Fetched ncurses source code from ${curses_url}..."
fi
cd ncurses/*/ || exit
echo "Runnning configure script..."
2 years ago
if test -f "$FILE"; then
echo "You have already compiled ncurses. Skipping this step..."
echo "However, ensure that you ran the 'configure' script with the '--with-pthread' and '--with-shared' flags."
echo ""
else
./configure --with-pthread --with-shared > /dev/null
echo "Running make..."
make -j"${cores}" > /dev/null
fi
cd lib || exit
FILE=libncursest.so.?.?
2 years ago
if ls /lib/${FILE} 1> /dev/null 2>&1 ; then
echo "You have a version of ncurses that was identical to the one that was compiled."
echo " Quitting..."
exit
else
echo "You have a different version of ncurses than the one that was just compiled."
read -p "Would you like to install the new version? [y/N] " userchoice
2 years ago
if [ "$userchoice" = "y" ]; then
echo "The program will now attempt to install the new version of ncurses (the one that was just compiled). In order to do this, the sudo password is required."
echo "Installing the new version of ncurses..."
2 years ago
cd ../ || exit
sudo make install
echo "The new version has been installed. The program will now quit."
echo "Quitting..."
exit
else
echo "You chose to not install the new ncurses version. This program will now quit."
echo "Quitting..."
exit
fi
fi