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@2606
|
12 |
apt install -y 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@2607
|
18 |
apt install -y git build-essential automake libtool autoconf
|
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@2606
|
28 |
hg clone https://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@2606
|
62 |
hg clone https://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@2218
|
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`.
|
damiano@2082
|
68 |
|
damiano@2218
|
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.
|
damiano@2210
|
70 |
|
damiano@2218
|
71 |
For a more detailed explanation of the mechanics of these build configuration files, and overriding defaults, see the comments in `default.conf`.
|
damiano@2218
|
72 |
|
damiano@2218
|
73 |
Below is a sample `./local.conf` file, for orientation.
|
damiano@2014
|
74 |
|
damiano@2014
|
75 |
~~~
|
damiano@2218
|
76 |
PREFIX=$(HOME)/engine/build
|
damiano@2014
|
77 |
SYSTEM_DB=$(PREFIX)/share/pEp/system.db
|
damiano@2014
|
78 |
|
damiano@2218
|
79 |
YML2_PATH=$(HOME)/yml2
|
damiano@2014
|
80 |
|
damiano@2218
|
81 |
ETPAN_LIB=-L$(HOME)/libetpan/build/lib
|
damiano@2218
|
82 |
ETPAN_INC=-I$(HOME)/libetpan/build/include
|
damiano@2014
|
83 |
|
damiano@2218
|
84 |
ASN1C=$(HOME)/asn1c/build/bin/asn1c
|
damiano@2218
|
85 |
ASN1C_INC=-I$(HOME)/asn1c/build/share/asn1c
|
damiano@2014
|
86 |
~~~
|
damiano@2014
|
87 |
|
damiano@2014
|
88 |
The engine is built as follows:
|
damiano@2014
|
89 |
|
damiano@2014
|
90 |
~~~
|
damiano@2014
|
91 |
make all
|
damiano@2014
|
92 |
make db
|
damiano@2014
|
93 |
~~~
|
damiano@2014
|
94 |
|
damiano@2015
|
95 |
The unit tests can be run without the engine library being installed, however `system.db` must be installed:
|
damiano@2014
|
96 |
|
damiano@2014
|
97 |
~~~
|
damiano@2014
|
98 |
make -C db install
|
damiano@2014
|
99 |
~~~
|
damiano@2014
|
100 |
|
damiano@2014
|
101 |
Since `system.db` rarely changes, its installation is not needed for every build.
|
damiano@2014
|
102 |
|
damiano@2014
|
103 |
Tests can be compiled and executed with the following commands:
|
damiano@2014
|
104 |
|
damiano@2014
|
105 |
~~~
|
damiano@2014
|
106 |
make -C test compile
|
damiano@2014
|
107 |
make test
|
damiano@2014
|
108 |
~~~
|