README.md
author Dirk Zimmermann <dz@pep.security>
Tue, 12 Feb 2019 13:54:42 +0100
changeset 7614 6ddb020e6c35
parent 7573 31b2b2416ad1
child 7615 4b7c33884831
permissions -rw-r--r--
IOS-1475 GMake (from macports) needed.
dirk@59
     1
# How to build
dirk@59
     2
dirk@59
     3
## Prerequisites
dirk@59
     4
dirk@813
     5
### Package managers
dirk@813
     6
dirk@1148
     7
MacPorts for installing all dependencies:
dirk@813
     8
dirk@813
     9
Install [MacPorts](https://www.macports.org/) for your
dirk@813
    10
[version of OS X/macOS](https://www.macports.org/install.php).
dirk@813
    11
dirk@211
    12
### Dependencies of prerequisites
dirk@211
    13
dirk@1148
    14
For building the engine, you need a working python2 environment
dirk@1148
    15
and all dependencies:
dirk@1148
    16
dirk@1148
    17
```
dirk@1225
    18
sudo port install python27
dirk@1148
    19
sudo port install asn1c
dirk@1148
    20
sudo port install py27-lxml
dirk@1148
    21
dirk@1148
    22
sudo port install python_select
dirk@1224
    23
sudo port select python python27
dirk@3524
    24
dirk@3524
    25
sudo port install autoconf
dirk@3524
    26
sudo port install libtool
dirk@3524
    27
sudo port install automake
dz@7614
    28
dz@7614
    29
sudo port install gmake
dirk@1148
    30
```
dirk@211
    31
dirk@609
    32
### Other dependecies
dirk@609
    33
dirk@609
    34
#### pEpEngine: [yml2](https://fdik.org/yml/toolchain)
dirk@609
    35
dirk@609
    36
Clone into your home directory:
dirk@609
    37
dirk@609
    38
```
dirk@609
    39
pushd ~
dirk@3786
    40
hg clone https://pep.foundation/dev/repos/yml2/
dirk@609
    41
popd
dirk@609
    42
```
dirk@609
    43
ana@683
    44
## Setup instructions
dirk@113
    45
dirk@59
    46
```
dirk@59
    47
mkdir ~/src
dirk@59
    48
cd ~/src
dirk@59
    49
dirk@3160
    50
git clone https://github.com/fdik/libetpan.git
dirk@5659
    51
git clone https://pep-security.lu/gitlab/iOS/OpenSSL-for-iPhone.git
xavier@5641
    52
git clone https://pep-security.lu/gitlab/iOS/SwipeCellKit.git/
dirk@5659
    53
git clone https://pep-security.lu/gitlab/iOS/AppAuth-iOS.git
agp@7563
    54
git clone https://pep-security.lu/gitlab/misc/ldns.git
dirk@59
    55
dirk@3786
    56
hg clone https://pep.foundation/dev/repos/pantomime-iOS/
dirk@3786
    57
hg clone https://pep.foundation/dev/repos/netpgp-et
dirk@3786
    58
hg clone https://pep.foundation/dev/repos/pEpEngine
dirk@3786
    59
hg clone https://pep.foundation/dev/repos/pEpObjCAdapter
dirk@3786
    60
hg clone https://pep.foundation/dev/repos/MessageModel/
dirk@3786
    61
hg clone https://pep.foundation/dev/repos/libAccountSettings/
dirk@59
    62
dirk@3786
    63
hg clone https://pep-security.ch/dev/repos/pEp_for_iOS/
agp@7563
    64
agp@7563
    65
//Temp hot fix
agp@7563
    66
cd ~/ldns
agp@7563
    67
git checkout IOS-749
agp@7571
    68
cd ..
agp@7571
    69
cd ~/SwipeCellKit
agp@7571
    70
git checkout master
dirk@59
    71
```
dirk@83
    72
andreas@1802
    73
### Build Project
andreas@1802
    74
andreas@1802
    75
Open pEpForiOS.xcworkspace and build schema "pEp".
dirk@1148
    76
dirk@949
    77
### Unit Tests
dirk@113
    78
dz@7573
    79
Out of the box, most tests expect a local test server:
dz@7573
    80
dz@7573
    81
```
dz@7573
    82
cd ~/Downloads
dz@7573
    83
wget http://central.maven.org/maven2/com/icegreen/greenmail-standalone/1.5.9/greenmail-standalone-1.5.9.jar
dz@7573
    84
shasum -a 256 greenmail-standalone-1.5.9.jar
dz@7573
    85
8301b89007e986e8d5e93e2504aad866a58b07b53ac06abb87e6e43eb7646261  greenmail-standalone-1.5.9.jar
dz@7573
    86
java -Dgreenmail.setup.test.all -Dgreenmail.users=test001:pwd@localhost,test002:pwd@localhost,test003:pwd@localhost -jar ~/Downloads/greenmail-standalone-1.5.9.jar
dz@7573
    87
```
dz@7573
    88
dirk@4172
    89
The non-existing file referenced in the unit test project, ./pEpForiOSTests/TestUtil/SecretTestData.swift, must be
dz@7573
    90
created, with a class named SecretTestData, derived from TestDataBase.
dirk@986
    91
dz@7573
    92
In `SecretTestData.swift`, you must override `populateVerifiableAccounts`, adding servers that are either registered in the LAS database or provide DNS SRV for IMAP and SMTP in order to test the "automatic account login".
dz@7573
    93
dz@7573
    94
If you want to run the tests against your own servers, override `populateAccounts` accordingly.
dirk@3786
    95
dirk@3707
    96
### UI Tests
dirk@3707
    97
dirk@3708
    98
There is a file referenced in the UI test project, UITestData. You need to create it
dirk@4172
    99
(./pEpForiOSUITests/SecretUITestData.swift), and implement it according to the protocol UITestDataProtocol.
dirk@3709
   100
dirk@3709
   101
The UI tests will not compile without it.
dirk@3713
   102
andreas@3864
   103
### secret.xcconfig (needed for OAuth2 config secrects and others)
dirk@3713
   104
andreas@3864
   105
Create secret.xcconfig @ pEpForiOS/secret.xcconfig, with those contents:
dirk@3713
   106
dirk@3713
   107
```
dirk@4747
   108
OAUTH2_GMAIL_CLIENT_ID = some_content
dirk@4747
   109
OAUTH2_GMAIL_REDIRECT_URL_SCHEME = some_content
dirk@4747
   110
dirk@4747
   111
OAUTH2_YAHOO_CLIENT_ID = some_content
dirk@4747
   112
OAUTH2_YAHOO_CLIENT_SECRET = some_content
dirk@4747
   113
dirk@3713
   114
```