About

Supporting the site

App Repository‎ > ‎

rtorrent-0.8.9

Overview

This tutorial creates both the rTorrent client and the web interface ruTorrent. These instructions create two app packages: one for rTorrent and one for ruTorrent. If deployed in the proper order, these packages should "just work".

rTorrent requires zlib, openssl, ncurses, libsigc++, xmlrpc-c, cURL, and libtorrent to compile. We compile all the dependencies on a different destination folder, and then statically link them into rTorrent.

Instead of packing all the additional apps that ruTorrent requires in this package, this version requires the DroboApps to be installed separately. The dependencies are:

If you do not need those plugins, you can disable them from the ruTorrent UI. Otherwise, make sure these DroboApps are installed before you install ruTorrent.

Otherwise, keep in mind that this is a very large DroboApp, with lots of dependencies. I have repeated this procedure from scratch several times to make sure it really works, but please keep in mind that this is a very complex procedure, and therefore proceed with caution.

Preparation

Make sure you have a cross-compiling virtual machine properly setup. You'll also need the updated version of the GCC cross-compile toolchain since rTorrent uses GCC Atomic Builtins.

Compilation

The compilation has a small two-pass step due to the fact that XMLRPC-C is not very cross-compile friendly. As usual, we do a first pass to get the native binaries, then a second pass for the cross-compiled binaries.

sudo apt-get install libcppunit-dev
cd ~/code/

. ~/uncrosscompile.sh
wget http://sourceforge.net/projects/xmlrpc-c/files/Xmlrpc-c%20Super%20Stable/1.16.37/xmlrpc-c-1.16.37.tgz
tar zxf xmlrpc-c-1.16.37.tgz
pushd xmlrpc-c-1.16.37/
./configure
cd lib/expat/gennmtab/
make clean && make gennmtab
cp gennmtab ~/bin/
popd

. ~/crosscompile2009q1.sh
export DEST=/mnt/DroboFS/Shares/DroboApps/rtorrent
export DEPS=/mnt/DroboFS/Shares/DroboApps/rtorrentdeps

wget http://zlib.net/zlib-1.2.5.tar.gz
tar zxf zlib-1.2.5.tar.gz
pushd zlib-1.2.5
CFLAGS="$CFLAGS -O3" ./configure --prefix=$DEPS
make clean && make && make install
find $DEPS | grep "\.so" | xargs rm
popd

wget http://www.openssl.org/source/openssl-1.0.0d.tar.gz
tar zxf openssl-1.0.0d.tar.gz
pushd openssl-1.0.0d
./Configure linux-generic32 -DL_ENDIAN --prefix=$DEPS --openssldir=$DEST/etc/ssl no-shared no-zlib-dynamic --with-zlib-include=$DEPS/include --with-zlib-lib=$DEPS/lib
sed -i -e "s/CFLAG= /CFLAG=${CFLAGS} /g" Makefile
make clean && make && make install
popd

wget http://curl.haxx.se/download/curl-7.21.7.tar.gz
tar zxf curl-7.21.7.tar.gz
pushd curl-7.21.7/
CFLAGS="$CFLAGS -O3" LIBS="-ldl" ./configure --host=arm-none-linux-gnueabi --prefix=$DEPS --with-ssl=$DEPS --with-zlib==$DEPS --with-random --with-ca-bundle=$DEST/etc/ssl/certs/ca-certificates.crt --disable-shared
make clean && make && make install
popd

wget http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.2/libsigc++-2.2.10.tar.bz2
tar jxf libsigc++-2.2.10.tar.bz2
pushd libsigc++-2.2.10/
CXXFLAGS="$CFLAGS -O3" ./configure --host=arm-none-linux-gnueabi --prefix=$DEPS --enable-static --disable-shared
make clean && make && make install
popd

pushd xmlrpc-c-1.16.37/
PATH=$DEPS/bin:$PATH ./configure --host=arm-none-linux-gnueabi --prefix=$DEPS --enable-curl-client
sed -i -e "s|^\(#include \)|//\1|g" lib/curl_transport/xmlrpc_curl_transport.c
sed -i -e "s|^\(#include \)|//\1|g" lib/curl_transport/curltransaction.c
sed -i -e "s|^\(#include \)|//\1|g" lib/curl_transport/curlmulti.c

make clean
PATH=$DEPS/bin:$PATH make CADD="$CFLAGS -O3"
cp ~/bin/gennmtab lib/expat/gennmtab/
PATH=$DEPS/bin:$PATH make CADD="$CFLAGS -O3"
PATH=$DEPS/bin:$PATH make install
find $DEPS | grep "\.so" | xargs rm
popd

wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.9.tar.gz
tar zxf libtorrent-0.12.9.tar.gz
pushd libtorrent-0.12.9/
CXXFLAGS="$CFLAGS -O3" PKG_CONFIG_PATH=$DEPS/lib/pkgconfig ./configure --host=arm-none-linux-gnueabi --prefix=$DEPS --enable-static --disable-shared --enable-aligned --disable-debug
make clean && make && make install
popd

wget http://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz
tar zxf ncurses-5.9.tar.gz
pushd ncurses-5.9/
CFLAGS="$CFLAGS -O3" ./configure --host=arm-none-linux-gnueabi --prefix=$DEPS --datadir=$DEST/share --enable-widec --without-shared
make clean && make && make install
pushd $DEPS/include
ln -s ncursesw/ncurses.h .
popd
popd

pushd $DEPS/lib
ln -s `readlink -e \`$CXX -print-file-name=libstdc++.a\`` .
popd

wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.9.tar.gz
tar zxf rtorrent-0.8.9.tar.gz
pushd rtorrent-0.8.9/
wget http://www.droboports.com/app-repository/rtorrent-0-8-9/canvas.h.patch
patch src/display/canvas.h canvas.h.patch
wget http://www.droboports.com/app-repository/rtorrent-0-8-9/common.m4.patch
patch scripts/common.m4 common.m4.patch
./autogen.sh
make clean
PATH=$DEPS/bin:$PATH CXXFLAGS="$CFLAGS -O3" LDFLAGS="-static -static-libgcc -static-libstdc++" PKG_CONFIG_PATH=$DEPS/lib/pkgconfig ac_cv_search_add_wch="-lncursesw" ac_cv_search_wbkgdset="-lncursesw" ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --with-xmlrpc-c --with-ncursesw --disable-debug
make
PATH=$DEPS/bin:$PATH CXXFLAGS="$CFLAGS -O3" LDFLAGS="-static -static-libgcc -static-libstdc++" PKG_CONFIG_PATH=$DEPS/lib/pkgconfig ac_cv_search_add_wch="-lncursesw" ac_cv_search_wbkgdset="-lncursesw" ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --with-xmlrpc-c --with-ncursesw --disable-debug
make && make install
$STRIP $DEST/bin/rtorrent

Packaging

First we package rTorrent:

cd $DEST
mkdir -p var/run var/log var/session
wget http://www.droboports.com/app-repository/rtorrent-0-8-9/rtorrent.rc.default -O etc/rtorrent.rc.default
~/bin/package.sh

Then we package ruTorrent:

sudo apt-get install subversion

cd ~/code/
svn checkout http://rutorrent.googlecode.com/svn/trunk/ rutorrent
cd rutorrent
find . -name ".svn" | xargs rm -fr
mv rutorrent www
mv plugins www/

wget http://www.droboports.com/app-repository/rtorrent-0-8-9/admin.url
wget http://www.droboports.com/app-repository/rtorrent-0-8-9/service.sh
chmod a+x service.sh

mkdir -p etc var/run var/log 
wget http://www.droboports.com/app-repository/rtorrent-0-8-9/rutorrent.conf -O etc/rutorrent.conf
wget http://www.droboports.com/app-repository/rtorrent-0-8-9/rtorrent.conf -O etc/rtorrent.conf

pushd www/conf
wget http://www.droboports.com/app-repository/rtorrent-0-8-9/config.php -O config.php
popd
pushd www/plugins/create
wget http://www.droboports.com/app-repository/rtorrent-0-8-9/create-conf.php -O conf.php
popd
pushd www/plugins/mediainfo
wget http://www.droboports.com/app-repository/rtorrent-0-8-9/mediainfo-conf.php -O conf.php
popd
pushd www/plugins/unpack
wget http://www.droboports.com/app-repository/rtorrent-0-8-9/unpack-conf.php -O conf.php
popd
pushd www/plugins
rm -fr httprpc rpc
popd

~/bin/package.sh

Installing

DroboAdmin link: Install rtorrent-0.8.8 first (this link only works if you have not changed the DroboFS name) and then install rutorrent-svn1834. Otherwise, download below and place it in you DroboApps share.

Final remarks

Again, make sure all the dependencies are installed before running ruTorrent. This DroboApp will automatically detect the presence of all the dependencies if they are installed at their default location, and should require no additional configuration to run.

rTorrent is configured to run as root, and ruTorrent is not password protected. This may be addressed in a future release, but right now rTorrent crashes without explanation if run under a non-root account. If you want to protect ruTorrent, edit etc/rutorrent.conf and add the authentication configuration following the model from droboadmin.conf.

Please visit the DroboSpace forums to leave your comments, suggestions and feedback.

ċ
admin.url
Download
  1k v. 1 Aug 30, 2011, 8:10 AM Ricardo Padilha
ċ
canvas.h.patch
Download
  1k v. 1 Aug 30, 2011, 8:10 AM Ricardo Padilha
ċ
common.m4.patch
Download
  1k v. 1 Aug 30, 2011, 8:10 AM Ricardo Padilha
ċ
config.php
Download
  1k v. 1 Aug 30, 2011, 8:10 AM Ricardo Padilha
ċ
create-conf.php
Download
  1k v. 1 Aug 30, 2011, 8:10 AM Ricardo Padilha
ċ
mediainfo-conf.php
Download
  1k v. 1 Aug 30, 2011, 8:10 AM Ricardo Padilha
ċ
rtorrent.conf
Download
  1k v. 1 Aug 30, 2011, 8:10 AM Ricardo Padilha
ċ
rtorrent.rc.default
Download
  1k v. 1 Aug 30, 2011, 8:11 AM Ricardo Padilha
ċ
rtorrent.tgz
Download
DroboApp for DroboFS  3105k v. 1 Aug 30, 2011, 8:15 AM Ricardo Padilha
ċ
rutorrent.conf
Download
  1k v. 1 Aug 30, 2011, 8:11 AM Ricardo Padilha
ą
rutorrent.png
View Download
  4k v. 1 Aug 30, 2011, 8:11 AM Ricardo Padilha
ċ
rutorrent.tgz
Download
WebApp for DroboFS  806k v. 1 Aug 30, 2011, 8:15 AM Ricardo Padilha
ċ
service.sh
Download
  4k v. 1 Aug 30, 2011, 8:11 AM Ricardo Padilha
ċ
unpack-conf.php
Download
  1k v. 1 Aug 30, 2011, 8:11 AM Ricardo Padilha
Comments