For most installs LUA_PATH and SNORT_LUA_PATH are known at build time;
they are the directories that we have configured the appropriate files
to be installed in. Set these as defaults in the installed snort.lua
config file. The environment variables will take precedence if set.
set (LUA_SCRIPTS
file_magic.lua
- snort.lua
snort_defaults.lua
)
-install (FILES ${LUA_SCRIPTS}
+configure_file(snort.lua.in
+ snort.lua)
+
+install (FILES ${LUA_SCRIPTS} ${CMAKE_CURRENT_BINARY_DIR}/snort.lua
DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/snort"
)
-- export LUA_PATH=$DIR/include/snort/lua/?.lua\;\;
-- export SNORT_LUA_PATH=$DIR/etc/snort
+lua_path = os.getenv('LUA_PATH')
+if ( not lua_path ) then
+ package.path = '${CMAKE_INSTALL_FULL_INCLUDEDIR}/${INSTALL_SUFFIX}/lua/?.lua;?;'
+end
+
-- this depends on LUA_PATH
-- used to load this conf into Snort
require('snort_config')
conf_dir = os.getenv('SNORT_LUA_PATH')
if ( not conf_dir ) then
- conf_dir = '.'
+ conf_dir = '${CMAKE_INSTALL_FULL_SYSCONFDIR}/snort'
end
---------------------------------------------------------------------------