riemann: Fix a compiler warning

Use a gint64 when dealing with 64-bit numbers, instead of a glong.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
basicfuncs-plus, rss: Link against syslog-ng and eventlog

Although the linking is not necessary, because both libsyslog-ng and
libeventlog will be loaded by the parent program anyway, it's nicer if
we do link to them, and it avoids warnings too. Plus we get better
dependency information.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Makefile.am: Do not ship generated grammar files

The generated grammar files are tied to a particular syslog-ng version,
and are not reusable. The tarball should compile with all supported
versions of syslog-ng, regardless of grammar files.

For this reason, BUILT_SOURCES have been dropped, and nodist_* variables
are used instead. This also means that one needs flex & bison to compile
the Incubator, which is now noted in the README.

This fixes #5.

Reported-by: Peter Czanik <czanik@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
README.md: Update the syslog-ng github repo URL

The source repository has been moved to an unversioned repo some time
ago, so update the reference. While the versioned repository will
continue working, it is better to point people towards the canonical one
instead.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
basicfuncs-plus: Disable $(state) when glib is too old

When compiling on systems with glib older than 2.32, disable the
$(state) template function, because that requires features not present
in earlier versions. This fixes #4.

Reported-by: Peter Czanik <czanik@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
riemann: Fix the Makefile.am

The recent change that added nodist_* prefixes broke the Riemann
destination, and made automake emit a warning. Fixed the variable name
that caused all this.

Reported-by: Peter Czanik <czanik@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Revert "Makefile.am: Do not ship generated grammar files"

This reverts commits cb12ba8ef1fcac6b789485e9c8381ea04c59fda2 and
6872bd6360689e42875535096b5049f67ba23367.
Makefile.am: Do not ship generated grammar files, properly

This patch prevents make dist from shipping generated grammar files,
doing so in a more portable, reliable way than the previous, now
reverted patches.

Reported-by: Peter Czanik <czanik@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
lua: Added simple version of lua destination.

Usage:

  destination d_lua {
    lua(
      script("test.lua")
      init-func("test_init")
      queue-func("test_queue")
      template("$MESSAGE")
    );
  };

Parameters:
 * script: the name of the Lua file which contains the functions for the
   destination.
 * init-func: the name of the Lua function which is called during
   initialization of the destination.
 * queue-func: each message reaching this destination is formatted using
   the template parameter, and passed to this function as a Lua string.
 * template: can be omitted, it's default value is "$MESSAGE"

Each lua destination has it's own state, so init and queue functions can
have side effects, and global variables are kept between init and
queue calls.

Example lua file:

--BEGIN
function test_init()
  print "Init called!"
  counter = 0
end

function test_queue
  counter = counter + 1
  print(msg  .. " " .. tostring(counter))
end
--END
README.md: Add a pointer and some notes about the Lua destination

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
lua: Don't try to ship the non-existent example config

Reported-by: Peter Czanik <czanik@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
lua: Add ability to detect any suitable version of Lua

The lua module requires lua >= 5.1.4, but on some systems, the
pkg-config module is called lua, not lua5.1. To support this, test for
the existence of lua, lua5.2, and then lua5.1, and use the first found
to compare the version against.

Reported-by: Peter Czanik <czanik@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>
lua: Add support for lua5.2

lua_open() was deprecated in lua5.1, use luaL_newstate() instead, which
exists in both.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
lua: Renamed lua.{h,c} to lua-dest.{h,c}

Also did some cleanup around included headers.
Merge pull request #7 from talien/feature/lua-destination

lua: Renamed lua.{h,c} to lua-dest.{h,c}
lua: Added example config
lua: fixed typo in error message
Merge pull request #8 from talien/feature/lua-destination
lua: Add lua-example.conf and lua-example.lua to EXTRA_DIST

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
.travis.yml: New file

This doesn't do much, but at least verifies that distcheck works.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>