Add cabal file generation to Makefile.am

This allows us to specify the exact version ranges of dependencies we
support, across all operating systems.

See issue #988.

So far, we have only given the names of dependency in most cases,
making sure that Ganeti builds with the dependency versions that are in
Debian.
This has caused problems for users that were not running Debian, or
when there were packages installed in the compiling user's ~/.ghc
directory, leading to compile-time type errors instead of pre-build
configuration errors; for an example, see:
  https://code.google.com/p/ganeti/issues/detail?id=979#c10

By explicitly listing our dependencies, we make clear which versions
are supported.

Modules and executables listed in the cabal file are automatically
generated from the Makefile; executables are symlinked in an apps/
directory to avoid repeated compilation as explained in:

  http://stackoverflow.com/a/6711739/263061
  http://stackoverflow.com/q/12305970/263061

For example, in apps/ there is:

  hluxid.hs -> ../src/hluxid.hs
  hluxid.hs.stamp
  [...]

Each executable symlink has a stamp file to track its modification time
because make follow symlinks and thus does not see symlink modification
times.

In addition to declaring our dependencies, this setup allows building
Ganeti's Haskell code with cabal to support editor integration and
cabal-based tooling, the Makefile remains the default way to build Ganeti.
Cabal: Remove unused packages

Found with the `packunused` tool.

We only want to list the packages we directly depend on.
Cabal: Allow json-0.8

Compilation was tested successfully.
Cabal: Allow attoparsec <= 0.12 and lens <= 4.3

Compilation was tested successfully.
Cabal: Allow network <= 2.6

Compilation was tested successfully with network-2.5.0.0 and network-2.6.0.2.
Cabal: Relax lower bounds

Compilation was tested successfully on our buildbot.
Cabal: Make modules placeholder a comment

This allows to use ganeti.cabal.in as a valid cabal file, e.g.
for tooling that only deals with dependencies and not about modules.
Generate MIN_VERSION_* macros with cabal

This uses `cabal configure` to determine which exact dependency versions
we are compiling against.

MIN_VERSION_* macros are the standard way to build CPP dependency switches
in Haskell packages, and they replace our custom macros (like PARALLEL3).
We can now conditionally compile against any version of our dependencies,
without first having to manually add a flag via autoconf.

All ghc and hlint invocations were adjusted to take these macros into
account.

We now require hlint >= 1.8.60, which support the --cpp-file option,
and any installed version of cabal.

In addition to providing MIN_VERSION_* macros, the `cabal configure`
step makes the build fail at configuration time if the user tries to
compile against a dependency version we don't support; before, this
case led to type errors which were not clearly user errors.
This fixes issue #988.

In order to obtain the sought cabal_macros.h, we have to work around
the fact that cabal does not yet provide a way to build only the macros
(see https://github.com/haskell/cabal/issues/2209).
Ideally, they would be created as part of `cabal configure`, but
unfortunately they are created as the first step of `cabal build`.
Thus we `cabal build` a dummy executable (HaskellPackageVersionsDummy)
in a temporary directory to obtain cabal_macros.h.
Remove check for PARALLEL3

This uses the new MIN_VERSION_* infrastructure now.