Build Quassel on Linux (english) » History » Version 2
musca, 10/22/2009 10:17 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 | 1 | musca | |
24 | 1 | musca | $ cd ~ && git clone git://git.quassel-irc.org/quassel.git |
25 | 1 | musca | |
26 | 1 | musca | The development of Quassel is an ongoing process, so from time to time you want |
27 | 1 | musca | to update to the latest contributions with 'git pull origin' . |
28 | 1 | musca | |
29 | 1 | musca | $ cd ~/quassel && git pull origin |
30 | 1 | musca | |
31 | 1 | musca | |
32 | 2 | musca | h2. Compile! |
33 | 1 | musca | |
34 | 1 | musca | After updating the sourcecode one can generate a new build. |
35 | 1 | musca | Every build is done in its own directory enabling |
36 | 1 | musca | the return to the old build directory in the case of defeat. |
37 | 1 | musca | $ cd quassel |
38 | 1 | musca | $ mkdir build |
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 | 1 | musca | The options of cmake are described in the file ~/quassel/INSTALL in your source directory . |
42 | 1 | musca | $ 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 | 1 | musca | |
45 | 1 | musca | Now the command 'make' generates the calls for the compiler |
46 | 1 | musca | $ make |
47 | 1 | musca | |
48 | 1 | musca | h2. Install with checkinstall |
49 | 1 | musca | |
50 | 1 | musca | It is wise to prefer the default packagemanager of your system rather doing a 'make install'. |
51 | 1 | musca | The installation will be done as root with checkinstall. |
52 | 1 | musca | checkinstall generates a package (deb, rpm or tgz) for your packagemanager (apt, rpm or installpkg), |
53 | 1 | musca | that can later be removed easily and leaves a clean system. |
54 | 1 | musca | checkinstall has options for several distributions: -D for Debian, -R for RPM, -S for Slackware. |
55 | 1 | musca | When installing the package it asks interactive two questions, as shown in the following example: |
56 | 1 | musca | |
57 | 1 | musca | example: |
58 | 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 |
59 | 1 | musca | Output: |
60 | 1 | musca | Please enter a description of the package. |
61 | 1 | musca | Finish your description with an empty line or EOF. |
62 | 1 | musca | |
63 | 1 | musca | Input: |
64 | 1 | musca | >> [quassel-all contains quassel-core, quassel-client and quassel (mono).] |
65 | 1 | musca | >> [enter] |
66 | 1 | musca | |
67 | 1 | musca | Output: |
68 | 1 | musca | Das Paket wird entsprechend dieser Vorgaben erstellt: |
69 | 1 | musca | 0 - Maintainer: [ root@aquarium ] |
70 | 1 | musca | 1 - Summary: [ quassel-all contains core, client und quassel (mono). ] |
71 | 1 | musca | 2 - Name: [ quassel-all ] |
72 | 1 | musca | 3 - Version: [ 0.5.0 ] |
73 | 1 | musca | 4 - Release: [ 091021181559 ] |
74 | 1 | musca | 5 - License: [ GPL ] |
75 | 1 | musca | 6 - Group: [ checkinstall ] |
76 | 1 | musca | 7 - Architecture: [ i386 ] |
77 | 1 | musca | 8 - Source location: [ build_091021181559 ] |
78 | 1 | musca | 9 - Alternate source location: [ ] |
79 | 1 | musca | 10 - Requires: [ ] |
80 | 1 | musca | 11 - Provides: [ quassel-all ] |
81 | 1 | musca | |
82 | 1 | musca | Input: |
83 | 1 | musca | [ just press [enter] to proceed generating the package] |
84 | 1 | musca | |
85 | 1 | musca | The result (here for Debian): |
86 | 1 | musca | ********************************************************************** |
87 | 1 | musca | |
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 | 1 | musca | |
96 | 1 | musca | ********************************************************************** |
97 | 1 | 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 | 1 | musca | |
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 |