CONFIGURE_FILE(freebsd/redirector.sh.in freebsd/redirector @ONLY)
ENDIF(ENABLE_REDIRECTOR MATCHES "ON")
IF(CMAKE_INSTALL_PREFIX)
- SET(ETC_PREFIX "${CMAKE_INSTALL_PREFIX}/etc")
- SET(MAN_PREFIX "${CMAKE_INSTALL_PREFIX}/etc")
+ IF(NOT ETC_PREFIX)
+ SET(ETC_PREFIX "${CMAKE_INSTALL_PREFIX}/etc")
+ ENDIF(NOT ETC_PREFIX)
+ IF(NOT MAN_PREFIX)
+ SET(MAN_PREFIX "${CMAKE_INSTALL_PREFIX}/man")
+ ENDIF(NOT MAN_PREFIX)
SET(PREFIX "${CMAKE_INSTALL_PREFIX}")
ELSE(CMAKE_INSTALL_PREFIX)
IF(NOT ETC_PREFIX)
# Configs
INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${ETC_PREFIX}/rspamd)")
-INSTALL(FILES conf/2tld.inc RENAME 2tld.inc.orig DESTINATION etc/rspamd)
+INSTALL(FILES conf/2tld.inc RENAME 2tld.inc.orig DESTINATION ${ETC_PREFIX}/rspamd)
IF(NOT EXISTS ${ETC_PREFIX}/rspamd/2tld.inc)
- INSTALL(FILES conf/2tld.inc DESTINATION etc/rspamd)
+ INSTALL(FILES conf/2tld.inc DESTINATION ${ETC_PREFIX}/rspamd)
ENDIF(NOT EXISTS ${ETC_PREFIX}/rspamd/2tld.inc)
-INSTALL(FILES conf/surbl-whitelist.inc RENAME surbl-whitelist.inc DESTINATION etc/rspamd)
+INSTALL(FILES conf/surbl-whitelist.inc RENAME surbl-whitelist.inc DESTINATION ${ETC_PREFIX}/rspamd)
IF(NOT EXISTS ${ETC_PREFIX}/rspamd/surbl-whitelist.inc)
- INSTALL(FILES conf/surbl-whitelist.inc DESTINATION etc/rspamd)
+ INSTALL(FILES conf/surbl-whitelist.inc DESTINATION ${ETC_PREFIX}/rspamd)
ENDIF(NOT EXISTS ${ETC_PREFIX}/rspamd/surbl-whitelist.inc)
-INSTALL(FILES ${CMAKE_BINARY_DIR}/conf/rspamd.xml.sample DESTINATION etc/)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/conf/rspamd.xml.sample DESTINATION ${ETC_PREFIX})
# Lua plugins
INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${ETC_PREFIX}/rspamd/plugins/lua)")
FOREACH(LUA_PLUGIN ${LUA_PLUGINS})
GET_FILENAME_COMPONENT(_rp ${LUA_PLUGIN} PATH)
INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${ETC_PREFIX}/rspamd/plugins/lua/${_rp})")
- INSTALL(FILES "src/plugins/lua/${LUA_PLUGIN}" DESTINATION etc/rspamd/plugins/lua/${_rp})
+ INSTALL(FILES "src/plugins/lua/${LUA_PLUGIN}" DESTINATION ${ETC_PREFIX}/rspamd/plugins/lua/${_rp})
ENDFOREACH(LUA_PLUGIN)
# Lua config
GET_FILENAME_COMPONENT(_rp ${LUA_CONF} PATH)
INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${ETC_PREFIX}/rspamd/lua/${_rp})")
IF(NOT EXISTS ${DESTDIR}/${ETC_PREFIX}/rspamd/lua/${LUA_CONF})
- INSTALL(FILES "conf/lua/${LUA_CONF}" DESTINATION etc/rspamd/lua/${_rp})
+ INSTALL(FILES "conf/lua/${LUA_CONF}" DESTINATION ${ETC_PREFIX}/rspamd/lua/${_rp})
ENDIF(NOT EXISTS ${DESTDIR}/${ETC_PREFIX}/rspamd/lua/${LUA_CONF})
ENDFOREACH(LUA_CONF)
# Manual pages
-INSTALL(FILES "doc/rspamd.8" DESTINATION man/man8)
-INSTALL(FILES "doc/rspamc.1" DESTINATION man/man1)
+INSTALL(FILES "doc/rspamd.8" DESTINATION ${MAN_PREFIX}/man8)
+INSTALL(FILES "doc/rspamc.1" DESTINATION ${MAN_PREFIX}/man1)
# Start scripts
IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT BUILD_PORT)
- INSTALL(PROGRAMS ${CMAKE_BINARY_DIR}/freebsd/rspamd DESTINATION etc/rc.d)
+ INSTALL(PROGRAMS ${CMAKE_BINARY_DIR}/freebsd/rspamd DESTINATION ${ETC_PREFIX}/rc.d)
IF(ENABLE_REDIRECTOR MATCHES "ON")
- INSTALL(PROGRAMS ${CMAKE_BINARY_DIR}/freebsd/redirector DESTINATION etc/rc.d)
+ INSTALL(PROGRAMS ${CMAKE_BINARY_DIR}/freebsd/redirector DESTINATION ${ETC_PREFIX}/rc.d)
ENDIF(ENABLE_REDIRECTOR MATCHES "ON")
INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}/var/run/rspamd)")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND chown ${RSPAMD_USER}:${RSPAMD_GROUP} \$ENV{DESTDIR}/var/run/rspamd/)")
ENDIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT BUILD_PORT)
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
- INSTALL(PROGRAMS "linux/${LINUX_START_SCRIPT}" DESTINATION etc/init.d RENAME rspamd)
+ INSTALL(PROGRAMS "linux/${LINUX_START_SCRIPT}" DESTINATION ${ETC_PREFIX}/init.d RENAME rspamd)
INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}/var/run/rspamd)")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND chown ${RSPAMD_USER}:${RSPAMD_GROUP} \$ENV{DESTDIR}/var/run/rspamd/)")
ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")