diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fc4fef74..fb907c85e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,24 +119,28 @@ IF(NOT LOGDIR) SET(LOGDIR "/var/log/rspamd") ENDIF(NOT LOGDIR) +IF(NOT SHAREDIR) + SET(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/rspamd") +ENDIF(NOT SHAREDIR) + IF(NOT EXAMPLESDIR) SET(EXAMPLESDIR "${CMAKE_INSTALL_PREFIX}/share/examples/rspamd") ENDIF(NOT EXAMPLESDIR) IF(NOT PLUGINSDIR) - SET(PLUGINSDIR "${CMAKE_INSTALL_PREFIX}/share/rspamd") + SET(PLUGINSDIR "${SHAREDIR}/lualib/plugins") ENDIF(NOT PLUGINSDIR) IF(NOT RULESDIR) - SET(RULESDIR "${PLUGINSDIR}/rules") + SET(RULESDIR "${SHAREDIR}/rules") ENDIF(NOT RULESDIR) IF(NOT LUALIBDIR) - SET(LUALIBDIR "${PLUGINSDIR}/lib") + SET(LUALIBDIR "${SHAREDIR}/lualib") ENDIF(NOT LUALIBDIR) IF(NOT WWWDIR) - SET(WWWDIR "${CMAKE_INSTALL_PREFIX}/share/rspamd/www") + SET(WWWDIR "${SHAREDIR}/www") ENDIF(NOT WWWDIR) # Set libdir @@ -1301,10 +1305,11 @@ ADD_DEFINITIONS("HAVE_CONFIG_H") # Configs INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${CONFDIR})") +INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${SHAREDIR})") INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${EXAMPLESDIR})") -INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${PLUGINSDIR}/lua)") -INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${RULESDIR})") INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${LUALIBDIR})") +INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${PLUGINSDIR})") +INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${RULESDIR})") # Install configs only if they are unchanged LIST(LENGTH CONFFILES CONFLIST_COUNT) @@ -1335,22 +1340,22 @@ FILE(GLOB LUA_PLUGINS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src/plugins/lua" "${CMAKE_CURRENT_SOURCE_DIR}/src/plugins/lua/*.lua" ) FOREACH(LUA_PLUGIN ${LUA_PLUGINS}) GET_FILENAME_COMPONENT(_rp ${LUA_PLUGIN} PATH) - INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${PLUGINSDIR}/lua/${_rp})") - INSTALL(FILES "src/plugins/lua/${LUA_PLUGIN}" DESTINATION ${PLUGINSDIR}/lua/${_rp}) + INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${PLUGINSDIR}/${_rp})") + INSTALL(FILES "src/plugins/lua/${LUA_PLUGIN}" DESTINATION ${PLUGINSDIR}/${_rp}) ENDFOREACH(LUA_PLUGIN) # Install TLD list INSTALL(FILES "contrib/publicsuffix/effective_tld_names.dat" DESTINATION - "${PLUGINSDIR}") + "${SHAREDIR}") # Install languages data -INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${PLUGINSDIR}/languages)") +INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${SHAREDIR}/languages)") FILE(GLOB LANGUAGES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/languages-data/*.json") FOREACH(_LANG ${LANGUAGES}) - INSTALL(FILES "${_LANG}" DESTINATION ${PLUGINSDIR}/languages) + INSTALL(FILES "${_LANG}" DESTINATION ${SHAREDIR}/languages) ENDFOREACH() -INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/languages-data/stop_words" DESTINATION ${PLUGINSDIR}/languages) +INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/contrib/languages-data/stop_words" DESTINATION ${SHAREDIR}/languages) # Lua config FILE(GLOB_RECURSE LUA_CONFIGS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/rules" @@ -1366,8 +1371,8 @@ FILE(GLOB_RECURSE LUA_LIBS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/lualib" "${CMAKE_CURRENT_SOURCE_DIR}/lualib/*.lua") FOREACH(LUA_LIB ${LUA_LIBS}) GET_FILENAME_COMPONENT(_rp ${LUA_LIB} PATH) - INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${LUALIBDIR}/${_rp})") - INSTALL(FILES "lualib/${LUA_LIB}" DESTINATION ${LUALIBDIR}/${_rp}) + INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${LUALIBDIR}/rspamd/${_rp})") + INSTALL(FILES "lualib/${LUA_LIB}" DESTINATION ${LUALIBDIR}/rspamd/${_rp}) ENDFOREACH(LUA_LIB) # Install lua fun library @@ -1398,7 +1403,7 @@ IF(INSTALL_WEBUI MATCHES "ON") ENDIF(INSTALL_WEBUI MATCHES "ON") -INSTALL(DIRECTORY "contrib/elastic/" DESTINATION "${PLUGINSDIR}/elastic" PATTERN ".git" EXCLUDE) +INSTALL(DIRECTORY "contrib/elastic/" DESTINATION "${SHAREDIR}/elastic" PATTERN ".git" EXCLUDE) ADD_CUSTOM_TARGET(dist ${CMAKE_SOURCE_DIR}/dist.sh "${CMAKE_BINARY_DIR}/rspamd-${RSPAMD_VERSION}.tar.xz" "${TAR}" |