未验证 提交 8cd0fc3d 编写于 作者: C Ciju John 提交者: GitHub

Merge branch 'release/1.1' into tests-sys-info-2

......@@ -246,54 +246,88 @@
fi
printf "\\n\\tChecking MongoDB C++ driver installation.\\n"
if [ ! -e "/usr/local/lib/libmongocxx-static.a" ]; then
printf "\\n\\tInstalling MongoDB C & C++ drivers.\\n"
MONGO_INSTALL=true
if [ -e "/usr/local/lib/libmongocxx-static.a" ]; then
MONGO_INSTALL=false
if ! version=$( grep "Version:" /usr/local/lib/pkgconfig/libmongocxx-static.pc | tr -s ' ' | awk '{print $2}' )
then
printf "\\tUnable to determine mongodb-cxx-driver version.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
maj=$( echo "${version}" | cut -d'.' -f1 )
min=$( echo "${version}" | cut -d'.' -f2 )
if [ "${maj}" -gt 3 ]; then
MONGO_INSTALL=true
elif [ "${maj}" -eq 3 ] && [ "${min}" -lt 3 ]; then
MONGO_INSTALL=true
fi
fi
if [ $MONGO_INSTALL == "true" ]; then
if ! cd "${TEMP_DIR}"
then
printf "\\tUnable to enter directory %s.\\n" "${TEMP_DIR}"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
STATUS=$(curl -LO -w '%{http_code}' --connect-timeout 30 https://github.com/mongodb/mongo-c-driver/releases/download/1.9.3/mongo-c-driver-1.9.3.tar.gz)
STATUS=$( curl -LO -w '%{http_code}' --connect-timeout 30 https://github.com/mongodb/mongo-c-driver/releases/download/1.10.2/mongo-c-driver-1.10.2.tar.gz )
if [ "${STATUS}" -ne 200 ]; then
rm -f "${TEMP_DIR}/mongo-c-driver-1.9.3.tar.gz" 2>/dev/null
if ! rm -f "${TEMP_DIR}/mongo-c-driver-1.10.2.tar.gz"
then
printf "\\tUnable to remove file %s/mongo-c-driver-1.10.2.tar.gz.\\n" "${TEMP_DIR}"
fi
printf "\\tUnable to download MongoDB C driver at this time.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! tar xf "${TEMP_DIR}/mongo-c-driver-1.9.3.tar.gz"
if ! tar xf mongo-c-driver-1.10.2.tar.gz
then
printf "\\tUnable to unarchive file %s/mongo-c-driver-1.9.3.tar.gz.\\n" "${TEMP_DIR}"
printf "\\tUnable to unarchive file %s/mongo-c-driver-1.10.2.tar.gz.\\n" "${TEMP_DIR}"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! rm -f "${TEMP_DIR}/mongo-c-driver-1.9.3.tar.gz"
if ! rm -f "${TEMP_DIR}/mongo-c-driver-1.10.2.tar.gz"
then
printf "\\tUnable to remove file %s/mongo-c-driver-1.9.3.tar.gz.\\n" "${TEMP_DIR}"
printf "\\tUnable to remove file mongo-c-driver-1.10.2.tar.gz.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! cd "${TEMP_DIR}/mongo-c-driver-1.9.3"
if ! cd "${TEMP_DIR}"/mongo-c-driver-1.10.2
then
printf "\\tUnable to enter directory %s/mongo-c-driver-1.9.3.\\n" "${TEMP_DIR}"
printf "\\tUnable to cd into directory %s/mongo-c-driver-1.10.2.\\n" "${TEMP_DIR}"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! ./configure --enable-static --with-libbson=bundled --enable-ssl=openssl --disable-automatic-init-and-cleanup --prefix=/usr/local
if ! mkdir cmake-build
then
printf "\\tConfiguring MongoDB C driver has exited with the errors above.\\n"
printf "\\tUnable to create directory %s/mongo-c-driver-1.10.2/cmake-build.\\n" "${TEMP_DIR}"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! make -j"${JOBS}"
if ! cd cmake-build
then
printf "\\tMakecompiling MongoDB C driver has exited with the above error.\\n"
printf "\\tUnable to enter directory %s/mongo-c-driver-1.10.2/cmake-build.\\n" "${TEMP_DIR}"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BSON=ON \
-DENABLE_SSL=OPENSSL -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_STATIC=ON ..
then
printf "\\tConfiguring MongoDB C driver has encountered the errors above.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! make -j"${CPU_CORE}"
then
printf "\\tError compiling MongoDB C driver.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! sudo make install
then
printf "\\tInstalling MongoDB C driver has exited with the above error.\\nMake sure you have sudo privileges.\\n"
printf "\\tError installing MongoDB C driver.\\nMake sure you have sudo privileges.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
......@@ -303,13 +337,13 @@
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! rm -rf "${TEMP_DIR}/mongo-c-driver-1.9.3"
if ! rm -rf "${TEMP_DIR}/mongo-c-driver-1.10.2"
then
printf "\\tUnable to remove directory %s/mongo-c-driver-1.9.3.\\n" "${TEMP_DIR}"
printf "\\tUnable to remove directory %s/mongo-c-driver-1.10.2.\\n" "${TEMP_DIR}"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! git clone https://github.com/mongodb/mongo-cxx-driver.git --branch releases/v3.2 --depth 1
if ! git clone https://github.com/mongodb/mongo-cxx-driver.git --branch releases/v3.3 --depth 1
then
printf "\\tUnable to clone MongoDB C++ driver at this time.\\n"
printf "\\tExiting now.\\n\\n"
......@@ -327,9 +361,9 @@
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! sudo make -j"${JOBS}"
if ! sudo make -j"${CPU_CORE}"
then
printf "\\tMaking MongoDB C++ driver has exited with the above errors.\\n"
printf "\\tError compiling MongoDB C++ driver.\\n"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
......@@ -339,21 +373,21 @@
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! cd "${CWD}"
if ! cd "${TEMP_DIR}"
then
printf "\\tUnable to enter directory %s.\\n" "${CWD}"
printf "\\tUnable to enter directory %s.\\n" "${TEMP_DIR}"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
if ! sudo rm -rf "${TEMP_DIR}/mongo-cxx-driver"
then
printf "\\tUnable to remove directory %s/mongo-cxx-driver.\\n" "${TEMP_DIR}"
printf "\\tUnable to remove directory %s/mongo-cxx-driver.\\n" "${TEMP_DIR}" "${TEMP_DIR}"
printf "\\tExiting now.\\n\\n"
exit 1;
fi
printf "\\n\\tMongo C++ driver successfully installed @ /usr/local/lib.\\n\\n"
printf "\\tMongo C++ driver installed at /usr/local/lib/libmongocxx-static.a.\\n"
else
printf "\\tMongo C++ driver found /usr/local/lib.\\n"
printf "\\tMongo C++ driver found at /usr/local/lib/libmongocxx-static.a.\\n"
fi
printf "\\n\\tChecking secp256k1-zkp installation.\\n"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册