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