Repository: madlib Updated Branches: refs/heads/master 1d25d71fd -> 5ab573bec
Ubuntu support: Enable creation of gppkg on Ubuntu This commit makes necessary changes to create a gppkg on Ubuntu. The default behavior when MADlib is built on Ubuntu is to create a .deb installer. If we want to create a gppkg, then we need an RPM due to limitations in gppkg. We now create an RPM on Ubuntu (assuming package alien is installed on Ubuntu) if the right cmake flag is specified. Once an RPM is created on `make package`, we can now go ahead and create the gppkg using `make gppkg`. The cmake flag to use if we want to create an .rpm instead of .deb on Ubuntu when we run `make package` is: -DCREATE_RPM_FOR_UBUNTU=True Closes #314 Co-authored-by: Orhan Kislal <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/madlib/repo Commit: http://git-wip-us.apache.org/repos/asf/madlib/commit/5ab573be Tree: http://git-wip-us.apache.org/repos/asf/madlib/tree/5ab573be Diff: http://git-wip-us.apache.org/repos/asf/madlib/diff/5ab573be Branch: refs/heads/master Commit: 5ab573becbd1e8aba1d099305cce348a9726f91f Parents: 1d25d71 Author: Nandish Jayaram <[email protected]> Authored: Mon Aug 6 15:19:18 2018 -0700 Committer: Nandish Jayaram <[email protected]> Committed: Mon Aug 27 13:53:04 2018 -0700 ---------------------------------------------------------------------- ReadMe_Build.txt | 5 +++++ deploy/CMakeLists.txt | 31 ++++++++++++++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/madlib/blob/5ab573be/ReadMe_Build.txt ---------------------------------------------------------------------- diff --git a/ReadMe_Build.txt b/ReadMe_Build.txt index 8f63b8a..2e7b885 100644 --- a/ReadMe_Build.txt +++ b/ReadMe_Build.txt @@ -173,6 +173,11 @@ root directory) for more options, after having run `cmake` the first time. with `-DPYXB_TAR_SOURCE=/path/to/pyxb_x.tar.gz`, in which case this tarball is used. +- `CREATE_RPM_FOR_UBUNTU` (default: *empty*) + + By default, we create a .deb madlib installer on Ubuntu. If this + flag is set to 'True', we will create an RPM instead. Note that + package alien must be installed for this to work. Debugging ========= http://git-wip-us.apache.org/repos/asf/madlib/blob/5ab573be/deploy/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/deploy/CMakeLists.txt b/deploy/CMakeLists.txt index 8c8dd95..d25839a 100644 --- a/deploy/CMakeLists.txt +++ b/deploy/CMakeLists.txt @@ -10,12 +10,11 @@ if(APPLE) PackageMaker ) elseif(UNIX) - debian_version(DEB_VERSION) if(DEB_VERSION AND NOT (DEB_VERSION STREQUAL "DEB_VERSION-NOTFOUND")) set(IS_DEBIAN "True") endif() - rh_version(IS_REDHAT) + rh_version(RH_VERSION) if(RH_VERSION AND NOT (RH_VERSION STREQUAL "RH_VERSION-NOTFOUND")) set(IS_REDHAT "True") endif() @@ -27,9 +26,25 @@ elseif(UNIX) ) elseif(IS_DEBIAN) message(STATUS "Detected Debian version ${DEB_VERSION}") - list(APPEND CPACK_GENERATOR - DEB - ) + # By default, the cmake flag -DCREATE_RPM_FOR_UBUNTU is not + # set to any value. The default behavior is to create a .deb + # artifact when MADlib is compiled on Ubuntu. + # If we instead want to create an RPM artifact for MADlib + # on Ubuntu, then the cmake flag -DCREATE_RPM_FOR_UBUNTU can + # be set to some value (say True), and we will only create + # an RPM artifact on Ubuntu (i.e., we create an rpm instead + # of the default .deb). + # Note that package alien must already be installed for + # building an RPM on Ubuntu. + if(CREATE_RPM_FOR_UBUNTU) + list(APPEND CPACK_GENERATOR + RPM + ) + else(CREATE_RPM_FOR_UBUNTU) + list(APPEND CPACK_GENERATOR + DEB + ) + endif(CREATE_RPM_FOR_UBUNTU) endif() endif() @@ -78,8 +93,10 @@ if(IS_REDHAT) set(CPACK_POSTFLIGHT_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/postflight.sh) set(CPACK_MONOLITHIC_INSTALL 1) elseif(IS_DEBIAN) - set(CPACK_PACKAGE_FILE_NAME - "madlib${_PACKAGE_SUFFIX}-${MADLIB_VERSION_STRING}-${CMAKE_SYSTEM_NAME}") + if(NOT CREATE_RPM_FOR_UBUNTU) + set(CPACK_PACKAGE_FILE_NAME + "madlib${_PACKAGE_SUFFIX}-${MADLIB_VERSION_STRING}-${CMAKE_SYSTEM_NAME}") + endif(NOT CREATE_RPM_FOR_UBUNTU) set(CPACK_PACKAGE_VERSION ${MADLIB_VERSION_STRING}) set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/DEB/config;${CMAKE_CURRENT_SOURCE_DIR}/DEB/templates;${CMAKE_CURRENT_SOURCE_DIR}/DEB/preinst;${CMAKE_CURRENT_SOURCE_DIR}/DEB/postinst;${CMAKE_CURRENT_SOURCE_DIR}/DEB/postrm") endif()
