doc/build-debian.md
branchENGINE-237
changeset 2014 4b6659d17b61
child 2015 eefffcd9f781
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/doc/build-debian.md	Tue Aug 29 00:25:54 2017 +0200
     1.3 @@ -0,0 +1,111 @@
     1.4 +<!-- Copyright 2015-2017, pEp foundation, Switzerland
     1.5 +This file is part of the pEp Engine
     1.6 +This file may be used under the terms of the Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) License
     1.7 +See CC_BY-SA.txt -->
     1.8 +
     1.9 +# Build instructions for Debian 9
    1.10 +
    1.11 +# Installing packaged dependencies
    1.12 +
    1.13 +~~~
    1.14 +# general
    1.15 +apt install -y ca-cacert mercurial
    1.16 +# YML2
    1.17 +apt install -y python-lxml
    1.18 +# libetpan
    1.19 +apt install -y git build-essential automake libtool
    1.20 +# asn1c
    1.21 +apt install -y git build-essential automake libtool
    1.22 +# engine
    1.23 +apt install -y uuid-dev libgpgme11-dev libsqlite3-dev sqlite3
    1.24 +~~~
    1.25 +
    1.26 +# Installing unpackaged dependencies
    1.27 +## YML2
    1.28 +
    1.29 +~~~
    1.30 +mkdir -p ~/code/yml2
    1.31 +hg clone https://cacert.pep.foundation/dev/repos/yml2/ ~/code/yml2
    1.32 +~~~
    1.33 +
    1.34 +## libetpan
    1.35 +pEp Engine requires libetpan with a set of patches that have not been upstreamed yet.
    1.36 +
    1.37 +~~~
    1.38 +mkdir -p ~/code/libetpan
    1.39 +git clone https://github.com/fdik/libetpan ~/code/libetpan
    1.40 +cd ~/code/libetpan
    1.41 +mkdir ~/code/libetpan/build
    1.42 +./autogen.sh --prefix="$HOME/code/libetpan/build"
    1.43 +make
    1.44 +make install
    1.45 +~~~
    1.46 +
    1.47 +## asn1c
    1.48 +
    1.49 +~~~
    1.50 +mkdir -p ~/code/asn1c
    1.51 +git clone git://github.com/vlm/asn1c.git ~/code/asn1c
    1.52 +cd ~/code/asn1c
    1.53 +git checkout tags/v0.9.28 -b pep-engine
    1.54 +autoreconf -iv
    1.55 +mkdir ~/code/asn1c/build
    1.56 +./configure --prefix="$HOME/code/asn1c/build"
    1.57 +make
    1.58 +make install
    1.59 +~~~
    1.60 +
    1.61 +# pEp Engine
    1.62 +
    1.63 +~~~
    1.64 +mkdir -p ~/code/pep-engine
    1.65 +hg clone https://cacert.pep.foundation/dev/repos/pEpEngine/ ~/code/pep-engine
    1.66 +cd ~/code/pep-engine
    1.67 +mkdir ~/code/pep-engine/build
    1.68 +~~~
    1.69 +
    1.70 +For an explanation of the mechanics of `PLATFORM_OVERRIDE`, see the inline comments in `Makefile.conf`.
    1.71 +In this guide, the platform-specific configuration will be called `local`.
    1.72 +The installation directory will be a subdirectory of the repository.
    1.73 +This is useful for testing only.
    1.74 +
    1.75 +~~~
    1.76 +export PLATFORM_OVERRIDE=local
    1.77 +~~~
    1.78 +
    1.79 +`./build-config/local.conf`:
    1.80 +
    1.81 +~~~
    1.82 +PREFIX=$(HOME)/code/pep-engine/build
    1.83 +SYSTEM_DB=$(PREFIX)/share/pEp/system.db
    1.84 +
    1.85 +YML2_PATH=$(HOME)/code/yml2
    1.86 +
    1.87 +ETPAN_LIB=-L$(HOME)/code/libetpan/build/lib
    1.88 +ETPAN_INC=-I$(HOME)/code/libetpan/build/include
    1.89 +
    1.90 +ASN1C=$(HOME)/code/asn1c/build/bin/asn1c
    1.91 +ASN1C_INC=-I$(HOME)/code/asn1c/build/share
    1.92 +~~~
    1.93 +
    1.94 +The engine is built as follows:
    1.95 +
    1.96 +~~~
    1.97 +make all
    1.98 +make db
    1.99 +~~~
   1.100 +
   1.101 +The unit tests can be run without the engine library being installed, however the `system.db` must be installed:
   1.102 +
   1.103 +~~~
   1.104 +make -C db install
   1.105 +~~~
   1.106 +
   1.107 +Since `system.db` rarely changes, its installation is not needed for every build.
   1.108 +
   1.109 +Tests can be compiled and executed with the following commands:
   1.110 +
   1.111 +~~~
   1.112 +make -C test compile
   1.113 +make test
   1.114 +~~~