Add support for building el6 and el7 RPM packages by default using single cpack command

This commit is contained in:
Alvin Moore 2019-12-16 00:13:17 -08:00
parent 0c4c93a041
commit bc339414f5
2 changed files with 14 additions and 7 deletions

View File

@ -1,10 +1,16 @@
# RPM specifics
if(CPACK_GENERATOR MATCHES "RPM")
set(GENERATE_EL6 TRUE)
set(GENERATE_EL7 TRUE)
set(CPACK_PACKAGING_INSTALL_PREFIX "/")
if(GENERATE_EL6)
set(CPACK_COMPONENTS_ALL clients-el6 server-el6)
if(GENERATE_EL7)
if(GENERATE_EL6)
set(CPACK_COMPONENTS_ALL clients-el6 server-el6 clients-el7 server-el7)
else()
set(CPACK_COMPONENTS_ALL clients-el7 server-el7)
endif()
else()
set(CPACK_COMPONENTS_ALL clients-el7 server-el7)
set(CPACK_COMPONENTS_ALL clients-el6 server-el6)
endif()
set(CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/README.md)
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE)

View File

@ -284,10 +284,11 @@ set(deb-server-filename "foundationdb-server_${PROJECT_VERSION}-0.${CURRENT_GIT_
set(CPACK_RPM_PACKAGE_LICENSE "Apache 2.0")
set(CPACK_RPM_PACKAGE_NAME "foundationdb")
set(CPACK_RPM_CLIENTS-EL6_PACKAGE_NAME "foundationdb-clients")
set(CPACK_RPM_CLIENTS-EL7_PACKAGE_NAME "foundationdb-clients")
set(CPACK_RPM_SERVER-EL6_PACKAGE_NAME "foundationdb-server")
set(CPACK_RPM_SERVER-EL7_PACKAGE_NAME "foundationdb-server")
set(CPACK_RPM_CLIENTS-EL6_PACKAGE_NAME "foundationdb-clients-el6")
set(CPACK_RPM_CLIENTS-EL7_PACKAGE_NAME "foundationdb-clients-el7")
set(CPACK_RPM_SERVER-EL6_PACKAGE_NAME "foundationdb-server-el6")
set(CPACK_RPM_SERVER-EL7_PACKAGE_NAME "foundationdb-server-el7")
set(CPACK_RPM_CLIENTS-EL6_FILE_NAME "${rpm-clients-filename}.el6.x86_64.rpm")
set(CPACK_RPM_CLIENTS-EL7_FILE_NAME "${rpm-clients-filename}.el7.x86_64.rpm")