RedHat initscript: small improvements

  * checks configuration before (re)starting, based on debian's
    initscript
  * use /etc/sysconfig instdead of /etc/default
  * include optional $ARGS in arguments passed to collectd.
RedHat RPM spec: update for 5.1 + improvements

  * Enabled all buildable plugins based on libraries available on EL6 +
    EPEL
  * All plugins requiring external libraries are now shipped in seperate
    packages.
  * No longer treat Java plugin as an exception, correctly set
    $JAVA_HOME during the build process + ensure build deps are installed.
  * Dropped per-plugin configuration files, as they tend to diverge from
    upstream defaults.
  * Moved perl stuff to /usr/share/perl5/
  * Don't alter Interval and ReadThreads by default, let the user change
    this himself.
  * Drop collection.cgi from main package, as it's been obsoleted by
    collection3
  * Moved contrib/ to its own package, to avoid cluttering the main
    package with non-essential stuff.
  * Replaced BuildPrereq by BuildRequires
Cleanup redhat specfile

Fixed a few rpmlint warnings
Updated (mostly) to Fedora Packaging Guidelines
Follow Fedora Packaging Guidelines in java subpackage
No need to edit collectd.conf anymore.

This was fixed by in commit 25fa4ad
Quote arguments
Allow for conditional compilation of plugins

To enable/disable a plugin you can toggle the
%define for that plugin at the top of the specfile.
You can also pass the plugin as argument to rpmbuild,
for example:
rpmbuild -ba --without rrdtool
or:
rpmbuild -ba --with rrdcached
RedHat specfile: updated for 5.2.0

Also includes a couple of cleanups mentioned in github#186.
redhat/collectd.spec - typo.
RedHat RPM spec: package php-collection/collection3 independently
RedHat RPM spec: bump release number
RedHat RPM spec: remove unnecessary dependency on libstatgrab
Allow out-of-tree builds

The generated header file lcc_features.h and collectd.h cause problems
otherwise.

Signed-off-by: Florian Forster <octo@collectd.org>
src/Makefile.am: Only add path to lcc_features.h to binaries linked against libcollectdclient.
src/plugin.c: Initialize "next_read" field of read callbacks.

Fixes Github issue #230.
curl_xml plugin: Fix potential dereference of NULL pointer.

I managed to get collectd to segfault in a couple of places while
playing with it a bit. The first is in the curl_xml module when the
XPATH expression doesn't quite match the input. The crash occurs on line
407 when instance_node->nodeTab[0] is dereferenced. At this point, all
members of instance_node are 0, so dereferencing the array isn't a good
idea. This patch fixes the problem, although I'm not sure if this
particular case actually deserves its own error message.

Signed-off-by: Florian Forster <octo@collectd.org>
Add protection from infinite redirect loops to curl-using plugins

Signed-off-by: Florian Forster <octo@collectd.org>
curl_json plugin: Call yajl_complete_parse() / yajl_parse_complete() only once.

The cURL callback may be called several times, so we need to call the
complete() function after perform() returns.
Merge branch 'mf/redhat' into collectd-5.2

Fixes Github issue #220.
Add upstart configuration file for Ubuntu, Debian and RedHat distros

Signed-off-by: Florian Forster <octo@collectd.org>