]> source.dussan.org Git - rspamd.git/commitdiff
Another installation paths fix.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 29 Jul 2011 21:34:24 +0000 (01:34 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 29 Jul 2011 21:34:24 +0000 (01:34 +0400)
CMakeLists.txt

index 4a817241815b048cfd144a9aee7a831fcdfe52cc..49afeb6cf68daec67e6a9972f9fe4454fc2ae210 100644 (file)
@@ -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")