INSTALLATION INSTRUCTIONS FOR OSPD
==================================

Please note: The reference system used by most of the developers is
Debian GNU/Linux 'Stretch' 9. The build might fail on any other systems.
Also it is necessary to install dependent development packages.


Prerequisites for OSPD
----------------------

Prerequisites:
* python 3
* python-setuptools
* python-defusedxml

For using ospd_ssh:
* python-paramiko

For unittests:
* python-lxml

On Debian this should work to install dependencies:
# apt-get install python3-setuptools python3-paramiko python3-defusedxml \
  python3-lxml


Building OSPD
-------------

To install OSPD into directory <prefix> run this command:

python3 setup.py install --prefix=<prefix>

The default for <prefix> is /usr/local

Be aware that this might automatically download and install missing
Python packages. To prevent this, you should install the prerequisites
first with the mechanism of your system (for example via apt or rpm).

You may need to set the PYTHONPATH like this before running
the install command (perhaps with another python version):

export PYTHONPATH=<prefix>/lib/python3.5/site-packages/

You also may need to create directories prior to the install:

mkdir -p <prefix>/lib/python3.5/site-packages


Creating a source archive
-------------------------

To create a .tar.gz file for the ospd module run this command:

python3 setup.py sdist

This will create the archive file in the subdirectory "dist".


Documentation
-------------

To generate the protocol documentation for OSP in HTML format, run the script:

./doc/generate

This will create the osp.html file in the subdirectory "doc".

Source code documentation can be accessed over the usual methods,
for example:

$ python3
>>> import ospd.ospd
>>> help (ospd.ospd)

An equivalent to this is:

$ pydoc3 ospd.ospd

To explore the code documentation in a web browser:

$ pydoc3 -p 12345
pydoc server ready at http://localhost:12345/
 
For further options see the man page of pydoc.


Tests
-----

To run the tests, execute the command:

python3 setup.py test

If successful, something like the text below will be outputted:
...
Ran 14 tests in 0.025s

OK

Don't get confused by the various error message you will see. Those
are part of the tests. The "OK" at the end is what counts.
