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