Last active
March 10, 2016 11:19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download latest OTR and Pidgin and run vanilla configure & compile | |
# you'll have to run make install manually when completed. | |
# If you get errors on OSX you may find help at: | |
# https://gist.github.com/cyphunk/5048773 | |
INSTALLPREFIX=/usr/local | |
SH_SOURCE=${BASH_SOURCE:-$_} | |
if readlink "$SH_SOURCE" >/dev/null 2>&1; then | |
cd "$(dirname $(readlink $SH_SOURCE))" | |
else | |
cd "$(dirname $SH_SOURCE)" | |
fi | |
echo -e "\n\n# OTR - DOWNLOAD & VERIFY\n" | |
wget -r --no-verbose --no-parent --no-clobber --no-host-directories --cut-dirs=100 \ | |
-A tar.gz,tar.gz.asc \ | |
https://otr.cypherpunks.ca/ \ | |
|| exit | |
LIBOTR=$(ls -t libotr-* | grep -v .asc | head -1) | |
LIBOTRPIDGIN=$(ls -t pidgin-otr-* | grep -v .asc | head -1) | |
curl https://otr.cypherpunks.ca/gpgkey.asc | gpg --import | |
gpg --verify ${LIBOTR}.asc $LIBOTR || exit | |
gpg --verify ${LIBOTRPIDGIN}.asc $LIBOTRPIDGIN || exit | |
test -d ${LIBOTR%.tar.*} || tar xf $LIBOTR || exit | |
test -d ${LIBOTRPIDGIN%.tar.*} || tar xf $LIBOTRPIDGIN || exit | |
echo -e "\n\n# PIDGIN - DOWNLOAD & VERIFY\n" | |
wget --no-verbose --no-clobber --content-disposition \ | |
https://sourceforge.net/projects/pidgin/files/latest/download?source=files \ | |
|| exit | |
PIDGIN=$(ls -t pidgin-[0-9]* | grep -v .asc | head -1) | |
VERSION=${PIDGIN#pidgin-} | |
VERSION=${VERSION%.tar.*} | |
wget --no-verbose --no-clobber --content-disposition \ | |
https://sourceforge.net/projects/pidgin/files/Pidgin/$VERSION/${PIDGIN}.asc/download \ | |
|| exit | |
gpg --verify ${PIDGIN}.asc $PIDGIN | |
if [[ $? -ne 0 ]]; then | |
cat <<EOM | |
You might need to import the key by hand. Check required key from pidgin site | |
and then download via SSL keyserver and import with gpg --import rather than | |
gpg --recv-key which is insecure. | |
https://developer.pidgin.im/wiki/Are%20the%20packages%20signed | |
https://pgp.mit.edu | |
example: | |
curl 'https://sks-keyservers.net/pks/lookup?op=get&search=0xA8AC8032' \ | |
| gpg --import | |
EOM | |
exit | |
fi | |
test -d ${PIDGIN%.tar.*} || tar xf $PIDGIN || exit | |
echo -e "\n\n# Build $LIBOTR\n" | |
cd ${LIBOTR%.tar.*} || exit | |
./configure --prefix=$INSTALLPREFIX || exit | |
make || exit | |
echo -e "\n\n# Build $LIBOTRPIDGIN\n" | |
cd ../${LIBOTRPIDGIN%.tar.*} || exit | |
./configure --prefix=$INSTALLPREFIX || exit | |
make || exit | |
echo -e "\n\n# Build $PIDGIN\n" | |
cd ../${PIDGIN%.tar.*} || exit | |
# need gtkspell2 | |
./configure --prefix=$INSTALLPREFIX \ | |
--disable-screensaver --disable-gstreamer --disable-vv --disable-idn \ | |
--disable-meanwhile --disable-avahi --disable-dbus --disable-perl \ | |
--disable-tcl --disable-gestures --disable-startup-notification \ | |
|| exit | |
make || exit | |
cd .. | |
cat <<EOM | |
Compiled. To install run manually: | |
cd `pwd`/${LIBOTR%.tar.*} && sudo make install \\ | |
&& cd ../${LIBOTRPIDGIN%.tar.*} && sudo make install \\ | |
&& cd ../${PIDGIN%.tar.*} && sudo make install | |
EOM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment