removed manual UBUNTU flag and renamed it to DEB_LIKE and made it automated

This commit is contained in:
Markus Makela
2014-09-18 15:50:58 +03:00
parent b6ab18166e
commit 942174e94f
3 changed files with 62 additions and 49 deletions

View File

@ -80,12 +80,11 @@ add_subdirectory(query_classifier)
add_subdirectory(server) add_subdirectory(server)
add_subdirectory(client) add_subdirectory(client)
file(GLOB DOCS Documentation/*.pdf) file(GLOB DOCS Documentation/*.pdf)
if( NOT ( (DEFINED INSTALL_SYSTEM_FILES) AND ( NOT ( INSTALL_SYSTEM_FILES ) ) ) ) if( NOT ( (DEFINED INSTALL_SYSTEM_FILES) AND ( NOT ( INSTALL_SYSTEM_FILES ) ) ) )
install(FILES maxscale.conf DESTINATION /etc/ld.so.conf.d/ PERMISSIONS WORLD_EXECUTE WORLD_READ) install(FILES maxscale.conf DESTINATION /etc/ld.so.conf.d/ PERMISSIONS WORLD_EXECUTE WORLD_READ)
if(UBUNTU) if(DEB_BASED)
message(STATUS "Ubuntu: Y") message(STATUS "Ubuntu: Y")
install(FILES etc/ubuntu/init.d/maxscale DESTINATION /etc/init.d/ PERMISSIONS WORLD_EXECUTE) install(FILES etc/ubuntu/init.d/maxscale DESTINATION /etc/init.d/ PERMISSIONS WORLD_EXECUTE)
else() else()

1
README
View File

@ -196,7 +196,6 @@ MYSQL_DIR=<path> Path to MySQL headers
STATIC_EMBEDDED=[Y|N] Link the static or the dynamic verson of the library STATIC_EMBEDDED=[Y|N] Link the static or the dynamic verson of the library
GCOV=[Y|N] Generate gcov output GCOV=[Y|N] Generate gcov output
BUILD_TESTS=[Y|N] Build tests BUILD_TESTS=[Y|N] Build tests
UBUNTU=[Y|N] Install Ubuntu specific startup scripts
DEBUG_OUTPUT=[Y|N] Produce debugging output when configuring CMake DEBUG_OUTPUT=[Y|N] Produce debugging output when configuring CMake
\section Running Running MaxScale \section Running Running MaxScale

View File

@ -119,6 +119,21 @@ else()
message(STATUS "Using embedded library: ${EMBEDDED_LIB}") message(STATUS "Using embedded library: ${EMBEDDED_LIB}")
endif() endif()
# Check which init.d script to install
find_file(RPM_FNC functions PATHS /etc/rc.d/init.d)
if(${RPM_FNC} MATCHES "RPM_FNC-NOTFOUND")
find_file(DEB_FNC init-functions PATHS /lib/lsb)
if(${DEB_FNC MATCHES} "DEB_FNC-NOTFOUND")
message(FATAL_ERROR "Cannot find required init-functions in /lib/lsb/ or /etc/rc.d/init.d/, please confirm that your system files are OK.")
else()
set(DEB_BASED TRUE CACHE BOOL "If init.d script uses /lib/lsb/init-functions instead of /etc/rc.d/init.d/functions.")
endif()
else()
set(DEB_BASED FALSE CACHE BOOL "If init.d script uses /lib/lsb/init-functions instead of /etc/rc.d/init.d/functions.")
endif()
set(DEPS_OK TRUE CACHE BOOL "If all the dependencies were found.") set(DEPS_OK TRUE CACHE BOOL "If all the dependencies were found.")
endmacro() endmacro()