Last part in windows support, director on windows.

This patch adds the things needed to cross-compile the director using
MINGW on Linux. It adds the build infrastructure for building the
database backend infrastructure (catalog) and the actual director and
dbcheck for windows. It also adds the bsmtp binary in tools and the
changes needed to the installer to install all new stuff.

It does however not supply the database (postgresql or sqlite3) you
need to install those before running the bareos-installer.

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
Use proper filename for windows paths.

For ASCII paths you need to use unix_name_to_win32() and for UTF8 paths
make_win32_path_UTF8_2_wchar()

We were always doing first a unix_name_to_win32() and that output as
input for UTF8 make_win32_path_UTF8_2_wchar() that ain't going to work.

Fixes #274: bareos-fd on windows 7 struggles with unix-style pathes
added Coverity Scan to travis

see https://scan.coverity.com/

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
Fix some compiler warnings.
Fix some more compiler warnings.
Fix resource leak in create_pid_file().
Fix buffer overrun.
Fix resource leak.
Explicitly return NULL or 0 on M_ABORT error.

This makes the work for static analyzing tools a lot easier that
don't understand that a M_ABORT means stop executing the program
and abort creating a crash on our way out.
Fix wrong return.
Fix socket closing.
Use bstrncpy and not strncpy.
Don't return a pointer to a local variable.
Remove useless debug message.
Fix for purge command not purging and truncating.

Fix for purge command not purging and truncating volumes when run
with action parameter

Fixes #282: Running purge command with action parameter does not purge
            or truncates volumes

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
Adds support for different blocksizes.

Min- and maxblocksize are now a property of the
pool and are promoted to tapes in that pool.

Therefore, the media and pool database tables were
adapted to hold min and maxblocksize.

In order to be able to read the tape label always,
the label is always read and written with the
DEFAULT_BLOCK_SIZE = 63k/64512 bytes

For backward compatibility, the blocksize
DEFAULT_BLOCK_SIZE is used if the blocksize
for the medium is zero in the database table.

The device blocksizes are set to the values
of the mounted volume after it was mounted, so
all blocks being written after the label block
are written with the blocksizes configured in the
medium/pool.

Moving a tape from one pool to another through
the scratch pool mechanism is supported,
as then the pool's properties are promoted
to the medium.

This new feature makes it possible to move from
one blocksize to a new one during normal operation
while being able to restore the old backups at any
time.

For disaster recovery (DR) using bscan etc. you need to
set the blocksize used during write of the tape for
restore.

Fixes #267: make blocksize a property of the pool
Tweak layout and naming.

- Always use the virtual d_open method.
- Open system call is called with 2 or 3 arguments but they are named
  path, oflag and mode so don't use mode for what is normally is
  called oflag as that could be misinterpretted as being the mode
  argument.
- Tweak layout of comments and use spaces around or-ed values for
  readability.
- Abstract truncate function to device specific truncate function.
- Rename ST_APPEND to ST_APPENDREADY and ST_READ to ST_READREADY
  to work around namespace collision of ST_APPEND in statvfs.h
  on Linux.
- Move device abstraction into src/stored/backends
Add first prototype for abstracting Gluster FS API.
Add first prototype for object storage device abstraction.

For this we use libdroplet from scality.
Add first prototype for abstracting librados API.