doc/build-debian.md
author Damiano Boppart <damiano@pep-security.net>
Thu, 26 Oct 2017 15:43:22 +0200
branchENGINE-261
changeset 2210 17c30881c885
parent 2162 9e693cb1b2f2
child 2218 da5d2c04cd94
permissions -rw-r--r--
Add default.conf into the build system
     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 Note: Everything PLATFORM_OVERRIDE-related is currenty outdated. Do not rely on the documentation here!
    68 
    69 Note: Everything Makefile.conf-related is currenty outdated. Do not rely on the documentation here!
    70 
    71 For an explanation of the mechanics of `PLATFORM_OVERRIDE`, see the inline comments in `Makefile.conf`.
    72 In this guide, the platform-specific configuration will be called `local`.
    73 The installation directory will be a subdirectory of the repository.
    74 This is useful for testing only.
    75 
    76 ~~~
    77 export PLATFORM_OVERRIDE=local
    78 ~~~
    79 
    80 `./build-config/local.conf`:
    81 
    82 ~~~
    83 PREFIX=$(HOME)/code/pep-engine/build
    84 SYSTEM_DB=$(PREFIX)/share/pEp/system.db
    85 
    86 YML2_PATH=$(HOME)/code/yml2
    87 
    88 ETPAN_LIB=-L$(HOME)/code/libetpan/build/lib
    89 ETPAN_INC=-I$(HOME)/code/libetpan/build/include
    90 
    91 ASN1C=$(HOME)/code/asn1c/build/bin/asn1c
    92 ASN1C_INC=-I$(HOME)/code/asn1c/build/share
    93 ~~~
    94 
    95 The engine is built as follows:
    96 
    97 ~~~
    98 make all
    99 make db
   100 ~~~
   101 
   102 The unit tests can be run without the engine library being installed, however `system.db` must be installed:
   103 
   104 ~~~
   105 make -C db install
   106 ~~~
   107 
   108 Since `system.db` rarely changes, its installation is not needed for every build.
   109 
   110 Tests can be compiled and executed with the following commands:
   111 
   112 ~~~
   113 make -C test compile
   114 make test
   115 ~~~