Harald Welte | ab599af | 2011-02-25 16:11:30 +0100 | [diff] [blame] | 1 | = Installing mgw_nat = |
| 2 | |
| 3 | ... is currently not _that_ simple, I'm working on it. |
| 4 | |
| 5 | == Installation procedure (rebar) = |
| 6 | |
| 7 | === checking out mgw_nat === |
| 8 | |
| 9 | {{{ |
| 10 | cd ~/osmo-erlang/ |
| 11 | git clone git://git.osmocom.org/erlang/mgw_nat |
| 12 | }}} |
| 13 | |
| 14 | === getting + patching rebar === |
| 15 | |
| 16 | {{{ |
| 17 | cd ~/osmo-erlang |
| 18 | hg clone https://bitbucket.org/basho/rebar |
| 19 | patch -p1 < ~/osmo-erlang/mgw_nat/rebar-asn1_set.diff |
| 20 | cd rebar |
| 21 | ./bootstrap |
| 22 | cp rebar /usr/local/bin/ |
| 23 | }}} |
| 24 | |
| 25 | === building mgw_nat and its dependencies === |
| 26 | |
| 27 | {{{ |
| 28 | cd ~/osmo-erlang/mgw_nat |
| 29 | rebar get-deps |
| 30 | rebar compile |
| 31 | }}} |
| 32 | some error will occur regarding src/tcap_map_patch.erl due to missing map.hrl file |
| 33 | {{{ |
| 34 | mv deps/osmo_map/src/map.hrl deps/osmo_map/include/ |
| 35 | rebar compile |
| 36 | }}} |
| 37 | |
| 38 | == Installation procedure (manual) == |
| 39 | |
| 40 | === Dependencies === |
| 41 | |
| 42 | let's assume we create a new base directory directory {{{~/osmo-erlang}}} for all |
| 43 | the Osmocom related Erlang code. |
| 44 | |
| 45 | As such, we need to set the {{{ERL_LIBS}}} variable to include this directory, e.g. |
| 46 | by using {{{export ERL_LIBS=~/osmo-erlang/}}} in the shell. |
| 47 | |
| 48 | ==== osmo_ss7 ==== |
| 49 | |
| 50 | {{{ |
| 51 | cd ~/osmo-erlang/ |
| 52 | git clone git://git.osmocom.org/erlang/osmo_ss7 |
| 53 | cd osmo_ss7 |
| 54 | erl -make |
| 55 | }}} |
| 56 | |
| 57 | |
| 58 | ==== osmo_map ==== |
| 59 | |
| 60 | {{{ |
| 61 | cd ~/osmo-erlang/ |
| 62 | git clone git://git.osmocom.org/erlang/osmo_map |
| 63 | cd osmo_map |
| 64 | erl -make |
| 65 | }}} |
| 66 | |
| 67 | === mgw_nat === |
| 68 | |
| 69 | {{{ |
| 70 | cd ~/osmo-erlang/ |
| 71 | git clone git://git.osmocom.org/erlang/mgw_nat |
| 72 | cd mgw_nat |
| 73 | erl -make |
| 74 | }}} |
| 75 | |
| 76 | == Configuration file == |
| 77 | |
| 78 | You have to write the config file using the standard Erlang OTP application |
| 79 | configuration file syntax and store it in e.g. {{{~/osmo-erlang/local.cfg}}} |
| 80 | |
| 81 | == Starting the VM / Application == |
| 82 | |
| 83 | * Make sure ERL_LIBS is set (see above) |
| 84 | {{{ |
| 85 | cd ~/osmo-erlang/ |
| 86 | erl -config ./local.cfg |
| 87 | }}} |
| 88 | |
| 89 | Inside the VM, you can then type |
| 90 | {{{ |
| 91 | application:start(mgw_nat). |
| 92 | }}} |
| 93 | in order to start the application. |