2020-10-29 02:55:15 +08:00
|
|
|
include(FDBInstall)
|
2019-02-11 12:51:36 +08:00
|
|
|
|
2019-02-28 12:17:11 +08:00
|
|
|
function(install_symlink_impl)
|
2019-02-17 04:07:52 +08:00
|
|
|
if (NOT WIN32)
|
|
|
|
set(options "")
|
2019-02-28 12:17:11 +08:00
|
|
|
set(one_value_options TO DESTINATION)
|
|
|
|
set(multi_value_options COMPONENTS)
|
2019-02-17 04:07:52 +08:00
|
|
|
cmake_parse_arguments(SYM "${options}" "${one_value_options}" "${multi_value_options}" "${ARGN}")
|
|
|
|
|
|
|
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/symlinks)
|
|
|
|
get_filename_component(fname ${SYM_DESTINATION} NAME)
|
|
|
|
get_filename_component(dest_dir ${SYM_DESTINATION} DIRECTORY)
|
|
|
|
set(sl ${CMAKE_CURRENT_BINARY_DIR}/symlinks/${fname})
|
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SYM_TO} ${sl})
|
2019-02-28 12:17:11 +08:00
|
|
|
foreach(component IN LISTS SYM_COMPONENTS)
|
|
|
|
install(FILES ${sl} DESTINATION ${dest_dir} COMPONENT ${component})
|
|
|
|
endforeach()
|
2019-02-17 04:07:52 +08:00
|
|
|
endif()
|
2019-02-11 12:51:36 +08:00
|
|
|
endfunction()
|
|
|
|
|
2019-02-28 12:17:11 +08:00
|
|
|
function(install_symlink)
|
|
|
|
if(NOT WIN32 AND NOT OPEN_FOR_IDE)
|
|
|
|
set(options "")
|
|
|
|
set(one_value_options COMPONENT LINK_DIR FILE_DIR LINK_NAME FILE_NAME)
|
|
|
|
set(multi_value_options "")
|
|
|
|
cmake_parse_arguments(IN "${options}" "${one_value_options}" "${multi_value_options}" "${ARGN}")
|
2018-05-06 00:43:50 +08:00
|
|
|
|
2019-03-03 02:58:54 +08:00
|
|
|
set(rel_path "")
|
2019-02-28 12:17:11 +08:00
|
|
|
string(REGEX MATCHALL "\\/" slashes "${IN_LINK_NAME}")
|
2019-03-03 02:58:54 +08:00
|
|
|
foreach(ignored IN LISTS slashes)
|
2019-02-28 12:17:11 +08:00
|
|
|
set(rel_path "../${rel_path}")
|
|
|
|
endforeach()
|
|
|
|
if("${IN_FILE_DIR}" MATCHES "bin")
|
|
|
|
if("${IN_LINK_DIR}" MATCHES "lib")
|
|
|
|
install_symlink_impl(
|
2019-03-03 02:58:54 +08:00
|
|
|
TO "../${rel_path}bin/${IN_FILE_NAME}"
|
2019-02-28 12:17:11 +08:00
|
|
|
DESTINATION "lib/${IN_LINK_NAME}"
|
|
|
|
COMPONENTS "${IN_COMPONENT}-tgz")
|
|
|
|
install_symlink_impl(
|
2019-03-03 02:58:54 +08:00
|
|
|
TO "../${rel_path}bin/${IN_FILE_NAME}"
|
2019-02-28 12:17:11 +08:00
|
|
|
DESTINATION "usr/lib64/${IN_LINK_NAME}"
|
|
|
|
COMPONENTS "${IN_COMPONENT}-el6"
|
|
|
|
"${IN_COMPONENT}-el7"
|
|
|
|
"${IN_COMPONENT}-deb")
|
|
|
|
install_symlink_impl(
|
2019-03-03 02:58:54 +08:00
|
|
|
TO "../${rel_path}bin/${IN_FILE_NAME}"
|
2019-02-28 12:17:11 +08:00
|
|
|
DESTINATION "usr/lib64/${IN_LINK_NAME}"
|
|
|
|
COMPONENTS "${IN_COMPONENT}-deb")
|
2020-10-31 09:21:04 +08:00
|
|
|
install_symlink_impl(
|
|
|
|
TO "../${rel_path}local/bin/${IN_FILE_NAME}"
|
|
|
|
DESTINATION "usr/lib64/${IN_LINK_NAME}"
|
|
|
|
COMPONENTS "${IN_COMPONENT}-pm")
|
2019-02-28 12:17:11 +08:00
|
|
|
elseif("${IN_LINK_DIR}" MATCHES "bin")
|
|
|
|
install_symlink_impl(
|
2019-03-03 02:58:54 +08:00
|
|
|
TO "../${rel_path}bin/${IN_FILE_NAME}"
|
2019-02-28 12:17:11 +08:00
|
|
|
DESTINATION "bin/${IN_LINK_NAME}"
|
|
|
|
COMPONENTS "${IN_COMPONENT}-tgz")
|
|
|
|
install_symlink_impl(
|
2019-03-03 02:58:54 +08:00
|
|
|
TO "../${rel_path}bin/${IN_FILE_NAME}"
|
2019-02-28 12:17:11 +08:00
|
|
|
DESTINATION "usr/bin/${IN_LINK_NAME}"
|
|
|
|
COMPONENTS "${IN_COMPONENT}-el6"
|
|
|
|
"${IN_COMPONENT}-el7"
|
|
|
|
"${IN_COMPONENT}-deb")
|
2020-10-31 09:21:04 +08:00
|
|
|
install_symlink_impl(
|
|
|
|
TO "../${rel_path}/bin/${IN_FILE_NAME}"
|
|
|
|
DESTINATION "usr/local/bin/${IN_LINK_NAME}"
|
|
|
|
COMPONENTS "${IN_COMPONENT}-pm")
|
2019-03-03 06:05:05 +08:00
|
|
|
elseif("${IN_LINK_DIR}" MATCHES "fdbmonitor")
|
|
|
|
install_symlink_impl(
|
|
|
|
TO "../../${rel_path}bin/${IN_FILE_NAME}"
|
|
|
|
DESTINATION "lib/foundationdb/${IN_LINK_NAME}"
|
|
|
|
COMPONENTS "${IN_COMPONENT}-tgz")
|
|
|
|
install_symlink_impl(
|
|
|
|
TO "../../${rel_path}bin/${IN_FILE_NAME}"
|
|
|
|
DESTINATION "usr/lib/foundationdb/${IN_LINK_NAME}"
|
|
|
|
COMPONENTS "${IN_COMPONENT}-el6"
|
|
|
|
"${IN_COMPONENT}-el7"
|
|
|
|
"${IN_COMPONENT}-deb")
|
2020-10-31 09:21:04 +08:00
|
|
|
install_symlink_impl(
|
|
|
|
TO "../../${rel_path}/bin/${IN_FILE_NAME}"
|
|
|
|
DESTINATION "usr/local/lib/foundationdb/${IN_LINK_NAME}"
|
|
|
|
COMPONENTS "${IN_COMPONENT}-pm")
|
2019-02-28 12:17:11 +08:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Unknown LINK_DIR ${IN_LINK_DIR}")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Unknown FILE_DIR ${IN_FILE_DIR}")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endfunction()
|
2019-02-11 07:50:11 +08:00
|
|
|
|
2019-12-12 05:59:03 +08:00
|
|
|
function(symlink_files)
|
2019-12-11 03:35:18 +08:00
|
|
|
if (NOT WIN32)
|
|
|
|
set(options "")
|
|
|
|
set(one_value_options LOCATION SOURCE)
|
|
|
|
set(multi_value_options TARGETS)
|
|
|
|
cmake_parse_arguments(SYM "${options}" "${one_value_options}" "${multi_value_options}" "${ARGN}")
|
|
|
|
|
|
|
|
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${SYM_LOCATION})
|
|
|
|
foreach(component IN LISTS SYM_TARGETS)
|
2019-12-12 05:59:03 +08:00
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SYM_SOURCE} ${CMAKE_BINARY_DIR}/${SYM_LOCATION}/${component} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${SYM_LOCATION})
|
2019-12-11 03:35:18 +08:00
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
|
2020-10-29 03:10:59 +08:00
|
|
|
fdb_install_packages(TGZ DEB EL7 PM VERSIONED)
|
2020-10-29 02:55:15 +08:00
|
|
|
fdb_install_dirs(BIN SBIN LIB FDBMONITOR INCLUDE ETC LOG DATA)
|
|
|
|
message(STATUS "FDB_INSTALL_DIRS -> ${FDB_INSTALL_DIRS}")
|
2019-05-23 07:09:04 +08:00
|
|
|
|
2020-10-29 02:55:15 +08:00
|
|
|
install_destinations(TGZ
|
|
|
|
BIN bin
|
|
|
|
SBIN sbin
|
|
|
|
LIB lib
|
|
|
|
FDBMONITOR sbin
|
|
|
|
INCLUDE include
|
|
|
|
ETC etc/foundationdb
|
|
|
|
LOG log/foundationdb
|
|
|
|
DATA lib/foundationdb)
|
|
|
|
copy_install_destinations(TGZ VERSIONED PREFIX "usr/lib/foundationdb-${PROJECT_VERSION}/")
|
|
|
|
install_destinations(DEB
|
|
|
|
BIN usr/bin
|
|
|
|
SBIN usr/sbin
|
|
|
|
LIB usr/lib
|
|
|
|
FDBMONITOR usr/lib/foundationdb
|
|
|
|
INCLUDE usr/include
|
|
|
|
ETC etc/foundationdb
|
|
|
|
LOG var/log/foundationdb
|
2021-04-30 05:25:55 +08:00
|
|
|
DATA var/lib/foundationdb/data)
|
2020-10-29 03:10:59 +08:00
|
|
|
copy_install_destinations(DEB EL7)
|
|
|
|
install_destinations(EL7 LIB usr/lib64)
|
2020-10-29 02:55:15 +08:00
|
|
|
install_destinations(PM
|
|
|
|
BIN usr/local/bin
|
|
|
|
SBIN usr/local/sbin
|
|
|
|
LIB lib
|
|
|
|
FDBMONITOR usr/local/libexec
|
|
|
|
INCLUDE usr/local/include
|
|
|
|
ETC usr/local/etc/foundationdb)
|
|
|
|
|
|
|
|
# This can be used for debugging in case above is behaving funky
|
|
|
|
#print_install_destinations()
|
2019-02-11 07:50:11 +08:00
|
|
|
|
2019-05-24 05:13:07 +08:00
|
|
|
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
2018-05-06 00:43:50 +08:00
|
|
|
|
2019-02-28 12:17:11 +08:00
|
|
|
if(APPLE)
|
2019-05-12 05:42:48 +08:00
|
|
|
set(CPACK_GENERATOR TGZ productbuild)
|
2019-02-08 08:35:08 +08:00
|
|
|
else()
|
2019-02-28 12:17:11 +08:00
|
|
|
set(CPACK_GENERATOR RPM DEB TGZ)
|
2019-02-08 08:35:08 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2019-02-28 12:17:11 +08:00
|
|
|
set(CPACK_PACKAGE_CHECKSUM SHA256)
|
2019-05-12 05:42:48 +08:00
|
|
|
configure_file("${CMAKE_SOURCE_DIR}/cmake/CPackConfig.cmake" "${CMAKE_BINARY_DIR}/packaging/CPackConfig.cmake")
|
|
|
|
set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_BINARY_DIR}/packaging/CPackConfig.cmake")
|
2019-02-28 12:17:11 +08:00
|
|
|
|
2020-04-23 07:29:28 +08:00
|
|
|
################################################################################
|
|
|
|
# User config
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
set(GENERATE_DEBUG_PACKAGES "${FDB_RELEASE}" CACHE BOOL "Build debug rpm/deb packages (default: only ON for FDB_RELEASE)")
|
|
|
|
|
2018-05-06 00:43:50 +08:00
|
|
|
################################################################################
|
|
|
|
# Version information
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
string(REPLACE "." ";" FDB_VERSION_LIST ${FDB_VERSION_PLAIN})
|
|
|
|
list(GET FDB_VERSION_LIST 0 FDB_MAJOR)
|
|
|
|
list(GET FDB_VERSION_LIST 1 FDB_MINOR)
|
|
|
|
list(GET FDB_VERSION_LIST 2 FDB_PATCH)
|
|
|
|
|
2020-10-29 04:03:48 +08:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Alternatives config
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
math(EXPR ALTERNATIVES_PRIORITY "(${PROJECT_VERSION_MAJOR} * 1000) + (${PROJECT_VERSION_MINOR} * 100) + ${PROJECT_VERSION_PATCH}")
|
|
|
|
set(script_dir "${PROJECT_BINARY_DIR}/packaging/multiversion/")
|
|
|
|
file(MAKE_DIRECTORY "${script_dir}/server" "${script_dir}/clients")
|
|
|
|
configure_file("${PROJECT_SOURCE_DIR}/packaging/multiversion/server/postinst" "${script_dir}/server" @ONLY)
|
|
|
|
configure_file("${PROJECT_SOURCE_DIR}/packaging/multiversion/server/prerm" "${script_dir}/server" @ONLY)
|
|
|
|
set(LIB_DIR lib)
|
|
|
|
configure_file("${PROJECT_SOURCE_DIR}/packaging/multiversion/clients/postinst" "${script_dir}/clients" @ONLY)
|
|
|
|
set(LIB_DIR lib64)
|
|
|
|
configure_file("${PROJECT_SOURCE_DIR}/packaging/multiversion/clients/postinst" "${script_dir}/clients/postinst-el7" @ONLY)
|
|
|
|
configure_file("${PROJECT_SOURCE_DIR}/packaging/multiversion/clients/prerm" "${script_dir}/clients" @ONLY)
|
|
|
|
|
2021-04-20 02:52:44 +08:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Move Docker Setup
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
file(COPY "${PROJECT_SOURCE_DIR}/packaging/docker" DESTINATION "${PROJECT_BINARY_DIR}/packages/")
|
|
|
|
|
2018-05-06 00:43:50 +08:00
|
|
|
################################################################################
|
|
|
|
# General CPack configuration
|
|
|
|
################################################################################
|
|
|
|
|
2018-05-06 03:08:39 +08:00
|
|
|
include(InstallRequiredSystemLibraries)
|
2018-05-06 00:43:50 +08:00
|
|
|
set(CPACK_PACKAGE_NAME "foundationdb")
|
2019-05-03 13:14:18 +08:00
|
|
|
set(CPACK_PACKAGE_VENDOR "FoundationDB")
|
|
|
|
set(CPACK_PACKAGE_CONTACT "fdb-dist@apple.com")
|
2018-05-06 00:43:50 +08:00
|
|
|
set(CPACK_PACKAGE_VERSION_MAJOR ${FDB_MAJOR})
|
|
|
|
set(CPACK_PACKAGE_VERSION_MINOR ${FDB_MINOR})
|
|
|
|
set(CPACK_PACKAGE_VERSION_PATCH ${FDB_PATCH})
|
2019-02-17 04:07:52 +08:00
|
|
|
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${FDB_VERSION}-${CPACK_SYSTEM_NAME}")
|
|
|
|
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_BINARY_DIR}/packages")
|
2018-05-06 00:43:50 +08:00
|
|
|
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_SOURCE_DIR}/packaging/description)
|
|
|
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
|
|
|
|
"FoundationDB is a scalable, fault-tolerant, ordered key-value store with full ACID transactions.")
|
|
|
|
set(CPACK_PACKAGE_ICON ${CMAKE_SOURCE_DIR}/packaging/foundationdb.ico)
|
2018-05-07 05:20:21 +08:00
|
|
|
set(CPACK_PACKAGE_CONTACT "The FoundationDB Community")
|
2019-03-02 06:13:16 +08:00
|
|
|
|
|
|
|
set(CPACK_COMPONENT_SERVER-EL7_DEPENDS clients-el7)
|
|
|
|
set(CPACK_COMPONENT_SERVER-DEB_DEPENDS clients-deb)
|
|
|
|
set(CPACK_COMPONENT_SERVER-TGZ_DEPENDS clients-tgz)
|
|
|
|
set(CPACK_COMPONENT_SERVER-PM_DEPENDS clients-pm)
|
2020-10-29 02:55:15 +08:00
|
|
|
set(CPACK_COMPONENT_SERVER-VERSIONED_DEPENDS clients-versioned)
|
2019-03-02 06:13:16 +08:00
|
|
|
|
|
|
|
set(CPACK_COMPONENT_SERVER-EL7_DISPLAY_NAME "foundationdb-server")
|
|
|
|
set(CPACK_COMPONENT_SERVER-DEB_DISPLAY_NAME "foundationdb-server")
|
|
|
|
set(CPACK_COMPONENT_SERVER-TGZ_DISPLAY_NAME "foundationdb-server")
|
|
|
|
set(CPACK_COMPONENT_SERVER-PM_DISPLAY_NAME "foundationdb-server")
|
2020-10-29 02:55:15 +08:00
|
|
|
set(CPACK_COMPONENT_SERVER-VERSIONED_DISPLAY_NAME "foundationdb-server-${PROJECT_VERSION}")
|
2019-03-02 06:13:16 +08:00
|
|
|
|
|
|
|
set(CPACK_COMPONENT_CLIENTS-EL7_DISPLAY_NAME "foundationdb-clients")
|
|
|
|
set(CPACK_COMPONENT_CLIENTS-DEB_DISPLAY_NAME "foundationdb-clients")
|
|
|
|
set(CPACK_COMPONENT_CLIENTS-TGZ_DISPLAY_NAME "foundationdb-clients")
|
|
|
|
set(CPACK_COMPONENT_CLIENTS-PM_DISPLAY_NAME "foundationdb-clients")
|
2020-10-29 02:55:15 +08:00
|
|
|
set(CPACK_COMPONENT_CLIENTS-VERSIONED_DISPLAY_NAME "foundationdb-clients-${PROJECT_VERSION}")
|
2019-03-02 06:13:16 +08:00
|
|
|
|
2019-03-01 06:05:24 +08:00
|
|
|
|
|
|
|
# MacOS needs a file exiension for the LICENSE file
|
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/LICENSE ${CMAKE_BINARY_DIR}/License.txt COPYONLY)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Filename of packages
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
if(NOT FDB_RELEASE)
|
2019-12-23 12:11:40 +08:00
|
|
|
if(CURRENT_GIT_VERSION)
|
|
|
|
set(git_string ".${CURRENT_GIT_VERSION}")
|
|
|
|
endif()
|
2019-12-23 18:42:02 +08:00
|
|
|
set(CPACK_RPM_PACKAGE_RELEASE 0)
|
|
|
|
set(prerelease_string "-0${git_string}.PRERELEASE")
|
|
|
|
else()
|
|
|
|
set(CPACK_RPM_PACKAGE_RELEASE 1)
|
|
|
|
set(prerelease_string "-1")
|
2018-05-06 00:43:50 +08:00
|
|
|
endif()
|
2019-12-12 14:18:05 +08:00
|
|
|
|
2019-12-17 06:40:40 +08:00
|
|
|
|
2019-12-12 14:18:05 +08:00
|
|
|
# RPM filenames
|
2019-12-23 18:42:02 +08:00
|
|
|
set(rpm-clients-filename "foundationdb-clients-${PROJECT_VERSION}${prerelease_string}")
|
|
|
|
set(rpm-server-filename "foundationdb-server-${PROJECT_VERSION}${prerelease_string}")
|
2019-12-12 14:18:05 +08:00
|
|
|
|
|
|
|
# Deb filenames
|
2019-12-23 18:42:02 +08:00
|
|
|
set(deb-clients-filename "foundationdb-clients_${PROJECT_VERSION}${prerelease_string}")
|
|
|
|
set(deb-server-filename "foundationdb-server_${PROJECT_VERSION}${prerelease_string}")
|
2018-05-06 00:43:50 +08:00
|
|
|
|
2018-05-06 06:33:21 +08:00
|
|
|
################################################################################
|
|
|
|
# Configuration for RPM
|
|
|
|
################################################################################
|
2019-02-11 14:51:40 +08:00
|
|
|
|
2019-03-02 06:13:16 +08:00
|
|
|
set(CPACK_RPM_PACKAGE_LICENSE "Apache 2.0")
|
|
|
|
|
|
|
|
set(CPACK_RPM_PACKAGE_NAME "foundationdb")
|
2019-03-02 07:21:21 +08:00
|
|
|
set(CPACK_RPM_CLIENTS-EL7_PACKAGE_NAME "foundationdb-clients")
|
|
|
|
set(CPACK_RPM_SERVER-EL7_PACKAGE_NAME "foundationdb-server")
|
2020-10-29 02:55:15 +08:00
|
|
|
set(CPACK_RPM_SERVER-VERSIONED_PACKAGE_NAME "foundationdb-server-${PROJECT_VERSION}")
|
2019-03-02 06:13:16 +08:00
|
|
|
|
2021-01-26 02:30:32 +08:00
|
|
|
set(CPACK_RPM_CLIENTS-EL7_FILE_NAME "${rpm-clients-filename}.el7.${CMAKE_SYSTEM_PROCESSOR}.rpm")
|
|
|
|
set(CPACK_RPM_CLIENTS-VERSIONED_FILE_NAME "${rpm-clients-filename}.versioned.${CMAKE_SYSTEM_PROCESSOR}.rpm")
|
|
|
|
set(CPACK_RPM_SERVER-EL7_FILE_NAME "${rpm-server-filename}.el7.${CMAKE_SYSTEM_PROCESSOR}.rpm")
|
|
|
|
set(CPACK_RPM_SERVER-VERSIONED_FILE_NAME "${rpm-server-filename}.versioned.${CMAKE_SYSTEM_PROCESSOR}.rpm")
|
2019-03-02 06:13:16 +08:00
|
|
|
|
2021-01-26 02:30:32 +08:00
|
|
|
set(CPACK_RPM_CLIENTS-EL7_DEBUGINFO_FILE_NAME "${rpm-clients-filename}.el7-debuginfo.${CMAKE_SYSTEM_PROCESSOR}.rpm")
|
|
|
|
set(CPACK_RPM_CLIENTS-VERSIONED_DEBUGINFO_FILE_NAME "${rpm-clients-filename}.versioned-debuginfo.${CMAKE_SYSTEM_PROCESSOR}.rpm")
|
|
|
|
set(CPACK_RPM_SERVER-EL7_DEBUGINFO_FILE_NAME "${rpm-server-filename}.el7-debuginfo.${CMAKE_SYSTEM_PROCESSOR}.rpm")
|
|
|
|
set(CPACK_RPM_SERVER-VERSIONED_DEBUGINFO_FILE_NAME "${rpm-server-filename}.versioned-debuginfo.${CMAKE_SYSTEM_PROCESSOR}.rpm")
|
2019-03-02 06:13:16 +08:00
|
|
|
|
2020-05-05 01:47:24 +08:00
|
|
|
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/packaging/emptydir")
|
|
|
|
fdb_install(DIRECTORY "${CMAKE_BINARY_DIR}/packaging/emptydir/" DESTINATION data COMPONENT server)
|
|
|
|
fdb_install(DIRECTORY "${CMAKE_BINARY_DIR}/packaging/emptydir/" DESTINATION log COMPONENT server)
|
|
|
|
fdb_install(DIRECTORY "${CMAKE_BINARY_DIR}/packaging/emptydir/" DESTINATION etc COMPONENT clients)
|
2018-05-06 06:33:21 +08:00
|
|
|
|
2019-03-02 06:13:16 +08:00
|
|
|
set(CPACK_RPM_SERVER-EL7_USER_FILELIST
|
2019-02-28 12:17:11 +08:00
|
|
|
"%config(noreplace) /etc/foundationdb/foundationdb.conf"
|
|
|
|
"%attr(0700,foundationdb,foundationdb) /var/log/foundationdb"
|
|
|
|
"%attr(0700, foundationdb, foundationdb) /var/lib/foundationdb")
|
2020-04-17 05:55:15 +08:00
|
|
|
set(CPACK_RPM_CLIENTS-EL7_USER_FILELIST "%dir /etc/foundationdb")
|
2019-02-28 12:17:11 +08:00
|
|
|
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
|
|
|
|
"/usr/sbin"
|
|
|
|
"/usr/share/java"
|
2020-10-29 02:55:15 +08:00
|
|
|
"/usr/lib"
|
2020-04-17 05:55:15 +08:00
|
|
|
"/usr/lib64/cmake"
|
|
|
|
"/etc/foundationdb"
|
|
|
|
"/usr/lib64/pkgconfig"
|
2019-02-28 12:17:11 +08:00
|
|
|
"/usr/lib64/python2.7"
|
|
|
|
"/usr/lib64/python2.7/site-packages"
|
|
|
|
"/var"
|
|
|
|
"/var/log"
|
|
|
|
"/var/lib"
|
|
|
|
"/lib"
|
|
|
|
"/lib/systemd"
|
|
|
|
"/lib/systemd/system"
|
|
|
|
"/etc/rc.d/init.d")
|
2020-04-23 07:29:28 +08:00
|
|
|
set(CPACK_RPM_DEBUGINFO_PACKAGE ${GENERATE_DEBUG_PACKAGES})
|
2020-10-29 02:55:15 +08:00
|
|
|
#set(CPACK_RPM_BUILD_SOURCE_FDB_INSTALL_DIRS_PREFIX /usr/src)
|
2019-02-28 12:17:11 +08:00
|
|
|
set(CPACK_RPM_COMPONENT_INSTALL ON)
|
|
|
|
|
|
|
|
set(CPACK_RPM_clients-el7_PRE_INSTALL_SCRIPT_FILE
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/rpm/scripts/preclients.sh)
|
|
|
|
|
2019-03-02 06:13:16 +08:00
|
|
|
set(CPACK_RPM_CLIENTS-EL7_POST_INSTALL_SCRIPT_FILE
|
2019-02-28 12:17:11 +08:00
|
|
|
${CMAKE_SOURCE_DIR}/packaging/rpm/scripts/postclients.sh)
|
|
|
|
|
2019-03-02 06:13:16 +08:00
|
|
|
set(CPACK_RPM_SERVER-EL7_PRE_INSTALL_SCRIPT_FILE
|
2019-02-28 12:17:11 +08:00
|
|
|
${CMAKE_SOURCE_DIR}/packaging/rpm/scripts/preserver.sh)
|
|
|
|
|
2019-03-02 06:13:16 +08:00
|
|
|
set(CPACK_RPM_SERVER-EL7_POST_INSTALL_SCRIPT_FILE
|
2019-02-28 12:17:11 +08:00
|
|
|
${CMAKE_SOURCE_DIR}/packaging/rpm/scripts/postserver.sh)
|
|
|
|
|
2019-03-02 06:13:16 +08:00
|
|
|
set(CPACK_RPM_SERVER-EL7_PRE_UNINSTALL_SCRIPT_FILE
|
2019-02-28 12:17:11 +08:00
|
|
|
${CMAKE_SOURCE_DIR}/packaging/rpm/scripts/preunserver.sh)
|
|
|
|
|
2019-03-02 06:13:16 +08:00
|
|
|
set(CPACK_RPM_SERVER-EL7_PACKAGE_REQUIRES
|
2019-03-02 08:02:51 +08:00
|
|
|
"foundationdb-clients = ${FDB_MAJOR}.${FDB_MINOR}.${FDB_PATCH}")
|
2020-10-29 04:03:48 +08:00
|
|
|
|
|
|
|
set(CPACK_RPM_SERVER-VERSIONED_POST_INSTALL_SCRIPT_FILE
|
|
|
|
${CMAKE_BINARY_DIR}/packaging/multiversion/server/postinst)
|
|
|
|
|
|
|
|
set(CPACK_RPM_SERVER-VERSIONED_PRE_UNINSTALL_SCRIPT_FILE
|
|
|
|
${CMAKE_BINARY_DIR}/packaging/multiversion/server/prerm)
|
|
|
|
|
|
|
|
set(CPACK_RPM_CLIENTS-VERSIONED_POST_INSTALL_SCRIPT_FILE
|
|
|
|
${CMAKE_BINARY_DIR}/packaging/multiversion/clients/postinst-el7)
|
|
|
|
|
|
|
|
set(CPACK_RPM_CLIENTS-VERSIONED_PRE_UNINSTALL_SCRIPT_FILE
|
|
|
|
${CMAKE_BINARY_DIR}/packaging/multiversion/clients/prerm)
|
2018-05-07 05:20:21 +08:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Configuration for DEB
|
|
|
|
################################################################################
|
|
|
|
|
2021-01-26 02:30:32 +08:00
|
|
|
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
|
|
|
|
set(CPACK_DEBIAN_CLIENTS-DEB_FILE_NAME "${deb-clients-filename}_amd64.deb")
|
|
|
|
set(CPACK_DEBIAN_SERVER-DEB_FILE_NAME "${deb-server-filename}_amd64.deb")
|
2021-03-11 06:42:17 +08:00
|
|
|
set(CPACK_DEBIAN_CLIENTS-VERSIONED_FILE_NAME "${deb-clients-filename}.versioned_amd64.deb")
|
|
|
|
set(CPACK_DEBIAN_SERVER-VERSIONED_FILE_NAME "${deb-server-filename}.versioned_amd64.deb")
|
2021-01-26 02:30:32 +08:00
|
|
|
else()
|
|
|
|
set(CPACK_DEBIAN_CLIENTS-DEB_FILE_NAME "${deb-clients-filename}_${CMAKE_SYSTEM_PROCESSOR}.deb")
|
|
|
|
set(CPACK_DEBIAN_SERVER-DEB_FILE_NAME "${deb-server-filename}_${CMAKE_SYSTEM_PROCESSOR}.deb")
|
2021-03-11 06:42:17 +08:00
|
|
|
set(CPACK_DEBIAN_CLIENTS-VERSIONED_FILE_NAME "${deb-clients-filename}.versioned_${CMAKE_SYSTEM_PROCESSOR}.deb")
|
|
|
|
set(CPACK_DEBIAN_SERVER-VERSIONED_FILE_NAME "${deb-server-filename}.versioned_${CMAKE_SYSTEM_PROCESSOR}.deb")
|
2021-01-26 02:30:32 +08:00
|
|
|
endif()
|
2021-03-03 03:41:21 +08:00
|
|
|
|
2019-02-28 12:17:11 +08:00
|
|
|
set(CPACK_DEB_COMPONENT_INSTALL ON)
|
2020-04-23 07:29:28 +08:00
|
|
|
set(CPACK_DEBIAN_DEBUGINFO_PACKAGE ${GENERATE_DEBUG_PACKAGES})
|
2019-02-28 12:17:11 +08:00
|
|
|
set(CPACK_DEBIAN_PACKAGE_SECTION "database")
|
|
|
|
set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS ON)
|
2018-05-07 05:20:21 +08:00
|
|
|
|
2019-03-02 06:13:16 +08:00
|
|
|
set(CPACK_DEBIAN_SERVER-DEB_PACKAGE_NAME "foundationdb-server")
|
|
|
|
set(CPACK_DEBIAN_CLIENTS-DEB_PACKAGE_NAME "foundationdb-clients")
|
2020-10-29 02:55:15 +08:00
|
|
|
set(CPACK_DEBIAN_SERVER-VERSIONED_PACKAGE_NAME "foundationdb-server-${PROJECT_VERSION}")
|
|
|
|
set(CPACK_DEBIAN_CLIENTS-VERSIONED_PACKAGE_NAME "foundationdb-clients-${PROJECT_VERSION}")
|
2019-03-02 06:13:16 +08:00
|
|
|
|
2019-03-19 01:24:01 +08:00
|
|
|
set(CPACK_DEBIAN_SERVER-DEB_PACKAGE_DEPENDS "adduser, libc6 (>= 2.12), foundationdb-clients (= ${FDB_VERSION})")
|
2019-03-20 00:51:52 +08:00
|
|
|
set(CPACK_DEBIAN_SERVER-DEB_PACKAGE_RECOMMENDS "python (>= 2.6)")
|
2019-02-28 12:17:11 +08:00
|
|
|
set(CPACK_DEBIAN_CLIENTS-DEB_PACKAGE_DEPENDS "adduser, libc6 (>= 2.12)")
|
|
|
|
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.foundationdb.org")
|
|
|
|
set(CPACK_DEBIAN_CLIENTS-DEB_PACKAGE_CONTROL_EXTRA
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/deb/DEBIAN-foundationdb-clients/postinst)
|
|
|
|
set(CPACK_DEBIAN_SERVER-DEB_PACKAGE_CONTROL_EXTRA
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/deb/DEBIAN-foundationdb-server/conffiles
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/deb/DEBIAN-foundationdb-server/preinst
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/deb/DEBIAN-foundationdb-server/postinst
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/deb/DEBIAN-foundationdb-server/prerm
|
|
|
|
${CMAKE_SOURCE_DIR}/packaging/deb/DEBIAN-foundationdb-server/postrm)
|
2018-05-06 00:43:50 +08:00
|
|
|
|
2020-10-29 04:03:48 +08:00
|
|
|
set(CPACK_DEBIAN_CLIENTS-VERSIONED_PACKAGE_CONTROL_EXTRA
|
|
|
|
${CMAKE_BINARY_DIR}/packaging/multiversion/clients/postinst
|
|
|
|
${CMAKE_BINARY_DIR}/packaging/multiversion/clients/prerm)
|
|
|
|
set(CPACK_DEBIAN_SERVER-VERSIONED_PACKAGE_CONTROL_EXTRA
|
|
|
|
${CMAKE_BINARY_DIR}/packaging/multiversion/server/postinst
|
|
|
|
${CMAKE_BINARY_DIR}/packaging/multiversion/server/prerm)
|
|
|
|
|
2019-02-08 07:10:32 +08:00
|
|
|
################################################################################
|
|
|
|
# MacOS configuration
|
|
|
|
################################################################################
|
|
|
|
|
2019-05-12 05:42:48 +08:00
|
|
|
if(APPLE)
|
2019-02-08 08:35:08 +08:00
|
|
|
install(PROGRAMS ${CMAKE_SOURCE_DIR}/packaging/osx/uninstall-FoundationDB.sh
|
|
|
|
DESTINATION "usr/local/foundationdb"
|
2019-02-28 12:17:11 +08:00
|
|
|
COMPONENT clients-pm)
|
2019-02-08 08:35:08 +08:00
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/packaging/osx/com.foundationdb.fdbmonitor.plist
|
|
|
|
DESTINATION "Library/LaunchDaemons"
|
2019-02-28 12:17:11 +08:00
|
|
|
COMPONENT server-pm)
|
2019-02-08 07:10:32 +08:00
|
|
|
endif()
|
|
|
|
|
2019-03-01 06:05:24 +08:00
|
|
|
################################################################################
|
|
|
|
# Configuration for DEB
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
|
2021-01-26 02:30:32 +08:00
|
|
|
set(CPACK_ARCHIVE_CLIENTS-TGZ_FILE_NAME "${deb-clients-filename}.${CMAKE_SYSTEM_PROCESSOR}")
|
|
|
|
set(CPACK_ARCHIVE_SERVER-TGZ_FILE_NAME "${deb-server-filename}.${CMAKE_SYSTEM_PROCESSOR}")
|
2019-03-01 06:05:24 +08:00
|
|
|
|
2018-05-06 03:08:39 +08:00
|
|
|
################################################################################
|
|
|
|
# Server configuration
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
string(RANDOM LENGTH 8 description1)
|
|
|
|
string(RANDOM LENGTH 8 description2)
|
|
|
|
set(CLUSTER_DESCRIPTION1 ${description1} CACHE STRING "Cluster description")
|
|
|
|
set(CLUSTER_DESCRIPTION2 ${description2} CACHE STRING "Cluster description")
|
|
|
|
|
2019-02-07 04:02:19 +08:00
|
|
|
if(NOT WIN32)
|
2019-02-28 12:17:11 +08:00
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/packaging/osx/foundationdb.conf.new
|
|
|
|
DESTINATION "usr/local/etc"
|
|
|
|
COMPONENT server-pm)
|
|
|
|
fdb_install(FILES ${CMAKE_SOURCE_DIR}/packaging/foundationdb.conf
|
|
|
|
DESTINATION etc
|
2019-02-07 04:02:19 +08:00
|
|
|
COMPONENT server)
|
2019-02-28 12:17:11 +08:00
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/packaging/make_public.py
|
|
|
|
DESTINATION "usr/lib/foundationdb"
|
|
|
|
COMPONENT server-deb)
|
2019-02-11 13:30:50 +08:00
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/packaging/rpm/foundationdb.service
|
|
|
|
DESTINATION "lib/systemd/system"
|
2019-02-28 12:17:11 +08:00
|
|
|
COMPONENT server-el7)
|
|
|
|
install(PROGRAMS ${CMAKE_SOURCE_DIR}/packaging/deb/foundationdb-init
|
|
|
|
DESTINATION "etc/init.d"
|
|
|
|
RENAME "foundationdb"
|
|
|
|
COMPONENT server-deb)
|
2020-10-29 04:14:58 +08:00
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/packaging/rpm/foundationdb.service
|
|
|
|
DESTINATION "usr/lib/foundationdb-${PROJECT_VERSION}/lib/systemd/system"
|
|
|
|
COMPONENT server-versioned)
|
|
|
|
install(PROGRAMS ${CMAKE_SOURCE_DIR}/packaging/deb/foundationdb-init
|
|
|
|
DESTINATION "usr/lib/foundationdb-${PROJECT_VERSION}/etc/init.d"
|
|
|
|
RENAME "foundationdb"
|
|
|
|
COMPONENT server-versioned)
|
2018-05-06 06:33:21 +08:00
|
|
|
endif()
|