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
damiano@2014
     1
<!-- Copyright 2015-2017, pEp foundation, Switzerland
damiano@2014
     2
This file is part of the pEp Engine
damiano@2014
     3
This file may be used under the terms of the Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) License
damiano@2014
     4
See CC_BY-SA.txt -->
damiano@2014
     5
damiano@2014
     6
# Build instructions for Debian 9
damiano@2014
     7
damiano@2014
     8
# Installing packaged dependencies
damiano@2014
     9
damiano@2014
    10
~~~
damiano@2014
    11
# general
damiano@2014
    12
apt install -y ca-cacert mercurial
damiano@2014
    13
# YML2
damiano@2014
    14
apt install -y python-lxml
damiano@2014
    15
# libetpan
damiano@2014
    16
apt install -y git build-essential automake libtool
damiano@2014
    17
# asn1c
damiano@2014
    18
apt install -y git build-essential automake libtool
damiano@2014
    19
# engine
damiano@2162
    20
apt install -y uuid-dev libgpgme-dev libsqlite3-dev sqlite3
damiano@2014
    21
~~~
damiano@2014
    22
damiano@2014
    23
# Installing unpackaged dependencies
damiano@2014
    24
## YML2
damiano@2014
    25
damiano@2014
    26
~~~
damiano@2014
    27
mkdir -p ~/code/yml2
damiano@2014
    28
hg clone https://cacert.pep.foundation/dev/repos/yml2/ ~/code/yml2
damiano@2014
    29
~~~
damiano@2014
    30
damiano@2014
    31
## libetpan
damiano@2014
    32
pEp Engine requires libetpan with a set of patches that have not been upstreamed yet.
damiano@2014
    33
damiano@2014
    34
~~~
damiano@2014
    35
mkdir -p ~/code/libetpan
damiano@2014
    36
git clone https://github.com/fdik/libetpan ~/code/libetpan
damiano@2014
    37
cd ~/code/libetpan
damiano@2014
    38
mkdir ~/code/libetpan/build
damiano@2014
    39
./autogen.sh --prefix="$HOME/code/libetpan/build"
damiano@2014
    40
make
damiano@2014
    41
make install
damiano@2014
    42
~~~
damiano@2014
    43
damiano@2014
    44
## asn1c
damiano@2014
    45
damiano@2014
    46
~~~
damiano@2014
    47
mkdir -p ~/code/asn1c
damiano@2014
    48
git clone git://github.com/vlm/asn1c.git ~/code/asn1c
damiano@2014
    49
cd ~/code/asn1c
damiano@2014
    50
git checkout tags/v0.9.28 -b pep-engine
damiano@2014
    51
autoreconf -iv
damiano@2014
    52
mkdir ~/code/asn1c/build
damiano@2014
    53
./configure --prefix="$HOME/code/asn1c/build"
damiano@2014
    54
make
damiano@2014
    55
make install
damiano@2014
    56
~~~
damiano@2014
    57
damiano@2014
    58
# pEp Engine
damiano@2014
    59
damiano@2014
    60
~~~
damiano@2014
    61
mkdir -p ~/code/pep-engine
damiano@2014
    62
hg clone https://cacert.pep.foundation/dev/repos/pEpEngine/ ~/code/pep-engine
damiano@2014
    63
cd ~/code/pep-engine
damiano@2014
    64
mkdir ~/code/pep-engine/build
damiano@2014
    65
~~~
damiano@2014
    66
damiano@2082
    67
Note: Everything PLATFORM_OVERRIDE-related is currenty outdated. Do not rely on the documentation here!
damiano@2082
    68
damiano@2014
    69
For an explanation of the mechanics of `PLATFORM_OVERRIDE`, see the inline comments in `Makefile.conf`.
damiano@2014
    70
In this guide, the platform-specific configuration will be called `local`.
damiano@2014
    71
The installation directory will be a subdirectory of the repository.
damiano@2014
    72
This is useful for testing only.
damiano@2014
    73
damiano@2014
    74
~~~
damiano@2014
    75
export PLATFORM_OVERRIDE=local
damiano@2014
    76
~~~
damiano@2014
    77
damiano@2014
    78
`./build-config/local.conf`:
damiano@2014
    79
damiano@2014
    80
~~~
damiano@2014
    81
PREFIX=$(HOME)/code/pep-engine/build
damiano@2014
    82
SYSTEM_DB=$(PREFIX)/share/pEp/system.db
damiano@2014
    83
damiano@2014
    84
YML2_PATH=$(HOME)/code/yml2
damiano@2014
    85
damiano@2014
    86
ETPAN_LIB=-L$(HOME)/code/libetpan/build/lib
damiano@2014
    87
ETPAN_INC=-I$(HOME)/code/libetpan/build/include
damiano@2014
    88
damiano@2014
    89
ASN1C=$(HOME)/code/asn1c/build/bin/asn1c
damiano@2014
    90
ASN1C_INC=-I$(HOME)/code/asn1c/build/share
damiano@2014
    91
~~~
damiano@2014
    92
damiano@2014
    93
The engine is built as follows:
damiano@2014
    94
damiano@2014
    95
~~~
damiano@2014
    96
make all
damiano@2014
    97
make db
damiano@2014
    98
~~~
damiano@2014
    99
damiano@2015
   100
The unit tests can be run without the engine library being installed, however `system.db` must be installed:
damiano@2014
   101
damiano@2014
   102
~~~
damiano@2014
   103
make -C db install
damiano@2014
   104
~~~
damiano@2014
   105
damiano@2014
   106
Since `system.db` rarely changes, its installation is not needed for every build.
damiano@2014
   107
damiano@2014
   108
Tests can be compiled and executed with the following commands:
damiano@2014
   109
damiano@2014
   110
~~~
damiano@2014
   111
make -C test compile
damiano@2014
   112
make test
damiano@2014
   113
~~~