Build: Fix photon rpm creation
JIRA: MADLIB-1510
Creating RPMs on Photon 3 systems missed rpm scripts. This commit
ensures that it is treated like a redhat system and necessary scripts
are included in the metadata.
diff --git a/cmake/LinuxUtils.cmake b/cmake/LinuxUtils.cmake
index 9c12f7e..525df6e 100644
--- a/cmake/LinuxUtils.cmake
+++ b/cmake/LinuxUtils.cmake
@@ -8,19 +8,15 @@
else(EXISTS "/etc/redhat-release")
set(${OUT_VERSION} "${OUT_VERSION}-NOTFOUND")
endif(EXISTS "/etc/redhat-release")
-endmacro(rh_version)
-# Get the Photon OS version
-macro(ph_version OUT_VERSION)
if(EXISTS "/etc/photon-release")
file(READ "/etc/photon-release" _PHOTON_RELEASE_CONTENT)
- string(REGEX REPLACE "[^0-9.]*([0-9.]+)[^0-9.]*\$" "\\1" ${OUT_VERSION}
+ string(REGEX REPLACE "VMware Photon OS ([0-9.]+)[0-9.]*$" "\\1"
+ ${OUT_VERSION}
"${_PHOTON_RELEASE_CONTENT}"
)
- else(EXISTS "/etc/photon-release")
- set(${OUT_VERSION} "${OUT_VERSION}-NOTFOUND")
endif(EXISTS "/etc/photon-release")
-endmacro(ph_version)
+endmacro(rh_version)
# Get the Debian version
# DEB_OUT_VERSION will have a number if /etc/issue exists, with an entry for Debian.
diff --git a/deploy/CMakeLists.txt b/deploy/CMakeLists.txt
index 831985d..e727e92 100644
--- a/deploy/CMakeLists.txt
+++ b/deploy/CMakeLists.txt
@@ -18,21 +18,12 @@
if(RH_VERSION AND NOT (RH_VERSION STREQUAL "RH_VERSION-NOTFOUND"))
set(IS_REDHAT "True")
endif()
- ph_version(PH_VERSION)
- if(PH_VERSION AND NOT (PH_VERSION STREQUAL "PH_VERSION-NOTFOUND"))
- set(IS_PHOTON "True")
- endif()
if(IS_REDHAT)
message(STATUS "Detected RH version ${RH_VERSION}")
list(APPEND CPACK_GENERATOR
RPM
)
- elseif(IS_PHOTON)
- message(STATUS "Detected Photon version ${PH_VERSION}")
- list(APPEND CPACK_GENERATOR
- RPM
- )
elseif(IS_DEBIAN)
message(STATUS "Detected Debian version ${DEB_VERSION}")
# By default, the cmake flag -DCREATE_RPM_FOR_UBUNTU is not
diff --git a/deploy/RPM/CMakeLists.txt b/deploy/RPM/CMakeLists.txt
index 88254c5..da31da2 100644
--- a/deploy/RPM/CMakeLists.txt
+++ b/deploy/RPM/CMakeLists.txt
@@ -8,7 +8,6 @@
# Get information about the environment
rh_version(RH_VERSION)
-ph_version(PH_VERSION)
# -- Set RPM-specific variables ------------------------------------------------
@@ -18,9 +17,7 @@
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local/madlib/Versions/${MADLIB_VERSION_STRING}" PARENT_SCOPE)
set(_PACKAGE_REQUIRES "m4 >= 1.4")
-if(PH_VERSION)
- set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.6, ${_PACKAGE_REQUIRES}" PARENT_SCOPE)
-elseif(RH_VERSION AND RH_VERSION VERSION_LESS "6.0")
+if(RH_VERSION AND RH_VERSION VERSION_LESS "6.0")
# on RH/CentOS 5, there is no Python 2.6 or higher in the default
# repositories.
set(CPACK_RPM_PACKAGE_REQUIRES "python, ${_PACKAGE_REQUIRES}" PARENT_SCOPE)