README.md
author Dirk Zimmermann <dirk@pep-project.org>
Tue, 18 Oct 2016 12:43:20 +0200
changeset 813 703f4850ea9e
parent 781 83693513d108
child 817 088f54d957bb
permissions -rw-r--r--
Update readme for lxml
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@813
     7
Except for lxml, everything can be installed via [brew](http://brew.sh/)
dirk@813
     8
dirk@813
     9
For the lxml, you need MacPorts:
dirk@813
    10
dirk@813
    11
Install [MacPorts](https://www.macports.org/) for your
dirk@813
    12
[version of OS X/macOS](https://www.macports.org/install.php).
dirk@813
    13
hernani@156
    14
### Install Revision Control Systems used
hernani@156
    15
dirk@83
    16
Choose homebrew or macports for installing.
dirk@83
    17
dirk@83
    18
* git
dirk@59
    19
* Mercurial
dirk@59
    20
hernani@156
    21
### Install CAcert root certificates
hernani@156
    22
hernani@156
    23
Import the root certificates of the community-driven CAcert project
hernani@157
    24
in order to deal with the Mercurial repositories via https; for Mac
hernani@158
    25
OS X follow (the GUI or commandline) instructions provided:
hernani@156
    26
hernani@156
    27
http://wiki.cacert.org/FAQ/ImportRootCert#Mac_OS_X
hernani@156
    28
hernani@158
    29
Before using, please check the authenticity of the certificate(s)
hernani@159
    30
downloaded.
hernani@158
    31
hernani@158
    32
The fingerprints should be:
hernani@158
    33
hernani@158
    34
* Class 1 PKI Key (SHA1): 13:5C:EC:36:F4:9C:B8:E9:3B:1A:B2:70:CD:80:88:46:76:CE:8F:33 
hernani@158
    35
* Class 3 PKI Key (SHA1): AD:7C:3F:64:FC:44:39:FE:F4:E9:0B:E8:F4:7C:6C:FA:8A:AD:FD:CE
hernani@158
    36
hernani@158
    37
(Cf. http://www.cacert.org/index.php?id=3)
hernani@158
    38
dirk@211
    39
### Dependencies of prerequisites
dirk@211
    40
dirk@211
    41
* pEpEngine: asn1c
dirk@211
    42
  ```
dirk@211
    43
  brew install asn1c
dirk@211
    44
  ```
dirk@475
    45
* mogenerator
dirk@475
    46
  ```
dirk@475
    47
  brew install mogenerator
dirk@475
    48
  ```
dirk@813
    49
* python lxml (Alternatively, install it with pip)
dirk@781
    50
  ```
dirk@781
    51
  brew install python
dirk@813
    52
  sudo port install py27-lxml
dirk@781
    53
  ```
dirk@211
    54
dirk@609
    55
### Other dependecies
dirk@609
    56
dirk@609
    57
#### pEpEngine: [yml2](https://fdik.org/yml/toolchain)
dirk@609
    58
dirk@609
    59
Clone into your home directory:
dirk@609
    60
dirk@609
    61
```
dirk@609
    62
pushd ~
dirk@609
    63
hg clone https://cacert.pep.foundation/dev/repos/yml2/
dirk@609
    64
popd
dirk@609
    65
```
dirk@609
    66
ana@683
    67
## Setup instructions
dirk@113
    68
dirk@59
    69
```
dirk@59
    70
mkdir ~/src
dirk@59
    71
cd ~/src
dirk@59
    72
dirk@59
    73
git clone https://github.com/fdik/libetpan
dirk@59
    74
dirk@62
    75
hg clone https://cacert.pep.foundation/dev/repos/pantomime-iOS/
dirk@59
    76
hg clone https://cacert.pep.foundation/dev/repos/netpgp-et
dirk@59
    77
hg clone https://cacert.pep.foundation/dev/repos/pEpEngine
dirk@59
    78
hg clone https://cacert.pep.foundation/dev/repos/pEpiOSAdapter
dirk@59
    79
dirk@62
    80
hg clone https://cacert.pep-security.ch/dev/repos/pEp_for_iOS/
dirk@63
    81
dirk@531
    82
# Set up working account for unit tests. After copying, fill in working account:
dirk@63
    83
cp ./pEpForiOS/Sync/TestData.swift.sample ./pEpForiOS/Sync/TestData.swift
dirk@531
    84
dirk@531
    85
# Set up working account for UI tests. After copying, fill in working account:
dirk@531
    86
cp ./pEpForiOSUITests/UITestData.swift.sample ./pEpForiOSUITests/UITestData.swift
dirk@59
    87
```
dirk@83
    88
dirk@83
    89
Note that netpgp includes a static openssl, and pEpEngine a static libcurl. For
dirk@83
    90
rebuilding see the respective scripts. But you should not have to do that for iOS.
dirk@113
    91
dirk@113
    92
## Auto-generating model files
dirk@113
    93
dirk@475
    94
The core data model files are generated with mogenerator, using modified templates
dirk@113
    95
(for generating protocol definitions as well).
dirk@113
    96
dirk@211
    97
You only need to regenerate them when there were changes in the model.
dirk@211
    98
dirk@113
    99
```
dirk@113
   100
cd pEp_for_iOS
dirk@113
   101
dirk@475
   102
mogenerator --model pEpForiOS/pEpForiOS.xcdatamodeld/pEpForiOS.xcdatamodel --machine-dir pEpForiOS/Models/machine/ --human-dir pEpForiOS/Models/ --swift --base-class BaseManagedObject --template-path ../mogenerator.templates/
dirk@113
   103
```