Project

General

Profile

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

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