diff options
author | Daniel Fischer <df@sun.com> | 2010-06-18 17:04:15 +0200 |
---|---|---|
committer | Daniel Fischer <df@sun.com> | 2010-06-18 17:04:15 +0200 |
commit | 9891642e773dd2fb1b8032e603b23a4c0f804eb0 (patch) | |
tree | 129482b631bc451c9ff9b99ac55692b6bec2563d | |
parent | 527446e0a256e6a111724b6f8346640e3cc5e947 (diff) | |
parent | 89205a3bf6bba245e312078b23168ff5f8560759 (diff) | |
download | mariadb-git-9891642e773dd2fb1b8032e603b23a4c0f804eb0.tar.gz |
merge
38 files changed, 1294 insertions, 276 deletions
diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf index fcb3cab2de6..ac654d5cf71 100644 --- a/.bzr-mysql/default.conf +++ b/.bzr-mysql/default.conf @@ -1,4 +1,4 @@ [MYSQL] -post_commit_to = "commits@lists.mysql.com" -post_push_to = "commits@lists.mysql.com" +#post_commit_to = "commits@lists.mysql.com" +#post_push_to = "commits@lists.mysql.com" tree_name = "mysql-trunk" diff --git a/CMakeLists.txt b/CMakeLists.txt index 536fae9f4b1..0131ac1b0a7 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,18 @@ SET(CUSTOM_C_FLAGS $ENV{CFLAGS}) OPTION(WITH_DEBUG "Use dbug/safemutex" OFF) OPTION(WITH_DEBUG_FULL "Use dbug and safemalloc/safemutex. Slow" OFF) +# Distinguish between community and non-community builds, with the +# default being a community build. This does not impact the feature +# set that will be compiled in; it's merely provided as a hint to +# custom packaging steps. +OPTION(COMMUNITY_BUILD "Set to true if this is a community build" ON) + +# Use a default manufacturer if no manufacturer was identified. +SET(MANUFACTURER_DOCSTRING + "Set the entity that appears as the manufacturer of packages that support a manufacturer field.") +IF(NOT DEFINED MANUFACTURER) + SET(MANUFACTURER "Built from Source" CACHE BOOL ${MANUFACTURER_DOCSTRING}) +ENDIF() # We choose to provide WITH_DEBUG as alias to standard CMAKE_BUILD_TYPE=Debug # which turns out to be not trivial, as this involves synchronization @@ -277,6 +289,7 @@ IF(WIN32) ELSE() SET(CPACK_GENERATOR "TGZ") ENDIF() +ADD_SUBDIRECTORY(packaging/WiX) INCLUDE(CPack) IF(UNIX) INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index f4e223c9c72..d0bb8d43edd 100755 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -33,7 +33,7 @@ IF(UNIX) TARGET_LINK_LIBRARIES(mysql ${READLINE_LIBRARY}) ENDIF(UNIX) -MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc) +MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test) SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS") TARGET_LINK_LIBRARIES(mysqltest mysqlclient regex) diff --git a/cmake/create_initial_db.cmake.in b/cmake/create_initial_db.cmake.in index 649d96a6627..01b2da665a6 100644 --- a/cmake/create_initial_db.cmake.in +++ b/cmake/create_initial_db.cmake.in @@ -31,8 +31,7 @@ ENDIF() # Create bootstrapper SQL script FILE(WRITE bootstrap.sql "use mysql;\n" ) -FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql - fill_help_tables.sql) +FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql) FILE(STRINGS ${CMAKE_SOURCE_DIR}/scripts/${FILENAME} CONTENTS) FOREACH(STR ${CONTENTS}) IF(NOT STR MATCHES "@current_hostname") @@ -40,6 +39,8 @@ FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql ENDIF() ENDFOREACH() ENDFOREACH() +FILE(READ ${CMAKE_SOURCE_DIR}/scripts/fill_help_tables.sql CONTENTS) +FILE(APPEND bootstrap.sql ${CONTENTS}) FILE(REMOVE_RECURSE mysql) diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake index f049776b8f4..07aa4500188 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -35,15 +35,84 @@ MACRO (INSTALL_DEBUG_SYMBOLS targets) IF(CMAKE_GENERATOR MATCHES "Visual Studio") STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}" pdb_location ${pdb_location}) ENDIF() - INSTALL(FILES ${pdb_location} DESTINATION ${INSTALL_LOCATION}) + IF(target STREQUAL "mysqld") + SET(comp Server) + ELSE() + SET(comp Debuginfo) + ENDIF() + INSTALL(FILES ${pdb_location} DESTINATION ${INSTALL_LOCATION} COMPONENT ${comp}) ENDFOREACH() ENDIF() ENDMACRO() +# Installs manpage for given file (either script or executable) +# +FUNCTION(INSTALL_MANPAGE file) + IF(NOT UNIX) + RETURN() + ENDIF() + GET_FILENAME_COMPONENT(file_name "${file}" NAME) + SET(GLOB_EXPR + ${CMAKE_SOURCE_DIR}/man/*${file}man.1* + ${CMAKE_SOURCE_DIR}/man/*${file}man.8* + ${CMAKE_BINARY_DIR}/man/*${file}man.1* + ${CMAKE_BINARY_DIR}/man/*${file}man.8* + ) + IF(MYSQL_DOC_DIR) + SET(GLOB_EXPR + ${MYSQL_DOC_DIR}/man/*${file}man.1* + ${MYSQL_DOC_DIR}/man/*${file}man.8* + ${MYSQL_DOC_DIR}/man/*${file}.1* + ${MYSQL_DOC_DIR}/man/*${file}.8* + ${GLOB_EXPR} + ) + ENDIF() + + FILE(GLOB_RECURSE MANPAGES ${GLOB_EXPR}) + IF(MANPAGES) + LIST(GET MANPAGES 0 MANPAGE) + STRING(REPLACE "${file}man.1" "${file}.1" MANPAGE "${MANPAGE}") + STRING(REPLACE "${file}man.8" "${file}.8" MANPAGE "${MANPAGE}") + IF(MANPAGE MATCHES "${file}.1") + SET(SECTION man1) + ELSE() + SET(SECTION man8) + ENDIF() + INSTALL(FILES "${MANPAGE}" DESTINATION "${INSTALL_MANDIR}/${SECTION}") + ENDIF() +ENDFUNCTION() + +FUNCTION(INSTALL_SCRIPT) + CMAKE_PARSE_ARGUMENTS(ARG + "DESTINATION;COMPONENT" + "" + ${ARGN} + ) + + SET(script ${ARG_DEFAULT_ARGS}) + IF(NOT ARG_DESTINATION) + SET(ARG_DESTINATION ${INSTALL_BINDIR}) + ENDIF() + IF(ARG_COMPONENT) + SET(COMP COMPONENT ${ARG_COMPONENT}) + ELSE() + SET(COMP) + ENDIF() + + INSTALL(FILES + ${script} + DESTINATION ${ARG_DESTINATION} + PERMISSIONS OWNER_READ OWNER_WRITE + OWNER_EXECUTE GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE ${COMP} + ) + INSTALL_MANPAGE(${script}) +ENDFUNCTION() + # Install symbolic link to CMake target. # the link is created in the same directory as target # and extension will be the same as for target file. -MACRO(INSTALL_SYMLINK linkname target destination) +MACRO(INSTALL_SYMLINK linkname target destination component) IF(UNIX) GET_TARGET_PROPERTY(location ${target} LOCATION) GET_FILENAME_COMPONENT(path ${location} PATH) @@ -68,7 +137,12 @@ IF(UNIX) STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}" output ${output}) ENDIF() - INSTALL(FILES ${output} DESTINATION ${destination}) + IF(component) + SET(COMP COMPONENT ${component}) + ELSE() + SET(COMP) + ENDIF() + INSTALL(FILES ${output} DESTINATION ${destination} ${COMP}) ENDIF() ENDMACRO() @@ -128,13 +202,11 @@ ENDMACRO() # Installs targets, also installs pdbs on Windows. # -# More stuff can be added later, e.g signing -# or pre-link custom targets (one example is creating -# version resource for windows executables) +# FUNCTION(MYSQL_INSTALL_TARGETS) CMAKE_PARSE_ARGUMENTS(ARG - "DESTINATION" + "DESTINATION;COMPONENT" "" ${ARGN} ) @@ -146,15 +218,24 @@ FUNCTION(MYSQL_INSTALL_TARGETS) MESSAGE(FATAL_ERROR "Need DESTINATION parameter for MYSQL_INSTALL_TARGETS") ENDIF() - # If signing is required, sign executables before installing + FOREACH(target ${TARGETS}) - IF(SIGNCODE AND SIGNCODE_ENABLED) + # If signing is required, sign executables before installing + IF(SIGNCODE AND SIGNCODE_ENABLED) SIGN_TARGET(${target}) ENDIF() + # For Windows, add version info to executables ADD_VERSION_INFO(${target}) + # Install man pages on Unix + IF(UNIX) + GET_TARGET_PROPERTY(target_location ${target} LOCATION) + INSTALL_MANPAGE(${target_location}) + ENDIF() ENDFOREACH() - - INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION}) + IF(ARG_COMPONENT) + SET(COMP COMPONENT ${ARG_COMPONENT}) + ENDIF() + INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP}) SET(INSTALL_LOCATION ${ARG_DESTINATION} ) INSTALL_DEBUG_SYMBOLS("${TARGETS}") SET(INSTALL_LOCATION) diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake index 2263b146ed6..ba63df71428 100644 --- a/cmake/libutils.cmake +++ b/cmake/libutils.cmake @@ -214,7 +214,7 @@ ENDMACRO() #) MACRO(MERGE_LIBRARIES) CMAKE_PARSE_ARGUMENTS(ARG - "EXPORTS;OUTPUT_NAME" + "EXPORTS;OUTPUT_NAME;COMPONENT" "STATIC;SHARED;MODULE;NOINSTALL" ${ARGN} ) @@ -259,7 +259,10 @@ MACRO(MERGE_LIBRARIES) MESSAGE(FATAL_ERROR "Unknown library type") ENDIF() IF(NOT ARG_NOINSTALL) - MYSQL_INSTALL_TARGETS(${TARGET} DESTINATION "${INSTALL_LIBDIR}") + IF(ARG_COMPONENT) + SET(COMP COMPONENT ${ARG_COMPONENT}) + ENDIF() + MYSQL_INSTALL_TARGETS(${TARGET} DESTINATION "${INSTALL_LIBDIR}" ${COMP}) ENDIF() SET_TARGET_PROPERTIES(${TARGET} PROPERTIES LINK_INTERFACE_LIBRARIES "") ENDMACRO() diff --git a/cmake/mysql_add_executable.cmake b/cmake/mysql_add_executable.cmake index 2157d03e6d1..86301c2eec8 100644 --- a/cmake/mysql_add_executable.cmake +++ b/cmake/mysql_add_executable.cmake @@ -29,7 +29,7 @@ INCLUDE(cmake_parse_arguments) FUNCTION (MYSQL_ADD_EXECUTABLE)
# Pass-through arguments for ADD_EXECUTABLE
CMAKE_PARSE_ARGUMENTS(ARG
- "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION"
+ "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT"
""
${ARGN}
)
@@ -43,7 +43,14 @@ FUNCTION (MYSQL_ADD_EXECUTABLE) IF(NOT ARG_EXCLUDE_FROM_ALL)
IF(NOT ARG_DESTINATION)
SET(ARG_DESTINATION ${INSTALL_BINDIR})
+ ENDIF() + IF(ARG_COMPONENT) + SET(COMP COMPONENT ${ARG_COMPONENT}) + ELSEIF(MYSQL_INSTALL_COMPONENT) + SET(COMP COMPONENT ${MYSQL_INSTALL_COMPONENT}) + ELSE() + SET(COMP COMPONENT Client) ENDIF()
- MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION})
+ MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP})
ENDIF()
-ENDFUNCTION()
\ No newline at end of file +ENDFUNCTION() diff --git a/cmake/package_name.cmake b/cmake/package_name.cmake index d2998cfd795..6e6fe89e8b3 100644 --- a/cmake/package_name.cmake +++ b/cmake/package_name.cmake @@ -15,6 +15,8 @@ # Produce meaningful package name for the binary package # The logic is rather involved with special cases for different OSes +INCLUDE(CheckTypeSize) +CHECK_TYPE_SIZE("void *" SIZEOF_VOIDP) MACRO(GET_PACKAGE_FILE_NAME Var) IF(NOT VERSION) MESSAGE(FATAL_ERROR @@ -24,7 +26,8 @@ IF(NOT VERSION) SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 1) SET(DEFAULT_PLATFORM ${CMAKE_SYSTEM_NAME}) SET(DEFAULT_MACHINE ${CMAKE_SYSTEM_PROCESSOR}) - IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + MESSAGE("SIZEOF_VOIDP=${SIZEOF_VOIDP}") + IF(SIZEOF_VOIDP EQUAL 8) SET(64BIT 1) ENDIF() diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 896624996d3..94edfb8741a 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -173,7 +173,7 @@ MACRO(MYSQL_ADD_PLUGIN) SET_TARGET_PROPERTIES(${target} PROPERTIES OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}") # Install dynamic library - MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR}) + MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Server) INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug) ENDIF() ENDMACRO() diff --git a/config.h.cmake b/config.h.cmake index c6c049814ba..7bef260cf4e 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -81,6 +81,8 @@ #cmakedefine HAVE_SYS_STREAM_H 1 #cmakedefine HAVE_SYS_TERMCAP_H 1 #cmakedefine HAVE_SYS_TIMEB_H 1 +#cmakedefine HAVE_SYS_TIMES_H 1 +#cmakedefine HAVE_SYS_TIME_H 1 #cmakedefine HAVE_SYS_TYPES_H 1 #cmakedefine HAVE_SYS_UN_H 1 #cmakedefine HAVE_SYS_VADVISE_H 1 @@ -88,6 +90,7 @@ #cmakedefine HAVE_TERMIOS_H 1 #cmakedefine HAVE_TERMIO_H 1 #cmakedefine HAVE_TERMCAP_H 1 +#cmakedefine HAVE_TIME_H 1 #cmakedefine HAVE_UNISTD_H 1 #cmakedefine HAVE_UTIME_H 1 #cmakedefine HAVE_VARARGS_H 1 @@ -261,6 +264,8 @@ #cmakedefine HAVE_TEMPNAM 1 #cmakedefine HAVE_THR_SETCONCURRENCY 1 #cmakedefine HAVE_THR_YIELD 1 +#cmakedefine HAVE_TIME 1 +#cmakedefine HAVE_TIMES 1 #cmakedefine HAVE_VALLOC 1 #define HAVE_VIO_READ_BUFF 1 #cmakedefine HAVE_VASPRINTF 1 @@ -295,11 +300,6 @@ /* Types we may use */ -#cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@ -#if SIZEOF_CHAR -# define HAVE_CHAR 1 -#endif - #ifdef __APPLE__ /* Special handling required for OSX to support universal binaries that @@ -310,127 +310,71 @@ #else #define SIZEOF_LONG 4 #endif + #define SIZEOF_VOIDP SIZEOF_LONG #define SIZEOF_CHARP SIZEOF_LONG #define SIZEOF_SIZE_T SIZEOF_LONG #else - #cmakedefine SIZEOF_LONG @SIZEOF_LONG@ - #cmakedefine SIZEOF_CHARP @SIZEOF_CHARP@ - #cmakedefine SIZEOF_SIZE_T @SIZEOF_CHARP@ -#endif - -#if SIZEOF_LONG -# define HAVE_LONG 1 -#endif - - -#if SIZEOF_CHARP -#define HAVE_CHARP 1 -#define SIZEOF_VOIDP SIZEOF_CHARP +/* No indentation, to fetch the lines from verification scripts */ +#cmakedefine SIZEOF_LONG @SIZEOF_LONG@ +#cmakedefine SIZEOF_VOIDP @SIZEOF_VOIDP@ +#cmakedefine SIZEOF_CHARP @SIZEOF_CHARP@ +#cmakedefine SIZEOF_SIZE_T @SIZEOF_CHARP@ #endif +#cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@ +#cmakedefine HAVE_CHAR 1 +#cmakedefine HAVE_LONG 1 +#cmakedefine HAVE_CHARP 1 #cmakedefine SIZEOF_SHORT @SIZEOF_SHORT@ -#if SIZEOF_SHORT -# define HAVE_SHORT 1 -#endif - +#cmakedefine HAVE_SHORT 1 #cmakedefine SIZEOF_INT @SIZEOF_INT@ -#if SIZEOF_INT -# define HAVE_INT 1 -#endif - - +#cmakedefine HAVE_INT 1 #cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@ -#if SIZEOF_LONG_LONG -# define HAVE_LONG_LONG 1 -#endif - +#cmakedefine HAVE_LONG_LONG 1 #cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@ -#if SIZEOF_OFF_T -#define HAVE_OFF_T 1 -#endif - +#cmakedefine HAVE_OFF_T 1 #cmakedefine SIZEOF_SIGSET_T @SIZEOF_SIGSET_T@ -#if SIZEOF_SIGSET_T -#define HAVE_SIGSET_T 1 -#endif - -#if SIZEOF_SIZE_T -#define HAVE_SIZE_T 1 -#endif - +#cmakedefine HAVE_SIGSET_T 1 +#cmakedefine HAVE_SIZE_T 1 #cmakedefine SIZEOF_UCHAR @SIZEOF_UCHAR@ -#if SIZEOF_UCHAR -#define HAVE_UCHAR 1 -#endif - +#cmakedefine HAVE_UCHAR 1 #cmakedefine SIZEOF_UINT @SIZEOF_UINT@ -#if SIZEOF_UINT -#define HAVE_UINT 1 -#endif - +#cmakedefine HAVE_UINT 1 #cmakedefine SIZEOF_ULONG @SIZEOF_ULONG@ -#if SIZEOF_ULONG -#define HAVE_ULONG 1 -#endif - +#cmakedefine HAVE_ULONG 1 #cmakedefine SIZEOF_INT8 @SIZEOF_INT8@ -#if SIZEOF_INT8 -#define HAVE_INT8 1 -#endif +#cmakedefine HAVE_INT8 1 #cmakedefine SIZEOF_UINT8 @SIZEOF_UINT8@ -#if SIZEOF_UINT8 -#define HAVE_UINT8 1 -#endif - +#cmakedefine HAVE_UINT8 1 #cmakedefine SIZEOF_INT16 @SIZEOF_INT16@ -#if SIZEOF_INT16 -# define HAVE_INT16 1 -#endif +#cmakedefine HAVE_INT16 1 #cmakedefine SIZEOF_UINT16 @SIZEOF_UINT16@ -#if SIZEOF_UINT16 -#define HAVE_UINT16 1 -#endif - +#cmakedefine HAVE_UINT16 1 #cmakedefine SIZEOF_INT32 @SIZEOF_INT32@ -#if SIZEOF_INT32 -#define HAVE_INT32 1 -#endif +#cmakedefine HAVE_INT32 1 #cmakedefine SIZEOF_UINT32 @SIZEOF_UINT32@ -#if SIZEOF_UINT32 -#define HAVE_UINT32 1 -#endif +#cmakedefine HAVE_UINT32 1 #cmakedefine SIZEOF_U_INT32_T @SIZEOF_U_INT32_T@ -#if SIZEOF_U_INT32_T -#define HAVE_U_INT32_T 1 -#endif - +#cmakedefine HAVE_U_INT32_T 1 #cmakedefine SIZEOF_INT64 @SIZEOF_INT64@ -#if SIZEOF_INT64 -#define HAVE_INT64 1 -#endif +#cmakedefine HAVE_INT64 1 #cmakedefine SIZEOF_UINT64 @SIZEOF_UINT64@ -#if SIZEOF_UINT64 -#define HAVE_UINT64 1 -#endif +#cmakedefine HAVE_UINT64 1 +#cmakedefine SIZEOF_BOOL @SIZEOF_BOOL@ +#cmakedefine HAVE_BOOL 1 #cmakedefine SOCKET_SIZE_TYPE @SOCKET_SIZE_TYPE@ -#cmakedefine SIZEOF_BOOL @SIZEOF_BOOL@ -#if SIZEOF_BOOL -#define HAVE_BOOL 1 -#endif #cmakedefine HAVE_MBSTATE_T #define MAX_INDEXES 64 #cmakedefine QSORT_TYPE_IS_VOID 1 -#define RETQSORTTYPE void +#cmakedefine RETQSORTTYPE @RETQSORTTYPE@ #cmakedefine SIGNAL_RETURN_TYPE_IS_VOID 1 -#define RETSIGTYPE void -#if SIGNAL_RETURN_TYPE_IS_VOID -#define VOID_SIGHANDLER 1 -#endif +#cmakedefine RETSIGTYPE @RETSIGTYPE@ +#cmakedefine VOID_SIGHANDLER 1 #define STRUCT_RLIMIT struct rlimit #ifdef __APPLE__ @@ -547,7 +491,7 @@ #cmakedefine strtoull @strtoull@ #cmakedefine vsnprintf @vsnprintf@ #if (_MSC_VER > 1310) -#define HAVE_SETENV +# define HAVE_SETENV #define setenv(a,b,c) _putenv_s(a,b) #endif @@ -575,7 +519,7 @@ #cmakedefine FN_NO_CASE_SENSE 1 #cmakedefine HAVE_CHARSET_armscii8 1 -#cmakedefine HAVE_CHARSET_ascii +#cmakedefine HAVE_CHARSET_ascii 1 #cmakedefine HAVE_CHARSET_big5 1 #cmakedefine HAVE_CHARSET_cp1250 1 #cmakedefine HAVE_CHARSET_cp1251 1 @@ -637,7 +581,7 @@ #cmakedefine WITH_PERFSCHEMA_STORAGE_ENGINE 1 #cmakedefine WITH_NDBCLUSTER_STORAGE_ENGINE 1 #if (WITH_NDBCLUSTER_STORAGE_ENGINE) && !defined(EMBEDDED_LIBRARY) -#define HAVE_NDB_BINLOG 1 +# define HAVE_NDB_BINLOG 1 #endif #cmakedefine DEFAULT_MYSQL_HOME "@DEFAULT_MYSQL_HOME@" diff --git a/configure.cmake b/configure.cmake index 1727e2b2c10..1a44d0e85f4 100644 --- a/configure.cmake +++ b/configure.cmake @@ -90,6 +90,13 @@ ENDIF(WITHOUT_DYNAMIC_PLUGINS) # Large files, common flag SET(_LARGEFILE_SOURCE 1) +# If finds the size of a type, set SIZEOF_<type> and HAVE_<type> +FUNCTION(MY_CHECK_TYPE_SIZE type defbase) + CHECK_TYPE_SIZE("${type}" SIZEOF_${defbase}) + IF(SIZEOF_${defbase}) + SET(HAVE_${defbase} 1 PARENT_SCOPE) + ENDIF() +ENDFUNCTION() # Searches function in libraries # if function is found, sets output parameter result to the name of the library @@ -108,6 +115,7 @@ FUNCTION(MY_SEARCH_LIBS func libs result) CHECK_LIBRARY_EXISTS(${lib} ${func} "" HAVE_${func}_IN_${lib}) IF(HAVE_${func}_IN_${lib}) SET(${result} ${lib} PARENT_SCOPE) + SET(HAVE_${result} 1 PARENT_SCOPE) RETURN() ENDIF() ENDFOREACH() @@ -169,6 +177,7 @@ CHECK_INCLUDE_FILES (alloca.h HAVE_ALLOCA_H) CHECK_INCLUDE_FILES (aio.h HAVE_AIO_H) CHECK_INCLUDE_FILES (arpa/inet.h HAVE_ARPA_INET_H) CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H) +CHECK_INCLUDE_FILES (cxxabi.h HAVE_CXXABI_H) CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H) CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H) CHECK_INCLUDE_FILES (execinfo.h HAVE_EXECINFO_H) @@ -195,7 +204,6 @@ CHECK_INCLUDE_FILES (select.h HAVE_SELECT_H) CHECK_INCLUDE_FILES (semaphore.h HAVE_SEMAPHORE_H) CHECK_INCLUDE_FILES (sys/dir.h HAVE_SYS_DIR_H) CHECK_INCLUDE_FILES (sys/pte.h HAVE_SYS_PTE_H) -CHECK_INCLUDE_FILES (sys/ptem.h HAVE_SYS_PTEM_H) CHECK_INCLUDE_FILES (stddef.h HAVE_STDDEF_H) CHECK_INCLUDE_FILES (stdint.h HAVE_STDINT_H) CHECK_INCLUDE_FILES (stdlib.h HAVE_STDLIB_H) @@ -235,6 +243,13 @@ CHECK_INCLUDE_FILES (fnmatch.h HAVE_FNMATCH_H) CHECK_INCLUDE_FILES (stdarg.h HAVE_STDARG_H) CHECK_INCLUDE_FILES("stdlib.h;sys/un.h" HAVE_SYS_UN_H) +IF(HAVE_SYS_STREAM_H) + # Needs sys/stream.h on Solaris + CHECK_INCLUDE_FILES (sys/stream.h sys/ptem.h HAVE_SYS_PTEM_H) +ELSE() + CHECK_INCLUDE_FILES (sys/ptem.h HAVE_SYS_PTEM_H) +ENDIF() + # Figure out threading library # FIND_PACKAGE (Threads) @@ -458,14 +473,11 @@ set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS) SET(CMAKE_EXTRA_INCLUDE_FILES signal.h) -CHECK_TYPE_SIZE(sigset_t SIZEOF_SIGSET_T) -IF(SIZEOF_SIGSET_T) - SET(HAVE_SIGSET_T 1) -ENDIF() +MY_CHECK_TYPE_SIZE(sigset_t SIGSET_T) IF(NOT SIZEOF_SIGSET_T) SET(sigset_t int) ENDIF() -CHECK_TYPE_SIZE(mode_t SIZEOF_MODE_T) +MY_CHECK_TYPE_SIZE(mode_t MODE_T) IF(NOT SIZEOF_MODE_T) SET(mode_t int) ENDIF() @@ -478,43 +490,41 @@ ENDIF(HAVE_STDINT_H) IF(NOT APPLE) # Prevent some checks on OSX, they return ambigious results # on universal 32/64 bit binariess - CHECK_TYPE_SIZE("char *" SIZEOF_CHARP) - CHECK_TYPE_SIZE(long SIZEOF_LONG) - CHECK_TYPE_SIZE(size_t SIZEOF_SIZE_T) + MY_CHECK_TYPE_SIZE("void *" VOIDP) + MY_CHECK_TYPE_SIZE("char *" CHARP) + MY_CHECK_TYPE_SIZE(long LONG) + MY_CHECK_TYPE_SIZE(size_t SIZE_T) ENDIF() -CHECK_TYPE_SIZE(char SIZEOF_CHAR) -CHECK_TYPE_SIZE(short SIZEOF_SHORT) -CHECK_TYPE_SIZE(int SIZEOF_INT) -CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG) +MY_CHECK_TYPE_SIZE(char CHAR) +MY_CHECK_TYPE_SIZE(short SHORT) +MY_CHECK_TYPE_SIZE(int INT) +MY_CHECK_TYPE_SIZE("long long" LONG_LONG) SET(CMAKE_EXTRA_INCLUDE_FILES stdio.h sys/types.h) -CHECK_TYPE_SIZE(off_t SIZEOF_OFF_T) -CHECK_TYPE_SIZE(uchar SIZEOF_UCHAR) -CHECK_TYPE_SIZE(uint SIZEOF_UINT) -CHECK_TYPE_SIZE(ulong SIZEOF_ULONG) -CHECK_TYPE_SIZE(int8 SIZEOF_INT8) -CHECK_TYPE_SIZE(uint8 SIZEOF_UINT8) -CHECK_TYPE_SIZE(int16 SIZEOF_INT16) -CHECK_TYPE_SIZE(uint16 SIZEOF_UINT16) -CHECK_TYPE_SIZE(int32 SIZEOF_INT32) -CHECK_TYPE_SIZE(uint32 SIZEOF_UINT32) -CHECK_TYPE_SIZE(u_int32_t SIZEOF_U_INT32_T) -CHECK_TYPE_SIZE(int64 SIZEOF_INT64) -CHECK_TYPE_SIZE(uint64 SIZEOF_UINT64) +MY_CHECK_TYPE_SIZE(off_t OFF_T) +MY_CHECK_TYPE_SIZE(uchar UCHAR) +MY_CHECK_TYPE_SIZE(uint UINT) +MY_CHECK_TYPE_SIZE(ulong ULONG) +MY_CHECK_TYPE_SIZE(int8 INT8) +MY_CHECK_TYPE_SIZE(uint8 UINT8) +MY_CHECK_TYPE_SIZE(int16 INT16) +MY_CHECK_TYPE_SIZE(uint16 UINT16) +MY_CHECK_TYPE_SIZE(int32 INT32) +MY_CHECK_TYPE_SIZE(uint32 UINT32) +MY_CHECK_TYPE_SIZE(u_int32_t U_INT32_T) +MY_CHECK_TYPE_SIZE(int64 INT64) +MY_CHECK_TYPE_SIZE(uint64 UINT64) SET (CMAKE_EXTRA_INCLUDE_FILES sys/types.h) -CHECK_TYPE_SIZE(bool SIZEOF_BOOL) +MY_CHECK_TYPE_SIZE(bool BOOL) SET(CMAKE_EXTRA_INCLUDE_FILES) IF(HAVE_SYS_SOCKET_H) SET(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h) ENDIF(HAVE_SYS_SOCKET_H) -CHECK_TYPE_SIZE(socklen_t SIZEOF_SOCKLEN_T) +MY_CHECK_TYPE_SIZE(socklen_t SOCKLEN_T) SET(CMAKE_EXTRA_INCLUDE_FILES) IF(HAVE_IEEEFP_H) SET(CMAKE_EXTRA_INCLUDE_FILES ieeefp.h) - CHECK_TYPE_SIZE(fp_except SIZEOF_FP_EXCEPT) - IF(SIZEOF_FP_EXCEPT) - SET(HAVE_FP_EXCEPT TRUE) - ENDIF() + MY_CHECK_TYPE_SIZE(fp_except FP_EXCEPT) ENDIF() @@ -678,6 +688,7 @@ int main(int ac, char **av) {} " SIGNAL_RETURN_TYPE_IS_VOID) IF(SIGNAL_RETURN_TYPE_IS_VOID) SET(RETSIGTYPE void) + SET(VOID_SIGHANDLER 1) ELSE(SIGNAL_RETURN_TYPE_IS_VOID) SET(RETSIGTYPE int) ENDIF(SIGNAL_RETURN_TYPE_IS_VOID) @@ -777,7 +788,7 @@ ENDIF(NOT HAVE_POSIX_SIGNALS) # Assume regular sprintf SET(SPRINTFS_RETURNS_INT 1) -IF(CMAKE_COMPILER_IS_GNUXX) +IF(CMAKE_COMPILER_IS_GNUXX AND HAVE_CXXABI_H) CHECK_CXX_SOURCE_COMPILES(" #include <cxxabi.h> int main(int argc, char **argv) @@ -787,9 +798,6 @@ CHECK_CXX_SOURCE_COMPILES(" return 0; }" HAVE_ABI_CXA_DEMANGLE) -IF(HAVE_ABI_CXA_DEMANGLE) - SET(HAVE_CXXABI_H 1) -ENDIF() ENDIF() CHECK_C_SOURCE_COMPILES(" @@ -983,14 +991,8 @@ ELSEIF(WIN32) SET(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} winsock2.h ws2ipdef.h) ENDIF() -CHECK_TYPE_SIZE("struct sockaddr_in6" SIZEOF_SOCKADDR_IN6) -CHECK_TYPE_SIZE("struct in6_addr" SIZEOF_IN6_ADDR) -IF(SIZEOF_SOCKADDR_IN6) - SET(HAVE_STRUCT_SOCKADDR_IN6 1) -ENDIF() -IF(SIZEOF_IN6_ADDR) - SET(HAVE_STRUCT_IN6_ADDR 1) -ENDIF() +MY_CHECK_TYPE_SIZE("struct sockaddr_in6" SOCKADDR_IN6) +MY_CHECK_TYPE_SIZE("struct in6_addr" IN6_ADDR) IF(HAVE_STRUCT_SOCKADDR_IN6 OR HAVE_STRUCT_IN6_ADDR) SET(HAVE_IPV6 TRUE CACHE INTERNAL "") diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt index 862635c25dc..27fc31cbdde 100755 --- a/extra/CMakeLists.txt +++ b/extra/CMakeLists.txt @@ -24,6 +24,8 @@ ${CMAKE_SOURCE_DIR}/storage/ndb/include/ndbapi ${CMAKE_SOURCE_DIR}/storage/ndb/include/portlib ${CMAKE_SOURCE_DIR}/storage/ndb/include/mgmapi) +# Default install component for the files is Server here +SET(MYSQL_INSTALL_COMPONENT Server) IF(NOT CMAKE_CROSSCOMPILING) ADD_EXECUTABLE(comp_err comp_err.c) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index e2ef01b3b4c..c3922231047 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -57,7 +57,7 @@ SET(HEADERS ${HEADERS_GEN_CONFIGURE} ) -INSTALL(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDEDIR}) -INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h") +INSTALL(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development) +INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development FILES_MATCHING PATTERN "*.h" ) diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index cd23f825b9e..2ae09c1707a 100755 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -152,7 +152,7 @@ SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES}) # Merge several convenience libraries into one big mysqlclient # and link them together into shared library. -MERGE_LIBRARIES(mysqlclient STATIC ${LIBS}) +MERGE_LIBRARIES(mysqlclient STATIC ${LIBS} COMPONENT Development) # Visual Studio users need debug static library for debug projects IF(MSVC) @@ -171,11 +171,11 @@ IF(UNIX) SET(${OUTNAME} ${LIBNAME}${EXTENSION}${DOT_VERSION}) ENDIF() ENDMACRO() - INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR}) + INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR} COMPONENT SharedLibraries) ENDIF() IF(NOT DISABLE_SHARED) - MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS}) + MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS} COMPONENT SharedLibraries) IF(UNIX) # libtool compatability IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE) @@ -209,7 +209,7 @@ IF(NOT DISABLE_SHARED) "${CMAKE_SHARED_LIBRARY_SUFFIX}" "" linkname) - INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR}) + INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} COMPONENT SharedLibraries) SET(OS_SHARED_LIB_SYMLINKS "${SHARED_LIB_MAJOR_VERSION}" "${OS_SHARED_LIB_VERSION}") LIST(REMOVE_DUPLICATES OS_SHARED_LIB_SYMLINKS) FOREACH(ver ${OS_SHARED_LIB_SYMLINKS}) @@ -218,7 +218,7 @@ IF(NOT DISABLE_SHARED) "${CMAKE_SHARED_LIBRARY_SUFFIX}" "${ver}" linkname) - INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR}) + INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} COMPONENT SharedLibraries) ENDFOREACH() ENDIF() ENDIF() diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index fa5088f288b..f6ecc340db6 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -124,7 +124,7 @@ FOREACH(LIB ${LIBS}) ENDFOREACH() MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS} - OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME}) + OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT Embedded) # Visual Studio users need debug static library IF(MSVC) @@ -137,5 +137,6 @@ IF(UNIX) ENDIF() IF(MSVC AND NOT DISABLE_SHARED) - MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS}) + MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS} + COMPONENT Embedded) ENDIF() diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt index b309db292da..9745699b61d 100644 --- a/mysql-test/CMakeLists.txt +++ b/mysql-test/CMakeLists.txt @@ -16,6 +16,7 @@ INSTALL( DIRECTORY . DESTINATION ${INSTALL_MYSQLTESTDIR} + COMPONENT Test PATTERN "var/" EXCLUDE PATTERN "lib/My/SafeProcess" EXCLUDE PATTERN "lib/t*" EXCLUDE diff --git a/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-test/lib/My/SafeProcess/CMakeLists.txt index 893e6d896be..f79c2d450b9 100644 --- a/mysql-test/lib/My/SafeProcess/CMakeLists.txt +++ b/mysql-test/lib/My/SafeProcess/CMakeLists.txt @@ -13,15 +13,20 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +SET(INSTALL_ARGS + DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" + COMPONENT Test +) + IF (WIN32) - ADD_EXECUTABLE(my_safe_process safe_process_win.cc) - ADD_EXECUTABLE(my_safe_kill safe_kill_win.cc) + MYSQL_ADD_EXECUTABLE(my_safe_process safe_process_win.cc ${INSTALL_ARGS}) + MYSQL_ADD_EXECUTABLE(my_safe_kill safe_kill_win.cc ${INSTALL_ARGS}) ELSE() - ADD_EXECUTABLE(my_safe_process safe_process.cc) + MYSQL_ADD_EXECUTABLE(my_safe_process safe_process.cc ${INSTALL_ARGS}) ENDIF() -INSTALL(TARGETS my_safe_process DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess") +INSTALL(TARGETS my_safe_process DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test) IF(WIN32) - INSTALL(TARGETS my_safe_kill DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess") + INSTALL(TARGETS my_safe_kill DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test) ENDIF() -INSTALL(FILES safe_process.pl Base.pm DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess") +INSTALL(FILES safe_process.pl Base.pm DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test) diff --git a/mysys/my_init.c b/mysys/my_init.c index f27f3f7b3e8..5bda2cb03ac 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -93,10 +93,6 @@ my_bool my_basic_init(void) my_umask_dir= (int) (atoi_octal(str) | 0700); #endif - /* $HOME is needed early to parse configuration files located in ~/ */ - if ((home_dir= getenv("HOME")) != 0) - home_dir= intern_filename(home_dir_buff, home_dir); - init_glob_errs(); instrumented_stdin.m_file= stdin; @@ -122,6 +118,10 @@ my_bool my_basic_init(void) return 1; #endif + /* $HOME is needed early to parse configuration files located in ~/ */ + if ((home_dir= getenv("HOME")) != 0) + home_dir= intern_filename(home_dir_buff, home_dir); + return 0; } diff --git a/packaging/WiX/AdminBackground.jpg b/packaging/WiX/AdminBackground.jpg Binary files differnew file mode 100644 index 00000000000..847dc6cdbed --- /dev/null +++ b/packaging/WiX/AdminBackground.jpg diff --git a/packaging/WiX/AdminHeader.jpg b/packaging/WiX/AdminHeader.jpg Binary files differnew file mode 100644 index 00000000000..6e2e33d404f --- /dev/null +++ b/packaging/WiX/AdminHeader.jpg diff --git a/packaging/WiX/CMakeLists.txt b/packaging/WiX/CMakeLists.txt new file mode 100644 index 00000000000..8a6a4ae4c41 --- /dev/null +++ b/packaging/WiX/CMakeLists.txt @@ -0,0 +1,112 @@ +# Copyright 2010, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +IF(NOT WIN32) + RETURN() +ENDIF() + +FIND_PATH(WIX_DIR heat.exe + $ENV{WIX_DIR}/bin + $ENV{ProgramFiles}/wix/bin + "$ENV{ProgramFiles}/Windows Installer XML v3/bin" + "$ENV{ProgramFiles}/Windows Installer XML v3.5/bin" +) + +IF(NOT WIX_DIR) + IF(NOT _WIX_DIR_CHECKED) + SET(_WIX_DIR_CHECKED 1 CACHE INTERNAL "") + MESSAGE(STATUS "Cannot find wix 3, installer project will not be generated") + ENDIF() + RETURN() +ENDIF() + +ADD_SUBDIRECTORY(ca) + +# extra.wxs.in needs DATADIR_MYSQL_FILES and DATADIR_PERFORMANCE_SCHEMA_FILES, i.e +# Wix-compatible file lists for ${builddir}\sql\data\{mysql,performance_schema} + +FOREACH(dir mysql performance_schema) + FILE(GLOB files ${CMAKE_BINARY_DIR}/sql/data/${dir}/*) + SET(filelist) + FOREACH(f ${files}) + FILE(TO_NATIVE_PATH "${f}" file_native_path) + GET_FILENAME_COMPONENT(file_name "${f}" NAME) + SET(filelist +"${filelist} +<File Id='${file_name}' Source='${file_native_path}'/>") + ENDFOREACH() + STRING(TOUPPER ${dir} DIR_UPPER) + SET(DATADIR_${DIR_UPPER}_FILES "${filelist}") +ENDFOREACH() + + +FIND_PROGRAM(HEAT_EXECUTABLE heat ${WIX_DIR}) +FIND_PROGRAM(CANDLE_EXECUTABLE candle ${WIX_DIR}) +FIND_PROGRAM(LIGHT_EXECUTABLE light ${WIX_DIR}) + +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/create_msi.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake + @ONLY) + +IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(WixWin64 " Win64='yes'") +ELSE() + SET(WixWin64) +ENDIF() +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/extra.wxs.in + ${CMAKE_CURRENT_BINARY_DIR}/extra.wxs) + +IF(CMAKE_GENERATOR MATCHES "Visual Studio") + SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_CFG_INTDIR}") +ENDIF() + +# WiX wants the license text as rtf; if there is no rtf license, +# we create a fake one from the plain text COPYING file. +IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.rtf") + MESSAGE("copying COPYING.rtf") + FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.rtf" CONTENTS) + FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "${CONTENTS}") +ELSE() + MESSAGE("creating COPYING.rtf") + FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../COPYING" CONTENTS) + STRING(REGEX REPLACE "\n" "\\\\par\n" CONTENTS "${CONTENTS}") + STRING(REGEX REPLACE "\t" "\\\\tab" CONTENTS "${CONTENTS}") + FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\\viewkind4\\uc1\\pard\\lang1031\\f0\\fs15") + FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "${CONTENTS}") + FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "\n}\n") +ENDIF() + +ADD_CUSTOM_TARGET( + MSI + COMMAND set VS_UNICODE_OUTPUT= + COMMAND ${CMAKE_COMMAND} + -DCPACK_WIX_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake + -DCPACK_WIX_INCLUDE=${CMAKE_CURRENT_BINARY_DIR}/extra.wxs + ${CONFIG_PARAM} + -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake +) +ADD_DEPENDENCIES(MSI wixca) + +ADD_CUSTOM_TARGET( + MSI_ESSENTIALS + COMMAND set VS_UNICODE_OUTPUT= + COMMAND ${CMAKE_COMMAND} -DESSENTIALS=1 + -DCPACK_WIX_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake + -DCPACK_WIX_INCLUDE=${CMAKE_CURRENT_BINARY_DIR}/extra.wxs + ${CONFIG_PARAM} + -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake +) +ADD_DEPENDENCIES(MSI wixca) + diff --git a/packaging/WiX/CPackWixConfig.cmake b/packaging/WiX/CPackWixConfig.cmake new file mode 100644 index 00000000000..9577574bbaf --- /dev/null +++ b/packaging/WiX/CPackWixConfig.cmake @@ -0,0 +1,95 @@ +
+IF(ESSENTIALS)
+ MESSAGE("Essentials!")
+ SET(CPACK_COMPONENTS_USED "Server;Client;DataFiles")
+ SET(CPACK_WIX_UI "WixUI_InstallDir")
+ MATH(EXPR bits ${CMAKE_SIZEOF_VOID_P}*8)
+ SET(CPACK_PACKAGE_FILE_NAME "mysql-essentials-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH}-win${bits}")
+ELSE()
+ SET(CPACK_COMPONENTS_USED
+ "Server;Client;DataFiles;Development;SharedLibraries;Embedded;Debuginfo;Documentation;IniFiles;Readme;Server_Scripts")
+ENDIF()
+
+
+# Some components like Embedded are optional
+# We will build MSI without embedded if it was not selected for build
+#(need to modify CPACK_COMPONENTS_ALL for that)
+SET(CPACK_ALL)
+FOREACH(comp1 ${CPACK_COMPONENTS_USED})
+ SET(found)
+ FOREACH(comp2 ${CPACK_COMPONENTS_ALL})
+ IF(comp1 STREQUAL comp2)
+ SET(found 1)
+ BREAK()
+ ENDIF()
+ ENDFOREACH()
+ IF(found)
+ SET(CPACK_ALL ${CPACK_ALL} ${comp1})
+ ENDIF()
+ENDFOREACH()
+SET(CPACK_COMPONENTS_ALL ${CPACK_ALL})
+
+# Always install (hidden), includes Readme files
+SET(CPACK_COMPONENT_GROUP_ALWAYSINSTALL_HIDDEN 1)
+SET(CPACK_COMPONENT_README_GROUP "AlwaysInstall")
+
+# Feature MySQL Server
+SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DISPLAY_NAME "MySQL Server")
+SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_EXPANDED "1")
+SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DESCRIPTION "Install MySQL Server")
+ # Subfeature "Server" (hidden)
+ SET(CPACK_COMPONENT_SERVER_GROUP "MySQLServer")
+ SET(CPACK_COMPONENT_SERVER_HIDDEN 1)
+ # Subfeature "Client"
+ SET(CPACK_COMPONENT_CLIENT_GROUP "MySQLServer")
+ SET(CPACK_COMPONENT_CLIENT_DISPLAY_NAME "Client Programs")
+ SET(CPACK_COMPONENT_CLIENT_DESCRIPTION
+ "Various helpful (commandline) tools including the mysql command line client" )
+
+ #Subfeature "Data Files"
+ SET(CPACK_COMPONENT_DATAFILES_GROUP "MySQLServer")
+ SET(CPACK_COMPONENT_DATAFILES_DISPLAY_NAME "Server data files")
+ SET(CPACK_COMPONENT_DATAFILES_DESCRIPTION "Server data files" )
+
+
+#Feature "Devel"
+SET(CPACK_COMPONENT_GROUP_DEVEL_DISPLAY_NAME "Development Components")
+SET(CPACK_COMPONENT_GROUP_DEVEL_DESCRIPTION "Installs C/C++ header files and libraries")
+ #Subfeature "Development"
+ SET(CPACK_COMPONENT_DEVELOPMENT_GROUP "Devel")
+ SET(CPACK_COMPONENT_DEVELOPMENT_HIDDEN 1)
+
+ #Subfeature "Shared libraries"
+ SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "Devel")
+ SET(CPACK_COMPONENT_SHAREDLIBRARIES_DISPLAY_NAME "Client C API library (shared)")
+ SET(CPACK_COMPONENT_SHAREDLIBRARIES_DESCRIPTION "Installs shared client library")
+
+ #Subfeature "Embedded"
+ SET(CPACK_COMPONENT_EMBEDDED_GROUP "Devel")
+ SET(CPACK_COMPONENT_EMBEDDED_DISPLAY_NAME "Embedded server library")
+ SET(CPACK_COMPONENT_EMBEDDED_DESCRIPTION "Installs embedded server library")
+ SET(CPACK_COMPONENT_EMBEDDED_WIX_LEVEL 2)
+
+#Feature Debug Symbols
+SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DISPLAY_NAME "Debug Symbols")
+SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_DESCRIPTION "Installs Debug Symbols")
+SET(CPACK_COMPONENT_GROUP_DEBUGSYMBOLS_WIX_LEVEL 2)
+ SET(CPACK_COMPONENT_DEBUGINFO_GROUP "DebugSymbols")
+ SET(CPACK_COMPONENT_DEBUGINFO_HIDDEN 1)
+
+#Feature Documentation
+SET(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation")
+SET(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION "Installs documentation")
+SET(CPACK_COMPONENT_DOCUMENTATION_WIX_LEVEL 2)
+
+#Feature tests
+SET(CPACK_COMPONENT_TEST_DISPLAY_NAME "Tests")
+SET(CPACK_COMPONENT_TEST_DESCRIPTION "Installs unittests (requires Perl to run)")
+SET(CPACK_COMPONENT_TEST_WIX_LEVEL 2)
+
+
+#Feature Misc (hidden, installs only if everything is installed)
+SET(CPACK_COMPONENT_GROUP_MISC_HIDDEN 1)
+SET(CPACK_COMPONENT_GROUP_MISC_WIX_LEVEL 100)
+ SET(CPACK_COMPONENT_INIFILES_GROUP "Misc")
+ SET(CPACK_COMPONENT_SERVER_SCRIPTS_GROUP "Misc")
diff --git a/packaging/WiX/MySQLServer.ico b/packaging/WiX/MySQLServer.ico Binary files differnew file mode 100644 index 00000000000..a471afcda95 --- /dev/null +++ b/packaging/WiX/MySQLServer.ico diff --git a/packaging/WiX/ca/CMakeLists.txt b/packaging/WiX/ca/CMakeLists.txt new file mode 100644 index 00000000000..c74b51284c7 --- /dev/null +++ b/packaging/WiX/ca/CMakeLists.txt @@ -0,0 +1,27 @@ +# Copyright 2010, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/inc) +LINK_DIRECTORIES(${WIX_DIR}/../SDK/lib) + +SET(WIXCA_SOURCES CustomAction.cpp CustomAction.rc CustomAction.def) + +IF(CMAKE_SIZEOF_VOID_P EQUAL 8) + LINK_LIBRARIES(wcautil_x64 dutil_x64 msi version) +ELSE() + LINK_LIBRARIES(wcautil dutil msi version) +ENDIF() + +ADD_LIBRARY(wixca SHARED ${WIXCA_SOURCES}) diff --git a/packaging/WiX/ca/CustomAction.cpp b/packaging/WiX/ca/CustomAction.cpp new file mode 100644 index 00000000000..806535bc79a --- /dev/null +++ b/packaging/WiX/ca/CustomAction.cpp @@ -0,0 +1,188 @@ +/* Copyright 2010, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef UNICODE +#define UNICODE +#endif + +#include <windows.h> +#include <winreg.h> +#include <msi.h> +#include <msiquery.h> +#include <wcautil.h> +#include <string.h> +#include <strsafe.h> + +/* + * Search the registry for a service whose ImagePath starts + * with our install directory. Stop and remove it if requested. + */ +static TCHAR last_service_name[128]; +int remove_service(TCHAR *installdir, int check_only) { + HKEY hKey; + int done = 0; + + if(wcslen(installdir) < 3) { + WcaLog(LOGMSG_STANDARD, "INSTALLDIR is suspiciously short, better not do anything."); + return 0; + } + + if(check_only == 0) { + WcaLog(LOGMSG_STANDARD, "Determining number of matching services..."); + int servicecount = remove_service(installdir, 1); + if(servicecount <= 0) { + WcaLog(LOGMSG_STANDARD, "No services found, not removing anything."); + return 0; + } else if(servicecount == 1) { + TCHAR buf[256]; + swprintf_s(buf, sizeof(buf), TEXT("There is a service called '%ls' set up to run from this installation. Do you wish me to stop and remove that service?"), last_service_name); + int rc = MessageBox(NULL, buf, TEXT("Removing MySQL Server"), MB_ICONQUESTION|MB_YESNOCANCEL|MB_SYSTEMMODAL); + if(rc == IDCANCEL) return -1; + if(rc != IDYES) return 0; + } else if(servicecount > 0) { + TCHAR buf[256]; + swprintf_s(buf, sizeof(buf), TEXT("There appear to be %d services set up to run from this installation. Do you wish me to stop and remove those services?"), servicecount); + int rc = MessageBox(NULL, buf, TEXT("Removing MySQL Server"), MB_ICONQUESTION|MB_YESNOCANCEL|MB_SYSTEMMODAL); + if(rc == IDCANCEL) return -1; + if(rc != IDYES) return 0; + } + } + + if(check_only == -1) check_only = 0; + + WcaLog(LOGMSG_STANDARD, "Looking for service..."); + WcaLog(LOGMSG_STANDARD, "INSTALLDIR = %ls", installdir); + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, TEXT("SYSTEM\\CurrentControlSet\\services"), 0, KEY_READ, &hKey)==ERROR_SUCCESS) { + DWORD index = 0; + TCHAR keyname[1024]; + DWORD keylen = sizeof(keyname); + FILETIME t; + /* Go through all services in the registry */ + while(RegEnumKeyExW(hKey, index, keyname, &keylen, NULL, NULL, NULL, &t) == ERROR_SUCCESS) { + HKEY hServiceKey = 0; + TCHAR path[1024]; + DWORD pathlen = sizeof(path)-1; + if (RegOpenKeyExW(hKey, keyname, NULL, KEY_READ, &hServiceKey) == ERROR_SUCCESS) { + /* Look at the ImagePath value of each service */ + if (RegQueryValueExW(hServiceKey, TEXT("ImagePath"), NULL, NULL, (LPBYTE)path, &pathlen) == ERROR_SUCCESS) { + path[pathlen] = 0; + TCHAR *p = path; + if(p[0] == '"') p += 1; + /* See if it is similar to our install directory */ + if(wcsncmp(p, installdir, wcslen(installdir)) == 0) { + WcaLog(LOGMSG_STANDARD, "Found service '%ls' with ImagePath '%ls'.", keyname, path); + swprintf_s(last_service_name, sizeof(last_service_name), TEXT("%ls"), keyname); + /* If we are supposed to stop and remove the service... */ + if(!check_only) { + WcaLog(LOGMSG_STANDARD, "Trying to stop the service."); + SC_HANDLE hSCM = NULL; + hSCM = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT); + if(hSCM != NULL) { + SC_HANDLE hService = NULL; + hService = OpenService(hSCM, keyname, SERVICE_STOP|SERVICE_QUERY_STATUS|DELETE); + if(hService != NULL) { + WcaLog(LOGMSG_STANDARD, "Waiting for the service to stop..."); + SERVICE_STATUS status; + /* Attempt to stop the service */ + if(ControlService(hService, SERVICE_CONTROL_STOP, &status)) { + /* Now wait until it's stopped */ + while("it's one big, mean and cruel world out there") { + if(!QueryServiceStatus(hService, &status)) break; + if(status.dwCurrentState == SERVICE_STOPPED) break; + Sleep(1000); + } + WcaLog(LOGMSG_STANDARD, "Stopped the service."); + } + /* Mark the service for deletion */ + DeleteService(hService); + CloseServiceHandle(hService); + } + CloseServiceHandle(hSCM); + } + } + done++; + } + } + RegCloseKey(hServiceKey); + } + index++; + keylen = sizeof(keyname)-1; + } + RegCloseKey(hKey); + } else { + WcaLog(LOGMSG_STANDARD, "Can't seem to go through the list of installed services in the registry."); + } + return done; +} + +UINT wrap(MSIHANDLE hInstall, char *name, int check_only) { + HRESULT hr = S_OK; + UINT er = ERROR_SUCCESS; + + hr = WcaInitialize(hInstall, name); + ExitOnFailure(hr, "Failed to initialize"); + + WcaLog(LOGMSG_STANDARD, "Initialized."); + + TCHAR INSTALLDIR[1024]; + DWORD INSTALLDIR_size = sizeof(INSTALLDIR); + if(MsiGetPropertyW(hInstall, TEXT("CustomActionData"), INSTALLDIR, &INSTALLDIR_size) == ERROR_SUCCESS) { + int rc = remove_service(INSTALLDIR, check_only); + if(rc < 0) { + er = ERROR_CANCELLED; + } + } else { + er = ERROR_CANT_ACCESS_FILE; + } + +LExit: + return WcaFinalize(er); +} + +UINT __stdcall RemoveServiceNoninteractive(MSIHANDLE hInstall) +{ + return wrap(hInstall, "RemoveServiceNoninteractive", -1); +} + +UINT __stdcall RemoveService(MSIHANDLE hInstall) +{ + return wrap(hInstall, "RemoveService", 0); +} + +UINT __stdcall TestService(MSIHANDLE hInstall) +{ + return wrap(hInstall, "TestService", 1); +} + +/* DllMain - Initialize and cleanup WiX custom action utils */ +extern "C" BOOL WINAPI DllMain( + __in HINSTANCE hInst, + __in ULONG ulReason, + __in LPVOID + ) +{ + switch(ulReason) + { + case DLL_PROCESS_ATTACH: + WcaGlobalInitialize(hInst); + break; + + case DLL_PROCESS_DETACH: + WcaGlobalFinalize(); + break; + } + + return TRUE; +} diff --git a/packaging/WiX/ca/CustomAction.def b/packaging/WiX/ca/CustomAction.def new file mode 100644 index 00000000000..5f5e6630013 --- /dev/null +++ b/packaging/WiX/ca/CustomAction.def @@ -0,0 +1,8 @@ +LIBRARY "wixca" +VERSION 1.0 + +EXPORTS + +RemoveService +RemoveServiceNoninteractive +TestService diff --git a/packaging/WiX/ca/CustomAction.rc b/packaging/WiX/ca/CustomAction.rc new file mode 100644 index 00000000000..3f37126ee77 --- /dev/null +++ b/packaging/WiX/ca/CustomAction.rc @@ -0,0 +1,18 @@ +#include "afxres.h" +#undef APSTUDIO_READONLY_SYMBOLS + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x0L + FILESUBTYPE 0x0L +BEGIN +END + diff --git a/packaging/WiX/create_msi.cmake.in b/packaging/WiX/create_msi.cmake.in new file mode 100644 index 00000000000..ff18009fd0c --- /dev/null +++ b/packaging/WiX/create_msi.cmake.in @@ -0,0 +1,311 @@ +SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
+SET(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
+SET(CANDLE_EXECUTABLE "@CANDLE_EXECUTABLE@")
+SET(LIGHT_EXECUTABLE "@LIGHT_EXECUTABLE@")
+SET(CMAKE_COMMAND "@CMAKE_COMMAND@")
+SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@")
+SET(MAJOR_VERSION "@MAJOR_VERSION@")
+SET(MINOR_VERSION "@MINOR_VERSION@")
+SET(PATCH "@PATCH@")
+SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@)
+SET(MANUFACTURER "@MANUFACTURER@")
+
+IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ SET(Win64 " Win64='yes'")
+ SET(Platform x64)
+ SET(PlatformProgramFilesFolder ProgramFiles64Folder)
+ELSE()
+ SET(Platform x86)
+ SET(PlatformProgramFilesFolder ProgramFilesFolder)
+ SET(Win64)
+ENDIF()
+
+SET(ENV{VS_UNICODE_OUTPUT})
+
+INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig.cmake)
+
+IF(CPACK_WIX_CONFIG)
+ INCLUDE(${CPACK_WIX_CONFIG})
+ENDIF()
+
+IF(NOT CPACK_WIX_UI)
+ SET(CPACK_WIX_UI "WixUI_Mondo")
+ENDIF()
+
+SET(WIX_FEATURES)
+FOREACH(comp ${CPACK_COMPONENTS_ALL})
+ STRING(TOUPPER "${comp}" comp_upper)
+ IF(NOT CPACK_COMPONENT_${comp_upper}_GROUP)
+ SET(WIX_FEATURE_${comp_upper}_COMPONENTS "${comp}")
+ SET(CPACK_COMPONENT_${comp_upper}_HIDDEN 1)
+ SET(CPACK_COMPONENT_GROUP_${comp_upper}_DISPLAY_NAME ${CPACK_COMPONENT_${comp_upper}_DISPLAY_NAME})
+ SET(CPACK_COMPONENT_GROUP_${comp_upper}_DESCRIPTION ${CPACK_COMPONENT_${comp_upper}_DESCRIPTION})
+ SET(CPACK_COMPONENT_GROUP_${comp_upper}_WIX_LEVEL ${CPACK_COMPONENT_${comp_upper}_WIX_LEVEL})
+ SET(WIX_FEATURES ${WIX_FEATURES} WIX_FEATURE_${comp_upper})
+ ELSE()
+ SET(FEATURE_NAME WIX_FEATURE_${CPACK_COMPONENT_${comp_upper}_GROUP})
+ SET(WIX_FEATURES ${WIX_FEATURES} ${FEATURE_NAME})
+ LIST(APPEND ${FEATURE_NAME}_COMPONENTS ${comp})
+ ENDIF()
+ENDFOREACH()
+
+LIST(REMOVE_DUPLICATES WIX_FEATURES)
+
+SET(CPACK_WIX_FEATURES)
+
+FOREACH(f ${WIX_FEATURES})
+ STRING(TOUPPER "${f}" f_upper)
+ STRING(REPLACE "WIX_FEATURE_" "" f_upper ${f_upper})
+ IF (CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)
+ SET(TITLE ${CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME})
+ ELSE()
+ SET(TITLE CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)
+ ENDIF()
+
+ IF (CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)
+ SET(DESCRIPTION ${CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION})
+ ELSE()
+ SET(DESCRIPTION CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)
+ ENDIF()
+ IF(CPACK_COMPONENT_${f_upper}_WIX_LEVEL)
+ SET(Level ${CPACK_COMPONENT_${f_upper}_WIX_LEVEL})
+ ELSE()
+ SET(Level 1)
+ ENDIF()
+ IF(CPACK_COMPONENT_GROUP_${f_upper}_HIDDEN)
+ SET(DISPLAY "Display='hidden'")
+ SET(TITLE ${f_upper})
+ SET(DESCRIPTION ${f_upper})
+ ELSE()
+ SET(DISPLAY)
+ IF(CPACK_COMPONENT_GROUP_${f_upper}_EXPANDED)
+ SET(DISPLAY "Display='expand'")
+ ENDIF()
+ IF (CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)
+ SET(TITLE ${CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME})
+ ELSE()
+ SET(TITLE CPACK_COMPONENT_GROUP_${f_upper}_DISPLAY_NAME)
+ ENDIF()
+ IF (CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)
+ SET(DESCRIPTION ${CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION})
+ ELSE()
+ SET(DESCRIPTION CPACK_COMPONENT_GROUP_${f_upper}_DESCRIPTION)
+ ENDIF()
+ ENDIF()
+
+ SET(CPACK_WIX_FEATURES
+ "${CPACK_WIX_FEATURES}
+ <Feature Id='${f_upper}'
+ Title='${TITLE}'
+ Description='${DESCRIPTION}'
+ ConfigurableDirectory='INSTALLDIR'
+ Level='${Level}' ${DISPLAY} >"
+ )
+ FOREACH(c ${${f}_COMPONENTS})
+ STRING(TOUPPER "${c}" c_upper)
+ IF (CPACK_COMPONENT_${c_upper}_DISPLAY_NAME)
+ SET(TITLE ${CPACK_COMPONENT_${c_upper}_DISPLAY_NAME})
+ ELSE()
+ SET(TITLE CPACK_COMPONENT_${c_upper}_DISPLAY_NAME)
+ ENDIF()
+
+ IF (CPACK_COMPONENT_${c_upper}_DESCRIPTION)
+ SET(DESCRIPTION ${CPACK_COMPONENT_${c_upper}_DESCRIPTION})
+ ELSE()
+ SET(DESCRIPTION CPACK_COMPONENT_${c_upper}_DESCRIPTION)
+ ENDIF()
+ IF(CPACK_COMPONENT_${c_upper}_WIX_LEVEL)
+ SET(Level ${CPACK_COMPONENT_${c_upper}_WIX_LEVEL})
+ ELSE()
+ SET(Level 1)
+ ENDIF()
+ IF(CPACK_COMPONENT_${c_upper}_HIDDEN)
+ SET(CPACK_WIX_FEATURES
+ "${CPACK_WIX_FEATURES}
+ <ComponentGroupRef Id='componentgroup.${c}'/>")
+ ELSE()
+ SET(CPACK_WIX_FEATURES
+ "${CPACK_WIX_FEATURES}
+ <Feature Id='${c}'
+ Title='${TITLE}'
+ Description='${DESCRIPTION}'
+ ConfigurableDirectory='INSTALLDIR'
+ Level='${Level}'>
+ <ComponentGroupRef Id='componentgroup.${c}'/>
+ </Feature>")
+ ENDIF()
+
+ ENDFOREACH()
+ SET(CPACK_WIX_FEATURES
+ "${CPACK_WIX_FEATURES}
+ </Feature>
+ ")
+ENDFOREACH()
+
+
+
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in
+ ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs)
+
+
+IF(CMAKE_INSTALL_CONFIG_NAME)
+ SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_INSTALL_CONFIG_NAME}")
+ENDIF()
+
+FOREACH(comp ${CPACK_COMPONENTS_ALL})
+ SET(ENV{DESTDIR} testinstall/${comp})
+ SET(DIRS ${DIRS} testinstall/${comp})
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} -DCMAKE_INSTALL_COMPONENT=${comp}
+ -DCMAKE_INSTALL_PREFIX= -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
+ OUTPUT_QUIET
+ )
+ENDFOREACH()
+
+MACRO(GENERATE_GUID VarName)
+ EXECUTE_PROCESS(COMMAND uuidgen -c
+ OUTPUT_VARIABLE ${VarName}
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ENDMACRO()
+
+SET(INC_VAR 0)
+MACRO(MAKE_WIX_IDENTIFIER str varname)
+ STRING(REPLACE "/" "." ${varname} "${str}")
+ STRING(REGEX REPLACE "[^a-zA-Z_0-9.]" "_" ${varname} "${${varname}}")
+ STRING(LENGTH "${${varname}}" len)
+ # Identifier should be smaller than 72 character
+ # We have to cut down the length to 70 chars, since we add 2 char prefix
+ # pretty often
+ IF(len GREATER 70)
+ STRING(SUBSTRING "${${varname}}" 0 67 shortstr)
+ MATH(EXPR INC_VAR ${INC_VAR}+1)
+ SET(${varname} "${shortstr}${INC_VAR}")
+ ENDIF()
+ENDMACRO()
+
+
+FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root)
+ FILE(GLOB all_files ${dir}/*)
+ IF(NOT all_files)
+ RETURN()
+ ENDIF()
+ FILE(RELATIVE_PATH dir_rel ${topdir} ${dir})
+ IF(dir_rel)
+ MAKE_DIRECTORY(${dir_root}/${dir_rel})
+ MAKE_WIX_IDENTIFIER("${dir_rel}" id)
+ SET(DirectoryRefId "D.${id}")
+ ELSE()
+ SET(DirectoryRefId "INSTALLDIR")
+ ENDIF()
+ FILE(APPEND ${file} "<DirectoryRef Id='${DirectoryRefId}'>\n")
+
+ SET(NONEXEFILES)
+ FOREACH(f ${all_files})
+ IF(NOT IS_DIRECTORY ${f})
+ FILE(RELATIVE_PATH rel ${topdir} ${f})
+ MAKE_WIX_IDENTIFIER("${rel}" id)
+ FILE(TO_NATIVE_PATH ${f} f_native)
+ GET_FILENAME_COMPONENT(f_ext "${f}" EXT)
+ # According to MSDN each DLL or EXE should be in the own component
+ IF(f_ext MATCHES ".exe" OR f_ext MATCHES ".dll")
+
+ FILE(APPEND ${file} " <Component Id='C.${id}' Guid='*' ${Win64}>\n")
+ FILE(APPEND ${file} " <File Id='F.${id}' KeyPath='yes' Source='${f_native}'/>\n")
+ FILE(APPEND ${file} " </Component>\n")
+ FILE(APPEND ${file_comp} " <ComponentRef Id='C.${id}'/>\n")
+ ELSE()
+ SET(NONEXEFILES "${NONEXEFILES}\n<File Id='F.${id}' Source='${f_native}'/>" )
+ ENDIF()
+ ENDIF()
+ ENDFOREACH()
+ FILE(APPEND ${file} "</DirectoryRef>\n")
+ IF(NONEXEFILES)
+ GENERATE_GUID(guid)
+ SET(ComponentId "C._files_${COMP_NAME}.${DirectoryRefId}")
+ FILE(APPEND ${file}
+ "<DirectoryRef Id='${DirectoryRefId}'>\n<Component Guid='${guid}' Id='${ComponentId}' ${Win64}>${NONEXEFILES}\n</Component></DirectoryRef>\n")
+ FILE(APPEND ${file_comp} " <ComponentRef Id='${ComponentId}'/>\n")
+ ENDIF()
+ FOREACH(f ${all_files})
+ IF(IS_DIRECTORY ${f})
+ TRAVERSE_FILES(${f} ${topdir} ${file} ${file_comp} ${dir_root})
+ ENDIF()
+ ENDFOREACH()
+ENDFUNCTION()
+
+FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix)
+ FILE(RELATIVE_PATH rel ${topdir} ${dir})
+ IF(rel AND IS_DIRECTORY "${f}")
+ MAKE_WIX_IDENTIFIER("${rel}" id)
+ GET_FILENAME_COMPONENT(name ${dir} NAME)
+ FILE(APPEND ${file} "${prefix}<Directory Id='D.${id}' Name='${name}'>\n")
+ ENDIF()
+ FILE(GLOB all_files ${dir}/*)
+ FOREACH(f ${all_files})
+ IF(IS_DIRECTORY ${f})
+ TRAVERSE_DIRECTORIES(${f} ${topdir} ${file} "${prefix} ")
+ ENDIF()
+ ENDFOREACH()
+ IF(rel AND IS_DIRECTORY "${f}")
+ FILE(APPEND ${file} "${prefix}</Directory>\n")
+ ENDIF()
+ENDFUNCTION()
+
+SET(CPACK_WIX_COMPONENTS)
+SET(CPACK_WIX_COMPONENT_GROUPS)
+GET_FILENAME_COMPONENT(abs . ABSOLUTE)
+FOREACH(d ${DIRS})
+ GET_FILENAME_COMPONENT(d ${d} ABSOLUTE)
+ GET_FILENAME_COMPONENT(d_name ${d} NAME)
+ FILE(WRITE ${abs}/${d_name}_component_group.wxs "<ComponentGroup Id='componentgroup.${d_name}'>")
+ SET(COMP_NAME ${d_name})
+ TRAVERSE_FILES(${d} ${d} ${abs}/${d_name}.wxs ${abs}/${d_name}_component_group.wxs "${abs}/dirs")
+ FILE(APPEND ${abs}/${d_name}_component_group.wxs "</ComponentGroup>")
+ FILE(READ ${d_name}.wxs WIX_TMP)
+ SET(CPACK_WIX_COMPONENTS "${CPACK_WIX_COMPONENTS}\n${WIX_TMP}")
+ FILE(REMOVE ${d_name}.wxs)
+ FILE(READ ${d_name}_component_group.wxs WIX_TMP)
+
+ SET(CPACK_WIX_COMPONENT_GROUPS "${CPACK_WIX_COMPONENT_GROUPS}\n${WIX_TMP}")
+ FILE(REMOVE ${d_name}_component_group.wxs)
+ENDFOREACH()
+
+FILE(WRITE directories.wxs "<DirectoryRef Id='INSTALLDIR'>\n")
+TRAVERSE_DIRECTORIES(${abs}/dirs ${abs}/dirs directories.wxs "")
+FILE(APPEND directories.wxs "</DirectoryRef>\n")
+
+FILE(READ directories.wxs CPACK_WIX_DIRECTORIES)
+FILE(REMOVE directories.wxs)
+
+
+FOREACH(src ${CPACK_WIX_INCLUDE})
+SET(CPACK_WIX_INCLUDES
+"${CPACK_WIX_INCLUDES}
+ <?include ${src}?>"
+)
+ENDFOREACH()
+
+
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in
+ ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs)
+
+SET(EXTRA_CANDLE_ARGS)
+IF("$ENV{EXTRA_CANDLE_ARGS}")
+ SET(EXTRA_CANDLE_ARGS "$ENV{EXTRA_CANDLE_ARGS}")
+ENDIF()
+
+SET(EXTRA_LIGHT_ARGS)
+IF("$ENV{EXTRA_LIGHT_ARGS}")
+ SET(EXTRA_LIGHT_ARGS "$ENV{EXTRA_LIGHT_ARGS}")
+ENDIF()
+
+FILE(REMOVE mysql_server.wixobj)
+EXECUTE_PROCESS(
+ COMMAND ${CANDLE_EXECUTABLE} -ext WixUtilExtension mysql_server.wxs ${EXTRA_CANDLE_ARGS}
+)
+EXECUTE_PROCESS(
+ COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension -ext WixUtilExtension
+ mysql_server.wixobj -out ${CPACK_PACKAGE_FILE_NAME}.msi
+ ${EXTRA_LIGHT_ARGS}
+)
+
diff --git a/packaging/WiX/extra.wxs.in b/packaging/WiX/extra.wxs.in new file mode 100644 index 00000000000..b6c42136129 --- /dev/null +++ b/packaging/WiX/extra.wxs.in @@ -0,0 +1,60 @@ +<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"
+ xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
+
+ <!-- Datafiles that installation will copy to CommonAppData (initial database)
+ They are declared Permanent and NeverOverwrite since it is user data -->
+ <DirectoryRef Id='TARGETDIR'>
+ <Directory Id="CommonAppDataFolder">
+ <Directory Id="datadir.mysql" Name="MySQL">
+ <Directory Id="datadir.mysql.mysqlserver"
+ Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@">
+ <Directory Id="DATADIR" Name=".">
+ <Component Id="component.datadir" Guid="d3491319-5dbc-4477-95f3-4f809ef1dd2d">
+ <CreateFolder>
+ <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
+ </CreateFolder>
+ </Component>
+ <Directory Id="datadir.mysql.mysqlserver.data" Name="data">
+ <Directory Id="datadir.mysql.mysqlserver.data.mysql" Name="mysql">
+ <Component Id="component.datadir.mysql"
+ Guid="19ec0f1f-1a7f-424e-a788-b09346c0a709"
+ Permanent="yes" NeverOverwrite="yes">
+ <CreateFolder>
+ <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
+ </CreateFolder>
+ @DATADIR_MYSQL_FILES@
+ </Component>
+ </Directory>
+ <Directory Id="datadir.mysql.mysqlserver.data.performance_schema"
+ Name="performance_schema">
+ <Component Id="component.datadir.performance_schema"
+ Guid="af2a6776-2655-431f-a748-9e9f4645acc3"
+ Permanent="yes" NeverOverwrite="yes">
+ <CreateFolder>
+ <util:PermissionEx User="[LogonUser]" GenericAll="yes" />
+ </CreateFolder>
+ @DATADIR_PERFORMANCE_SCHEMA_FILES@
+ </Component>
+ </Directory>
+ <Directory Id="datadir.mysql.mysqlserver.data.test" Name="test">
+ <Component Id="component.datadir.test" Guid="52fa9f0a-fcd1-420a-b2ac-95a8f70ad20a">
+ <CreateFolder/>
+ </Component>
+ </Directory>
+ </Directory>
+ </Directory>
+ </Directory>
+ </Directory>
+ </Directory>
+ </DirectoryRef>
+
+ <Feature Id="UserEditableDatafiles" Level='1' Display='hidden' ConfigurableDirectory="DATADIR">
+ <ComponentRef Id="component.datadir"/>
+ <ComponentRef Id="component.datadir.mysql"/>
+ <ComponentRef Id="component.datadir.performance_schema"/>
+ <ComponentRef Id="component.datadir.test"/>
+ </Feature>
+</Include>
+
+
+
diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in new file mode 100644 index 00000000000..8b20644e58d --- /dev/null +++ b/packaging/WiX/mysql_server.wxs.in @@ -0,0 +1,114 @@ +<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
+ xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
+ <Product
+ Id="*"
+ UpgradeCode="49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3"
+ Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@"
+ Version="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@"
+ Language="1033"
+ Manufacturer="@MANUFACTURER@">
+
+ <Package Id='*'
+ Keywords='Installer'
+ Description="MySQL Database Server"
+ Manufacturer='@MANUFACTURER@'
+ InstallerVersion='200'
+ Languages='1033'
+ Compressed='yes'
+ SummaryCodepage='1252'
+ Platform='@Platform@'/>
+
+ <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />
+
+ <!-- Upgrade -->
+ <Upgrade Id="49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3">
+ <UpgradeVersion
+ Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.0"
+ IncludeMinimum="yes"
+ Maximum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@"
+ Property="OLDERVERSIONBEINGUPGRADED" />
+ <UpgradeVersion
+ Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@"
+ OnlyDetect="yes"
+ Property="NEWERVERSIONDETECTED" />
+ </Upgrade>
+ <Condition Message="A later version of [ProductName] is already installed. Setup will now exit.">
+ NOT NEWERVERSIONDETECTED OR Installed
+ </Condition>
+ <InstallExecuteSequence>
+ <RemoveExistingProducts After="InstallInitialize"/>
+ </InstallExecuteSequence>
+
+
+ <!-- UI -->
+ <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"></Property>
+ <UIRef Id="@CPACK_WIX_UI@" />
+ <UIRef Id="WixUI_ErrorProgressText" />
+ <WixVariable
+ Id="WixUIBannerBmp"
+ Value="@CMAKE_CURRENT_SOURCE_DIR@/AdminHeader.jpg" />
+ <WixVariable
+ Id="WixUIDialogBmp"
+ Value="@CMAKE_CURRENT_SOURCE_DIR@/AdminBackground.jpg" />
+ <Icon
+ Id="icon.ico"
+ SourceFile="@CMAKE_CURRENT_SOURCE_DIR@/MySQLServer.ico"/>
+ <Property
+ Id="ARPPRODUCTICON"
+ Value="icon.ico" />
+
+ <!-- License -->
+ <WixVariable
+ Id="WixUILicenseRtf"
+ Value="@CMAKE_CURRENT_BINARY_DIR@/COPYING.rtf"/>
+
+ <!-- How to remove the service on uninstall -->
+ <Binary Id='wixca.dll' SourceFile='@CMAKE_CURRENT_BINARY_DIR@/ca/RelWithDebInfo/wixca.dll' />
+ <CustomAction Id="UnregisterProperty" Property="UnregisterService" Value="[INSTALLDIR]" Return="check" />
+ <CustomAction Id="UnregisterPropertySilent" Property="UnregisterServiceSilently" Value="[INSTALLDIR]" Return="check" />
+ <CustomAction Id="UnregisterService"
+ BinaryKey="wixca.dll"
+ DllEntry="RemoveService"
+ Execute="deferred"
+ Impersonate="no"
+ Return="check" />
+ <CustomAction Id="UnregisterServiceSilently"
+ BinaryKey="wixca.dll"
+ DllEntry="RemoveServiceNoninteractive"
+ Execute="deferred"
+ Impersonate="no"
+ Return="check" />
+ <InstallExecuteSequence>
+ <Custom Action="UnregisterProperty" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE</Custom>
+ <Custom Action="UnregisterPropertySilent" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE</Custom>
+ <Custom Action="UnregisterService" After="UnregisterProperty">Installed And Not UPGRADINGPRODUCTCODE And UILevel>2</Custom>
+ <Custom Action="UnregisterServiceSilently" After="UnregisterPropertySilent">Installed And Not UPGRADINGPRODUCTCODE And UILevel<=2</Custom>
+ </InstallExecuteSequence>
+
+ <!-- Installation root-->
+ <Directory Id='TARGETDIR' Name='SourceDir'>
+ <Directory Id='@PlatformProgramFilesFolder@'>
+ <Directory Id='directory.MySQL' Name='MySQL'>
+ <Directory Id='INSTALLDIR' Name='MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@'>
+ </Directory>
+ </Directory>
+ </Directory>
+ </Directory>
+
+ <!-- CPACK_WIX_FEATURES -->
+ @CPACK_WIX_FEATURES@
+
+ <!-- CPACK_WIX_DIRECTORIES -->
+ @CPACK_WIX_DIRECTORIES@
+
+ <!--CPACK_WIX_COMPONENTS-->
+ @CPACK_WIX_COMPONENTS@
+
+ <!--CPACK_WIX_COMPONENTS_GROUPS -->
+ @CPACK_WIX_COMPONENT_GROUPS@
+
+ <!--CPACK_WIX_INCLUDES -->
+ @CPACK_WIX_INCLUDES@
+ </Product>
+
+</Wix>
\ No newline at end of file diff --git a/plugin/audit_null/CMakeLists.txt b/plugin/audit_null/CMakeLists.txt index 4e27ae7e0d9..4baa1da35fe 100644 --- a/plugin/audit_null/CMakeLists.txt +++ b/plugin/audit_null/CMakeLists.txt @@ -13,4 +13,5 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -MYSQL_ADD_PLUGIN(audit_null audit_null.c MODULE_ONLY) +MYSQL_ADD_PLUGIN(audit_null audit_null.c + MODULE_ONLY MODULE_OUTPUT_NAME "adt_null") diff --git a/plugin/daemon_example/CMakeLists.txt b/plugin/daemon_example/CMakeLists.txt index 1c21d57b326..de4310b0244 100644 --- a/plugin/daemon_example/CMakeLists.txt +++ b/plugin/daemon_example/CMakeLists.txt @@ -13,4 +13,5 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -MYSQL_ADD_PLUGIN(daemon_example daemon_example.cc MODULE_ONLY) +MYSQL_ADD_PLUGIN(daemon_example daemon_example.cc + MODULE_ONLY MODULE_OUTPUT_NAME "libdaemon_example") diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index fc55a2923f2..84472c3a5c3 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -77,7 +77,7 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/fill_help_tables.sql ${CMAKE_CURRENT_SOURCE_DIR}/mysql_test_data_timezone.sql ${FIX_PRIVILEGES_SQL} - DESTINATION ${INSTALL_MYSQLSHAREDIR} + DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server ) # TCMalloc hacks @@ -175,12 +175,10 @@ ELSE() SET(EXT ".pl") ENDIF() -INSTALL(FILES +INSTALL_SCRIPT( "${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db${EXT}" DESTINATION ${DEST} - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE + COMPONENT Server ) @@ -255,6 +253,7 @@ IF(MSVC) ENDIF() SET(NON_THREADED_LIBS ${CLIENT_LIBS}) +SET(mysql_config_COMPONENT COMPONENT Development) IF(WIN32) # On Windows, some .sh and some .pl.in files are configured @@ -268,31 +267,22 @@ IF(WIN32) mysqlhotcopy) FOREACH(file ${PLIN_FILES}) + IF(NOT ${file}_COMPONENT) + SET(${file}_COMPONENT Server_Scripts) + ENDIF() CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.pl.in ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) - - INSTALL(FILES - ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl - DESTINATION scripts - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE - ) + INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT ${${file}_COMPONENT}) ENDFOREACH() FOREACH(file ${SH_FILES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY) - INSTALL(FILES - ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl - DESTINATION scripts - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE - ) + INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT ${${file}_COMPONENT}) ENDFOREACH() ELSE() # On Unix, most of the files end up in the bin directory + SET(mysql_config_COMPONENT COMPONENT Development) SET(BIN_SCRIPTS msql2mysql mysql_config @@ -321,13 +311,14 @@ ELSE() MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file} in " "${CMAKE_CURRENT_SOURCE_DIR}" ) ENDIF() - INSTALL(FILES - ${CMAKE_CURRENT_BINARY_DIR}/${file} - DESTINATION ${INSTALL_BINDIR} - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE - ) + IF(NOT ${file}_COMPONENT) + SET(${file}_COMPONENT Server) + ENDIF() + INSTALL_SCRIPT( + ${CMAKE_CURRENT_BINARY_DIR}/${file} + DESTINATION ${INSTALL_BINDIR} + COMPONENT ${${file}_COMPONENT} + ) ENDFOREACH() ENDIF() @@ -342,7 +333,8 @@ IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_FLAGS MATCHES "-static") ERROR_QUIET ) IF(${RESULT} EQUAL 0 AND EXISTS ${LIBGCC_LOCATION}) - INSTALL(FILES "${LIBGCC_LOCATION}" DESTINATION ${INSTALL_LIBDIR}) + INSTALL(FILES "${LIBGCC_LOCATION}" DESTINATION ${INSTALL_LIBDIR} + COMPONENT Development) ENDIF() ENDIF() diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index a0e157b7806..a7f5903247c 100755 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -97,7 +97,7 @@ ELSE() SET(MYSQLD_SOURCE main.cc ${DTRACE_PROBES_ALL}) ENDIF() -MYSQL_ADD_EXECUTABLE(mysqld ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR}) +MYSQL_ADD_EXECUTABLE(mysqld ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR} COMPONENT Server) IF(NOT WITHOUT_DYNAMIC_PLUGINS) SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE) @@ -252,7 +252,7 @@ IF(INSTALL_LAYOUT STREQUAL "STANDALONE") # Avoid completely empty directories and install dummy file instead. SET(DUMMY_FILE ${CMAKE_CURRENT_BINARY_DIR}/.empty ) FILE(WRITE ${DUMMY_FILE} "") -INSTALL(FILES ${DUMMY_FILE} DESTINATION data/test) +INSTALL(FILES ${DUMMY_FILE} DESTINATION data/test COMPONENT DataFiles) # Install initial database on windows IF(NOT CMAKE_CROSSCOMPILING) @@ -280,7 +280,7 @@ IF(WIN32 AND MYSQLD_EXECUTABLE) ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/data/mysql/user.frm ) - INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data DESTINATION . + INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data DESTINATION . COMPONENT DataFiles PATTERN "bootstrap.sql" EXCLUDE) ELSE() # Not windows or cross compiling, just install an empty directory diff --git a/sql/share/CMakeLists.txt b/sql/share/CMakeLists.txt index 1868200f038..14de851aaa2 100644 --- a/sql/share/CMakeLists.txt +++ b/sql/share/CMakeLists.txt @@ -45,10 +45,10 @@ SET(files FOREACH (dir ${dirs}) INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir} - DESTINATION ${INSTALL_MYSQLSHAREDIR}) + DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server) ENDFOREACH() -INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/charsets DESTINATION ${INSTALL_MYSQLSHAREDIR} +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/charsets DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server PATTERN "languages.html" EXCLUDE ) -INSTALL(FILES ${files} DESTINATION ${INSTALL_MYSQLSHAREDIR}) +INSTALL(FILES ${files} DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server) diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt index ff522ac1d35..72c4d1ab2d0 100644 --- a/support-files/CMakeLists.txt +++ b/support-files/CMakeLists.txt @@ -32,6 +32,8 @@ ELSE() SET(HOSTNAME "hostname") ENDIF() +# XXX: shouldn't we just have variables for all this stuff and centralise +# XXX: their configuration in install_layout.cmake? IF(WIN32) SET(inst_location ${INSTALL_DOCREADMEDIR}) ELSE() @@ -41,10 +43,13 @@ ENDIF() FOREACH(inifile my-huge my-innodb-heavy-4G my-large my-medium my-small) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${inifile}.cnf.sh ${CMAKE_CURRENT_BINARY_DIR}/${inifile}.${ini_file_extension} @ONLY) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${inifile}.${ini_file_extension} DESTINATION ${inst_location}) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${inifile}.${ini_file_extension} + DESTINATION ${inst_location} COMPONENT IniFiles) ENDFOREACH() IF(UNIX) + # XXX: again, used elsewhere (scripts/), should be standardised in + # XXX: install_layout.cmake IF(INSTALL_LAYOUT MATCHES "STANDALONE") SET(prefix ".") ELSE() @@ -64,7 +69,7 @@ IF(UNIX) INSTALL(FILES magic DESTINATION ${inst_location}) ENDIF() - INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal) + INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development) CONFIGURE_FILE(MySQL-shared-compat.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/MySQL-shared-compat.spec @ONLY) CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.spec @ONLY) CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.${VERSION}.spec @ONLY) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index bb15b27cd1f..da02bc11421 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -121,43 +121,62 @@ %define distro_specific 0 %endif %if %{distro_specific} - %if %(test -f /etc/redhat-release && echo 1 || echo 0) - %define rhelver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g') - %if "%rhelver" == "4" - %define distro_description Red Hat Enterprise Linux 4 - %define distro_releasetag rhel4 + %if %(test -f /etc/enterprise-release && echo 1 || echo 0) + %define oelver %(rpm -qf --qf '%%{version}\\n' /etc/enterprise-release | sed -e 's/^\\([0-9]*\\).*/\\1/g') + %if "%oelver" == "4" + %define distro_description Oracle Enterprise Linux 4 + %define distro_releasetag oel4 %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel %define distro_requires chkconfig coreutils grep procps shadow-utils %else - %if "%rhelver" == "5" - %define distro_description Red Hat Enterprise Linux 5 - %define distro_releasetag rhel5 + %if "%oelver" == "5" + %define distro_description Oracle Enterprise Linux 5 + %define distro_releasetag oel5 %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel %define distro_requires chkconfig coreutils grep procps shadow-utils %else - %{error:Red Hat Enterprise Linux %{rhelver} is unsupported} + %{error:Oracle Enterprise Linux %{oelver} is unsupported} %endif %endif %else - %if %(test -f /etc/SuSE-release && echo 1 || echo 0) - %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release) - %if "%susever" == "10" - %define distro_description SUSE Linux Enterprise Server 10 - %define distro_releasetag sles10 - %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client readline-devel zlib-devel - %define distro_requires aaa_base coreutils grep procps pwdutils + %if %(test -f /etc/redhat-release && echo 1 || echo 0) + %define rhelver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g') + %if "%rhelver" == "4" + %define distro_description Red Hat Enterprise Linux 4 + %define distro_releasetag rhel4 + %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel + %define distro_requires chkconfig coreutils grep procps shadow-utils %else - %if "%susever" == "11" - %define distro_description SUSE Linux Enterprise Server 11 - %define distro_releasetag sles11 - %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils readline-devel zlib-devel - %define distro_requires aaa_base coreutils grep procps pwdutils + %if "%rhelver" == "5" + %define distro_description Red Hat Enterprise Linux 5 + %define distro_releasetag rhel5 + %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel + %define distro_requires chkconfig coreutils grep procps shadow-utils %else - %{error:SuSE %{susever} is unsupported} + %{error:Red Hat Enterprise Linux %{rhelver} is unsupported} %endif %endif %else - %{error:Unsupported distribution} + %if %(test -f /etc/SuSE-release && echo 1 || echo 0) + %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release) + %if "%susever" == "10" + %define distro_description SUSE Linux Enterprise Server 10 + %define distro_releasetag sles10 + %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client readline-devel zlib-devel + %define distro_requires aaa_base coreutils grep procps pwdutils + %else + %if "%susever" == "11" + %define distro_description SUSE Linux Enterprise Server 11 + %define distro_releasetag sles11 + %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils readline-devel zlib-devel + %define distro_requires aaa_base coreutils grep procps pwdutils + %else + %{error:SuSE %{susever} is unsupported} + %endif + %endif + %else + %{error:Unsupported distribution} + %endif %endif %endif %else @@ -396,30 +415,30 @@ mkdir debug -e 's/ -ip / /' \ -e 's/^ //' \ -e 's/ $//'` - # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included - # XXX: before install_layout so we can't just set it based on - # XXX: INSTALL_LAYOUT=RPM + # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before + # XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM ${CMAKE} ../%{src_dir} -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \ -DCMAKE_BUILD_TYPE=Debug \ -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \ -DFEATURE_SET="%{feature_set}" \ -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \ -DMYSQL_SERVER_SUFFIX="%{server_suffix}" + echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG make VERBOSE=1 ) # Build full release mkdir release ( cd release - # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included - # XXX: before install_layout so we can't just set it based on - # XXX: INSTALL_LAYOUT=RPM + # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before + # XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM ${CMAKE} ../%{src_dir} -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \ -DFEATURE_SET="%{feature_set}" \ -DCOMPILATION_COMMENT="%{compilation_comment_release}" \ -DMYSQL_SERVER_SUFFIX="%{server_suffix}" + echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG make VERBOSE=1 ) @@ -470,10 +489,8 @@ install -d $RBR%{_sbindir} mv -v $RBR/%{_libdir}/*.a $RBR/%{_libdir}/mysql/ # Install logrotate and autostart -install -m 644 $MBD/release/support-files/mysql-log-rotate \ - $RBR%{_sysconfdir}/logrotate.d/mysql -install -m 755 $MBD/release/support-files/mysql.server \ - $RBR%{_sysconfdir}/init.d/mysql +install -m 644 $MBD/release/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql +install -m 755 $MBD/release/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql # Create a symlink "rcmysql", pointing to the init.script. SuSE users # will appreciate that, as all services usually offer this. @@ -578,9 +595,9 @@ fi # Shut down a previously installed server first if [ -x %{_sysconfdir}/init.d/mysql ] ; then - %{_sysconfdir}/init.d/mysql stop > /dev/null 2>&1 - echo "Giving mysqld 5 seconds to exit nicely" - sleep 5 + %{_sysconfdir}/init.d/mysql stop > /dev/null 2>&1 + echo "Giving mysqld 5 seconds to exit nicely" + sleep 5 fi %post -n MySQL-server%{product_suffix} @@ -598,10 +615,10 @@ if [ ! -d $mysql_datadir/test ] ; then mkdir $mysql_datadir/test; fi # ---------------------------------------------------------------------- # use insserv for older SuSE Linux versions if [ -x /sbin/insserv ] ; then - /sbin/insserv %{_sysconfdir}/init.d/mysql + /sbin/insserv %{_sysconfdir}/init.d/mysql # use chkconfig on Enterprise Linux and newer SuSE releases elif [ -x /sbin/chkconfig ] ; then - /sbin/chkconfig --add mysql + /sbin/chkconfig --add mysql fi # ---------------------------------------------------------------------- @@ -687,20 +704,26 @@ fi # Allow mysqld_safe to start mysqld and print a message before we exit sleep 2 +#echo "Thank you for installing the MySQL Community Server! For Production +#systems, we recommend MySQL Enterprise, which contains enterprise-ready +#software, intelligent advisory services, and full production support with +#scheduled service packs and more. Visit www.mysql.com/enterprise for more +#information." + %preun -n MySQL-server%{product_suffix} if [ $1 = 0 ] ; then - # Stop MySQL before uninstalling it - if [ -x %{_sysconfdir}/init.d/mysql ] ; then - %{_sysconfdir}/init.d/mysql stop > /dev/null - # Remove autostart of MySQL - # For older SuSE Linux versions - if [ -x /sbin/insserv ] ; then - /sbin/insserv -r %{_sysconfdir}/init.d/mysql - # use chkconfig on Enterprise Linux and newer SuSE releases - elif [ -x /sbin/chkconfig ] ; then - /sbin/chkconfig --del mysql - fi - fi + # Stop MySQL before uninstalling it + if [ -x %{_sysconfdir}/init.d/mysql ] ; then + %{_sysconfdir}/init.d/mysql stop > /dev/null + # Remove autostart of MySQL + # For older SuSE Linux versions + if [ -x /sbin/insserv ] ; then + /sbin/insserv -r %{_sysconfdir}/init.d/mysql + # use chkconfig on Enterprise Linux and newer SuSE releases + elif [ -x /sbin/chkconfig ] ; then + /sbin/chkconfig --del mysql + fi + fi fi # We do not remove the mysql user since it may still own a lot of @@ -786,13 +809,13 @@ fi %attr(755, root, root) %{_sbindir}/mysqld %attr(755, root, root) %{_sbindir}/mysqld-debug %attr(755, root, root) %{_sbindir}/rcmysql -%attr(755, root, root) %{_libdir}/mysql/plugin/audit_null.so -%attr(755, root, root) %{_libdir}/mysql/plugin/daemon_example.so +%attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so +%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so %attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so %attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so %attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so -%attr(755, root, root) %{_libdir}/mysql/plugin/debug/audit_null.so -%attr(755, root, root) %{_libdir}/mysql/plugin/debug/daemon_example.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_master.so %attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_slave.so diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ea2f41abb73..b0e3342b1bc 100755 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -27,4 +27,4 @@ IF(WITH_UNIT_TESTS) SET_TARGET_PROPERTIES(bug25714 PROPERTIES LINKER_LANGUAGE CXX) ENDIF() -INSTALL(TARGETS mysql_client_test DESTINATION bin) +INSTALL(TARGETS mysql_client_test DESTINATION ${INSTALL_BINDIR} COMPONENT Test) |