diff options
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ef6e02b57..09e4b1583 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -380,6 +380,8 @@ IF(DEBUG_MODE MATCHES "ON") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") ENDIF(DEBUG_MODE MATCHES "ON") +SET(DESTDIR $ENV{DESTDIR}) + ################################ SOURCES SECTION ########################### SET(RSPAMDSRC src/modules.c @@ -499,7 +501,7 @@ ADD_CUSTOM_COMMAND(OUTPUT src/modules.c IF(PERL_EXECUTABLE) ADD_CUSTOM_COMMAND(OUTPUT perl/Makefile DEPENDS perl/Makefile.PL - COMMAND ${PERL_EXECUTABLE} ./Makefile.PL PREFIX=${CMAKE_INSTALL_PREFIX} INSTALLMAN3DIR=${CMAKE_INSTALL_PREFIX}/man/man3 + COMMAND ${PERL_EXECUTABLE} ./Makefile.PL DESTDIR=${DESTDIR} PREFIX=${CMAKE_INSTALL_PREFIX} INSTALLMAN3DIR=${CMAKE_INSTALL_PREFIX}/man/man3 WORKING_DIRECTORY perl) CONFIGURE_FILE(perl/Makefile.PL.in perl/Makefile.PL) ADD_CUSTOM_TARGET(perlmodule @@ -627,7 +629,7 @@ ENDIF(PERL_EXECUTABLE) # Configs -INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${ETC_PREFIX}/rspamd)") +INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${DESTDIR}/${ETC_PREFIX}/rspamd)") INSTALL(FILES conf/2tld.inc RENAME 2tld.inc.orig DESTINATION ${ETC_PREFIX}/rspamd) IF(NOT EXISTS ${ETC_PREFIX}/rspamd/2tld.inc) @@ -662,11 +664,11 @@ ENDIF(NOT EXISTS ${ETC_PREFIX}/rspamd/lotto.inc) INSTALL(FILES conf/rspamd.xml.sample DESTINATION ${ETC_PREFIX}/) # Lua plugins -INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${ETC_PREFIX}/rspamd/plugins)") +INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${DESTDIR}/${ETC_PREFIX}/rspamd/plugins)") INSTALL(DIRECTORY src/plugins/lua DESTINATION ${ETC_PREFIX}/rspamd/plugins PATTERN "*.lua") # Lua config -INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${ETC_PREFIX}/rspamd/lua)") +INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${DESTDIR}/${ETC_PREFIX}/rspamd/lua)") INSTALL(DIRECTORY conf/lua DESTINATION ${ETC_PREFIX}/rspamd/ PATTERN "*.lua") # Perl lib @@ -685,8 +687,8 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") IF(ENABLE_REDIRECTOR MATCHES "ON") INSTALL(PROGRAMS freebsd/redirector.sh DESTINATION etc/rc.d) ENDIF(ENABLE_REDIRECTOR MATCHES "ON") - INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory /var/run/rspamd/)") - INSTALL(CODE "EXECUTE_PROCESS(COMMAND chown ${RSPAMD_USER}:${RSPAMD_GROUP} /var/run/rspamd/)") + INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${DESTDIR}/var/run/rspamd/)") + INSTALL(CODE "EXECUTE_PROCESS(COMMAND chown ${RSPAMD_USER}:${RSPAMD_GROUP} ${DESTDIR}/var/run/rspamd/)") ENDIF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") # CPack section |