Add section about testing connmand
[connman] / HACKING
1 Hacking on Connection Manager
2 *****************************
3
4
5 Working with the source code repository
6 =======================================
7
8 The repository contains two extra scripts that accomplish the bootstrap
9 process. One is called "bootstrap" which is the basic scripts that uses the
10 autotools scripts to create the needed files for building and installing.
11 It makes sure to call the right programs depending on the usage of shared or
12 static libraries or translations etc.
13
14 The second program is called "bootstrap-configure". This program will make
15 sure to properly clean the repository, call the "bootstrap" script and then
16 call configure with proper settings for development. It will use the best
17 options and pass them over to configure. These options normally include
18 the enabling the maintainer mode and the debugging features.
19
20 So while in a normal source project the call "./configure ..." is used to
21 configure the project with its settings like prefix and extra options. In
22 case of bare repositories call "./bootstrap-configure" and it will bootstrap
23 the repository and calls configure with all the correct options to make
24 development easier.
25
26 In case of preparing for a release with "make distcheck", don't use
27 bootstrap-configure since it could export development specific settings.
28
29 So the normal steps to checkout, build and install such a repository is
30 like this:
31
32   Checkout repository
33     # git-clone git://git.moblin.org/projects/connman.git
34     # cd connman
35
36   Configure and build
37     # ./bootstrap-configure
38     # make
39
40   Check installation
41     # make install DESTDIR=$PWD/x
42     # find x
43     # rm -rf x
44
45   Check distribution
46     # make distcheck
47
48   Final installation
49     # sudo make install
50
51   Remove autogenerated files
52     # make maintainer-clean
53
54
55 Running from within the source code repository
56 ==============================================
57
58 When using "./configure --enable-maintainer-mode" the automake scripts will
59 use the plugins directly from within the repository. This removes the need
60 to use "make install" when testing "connmand". The "bootstrap-configure"
61 automatically includes this option.
62
63   Run daemon in foreground with debugging
64     # sudo ./src/connmand -n -d
65
66 For production installations or distribution packaging it is important that
67 the "--enable-maintainer-mode" option is NOT used.
68
69 Some times it is important to restrict the available interfaces. For example
70 in cases where testing happens over a network connection. The "-i" command
71 line switch allows to specify a glob pattern for the interface names.
72
73   Run daemon for wireless interfaces
74     # sudo ./src/connmand -n -i wlan*
75
76
77 Generating source code documentation
78 ====================================
79
80 The source code is annotated using the gtk-doc style documentation. This
81 allows an easy way of generating API documentation. The "bootstrap-configure"
82 script will use the "--enable-gtk-doc" configure to enable the generation of
83 the documentation.
84
85 To make the gtk-doc process work, the gtk-doc tools need to be installed.
86 Every distribution should provide a package for this, but the naming of the
87 package might be different:
88
89   Ubuntu/Debian
90     # apt-get install gtk-doc-utils
91
92   Fedora
93     # yum install gtk-doc
94
95 In case "bootstrap-configure" is not used, the manual steps for generating
96 the documentation files are like this:
97
98   Configuring the repository
99     # ./configure --enable-gtk-doc
100
101   Generate the documentation
102     # cd doc && make
103
104   View documentation
105     # firefox doc/html/index.html
106