About

Supporting the site

App Repository‎ > ‎Archives‎ > ‎

rtorrent-0.8.8

Warning: This version of rTorrent is deprecated and has been replaced by rTorrent 0.8.9. This page and attached files are being kept for reference, but should not be deployed on any systems.

Overview

This tutorial creates both the rTorrent client and the web interface ruTorrent. This version of rTorrent uses a different approach than the previous version, since it prepares all the components separately, but still in a way that just works if they are all deployed correctly.

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 to make deployment easier.

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:

  • lighttpd: mandatory. The version of Apache provided by DRI does not have a working implementation of the PHP plugin
  • php: mandatory. Lighttpd and PHP are not bundled together
  • screenmandatory. Screen is used to run rTorrent as a service
  • curl: mandatory. cURL is used by ruTorrent to communicate with rTorrent
  • procps: optional. Pgrep is used by the create plugin
  • mediainfo: optional. Mediainfo is used by the mediainfo plugin
  • unrar: optional. Unrar is used by the unpack plugin

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 DroboApp, 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.35/xmlrpc-c-1.16.35.tgz
tar zxf xmlrpc-c-1.16.35.tgz
cd xmlrpc-c-1.16.35/
./configure
cd lib/expat/gennmtab/
make clean && make gennmtab
cp gennmtab ~/bin/

cd ~/code/

. ~/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
cd zlib-1.2.5
CFLAGS="$CFLAGS -O3" ./configure --prefix=$DEPS
make clean && make && make install
find $DEPS | grep "\.so" | xargs rm
cd ..

wget http://www.openssl.org/source/openssl-1.0.0d.tar.gz
tar zxf openssl-1.0.0d.tar.gz
cd 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
cd ..

wget http://curl.haxx.se/download/curl-7.21.6.tar.gz
tar zxf curl-7.21.6.tar.gz
cd curl-7.21.6/
CFLAGS="$CFLAGS -O3" ac_cv_path_PKGCONFIG="/usr/bin/pkg-config" ./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
cd ..

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

cd xmlrpc-c-1.16.35/
PATH=$DEPS/bin:$PATH ./configure --host=arm-none-linux-gnueabi --prefix=$DEPS --enable-curl-client
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
cd ..

wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.8.tar.gz
tar zxf libtorrent-0.12.8.tar.gz
cd libtorrent-0.12.8/
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
cd ..

wget http://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz
tar zxf ncurses-5.9.tar.gz
cd 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
cd ..

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

wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.8.tar.gz
tar zxf rtorrent-0.8.8.tar.gz
cd rtorrent-0.8.8/
wget http://www.droboports.com/app-repository/rtorrent-0-8-8/canvas.h.patch
patch src/display/canvas.h canvas.h.patch
wget http://www.droboports.com/app-repository/rtorrent-0-8-8/common.m4.patch
patch scripts/common.m4 common.m4.patch
./autogen.sh
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 clean && 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-8/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-8/admin.url
wget http://www.droboports.com/app-repository/rtorrent-0-8-8/service.sh
chmod a+x service.sh

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

pushd www/conf
wget http://www.droboports.com/app-repository/rtorrent-0-8-8/config.php -O config.php
popd
pushd www/plugins/create
wget http://www.droboports.com/app-repository/rtorrent-0-8-8/create-conf.php -O conf.php
popd
pushd www/plugins/mediainfo
wget http://www.droboports.com/app-repository/rtorrent-0-8-8/mediainfo-conf.php -O conf.php
popd
pushd www/plugins/unpack
wget http://www.droboports.com/app-repository/rtorrent-0-8-8/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-svn1696. 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. 2 Jun 10, 2011, 1:33 AM Ricardo Padilha
ċ
canvas.h.patch
Download
  1k v. 2 Jun 10, 2011, 1:33 AM Ricardo Padilha
ċ
common.m4.patch
Download
  1k v. 2 Jun 10, 2011, 1:34 AM Ricardo Padilha
ċ
config.php
Download
  1k v. 2 Jun 10, 2011, 1:34 AM Ricardo Padilha
ċ
create-conf.php
Download
  1k v. 2 Jun 10, 2011, 1:34 AM Ricardo Padilha
ċ
mediainfo-conf.php
Download
  1k v. 2 Jun 10, 2011, 1:34 AM Ricardo Padilha
ċ
rtorrent.conf
Download
  1k v. 2 Jun 10, 2011, 1:34 AM Ricardo Padilha
ċ
rtorrent.rc.default
Download
  1k v. 2 Jun 10, 2011, 1:34 AM Ricardo Padilha
ċ
rtorrent.tgz
Download
DroboApp for DroboFS  2393k v. 2 Jun 10, 2011, 1:38 AM Ricardo Padilha
ċ
rutorrent.conf
Download
  1k v. 2 Jun 10, 2011, 1:34 AM Ricardo Padilha
ą
rutorrent.png
View Download
  4k v. 2 Jun 10, 2011, 1:12 AM Ricardo Padilha
ċ
rutorrent.tgz
Download
WebApp for DroboFS  784k v. 2 Jun 10, 2011, 1:46 AM Ricardo Padilha
ċ
service.sh
Download
  4k v. 2 Jun 10, 2011, 1:35 AM Ricardo Padilha
ċ
unpack-conf.php
Download
  1k v. 2 Jun 10, 2011, 1:35 AM Ricardo Padilha
Comments