Project

General

Profile

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

musca, 10/22/2009 10:37 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 7 musca
<pre><code>$ cd ~ && git clone git://git.quassel-irc.org/quassel.git</code></pre> 
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 7 musca
<pre><code>$ cd ~/quassel && git pull origin</code></pre>
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 8 musca
<pre><code>
37 1 musca
$ cd quassel
38 1 musca
$ mkdir build
39 8 musca
</code></pre>
40 1 musca
41 1 musca
In the build directory the command 'cmake' generates the make-files (i.e. a dependency map for the compiler).
42 1 musca
The options of cmake are described in the file ~/quassel/INSTALL in your source directory .
43 8 musca
<pre><code>
44 1 musca
$ cd ~/quassel/build
45 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"
46 8 musca
</code></pre>
47 1 musca
48 1 musca
Now the command 'make' generates the calls for the compiler
49 8 musca
<pre><code>$ make </code></pre>
50 1 musca
51 1 musca
h2. Install with checkinstall
52 1 musca
53 1 musca
It is wise to prefer the default packagemanager of your system rather doing a 'make install'.
54 1 musca
The installation will be done as root with checkinstall.
55 1 musca
checkinstall generates a package (deb, rpm or tgz) for your packagemanager (apt, rpm or installpkg), 
56 1 musca
that can later be removed easily and leaves a clean system.
57 1 musca
checkinstall has options for several distributions: -D for Debian, -R for RPM, -S for Slackware.
58 1 musca
When installing the package it asks interactive two questions, as shown in the following example:
59 1 musca
60 1 musca
example:
61 8 musca
<pre><code>/home/user/quassel/build/#  checkinstall -D --pkgname quassel-all --pkgversion 0.5.0 --pkgrelease $(date +%y%m%d%H%M%S) make install</code></pre>
62 1 musca
Output:
63 1 musca
 Please enter a description of the package.
64 1 musca
 Finish your description  with an empty line or EOF.
65 1 musca
66 1 musca
Input:
67 1 musca
 >> [quassel-all contains quassel-core, quassel-client and quassel (mono).]                                           
68 1 musca
 >> [enter]
69 1 musca
70 1 musca
Output:
71 1 musca
 Das Paket wird entsprechend dieser Vorgaben erstellt:
72 1 musca
  0 -  Maintainer: [ root@aquarium ]
73 1 musca
  1 -  Summary: [ quassel-all contains core, client und quassel (mono). ]
74 1 musca
  2 -  Name:    [ quassel-all ]
75 1 musca
  3 -  Version: [ 0.5.0 ]
76 1 musca
  4 -  Release: [ 091021181559 ]
77 1 musca
  5 -  License: [ GPL ]
78 1 musca
  6 -  Group:   [ checkinstall ]
79 1 musca
  7 -  Architecture: [ i386 ]
80 1 musca
  8 -  Source location: [ build_091021181559 ]
81 1 musca
  9 -  Alternate source location: [  ]
82 1 musca
 10 - Requires: [  ]
83 1 musca
 11 - Provides: [ quassel-all ]
84 1 musca
 
85 1 musca
Input:
86 1 musca
 [ just press [enter] to proceed generating the package]
87 1 musca
88 5 musca
The result: Quassel is installed. (here for Debian):
89 5 musca
<pre><code>
90 1 musca
  Done. The new package has been installed and saved to
91 1 musca
92 1 musca
  /home/$(user)/quassel/build/quassel-all_0.5.0-091021103522_i386.deb
93 1 musca
94 1 musca
  You can remove it from your system anytime using:
95 1 musca
96 1 musca
  dpkg -r quassel-all
97 5 musca
</code></pre>
98 1 musca
99 3 musca
 
100 1 musca
101 1 musca
h2. Draft of a buildscript
102 1 musca
103 2 musca
The repeating tasks of updating and compiling is done in the following buildscript:
104 9 musca
<pre><code>#!/usr/bin/bash
105 1 musca
# quick quassel buildscript (draft)
106 1 musca
#
107 1 musca
# initialize your local git-repository once with this command
108 1 musca
# cd ~ && git clone git://git.quassel-irc.org/quassel.git ~/quassel
109 1 musca
#
110 1 musca
# updating latest contributions:
111 1 musca
cd ~/quassel
112 1 musca
git pull origin
113 1 musca
#
114 1 musca
# make a new build directory with a suffix containing the date
115 1 musca
export date=$(date +%y%m%d%H%M%S)
116 1 musca
mkdir build_$date
117 1 musca
#
118 1 musca
# cmake: Optionen siehe ~/quassel/INSTALL
119 1 musca
cd build_$date
120 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"
121 1 musca
make
122 1 musca
#
123 1 musca
# avoid the classic 'make install', prefer generating a package with checkinstall
124 1 musca
echo  please execute as root via copy & paste in the directory ~/quassel/build_$date 
125 1 musca
echo  first to remove old package: dpkg -r quassel-all
126 1 musca
echo  then to install new package: checkinstall -D --pkgname quassel-all --pkgversion 0.5.0 --pkgrelease $date make install
127 4 musca
</code></pre>