package = 'luasyslog'
version = '2.2.0-1'
description = {
    summary = 'syslog appender for LuaLogging',
    detailed = [[
        Add-on for LuaLogging that provides a new appender based on
        the syslog infrastructure presents on most UNIX system.
        Run `man 3 syslog' for technical details.
    ]],
    license = 'MIT/X11',
    homepage = 'https://github.com/ntd/luasyslog/',
    maintainer = 'Nicola Fontana <ntd@entidi.it>'
}
dependencies = {
    'lua >= 5.1',
    'lualogging >= 1.3.0',
}
source = {
    url = 'git://github.com/ntd/luasyslog',
    tag = '2.2.0'
}
build = {
    type = 'command',

    -- Actually the rock is built directly from a git checkout,
    -- so we must run ./autogen.sh before
    build_command = [[
	chmod +x ./autogen.sh &&
	./autogen.sh &&
	./configure CC="$(CC)" LUA="$(LUA)" \
		CFLAGS="$(CFLAGS)" \
		LDFLAGS="-L$(LUA_LIBDIR)" \
		LUA_INCLUDE="-I$(LUA_INCDIR)" \
		--bindir="$(SCRIPTS_DIR)" \
		--datadir="$(LUADIR)" \
		--docdir="$(DOCDIR)" \
		--sysconfdir="$(CONFDIR)" &&
	make]],

    -- The usual approach (install_command = 'make install')
    -- does not allow a clean uninstall with "luarocks remove"
    install = {
	lua = {
	    ['logging.syslog'] = 'syslog.lua'
	},
	lib = {
	    '.libs/lsyslog.so'
	},
	bin = {
	    'example.lua'
	}
    }
}
