Screenshots
Finally I found time to build the full version of deluge bittorrent client (version 1.0.5) and create a package for it.
Deluge 1.0.5 GTK client
(running on CoLinux with Debian 4.0, XMing server running on WinXP) Deluge 1.0.5 GTK client
(running on WinXP) Deluge 1.0.5 GTK client
(running on Ubuntu 8.04)
(running on CoLinux with Debian 4.0, XMing server running on WinXP) Deluge 1.0.5 GTK client
(running on WinXP) Deluge 1.0.5 GTK client
(running on Ubuntu 8.04)
Build result
[binary] [file list]Prerequisites: [JoKeR's minimal config] [JoKeR's essential libs]
For filopack system: [JoKeR's bash shell] [JoKeR's busybox extended]
Dependencies: [gcc libraries] [glib] [readline] [boost] [python] [setuptools] [DBus] [DBus-glib] [DBus-python] [pygobject] [pyxdg]
GUI dependencies: [X.Org] [Gtk+] [pycairo] [pygtk] [atk] [glade]
Edit: Regarding to this post it seems that [pygobject] and [pyxdg] packages are needed even for non-gui mode.
Overview
First I'll demonstrate the shortest path (given all the needed dependencies are already installed). Then I describe the build and package creation process, since I feel that such information can be helpful when something goes wrong.Download & Install
We can utilize the filopack system for that purpose. In case we do not have it we can simply download it (and make executable) as follows:box# cd /mnt/C box# wget http://filodej.ic.cz/filopack/filopack.sh box# chmod 755 filopack.shFirst action we have to do is to uninstall the previous Deluge version (assumed we have both Deluge 0.9.03 and ./filopack.sh installed on the box):
box# cd /mnt/C box# ./filopack.sh --remove deluge-0.9.03 Configuration file .filopack/.config file found and used Sure to remove deluge-0.9.03 locally at /mnt/C (y/n)?y ...Now we can download the package:
box# cd /mnt/C box# ./filopack.sh --download deluge-1.0.5 [root@storage C]# ./filopack.sh --download deluge-1.0.5 Configuration file .filopack/.config file found and used Retrieving package index... (Connecting to http://filodej.ic.cz) Downloading package deluge-1.0.5 from http://filodej.ic.cz ... connected! Length: 68,332 [text/plain] connected! Length: 15,645,450 [application/x-tar]And the last step is to install it:
box# ./filopack.sh --install deluge-1.0.5 Configuration file .filopack/.config file found and used Retrieving package index... (Connecting to http://filodej.ic.cz) Sure to unpack deluge-1.0.5 locally at /home/petr (y/n)? ...Now, we are done (if we are lucky ;-)
I added scripts (deluge.sh and deluged.sh) which we can run in place of original loader scripts (deluge and deluged) which are working around the weird problems with dynamic loader missing some symbols.
box# cat /mnt/C/sys/bin/deluged.sh LD_PRELOAD="/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0" delugedSo if you already have the /mnt/C/sys/bin/ directory in your PATH now instead of:
box# deluged /usr/bin/python: can't resolve symbol '__cxa_pure_virtual'... you can simple type:
box# deluged.shIt is great that the daemon mode is now supported and we can run the GTK GUI remotely (even so the demands of python runtime are relatively high for the box).
In following figures you can see the clients running on Ubuntu and WinXP both connected to the daemon running on the box. In previous figure there is also the client running on the box - it can be seen that its progress controls are way behind the real time and even the PC running client does not receive much information from the daemon. In such situations everything becomes reaaaalllllly sloooowwww as the box can't catch the train.
It is obvious that it is not a good idea to run GTK client directly on the box, since it pushes its HW resources really to its limits, but in is nice that it (no matter how slowly) works.
Build & Pack
Everything necessary for successful build was already described in previous three parts of this series, this part just collects the information and describes the whole building process step-by-step.Same as in the previous case we have to uninstall the old Deluge version (0.9.03)
dev# cd /mnt/C dev# ./filopack.sh --remove deluge-0.9.03 Configuration file .filopack/.config file found and used Sure to remove deluge-0.9.03 locally at /mnt/C (y/n)? ...Now we are ready to start the building process. First thing we have to do is to create a timestamp file. With help of this file the packaging system determines what files are included to the resulting package.
dev# ./filopack.sh --init deluge-1.0.5 Configuration file .filopack/.config file found and used Timestamp written to file .filopack/deluge-1.0.5.tsNow we can download and extract the sources.
dev# cd /usr/local/src/ dev# wget http://download.deluge-torrent.org/source/1.0.5/deluge-1.0.5.tar.bz2 ... dev# tar xjvf deluge-1.0.5.tar.bz2 dev# cd /usr/local/src/deluge-1.0.5We have to do the following steps in order to make a successful build:
(For explanations see previous parts of this series)
Add proper paths to boost header files and libraries
dev# export CFLAGS=-I/mnt/C/sys/include/boost-1_35 dev# export LDFLAGS=-L/mnt/C/sys/libAdd missing IPV6 related macro to socket.hpp header file:
dev# nano libtorrent/include/libtorrent/socket.hpp add: #ifndef IPV6_V6ONLY #define IPV6_V6ONLY 26 #endifDisable the memory debugging (file libtorrent/src/memdebug.cpp) from the build. You can:
- either modify the Makefile
- or clear the memdebug.cpp
- or use the preprocessor condition:
#if 0 ... #endifNow we are ready to start the build and installation:
dev# python setup.py build ... dev# python setup.py install --prefix=/mnt/C/sys/ ...If the build and installation succeeded, we are almost done. Now, when we try to start the deluge daemon, the dynamic loader is missing some symbols (it was same with previous version, I am possibly doing something wrong but do not know what).
dev# deluged dev# /usr/bin/python: can't resolve symbol '__cxa_pure_virtual'At least we have the workaround - library preload, with following triar and error method we get the set of libraries to be rpe-loaded:
dev# LD_PRELOAD=/usr/lib/libstdc++.so.6 deluged dev# /usr/bin/python: can't resolve symbol 'BIO_free' dev# LD_PRELOAD="/usr/lib/libstdc++.so.6 /usr/lib/libssl.so.0.9.7" deluged dev# /usr/bin/python: can't resolve symbol '_ZN5boost6system18get_posix_categoryEv' dev# LD_PRELOAD="/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0" delugedOK, now it works. We can prepare the loader script with previous command-line:
dev# echo LD_PRELOAD=\"/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0\" deluged \"\$@\" > /mnt/C/sys/bin/deluged.sh dev# chmod +x /mnt/C/sys/bin/deluged.shNow (if we have the /mnt/C/sys/bin in our PATH) we can run the deluge daemon as follows:
dev# deluged.shFor deluge client the symbol problem is the same, so we prepare a loader script as well:
dev# echo LD_PRELOAD=\"/usr/lib/libssl.so.0.9.7 /usr/lib/libboost_filesystem-gcc41-mt-1_35.so.1.35.0\" \"\$@\" deluge > /mnt/C/sys/bin/deluge.sh dev# chmod +x /mnt/C/sys/bin/deluge.shNow we try to launch the GUI (GTK client) but some problems still remain:
dev# deluge.sh ... File "/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/common.py", line 142, in get_logo size, size) gobject.GError: Unrecognized image file formatWe already solved this problem with previous version, so we know the receipt:
dev# sed -i 's/deluge.svg/deluge.png/g' /mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/common.pyLet's try again:
dev# deluge.sh ... self.window.show() /mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/ui/gtkui/mainwindow.py:95: GtkWarning: gtk_icon_theme_load_icon: assertion `GTK_IS_ICON_THEME (icon_theme)' failed self.window.show() Segmentation faultWe forgot the set up the DISPLAY environment variable properly (Actually I do not know why it crashes in such case, but the truth is that proper DISPLAY setup solves the problem):
dev# export DISPLAY=<x-server-ip>One more thing we have to do is to let python know the path to the deluge egg:
dev# cd /mnt/C/sys/lib/python2.5/site-packages dev# echo "./deluge-1.0.5-py2.5-linux-i686.egg" > deluge.pthFinally we are ready to create the deluge-1.0.5 package:
dev# cd /mnt/C dev# ./filopack.sh --pack deluge-1.0.5
Remote install
Now we have the package created locally on the "mirror" system (colinux debian in my case). But we have to get it to the box. The filopack script can help us with this task as well.First we have to uninstall the previous deluge version from the box. We can definitely do it locally on the box itself, but we can also do it remotely:
dev# ./filopack.sh -r --remove deluge-0.9.03 Configuration file .filopack/.config file found and used Sure to remove deluge-0.9.03 remotely at root@storage:/mnt/C (y/n)?y ...If we want to make sure that the previously installed software is gone, we can look at the package summary (unfortunately this feature is supported only locally). So from the box shell we can do following:
box# ./filopack.sh --summary Configuration file .filopack/.config file found and used Retrieving package index... (Connecting to http://filodej.ic.cz) Filodej package summary: Package name downloaded [#installed/#total] -------------------------------------------------------------------- Mesa-7.0.3 no [ 0/ 49] MesaDemos-7.0.3 no [ 129/ 129] atk-1.22.0 no [ 160/ 160] audiofile-0.2.6 no [ 0/ 13] binutils-2.18 no [ 140/ 140] boost-1.35.0 no [5195/5195] cairo-1.6.4 no [ 76/ 76] code2html-0.9.1 no [ 2/ 2] cvstrac-2.0.1-3 no [ 3/ 3] dbus-1.2.1 no [ 38/ 38] dbus-glib-0.76 no [ 32/ 32] dbus-python-0.82.4 no [ 66/ 66] deluge-0.9.03 no [ 0/ 673] didiwiki-0.5 no [ 1/ 1] faad2-2.6.1 no [ 0/ 8] ...Now we are back in the "mirror" system console and we can upload the (newly created) package to the box:
dev# ./filopack.sh -r --upload deluge-1.0.5 Configuration file .filopack/.config file found and used Sure to upload deluge-1.0.5 to root@storage:/mnt/C (y/n)?y root@storage's password: deluge-1.0.5.tar.bz2 100% 15MB 318.3KB/s 00:48And perform the remote installation as well:
dev# ./filopack.sh -r --install deluge-1.0.5 Configuration file .filopack/.config file found and used Retrieving package index... (Connecting to http://filodej.ic.cz) Module deluge-1.0.5 not found in package list - use 'tar.bz2' extension Sure to unpack deluge-1.0.5 remotely at root@storage:/mnt/C (y/n)?y root@storage's password: ...Deluge daemon (deluged.sh) now works OK on the box.
The only remaining problem is following. When we run the GTK GUI client (deluge.sh) we get following error:
box# deluge.sh ... gobject.GError: Failed to open file '/tmp/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/data/pixmaps/inactive16.png': No such file or directoryWhen we look to the /tmp/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/data/pixmaps/ directory there is not a inactive16.png there is just inactive16.png0000644 file and the same is with checking16.png file.
It seems it is a bug in tar implementation, the file permissions are "leaking out" to the name (see this issue description or this forum).
The solution is easy in this case:
box# mv /tmp/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/data/pixmaps/inactive16.png{0000644,} box# mv /tmp/mnt/C/sys/lib/python2.5/site-packages/deluge-1.0.5-py2.5-linux-i686.egg/deluge/data/pixmaps/checking16.png{0000644,}When you run the deluge and it looks similar like this: ... then there are some missing links to font directories:
box# mkdir /usr/share/fonts box# ln -sn /mnt/C/sys/X11/lib/X11/fonts/OTF /usr/share/fonts/X11-OTF box# ln -sn /mnt/C/sys/X11/lib/X11/fonts/TTF /usr/share/fonts/X11-TTF
Setup
Now (after the update of the python package) we are able to run the console client right on the box: We can read the configuration options:> configs * add_paused: False * allow_remote: False * auto_managed: True * autoadd_enable: False * autoadd_location: C * compact_allocation: False * config_location: /mnt/C/sys/root/.config/deluge ... * daemon_port: 58846 ...If we want access the daemon remotely, we can set it up as follows (of course it is possible to change the port as well):
> config-set allow_remote True * Configuration value successfully updated. > quit Thanks box#Now we have to restart the daemon (if it is running):
box# killall deluged box# deluged.sh... and we are set up to access the daemon remotely (from PC running either Linux or Windows) as can be seen on following screenshots: That's all for now.