INSTALLATION INSTRUCTIONS FOR OPENVAS-CLI
=========================================

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

Prerequisites for openvas-cli
-----------------------------

Prerequisites:
* cmake
* glib-2.0
* gnutls (>= 2.8)
* openvas-libraries (>= 8.0.4)
* pkg-config

Prerequisites for building documentation:
* Doxygen
* xmltoman (optional, for building man page)

Prerequisites for static code analysis:
* clang

Compiling openvas-cli
---------------------

If you have installed required libraries to a non-standard location, remember to
set the PKG_CONFIG_PATH environment variable to the location of your pkg-config
files before configuring:

    $ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/your/location/lib/pkgconfig

Create a build directory and change into it with

    $ mkdir build
    $ cd build

Then configure the build with

    $ cmake -DCMAKE_INSTALL_PREFIX=/path/to/your/installation ..

or (if you want to use the default installation path /usr/local)

    $ cmake ..

This only needs to be done once.  Note: It is assumed that the other
OpenVAS components are installed to the same path.

Thereafter, the following commands are useful.

    $ make                # build openvas-cli
    $ make doc            # build the documentation
    $ make doc-full       # build more developer-oriented documentation
    $ make install        # install the build
    $ make rebuild_cache  # rebuild the cmake cache


Static code analysis with the Clang Static Analyzer
---------------------------------------------------

If you want to use the Clang Static Analyzer (http://clang-analyzer.llvm.org/)
to do a static code analysis, you can do so by adding the following parameter
when configuring the build:

  -DCMAKE_C_COMPILER=/usr/share/clang/scan-build/ccc-analyzer

Note that the example above uses the default location of ccc-analyzer in Debian
GNU/Linux and may be different in other environments.

To have the analysis results aggregated into a set of HTML files, use the
following command:

    $ scan-build make

The tool will provide a hint on how to launch a web browser with the results.

It is recommended to do this analysis in a separate, empty build directory and
to empty the build directory before "scan-build" call.


Compiling stand-alone Nagios plugin
-----------------------------------

In order build a stand-alone (i.e. statically linked) version of the OMP Nagios
plugin check_omp in the "nagios/" subdirectory, openvas-cli must be configured
with the "BUILD_STATIC_NAGIOS" option:

    $ cmake -DBUILD_STATIC_NAGIOS=1 ..

Then use the "make" and "make install" commands to build the binary.

Compiling stand-alone OMP command line client
---------------------------------------------

In order build a stand-alone (i.e. statically linked) version of the OMP command
line client omp in the "omp/" subdirectory, openvas-cli must be configured
with the "BUILD_STATIC_OMP" option:

    $ cmake -DBUILD_STATIC_OMP=1 ..

Then use the "make" and "make install" commands to build the binary.
