2014-02-25 10:47:45 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -o errtrace
|
2012-07-09 21:14:07 -04:00
|
|
|
|
2013-11-20 18:10:45 -05:00
|
|
|
STATUS=development
|
|
|
|
|
2014-02-25 10:47:45 -05:00
|
|
|
error_handler()
|
|
|
|
{
|
|
|
|
ERR_CODE=$?
|
|
|
|
echo "Error $ERR_CODE with command '$BASH_COMMAND' on line ${BASH_LINENO[0]}. Exiting."
|
|
|
|
exit $ERR_CODE
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
trap error_handler ERR
|
|
|
|
|
2012-09-08 12:28:33 -04:00
|
|
|
debian_prepare()
|
2012-07-21 19:49:19 -04:00
|
|
|
{
|
|
|
|
echo
|
|
|
|
echo Profanity installer ... updating apt repositories
|
|
|
|
echo
|
|
|
|
sudo apt-get update
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo Profanity installer... installing dependencies
|
|
|
|
echo
|
2016-05-17 17:24:41 -04:00
|
|
|
sudo apt-get -y install git automake autoconf libssl-dev libexpat1-dev libncursesw5-dev libglib2.0-dev libnotify-dev libcurl3-dev libxss-dev libotr5-dev libreadline-dev libtool libgpgme11-dev libgtk2.0-dev autoconf-archive
|
2012-07-21 19:49:19 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-09-08 12:28:33 -04:00
|
|
|
fedora_prepare()
|
2012-07-21 19:49:19 -04:00
|
|
|
{
|
|
|
|
echo
|
|
|
|
echo Profanity installer... installing dependencies
|
|
|
|
echo
|
|
|
|
|
2016-05-17 17:24:41 -04:00
|
|
|
sudo dnf -y install gcc git autoconf automake openssl-devel expat-devel ncurses-devel glib2-devel libnotify-devel libcurl-devel libXScrnSaver-devel libotr-devel readline-devel libtool gpgme-devel gtk2-devel autoconf-archive
|
2012-07-21 19:49:19 -04:00
|
|
|
}
|
|
|
|
|
2014-02-21 05:33:58 -05:00
|
|
|
opensuse_prepare()
|
|
|
|
{
|
2014-08-09 14:12:37 -04:00
|
|
|
echo
|
|
|
|
echo Profanity installer...installing dependencies
|
|
|
|
echo
|
2016-05-17 17:24:41 -04:00
|
|
|
sudo zypper -n in gcc git automake make autoconf libopenssl-devel expat libexpat-devel ncurses-devel glib2-devel libnotify-devel libcurl-devel libXScrnSaver-devel libotr-devel readline-devel libtool libgpgme-devel autoconf-archive
|
2014-02-21 05:33:58 -05:00
|
|
|
}
|
|
|
|
|
2015-07-20 19:34:59 -04:00
|
|
|
centos_prepare()
|
|
|
|
{
|
|
|
|
echo
|
|
|
|
echo Profanity installer...installing dependencies
|
|
|
|
echo
|
|
|
|
|
|
|
|
sudo yum -y install epel-release
|
|
|
|
sudo yum -y install git
|
|
|
|
sudo yum -y install gcc autoconf automake cmake
|
2016-05-17 17:24:41 -04:00
|
|
|
sudo yum -y install openssl-devel expat-devel ncurses-devel glib2-devel libnotify-devel libcurl-devel libXScrnSaver-devel libotr-devel readline-devel libtool gpgme-devel autoconf-archive
|
2015-07-20 19:34:59 -04:00
|
|
|
}
|
|
|
|
|
2012-09-08 12:28:33 -04:00
|
|
|
cygwin_prepare()
|
|
|
|
{
|
|
|
|
echo
|
|
|
|
echo Profanity installer... installing dependencies
|
|
|
|
echo
|
|
|
|
|
2015-10-06 14:00:05 -04:00
|
|
|
if ! command -v apt-cyg &>/dev/null; then cyg_install_apt_cyg; fi
|
2013-10-07 11:53:47 -04:00
|
|
|
if [ -n "$CYG_MIRROR" ]; then
|
2016-05-17 17:24:41 -04:00
|
|
|
apt-cyg -m $CYG_MIRROR install git make gcc-core m4 automake autoconf pkg-config openssl-devel libexpat-devel zlib-devel libncursesw-devel libglib2.0-devel libcurl-devel libidn-devel libssh2-devel libkrb5-devel openldap-devel libgcrypt-devel libreadline-devel libgpgme-devel libtool libpcre-devel libisl10 libcloog-isl4 autoconf-archive
|
2013-10-07 11:53:47 -04:00
|
|
|
else
|
2016-05-17 17:24:41 -04:00
|
|
|
apt-cyg install git make gcc-core m4 automake autoconf pkg-config openssl-devel libexpat-devel zlib-devel libncursesw-devel libglib2.0-devel libcurl-devel libidn-devel libssh2-devel libkrb5-devel openldap-devel libgcrypt-devel libreadline-devel libgpgme-devel libtool libpcre-devel libisl10 libcloog-isl4 autoconf-archive
|
2013-11-20 18:06:26 -05:00
|
|
|
|
2013-10-07 11:53:47 -04:00
|
|
|
fi
|
2012-09-08 12:28:33 -04:00
|
|
|
}
|
|
|
|
|
2015-09-21 16:40:04 -04:00
|
|
|
install_lib_mesode()
|
2012-07-21 19:49:19 -04:00
|
|
|
{
|
|
|
|
echo
|
2015-09-21 16:40:04 -04:00
|
|
|
echo Profanity installer... installing libmesode
|
2012-07-21 19:49:19 -04:00
|
|
|
echo
|
2015-10-01 09:41:51 -04:00
|
|
|
git clone https://github.com/boothj5/libmesode.git
|
2015-09-21 16:40:04 -04:00
|
|
|
cd libmesode
|
2012-07-21 19:49:19 -04:00
|
|
|
./bootstrap.sh
|
2014-08-09 16:16:01 -04:00
|
|
|
./configure --prefix=$1
|
2012-07-21 19:49:19 -04:00
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
}
|
|
|
|
|
|
|
|
install_profanity()
|
|
|
|
{
|
|
|
|
echo
|
|
|
|
echo Profanity installer... installing Profanity
|
|
|
|
echo
|
2013-11-20 18:10:45 -05:00
|
|
|
if [ "${STATUS}" = "development" ]; then
|
|
|
|
./bootstrap.sh
|
|
|
|
fi
|
2012-07-21 19:49:19 -04:00
|
|
|
./configure
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
}
|
|
|
|
|
2015-10-06 14:00:05 -04:00
|
|
|
cyg_install_apt_cyg()
|
|
|
|
{
|
|
|
|
echo
|
|
|
|
echo Profanity installer... installing apt-cyg
|
|
|
|
echo
|
|
|
|
wget https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
|
|
|
|
#wget --no-check-certificate https://raw.github.com/boothj5/apt-cyg/master/apt-cyg
|
|
|
|
#wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
|
|
|
|
chmod +x apt-cyg
|
|
|
|
mv apt-cyg /usr/local/bin/
|
|
|
|
|
|
|
|
}
|
2015-09-21 16:40:04 -04:00
|
|
|
cyg_install_lib_mesode()
|
2012-09-08 12:58:42 -04:00
|
|
|
{
|
|
|
|
echo
|
2015-09-21 16:40:04 -04:00
|
|
|
echo Profanity installer... installing libmesode
|
2012-09-08 12:58:42 -04:00
|
|
|
echo
|
2015-10-01 09:41:51 -04:00
|
|
|
git clone https://github.com/boothj5/libmesode.git
|
2015-09-21 16:40:04 -04:00
|
|
|
cd libmesode
|
2012-09-08 12:58:42 -04:00
|
|
|
./bootstrap.sh
|
|
|
|
./bootstrap.sh # second call seems to fix problem on cygwin
|
2014-08-09 14:12:37 -04:00
|
|
|
./configure --prefix=/usr
|
2012-09-08 12:58:42 -04:00
|
|
|
make
|
|
|
|
make install
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
}
|
|
|
|
|
|
|
|
cyg_install_profanity()
|
|
|
|
{
|
|
|
|
echo
|
|
|
|
echo Profanity installer... installing Profanity
|
|
|
|
echo
|
2013-11-20 18:10:45 -05:00
|
|
|
if [ "${STATUS}" = "development" ]; then
|
|
|
|
./bootstrap.sh
|
|
|
|
fi
|
2012-09-08 12:58:42 -04:00
|
|
|
./configure
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
}
|
|
|
|
|
2012-07-21 19:49:19 -04:00
|
|
|
cleanup()
|
|
|
|
{
|
|
|
|
echo
|
|
|
|
echo Profanity installer... cleaning up
|
|
|
|
echo
|
|
|
|
|
2015-09-21 16:40:04 -04:00
|
|
|
echo Removing libmesode repository...
|
|
|
|
rm -rf libmesode
|
2012-07-21 19:49:19 -04:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo Profanity installer... complete!
|
|
|
|
echo
|
|
|
|
echo Type \'profanity\' to run.
|
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
2013-10-07 11:53:47 -04:00
|
|
|
while getopts m: opt
|
|
|
|
do
|
|
|
|
case "$opt" in
|
|
|
|
m) CYG_MIRROR=$OPTARG;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2012-09-08 09:54:41 -04:00
|
|
|
OS=`uname -s`
|
2012-07-21 19:49:19 -04:00
|
|
|
DIST=unknown
|
|
|
|
|
2012-09-08 09:54:41 -04:00
|
|
|
if [ "${OS}" = "Linux" ]; then
|
|
|
|
if [ -f /etc/fedora-release ]; then
|
|
|
|
DIST=fedora
|
2012-09-08 10:07:03 -04:00
|
|
|
elif [ -f /etc/debian_version ]; then
|
2012-09-08 09:54:41 -04:00
|
|
|
DIST=debian
|
2015-07-20 19:34:59 -04:00
|
|
|
elif [ -f /etc/centos-release ]; then
|
|
|
|
DIST=centos
|
2015-07-20 19:39:53 -04:00
|
|
|
elif [ -f /etc/os-release ]; then
|
|
|
|
DIST=opensuse
|
2012-09-08 09:54:41 -04:00
|
|
|
fi
|
2012-09-08 12:28:33 -04:00
|
|
|
else
|
|
|
|
echo $OS | grep -i cygwin
|
|
|
|
if [ "$?" -eq 0 ]; then
|
|
|
|
DIST=cygwin
|
|
|
|
fi
|
2012-07-21 19:49:19 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
case "$DIST" in
|
2012-09-08 09:54:41 -04:00
|
|
|
unknown) echo The install script will not work on this OS.
|
|
|
|
echo Try a manual install instead.
|
2012-07-21 19:49:19 -04:00
|
|
|
exit
|
|
|
|
;;
|
2012-09-08 12:28:33 -04:00
|
|
|
fedora) fedora_prepare
|
2015-09-21 16:40:04 -04:00
|
|
|
install_lib_mesode /usr
|
2012-09-08 12:58:42 -04:00
|
|
|
install_profanity
|
2012-09-08 12:28:33 -04:00
|
|
|
;;
|
|
|
|
debian) debian_prepare
|
2015-09-21 16:40:04 -04:00
|
|
|
install_lib_mesode /usr
|
2012-09-08 12:58:42 -04:00
|
|
|
install_profanity
|
2012-07-21 19:49:19 -04:00
|
|
|
;;
|
2014-02-21 05:33:58 -05:00
|
|
|
opensuse) opensuse_prepare
|
2015-09-21 16:40:04 -04:00
|
|
|
install_lib_mesode /usr/local
|
2014-08-09 18:06:19 -04:00
|
|
|
sudo /sbin/ldconfig
|
2014-02-21 05:33:58 -05:00
|
|
|
install_profanity
|
|
|
|
;;
|
2015-07-20 19:34:59 -04:00
|
|
|
centos) centos_prepare
|
2015-09-21 16:40:04 -04:00
|
|
|
install_lib_mesode /usr
|
2015-07-20 19:34:59 -04:00
|
|
|
sudo ldconfig
|
|
|
|
install_profanity
|
|
|
|
;;
|
2012-09-08 12:28:33 -04:00
|
|
|
cygwin) cygwin_prepare
|
2015-09-21 16:40:04 -04:00
|
|
|
cyg_install_lib_mesode
|
2012-09-08 12:58:42 -04:00
|
|
|
cyg_install_profanity
|
2012-07-21 19:49:19 -04:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
cleanup
|