kareem-h
11/22/2015 - 10:23 AM

rTorrent install/update on Ubuntu 14.04

rTorrent install/update on Ubuntu 14.04

#!/bin/bash

# installs/updates rtorrent from source on Ubuntu

TMPDIR=$(mktemp -d)
mkdir $TMPDIR/logs

install_dependencies () {
	apt-get update
	apt-get install -y git subversion build-essential automake libtool libcppunit-dev zlib1g-dev libcurl4-openssl-dev libncurses5-dev
}

install_xmlrpc-c () {
	cd $TMPDIR
	svn co http://svn.code.sf.net/p/xmlrpc-c/code/advanced xmlrpc-c
	cd xmlrpc-c
	./configure
	make && make install
}

install_librtorrent () {
	cd $TMPDIR
	git clone -b branch-0.13 https://github.com/rakshasa/libtorrent
	cd libtorrent
	./autogen.sh
	./configure
	make && make install
	ldconfig
}

install_rtorrent () {
        cd $TMPDIR
        git clone -b branch-0.9 https://github.com/rakshasa/rtorrent
        cd rtorrent
        ./autogen.sh
        ./configure --with-xmlrpc-c=/usr/local/bin/xmlrpc-c-config
        make && make install
}

echo ""
echo "updating/installing rTorrent"
echo "============================"
echo "Dir: $TMPDIR"
echo ""

echo "Installing dependencies..."
install_dependencies &> $TMPDIR/logs/apt.log
echo ""

echo "Installing xmlrpc-c..."
install_xmlrpc-c &> $TMPDIR/logs/xmlrpc-c.log
echo ""

echo "Installing librtorrent..."
install_librtorrent &> $TMPDIR/logs/librtorrent.log
echo ""

echo "Installing rtorrent..."
install_rtorrent &> $TMPDIR/logs/rtorrent.log
echo ""

echo ""
echo "Logs: $TMPDIR/logs"