README.md
author Dirk Zimmermann <dz@pep.security>
Thu, 21 Mar 2019 12:44:24 +0100
branchIOS-1480
changeset 8033 bf94050222a1
parent 7973 5f5183934189
child 8311 b3c93c82ed21
permissions -rw-r--r--
IOS-1480 Close branch.
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@3524
    23
dirk@3524
    24
sudo port install autoconf
dirk@3524
    25
sudo port install libtool
dirk@3524
    26
sudo port install automake
dz@7614
    27
dz@7614
    28
sudo port install gmake
dirk@1148
    29
```
dirk@211
    30
dirk@609
    31
### Other dependecies
dirk@609
    32
dirk@609
    33
#### pEpEngine: [yml2](https://fdik.org/yml/toolchain)
dirk@609
    34
dirk@609
    35
Clone into your home directory:
dirk@609
    36
dirk@609
    37
```
dirk@609
    38
pushd ~
dirk@3786
    39
hg clone https://pep.foundation/dev/repos/yml2/
dirk@609
    40
popd
dirk@609
    41
```
dirk@609
    42
ana@683
    43
## Setup instructions
dirk@113
    44
dirk@59
    45
```
dirk@59
    46
mkdir ~/src
dirk@59
    47
cd ~/src
dirk@59
    48
dirk@3160
    49
git clone https://github.com/fdik/libetpan.git
dirk@5659
    50
git clone https://pep-security.lu/gitlab/iOS/OpenSSL-for-iPhone.git
xavier@5641
    51
git clone https://pep-security.lu/gitlab/iOS/SwipeCellKit.git/
dirk@5659
    52
git clone https://pep-security.lu/gitlab/iOS/AppAuth-iOS.git
agp@7563
    53
git clone https://pep-security.lu/gitlab/misc/ldns.git
dirk@59
    54
dirk@3786
    55
hg clone https://pep.foundation/dev/repos/pantomime-iOS/
dirk@3786
    56
hg clone https://pep.foundation/dev/repos/netpgp-et
dirk@3786
    57
hg clone https://pep.foundation/dev/repos/pEpEngine
dirk@3786
    58
hg clone https://pep.foundation/dev/repos/pEpObjCAdapter
dirk@3786
    59
hg clone https://pep.foundation/dev/repos/MessageModel/
dirk@3786
    60
hg clone https://pep.foundation/dev/repos/libAccountSettings/
dirk@59
    61
dirk@3786
    62
hg clone https://pep-security.ch/dev/repos/pEp_for_iOS/
dirk@59
    63
```
dirk@83
    64
andreas@1802
    65
### Build Project
andreas@1802
    66
andreas@1802
    67
Open pEpForiOS.xcworkspace and build schema "pEp".
dirk@1148
    68
dirk@949
    69
### Unit Tests
dirk@113
    70
dz@7573
    71
Out of the box, most tests expect a local test server:
dz@7573
    72
dz@7573
    73
```
dz@7573
    74
cd ~/Downloads
dz@7573
    75
wget http://central.maven.org/maven2/com/icegreen/greenmail-standalone/1.5.9/greenmail-standalone-1.5.9.jar
dz@7573
    76
shasum -a 256 greenmail-standalone-1.5.9.jar
dz@7573
    77
8301b89007e986e8d5e93e2504aad866a58b07b53ac06abb87e6e43eb7646261  greenmail-standalone-1.5.9.jar
dz@7573
    78
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
    79
```
dz@7573
    80
dirk@4172
    81
The non-existing file referenced in the unit test project, ./pEpForiOSTests/TestUtil/SecretTestData.swift, must be
dz@7573
    82
created, with a class named SecretTestData, derived from TestDataBase.
dirk@986
    83
dz@7573
    84
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
    85
dz@7573
    86
If you want to run the tests against your own servers, override `populateAccounts` accordingly.
dirk@3786
    87
dirk@3707
    88
### UI Tests
dirk@3707
    89
dirk@3708
    90
There is a file referenced in the UI test project, UITestData. You need to create it
dirk@4172
    91
(./pEpForiOSUITests/SecretUITestData.swift), and implement it according to the protocol UITestDataProtocol.
dirk@3709
    92
dirk@3709
    93
The UI tests will not compile without it.
dirk@3713
    94
andreas@3864
    95
### secret.xcconfig (needed for OAuth2 config secrects and others)
dirk@3713
    96
andreas@3864
    97
Create secret.xcconfig @ pEpForiOS/secret.xcconfig, with those contents:
dirk@3713
    98
dirk@3713
    99
```
dirk@4747
   100
OAUTH2_GMAIL_CLIENT_ID = some_content
dirk@4747
   101
OAUTH2_GMAIL_REDIRECT_URL_SCHEME = some_content
dirk@4747
   102
dirk@4747
   103
OAUTH2_YAHOO_CLIENT_ID = some_content
dirk@4747
   104
OAUTH2_YAHOO_CLIENT_SECRET = some_content
dirk@4747
   105
dirk@3713
   106
```