Create MaxScale directories

If the installation directory is something else than /usr,
then the directories

    <install-dir>/var/cache/maxscale
    <install-dir>/var/log/maxscale
    <install-dir>/var/run/maxscale

will be created at installation time.
This commit is contained in:
Johan Wikman 2016-09-09 11:00:06 +03:00
parent a87a9c75e5
commit b6d743fd03
2 changed files with 10 additions and 0 deletions

View File

@ -357,3 +357,11 @@ if(PACKAGE)
message(STATUS "You can install startup scripts and system configuration files for MaxScale by running the 'postinst' shell script located at ${CMAKE_INSTALL_PREFIX}.")
message(STATUS "To remove these installed files, run the 'postrm' shell script located in the same folder.")
endif()
# NOTE: If you make changes here, ensure they are compatible with the
# situation in gwdirs.h.in.
if (NOT CMAKE_INSTALL_PREFIX EQUAL "/usr")
install(DIRECTORY DESTINATION var/cache/maxscale)
install(DIRECTORY DESTINATION var/log/maxscale)
install(DIRECTORY DESTINATION var/run/maxscale)
endif()

View File

@ -21,6 +21,8 @@
EXTERN_C_BLOCK_BEGIN
// NOTE: If you make changes here, ensure they are compatible with the
// situation in <root>/CMakeLists.txt, where directories are installed.
#define MXS_DEFAULT_PID_SUBPATH "run/maxscale"
#define MXS_DEFAULT_LOG_SUBPATH "log/maxscale"
#define MXS_DEFAULT_DATA_SUBPATH "lib/maxscale"