2323# Description: Configures Apache Cloudberry build environment and runs
2424# ./configure with optimized settings. Performs the
2525# following:
26- # 1. Prepares /usr/local/cloudberry-db directory
26+ # 1. Prepares ${BUILD_DESTINATION} directory
2727# 2. Sets up library dependencies
2828# 3. Configures build with required features enabled
2929#
@@ -101,25 +101,26 @@ export LOG_DIR="${SRC_DIR}/build-logs"
101101CONFIGURE_LOG=" ${LOG_DIR} /configure.log"
102102
103103# Initialize environment
104- init_environment " Cloudberry Configure Script" " ${CONFIGURE_LOG} "
104+ init_environment " Cloudberry Configure Script" " ${CONFIGURE_LOG} " " ${BUILD_DESTINATION} "
105105
106106# Initial setup
107107log_section " Initial Setup"
108- execute_cmd sudo rm -rf /usr/local/cloudberry-db || exit 2
108+ execute_cmd sudo rm -rf ${BUILD_DESTINATION} / * || exit 2
109109execute_cmd sudo chmod a+w /usr/local || exit 2
110- execute_cmd mkdir -p /usr/local/cloudberry-db/lib || exit 2
110+
111+ execute_cmd sudo mkdir -p ${BUILD_DESTINATION} /lib || exit 2
111112if [[ " $OS_ID " == " rocky" && " $OS_VERSION " =~ ^(8| 9) ]]; then
112113 execute_cmd sudo cp /usr/local/xerces-c/lib/libxerces-c.so \
113114 /usr/local/xerces-c/lib/libxerces-c-3.3.so \
114115 /usr/local/cloudberry-db/lib || exit 3
115116fi
117+ execute_cmd sudo chown -R gpadmin:gpadmin ${BUILD_DESTINATION} || exit 2
116118
117- execute_cmd sudo chown -R gpadmin:gpadmin /usr/local/cloudberry-db || exit 2
118119log_section_end " Initial Setup"
119120
120121# Set environment
121122log_section " Environment Setup"
122- export LD_LIBRARY_PATH=/usr/local/cloudberry-db /lib:LD_LIBRARY_PATH
123+ export LD_LIBRARY_PATH=${BUILD_DESTINATION} /lib:LD_LIBRARY_PATH
123124log_section_end " Environment Setup"
124125
125126# Add debug options if ENABLE_DEBUG is set to "true"
133134
134135# Configure build
135136log_section " Configure"
136- execute_cmd ./configure --prefix=/usr/local/cloudberry-db \
137+ execute_cmd ./configure --prefix=${BUILD_DESTINATION} \
137138 --disable-external-fts \
138139 --enable-gpcloud \
139140 --enable-ic-proxy \
@@ -158,7 +159,7 @@ execute_cmd ./configure --prefix=/usr/local/cloudberry-db \
158159 --with-openssl \
159160 --with-uuid=e2fs \
160161 --with-includes=/usr/local/xerces-c/include \
161- --with-libraries=/usr/local/cloudberry-db /lib || exit 4
162+ --with-libraries=${BUILD_DESTINATION} /lib || exit 4
162163log_section_end " Configure"
163164
164165# Capture version information
0 commit comments