Project

General

Profile

Build Quassel on Linux (english) » History » Version 6

musca, 10/22/2009 10:29 AM

1 1 musca
h1. Build Quassel on Linux
2 1 musca
3 1 musca
Step-by-step guide to compile the project utilizing the the classic toolchain in a terminal
4 1 musca
5 1 musca
{{toc}}
6 1 musca
7 1 musca
h2. Preparation of the build system
8 1 musca
9 1 musca
The build process needs 
10 1 musca
 - the compiler and some tools like a linker, cmake, make 
11 1 musca
 - the development libraries for KDE4, QT4, OpenSSL and zlib 
12 1 musca
 - and git to manage the Quassel sourcecode
13 1 musca
14 1 musca
Under DEBIAN GnU/Linux Sqeeze/Sid the needed packages are installed as follows (execute as root):
15 1 musca
apt-get update && apt-get install build-essential git-core cmake qt4-dev-tools libqt4-dev libqt4-sql-psql zlib1g-dev kdelibs4-dev libphonon-dev kdevelop-dev checkinstall
16 1 musca
17 1 musca
(please insert commands for other distributions here)
18 1 musca
19 1 musca
h2. Managing the sourcecode
20 1 musca
21 1 musca
This task is done utilizing "git":http://en.wikipedia.org/wiki/Git_(software) while being logged in as a normal user.
22 1 musca
The sourcecode is downloaded with 'git clone $URL' and stored in the directory ~/quassel.
23 6 musca
<code>$ cd ~ && git clone git://git.quassel-irc.org/quassel.git</code> 
24 1 musca
25 1 musca
The development of Quassel is an ongoing process, so from time to time you want
26 1 musca
to update to the latest contributions with 'git pull origin' .
27 1 musca
28 6 musca
<code>$ cd ~/quassel && git pull origin</code>
29 1 musca
30 1 musca
31 2 musca
h2. Compile!
32 1 musca
33 1 musca
After updating the sourcecode one can generate a new build.
34 1 musca
Every build is done in its own directory enabling 
35 1 musca
the return to the old build directory in the case of defeat.
36 1 musca
$ cd quassel
37 1 musca
$ mkdir build
38 1 musca
39 1 musca
In the build directory the command 'cmake' generates the make-files (i.e. a dependency map for the compiler).
40 1 musca
The options of cmake are described in the file ~/quassel/INSTALL in your source directory .
41 1 musca
$ cd ~/quassel/build
42 1 musca
$ cmake ~/quassel -DWANT_CORE=ON -DWANT_QTCLIENT=ON -DWANT_MONO=ON -DWITH_KDE=ON -DWITH_OPENSSL=ON -DWITH_DBUS=ON -DWITH_PHONON=ON -DWITH_WEBKIT=ON -DLINGUAS="de en_US"
43 1 musca
44 1 musca
Now the command 'make' generates the calls for the compiler
45 1 musca
$ make
46 1 musca
47 1 musca
h2. Install with checkinstall
48 1 musca
49 1 musca
It is wise to prefer the default packagemanager of your system rather doing a 'make install'.
50 1 musca
The installation will be done as root with checkinstall.
51 1 musca
checkinstall generates a package (deb, rpm or tgz) for your packagemanager (apt, rpm or installpkg), 
52 1 musca
that can later be removed easily and leaves a clean system.
53 1 musca
checkinstall has options for several distributions: -D for Debian, -R for RPM, -S for Slackware.
54 1 musca
When installing the package it asks interactive two questions, as shown in the following example:
55 1 musca
56 1 musca
example:
57 1 musca
/home/user/quassel/build/#  checkinstall -D --pkgname quassel-all --pkgversion 0.5.0 --pkgrelease $(date +%y%m%d%H%M%S) make install
58 1 musca
Output:
59 1 musca
 Please enter a description of the package.
60 1 musca
 Finish your description  with an empty line or EOF.
61 1 musca
62 1 musca
Input:
63 1 musca
 >> [quassel-all contains quassel-core, quassel-client and quassel (mono).]                                           
64 1 musca
 >> [enter]
65 1 musca
66 1 musca
Output:
67 1 musca
 Das Paket wird entsprechend dieser Vorgaben erstellt:
68 1 musca
  0 -  Maintainer: [ root@aquarium ]
69 1 musca
  1 -  Summary: [ quassel-all contains core, client und quassel (mono). ]
70 1 musca
  2 -  Name:    [ quassel-all ]
71 1 musca
  3 -  Version: [ 0.5.0 ]
72 1 musca
  4 -  Release: [ 091021181559 ]
73 1 musca
  5 -  License: [ GPL ]
74 1 musca
  6 -  Group:   [ checkinstall ]
75 1 musca
  7 -  Architecture: [ i386 ]
76 1 musca
  8 -  Source location: [ build_091021181559 ]
77 1 musca
  9 -  Alternate source location: [  ]
78 1 musca
 10 - Requires: [  ]
79 1 musca
 11 - Provides: [ quassel-all ]
80 1 musca
 
81 1 musca
Input:
82 1 musca
 [ just press [enter] to proceed generating the package]
83 1 musca
84 5 musca
The result: Quassel is installed. (here for Debian):
85 5 musca
<pre><code>
86 5 musca
87 1 musca
  Done. The new package has been installed and saved to
88 1 musca
89 1 musca
  /home/$(user)/quassel/build/quassel-all_0.5.0-091021103522_i386.deb
90 1 musca
91 1 musca
  You can remove it from your system anytime using:
92 1 musca
93 1 musca
  dpkg -r quassel-all
94 5 musca
95 5 musca
</code></pre>
96 1 musca
97 3 musca
 
98 1 musca
99 1 musca
h2. Draft of a buildscript
100 2 musca
101 1 musca
The repeating tasks of updating and compiling is done in the following buildscript:
102 4 musca
<pre><code>
103 1 musca
#!/usr/bin/bash
104 1 musca
# quick quassel buildscript (draft)
105 1 musca
#
106 1 musca
# initialize your local git-repository once with this command
107 1 musca
# cd ~ && git clone git://git.quassel-irc.org/quassel.git ~/quassel
108 1 musca
#
109 1 musca
# updating latest contributions:
110 1 musca
cd ~/quassel
111 1 musca
git pull origin
112 1 musca
#
113 1 musca
# make a new build directory with a suffix containing the date
114 1 musca
export date=$(date +%y%m%d%H%M%S)
115 1 musca
mkdir build_$date
116 1 musca
#
117 1 musca
# cmake: Optionen siehe ~/quassel/INSTALL
118 1 musca
cd build_$date
119 1 musca
cmake ~/quassel -DWANT_QTCLIENT=ON -DWITH_KDE=ON -DWITH_OPENSSL=ON -DWITH_DBUS=ON -DWITH_PHONON=ON -DWITH_WEBKIT=OFF -DLINGUAS="de en_US"
120 1 musca
make
121 1 musca
#
122 1 musca
# avoid the classic 'make install', prefer generating a package with checkinstall
123 1 musca
echo  please execute as root via copy & paste in the directory ~/quassel/build_$date 
124 1 musca
echo  first to remove old package: dpkg -r quassel-all
125 1 musca
echo  then to install new package: checkinstall -D --pkgname quassel-all --pkgversion 0.5.0 --pkgrelease $date make install
126 4 musca
</code></pre>