INSTALL 6.27 KB
Newer Older
1 2 3 4
INSTALLATION INSTRUCTIONS FOR OPENVAS-LIBRARIES
===============================================

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


9 10
Prerequisites for openvas-libraries
-----------------------------------
11

12 13 14 15
See at the end of this section how to easily install these prerequisites on
some supported platforms.

General build environment:
16 17 18
* a C compiler (e.g. gcc)
* bison
* flex
19
* cmake >= 2.8
20 21
* pkg-config

22
Specific development libraries:
23 24
* libglib >= 2.32
* libgnutls >= 3.2.15
25 26 27 28 29 30 31
* libgcrypt
* zlib
* libpcap
* libgpgme >= 1.1.2
* uuid-dev (from e2fsprogs)
* libssh >= 0.5.0
* libhiredis >= 0.10.1
32
* libksba >= 1.0.7
33

34
Prerequisites for building documentation:
35
* doxygen
36 37 38 39
* xmltoman (optional, for building man page)
* sqlfairy (optional, for producing database diagram)

Recommended to have WMI support:
40
* openvas-smb >= 1.0.1
41 42 43 44 45 46 47 48 49 50 51 52

Recommended to have improved SNMP support:
* netsnmp

Recommended to have LDAP support:
* libldap >= 2.4.11
  (LDAP can be disabled with -DBUILD_WITHOUT_LDAP=1)

Recommended to have RADIUS support:
* libfreeradius-client >= 1.1.6
  (RADIUS can be enabled with -DBUILD_WITH_RADIUS=1)

53
Install prerequisites on Debian GNU/Linux 'Jessie' 8:
54 55 56
# apt-get install dpkg-dev pkg-config libssh-dev libgnutls28-dev libglib2.0-dev \
  libpcap-dev libgpgme11-dev uuid-dev bison libksba-dev libhiredis-dev \
  libsnmp-dev libgcrypt20-dev libldap2-dev
57 58 59 60


Compiling openvas-libraries
---------------------------
61 62

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

66 67 68 69 70 71
    $ export PKG_CONFIG_PATH=/your/location/lib/pkgconfig:$PKG_CONFIG_PATH

Create a build directory and change into it with

    $ mkdir build
    $ cd build
72 73 74

Configure the build with

75
    $ cmake -DCMAKE_INSTALL_PREFIX=/path/to/your/installation ..
76 77 78

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

79
    $ cmake ..
80 81 82 83 84

This only needs to be done once.

Thereafter, the following commands are useful.

85
    $ make                # build the libraries
86 87 88
    $ make doc            # build the documentation
    $ make doc-full       # build more developer-oriented documentation
    $ make install        # install the build
89
    $ make rebuild_cache  # rebuild the cmake cache
90

91 92
Please note that you may have to execute "make install" as root, especially if
you have specified a prefix for which your user does not have full permissions.
93

94 95
To clean up the build environment, simply remove the contents of the "build"
directory you created above.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125


Configuration Options
---------------------

During compilation, the build process uses a set of compiler options which
enable very strict error checking and ask the compiler to abort should it detect
any errors in the code. This is to ensure a maximum of code quality and
security.

Unfortunately, some (especially newer) compiler can be more strict than others
when it comes to error checking. While this is a good thing and the OpenVAS
developers aim to address all compiler warnings, it may lead the build process
to abort on your system. Below you will find a list of the most common warnings
and what you can do about them.

* "call to function ‘xyz’ without a real prototype"

This warning shows up on recent openSUSE versions due to a compiler option only
present on these systems. To tell the build process to not abort the build
process on this warning, add -DIGNORE_UNPROTOTYPED_CALLS=1 to your configuration
command, for example:

    $ cmake -DIGNORE_UNPROTOTYPED_CALLS=1 .

Should you notice any other error messages causing your build process to abort,
do not hesitate to contact the OpenVAS developers using the mailing lists or IRC
chat. Don't forget to include the name and version of your system and
distribution in your message.

126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182

Building OpenVAS Libraries statically linked
--------------------------------------------

If you want to build a statically linked version of OpenVAS Libraries -- for
example to subsequently build a statically linked OMP command line client or
Nagios plugin from the "openvas-cli" module -- you need statically linked
versions of the prerequisite libraries as well.

This can be a problem with current versions of the GnuTLS library. In most
distributions GnuTLS is built with p11-kit support, which makes linking
statically against the GnuTLS library impossible. To work around this, you can
build the GnuTLS yourself after configuring it without support for p11-kit. This
can be done with the following parameters:

    $ ./configure --disable-shared --enable-static --without-p11-kit

Note that you will most likely want to add additional parameters to configure
the GnuTLS library based on your distributions policy and/or your personal
needs, e.g. the correct prefix so OpenVAS Libraries will find you statically
linked version. The "make install" command will then build the GnuTLS library
and install it into the path you configured.

Once you have build and installed the GnuTLS library, configure OpenVAS
Libraries with the following parameters to request statically linked versions of
the "base", "misc" and "omp" modules:

   $ cmake -DBUILD_STATIC=1 -DBUILD_SHARED=0 -DOPENVAS_OMP_ONLY=1 ..

Once again, the "make install" command will build and install the requested
modules.

For instructions on building statically linked binaries from the "openvas-cli"
module please see the INSTALL file there.


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.