doc/build-debian.md
author Damiano Boppart <damiano@pep-security.net>
Fri, 27 Oct 2017 17:21:25 +0200
changeset 2218 da5d2c04cd94
parent 2210 17c30881c885
child 2606 6bb1d3db6e36
permissions -rw-r--r--
Update documentation to reflect the changes to Makefile.conf
     1 <!-- Copyright 2015-2017, pEp foundation, Switzerland
     2 This file is part of the pEp Engine
     3 This file may be used under the terms of the Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) License
     4 See CC_BY-SA.txt -->
     5 
     6 # Build instructions for Debian 9
     7 
     8 # Installing packaged dependencies
     9 
    10 ~~~
    11 # general
    12 apt install -y ca-cacert mercurial
    13 # YML2
    14 apt install -y python-lxml
    15 # libetpan
    16 apt install -y git build-essential automake libtool
    17 # asn1c
    18 apt install -y git build-essential automake libtool
    19 # engine
    20 apt install -y uuid-dev libgpgme-dev libsqlite3-dev sqlite3
    21 ~~~
    22 
    23 # Installing unpackaged dependencies
    24 ## YML2
    25 
    26 ~~~
    27 mkdir -p ~/code/yml2
    28 hg clone https://cacert.pep.foundation/dev/repos/yml2/ ~/code/yml2
    29 ~~~
    30 
    31 ## libetpan
    32 pEp Engine requires libetpan with a set of patches that have not been upstreamed yet.
    33 
    34 ~~~
    35 mkdir -p ~/code/libetpan
    36 git clone https://github.com/fdik/libetpan ~/code/libetpan
    37 cd ~/code/libetpan
    38 mkdir ~/code/libetpan/build
    39 ./autogen.sh --prefix="$HOME/code/libetpan/build"
    40 make
    41 make install
    42 ~~~
    43 
    44 ## asn1c
    45 
    46 ~~~
    47 mkdir -p ~/code/asn1c
    48 git clone git://github.com/vlm/asn1c.git ~/code/asn1c
    49 cd ~/code/asn1c
    50 git checkout tags/v0.9.28 -b pep-engine
    51 autoreconf -iv
    52 mkdir ~/code/asn1c/build
    53 ./configure --prefix="$HOME/code/asn1c/build"
    54 make
    55 make install
    56 ~~~
    57 
    58 # pEp Engine
    59 
    60 ~~~
    61 mkdir -p ~/code/pep-engine
    62 hg clone https://cacert.pep.foundation/dev/repos/pEpEngine/ ~/code/pep-engine
    63 cd ~/code/pep-engine
    64 mkdir ~/code/pep-engine/build
    65 ~~~
    66 
    67 Edit the build configuration to your needs in `Makefile.conf`, or create a `local.conf` that sets any of the make variables documented in `Makefile.conf`. All the default values for the build configuration variables on each platform are documented in `default.conf`.
    68 
    69 If a dependency is not found in your system's default include or library paths, you will have to specify the according paths in a make variable. Typically, this has to be done at least for YML2, libetpan and asn1c.
    70 
    71 For a more detailed explanation of the mechanics of these build configuration files, and overriding defaults, see the comments in `default.conf`.
    72 
    73 Below is a sample `./local.conf` file, for orientation.
    74 
    75 ~~~
    76 PREFIX=$(HOME)/engine/build
    77 SYSTEM_DB=$(PREFIX)/share/pEp/system.db
    78 
    79 YML2_PATH=$(HOME)/yml2
    80 
    81 ETPAN_LIB=-L$(HOME)/libetpan/build/lib
    82 ETPAN_INC=-I$(HOME)/libetpan/build/include
    83 
    84 ASN1C=$(HOME)/asn1c/build/bin/asn1c
    85 ASN1C_INC=-I$(HOME)/asn1c/build/share/asn1c
    86 ~~~
    87 
    88 The engine is built as follows:
    89 
    90 ~~~
    91 make all
    92 make db
    93 ~~~
    94 
    95 The unit tests can be run without the engine library being installed, however `system.db` must be installed:
    96 
    97 ~~~
    98 make -C db install
    99 ~~~
   100 
   101 Since `system.db` rarely changes, its installation is not needed for every build.
   102 
   103 Tests can be compiled and executed with the following commands:
   104 
   105 ~~~
   106 make -C test compile
   107 make test
   108 ~~~