make file changes
###############################################################################
################################### COMMANDS ##################################
###############################################################################
+# Check RedHat || CentOS
+$(eval PLATFORM_RH=$(shell (lsb_release -ds 2>/dev/null || cat /etc/*release 2>/dev/null | head -n1 || uname -om) | egrep '(Red Hat|CentOS)'))
+# Log Platform RedHat || CentOS
+$(if $(PLATFORM_RH), $(info Platform is $(PLATFORM_RH)))
+
MKDIR_PATH := mkdir -p
CD := cd
LN := ln -sf
CMAKE := cmake
PIP_USER_FLAG = --user
-PIP_INSTALL_REQUIREMENTS := pip3 install -Ir
+
USE_PIP_CACHE := no
+# For RedHat || CentOS we need rh-python36
+ifneq ("$(PLATFORM_RH)","")
+ PIP_INSTALL_REQUIREMENTS := source scl_source enable rh-python36 && pip3 install -Ir
+ PYTHON_BUILD_PACKAGE = source scl_source enable rh-python36 && python3 setup.py build -b ../$(PYTHON_BUILD_DIR)
+else
+ PIP_INSTALL_REQUIREMENTS := pip3 install -Ir
PYTHON_BUILD_PACKAGE = python3 setup.py build -b ../$(PYTHON_BUILD_DIR)
+endif
+
RM_DIR := rm -r
RM_FILE := rm
MAKE_INSTALL = $(MAKE) install
@@ -78,6 +91,7 @@ FOGLAMP_UPDATE_SRC := scripts/extras/foglamp_update
UPDATE_TASK_APT_SRC := scripts/extras/update_task.apt
UPDATE_TASK_SNAPPY_SRC := scripts/extras/update_task.snappy
SUDOERS_SRC := scripts/extras/foglamp.sudoers
+SUDOERS_SRC_RH := scripts/extras/foglamp.sudoers_rh
# SCRIPTS TO INSTALL IN SCRIPTS DIR
COMMON_SCRIPTS_SRC := scripts/common
@@ -397,7 +411,11 @@ bin_install : $(BIN_INSTALL_DIR) $(FOGBENCH_SCRIPT_SRC) $(FOGLAMP_SCRIPT_SRC)
$(CP) $(FOGLAMP_UPDATE_SRC) $(BIN_INSTALL_DIR)
$(CP) $(UPDATE_TASK_APT_SRC) $(BIN_INSTALL_DIR)
$(CP) $(UPDATE_TASK_SNAPPY_SRC) $(BIN_INSTALL_DIR)
+ifneq ("$(PLATFORM_RH)","")
+ $(CP) $(SUDOERS_SRC_RH) $(BIN_INSTALL_DIR)
+else
$(CP) $(SUDOERS_SRC) $(BIN_INSTALL_DIR)
+endif
# create bin install dir
$(BIN_INSTALL_DIR) :
