blob: f23967e3290a8017fb3d574baf79db767272220f [file] [log] [blame]
# ------------------------------------------------------------------------------
# Packaging for Greenplum's gppkg
# ------------------------------------------------------------------------------
set(MADLIB_GPPKG_VERSION "1.3")
set(MADLIB_GPPKG_RELEASE_NUMBER 1)
set(MADLIB_GPPKG_RPM_SOURCE_DIR
"${CMAKE_BINARY_DIR}/_CPack_Packages/Linux/RPM/${CPACK_PACKAGE_FILE_NAME}"
)
# gppkg expects that the file name for the RPM from which the gppkg is generated
# follows the pattern "<name>-<version>-<release>.<arch>.rpm". Otherwise,
# uninstallation will not work (MPP-18078). Note that <version> has to be
# consistent with the version in madlib.spec.in. gppkg deduces the
# uninstallation command line options from the filename!
set(MADLIB_GPPKG_RPM_FILE_NAME
"madlib-${MADLIB_VERSION_STRING}-${MADLIB_GPPKG_RELEASE_NUMBER}.${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
find_program(
GPPKG_BINARY
gppkg
PATH /usr/local/greenplum-db/bin
DOC "Path to Greenplum gppkg"
)
find_program(
RPMBUILD_BINARY
rpmbuild
DOC "Path to rpmbuild"
)
file(READ "${CPACK_PACKAGE_DESCRIPTION_FILE}" CPACK_RPM_PACKAGE_DESCRIPTION)
# The target gppkg is a meta target that depends on all version-specific
# gppkg targets
add_custom_target(gppkg
COMMENT "Generating all Greenplum gppkg installers"
)
# We now run generated files, one for each Greenplum version
file(GLOB GPPKG_VERSIONS "${CMAKE_CURRENT_BINARY_DIR}/Version_*.cmake")
foreach(GPPKG_VERSION ${GPPKG_VERSIONS})
include("${GPPKG_VERSION}")
endforeach(GPPKG_VERSION)