diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-07-30 01:34:24 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-07-30 01:34:24 +0400 |
commit | 0c6e9d1f0bc8e010d30c27af1635513adfa9a6dd (patch) | |
tree | 1797483286dffa7b409512a6cff1deddaa3770cc /CMakeLists.txt | |
parent | 7e74858e3b1dfc134f25c9952b317f52d8f1bf76 (diff) | |
download | rspamd-0c6e9d1f0bc8e010d30c27af1635513adfa9a6dd.tar.gz rspamd-0c6e9d1f0bc8e010d30c27af1635513adfa9a6dd.zip |
Another installation paths fix.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a8172418..49afeb6cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,8 +57,12 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") 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) @@ -675,17 +679,17 @@ INSTALL(TARGETS rspamd RUNTIME DESTINATION bin) # 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)") @@ -694,7 +698,7 @@ FILE(GLOB LUA_PLUGINS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src/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 @@ -704,25 +708,25 @@ FOREACH(LUA_CONF ${LUA_CONFIGS}) 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") |