diff --git a/packaging/clean_env.sh b/packaging/clean_env.sh new file mode 100755 index 0000000000000000000000000000000000000000..a889064693a04807e4f5b26109424763974b4779 --- /dev/null +++ b/packaging/clean_env.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +CUR_DIR=$(pwd) +SHELL_DIR=$(dirname $(readlink -f "$0")) +ENTERPRISE_DIR=$SHELL_DIR/../.. +COMMUNITY_DIR=$SHELL_DIR/.. +TOOLS_DIR=$COMMUNITY_DIR/src/kit/taos-tools + +cd $ENTERPRISE_DIR +git checkout -- . +if [[ -e enterprise/src/plugins/taosainternal/taosadapter ]]; then + rm -f enterprise/src/plugins/taosainternal/taosadapter +fi +if [[ -e enterprise/src/plugins/taosainternal/upx.tar.xz ]]; then + rm -f enterprise/src/plugins/taosainternal/upx.tar.xz +fi + +cd $COMMUNITY_DIR +git checkout -- . + +cd $TOOLS_DIR +git checkout -- . +if [[ -e packaging/tools/install-khtools.sh ]]; then + rm -f packaging/tools/install-khtools.sh +fi +if [[ -e packaging/tools/uninstall-khtools.sh ]]; then + rm -f packaging/tools/uninstall-khtools.sh +fi + +rm -rf $COMMUNITY_DIR/debug/* +rm -rf $COMMUNITY_DIR/release/* + +cd $CUR_DIR diff --git a/packaging/sed_kh.bat b/packaging/sed_kh.bat index 1be0229d0496096de09060f9c37342b3d086baa8..0429226bc159e12d397c743a413a38d13690886a 100644 --- a/packaging/sed_kh.bat +++ b/packaging/sed_kh.bat @@ -6,7 +6,7 @@ set community_dir=%1 %sed% -i "s/taos\.cfg/kinghistorian\.cfg/g" %community_dir%\cmake\install.inc %sed% -i "s/taos\.exe/khclient\.exe/g" %community_dir%\cmake\install.inc %sed% -i "s/taosdemo\.exe/khdemo\.exe/g" %community_dir%\cmake\install.inc -%sed% -i "/src\/connector/d" %community_dir%\cmake\install.inc +%sed% -i "/connector/d" %community_dir%\cmake\install.inc %sed% -i "/tests\/examples/d" %community_dir%\cmake\install.inc ::src\kit\shell\CMakeLists.txt %sed% -i "s/OUTPUT_NAME taos/OUTPUT_NAME khclient/g" %community_dir%\src\kit\shell\CMakeLists.txt diff --git a/packaging/sed_kh.sh b/packaging/sed_kh.sh index 0d98946f97d832b51913a0f564f29af11b71ed6f..94c1bdc85a8176a5eccf4acf4be7b3e1562c86c4 100755 --- a/packaging/sed_kh.sh +++ b/packaging/sed_kh.sh @@ -71,15 +71,10 @@ function replace_community_kh() { sed -i "s/etc\/taos/etc\/kinghistorian/g" ${top_dir}/src/os/src/linux/linuxEnv.c sed -i "s/lib\/taos/lib\/kinghistorian/g" ${top_dir}/src/os/src/linux/linuxEnv.c sed -i "s/log\/taos/log\/kinghistorian/g" ${top_dir}/src/os/src/linux/linuxEnv.c + # src/kit/shell/src/shellDarwin.c sed -i "s/TDengine shell/KingHistorian shell/g" ${top_dir}/src/kit/shell/src/shellDarwin.c sed -i "s/2020 by TAOS Data/2021 by Wellintech/g" ${top_dir}/src/kit/shell/src/shellDarwin.c - # src/kit/shell/src/shellLinux.c - sed -i "s/support@taosdata\.com/support@wellintech\.com/g" ${top_dir}/src/kit/shell/src/shellLinux.c - sed -i "s/TDengine shell/KingHistorian shell/g" ${top_dir}/src/kit/shell/src/shellLinux.c - sed -i "s/2020 by TAOS Data/2021 by Wellintech/g" ${top_dir}/src/kit/shell/src/shellLinux.c - # src/os/src/windows/wEnv.c - sed -i "s/C:\/TDengine/C:\/KingHistorian/g" ${top_dir}/src/os/src/windows/wEnv.c # src/kit/shell/src/shellEngine.c sed -i "s/TDengine shell/KingHistorian shell/g" ${top_dir}/src/kit/shell/src/shellEngine.c sed -i "s/2020 by TAOS Data, Inc/2021 by Wellintech, Inc/g" ${top_dir}/src/kit/shell/src/shellEngine.c @@ -87,6 +82,17 @@ function replace_community_kh() { sed -i "s/\"taos> \"/\"khclient> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c sed -i "s/\" -> \"/\" -> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c sed -i "s/prompt_size = 6/prompt_size = 10/g" ${top_dir}/src/kit/shell/src/shellEngine.c + # src/kit/shell/src/shellImport.c + sed -i "s/TDengine/KingHistorian/g" ${top_dir}/src/kit/shell/src/shellImport.c + # src/kit/shell/src/shellLinux.c + sed -i "s/support@taosdata\.com/support@wellintech\.com/g" ${top_dir}/src/kit/shell/src/shellLinux.c + sed -i "s/TDengine/KingHistorian/g" ${top_dir}/src/kit/shell/src/shellLinux.c + sed -i "s/2020 by TAOS Data/2021 by Wellintech/g" ${top_dir}/src/kit/shell/src/shellLinux.c + # src/kit/shell/src/shellMain.c + sed -i "s/TDengine/KingHistorian/g" ${top_dir}/src/kit/shell/src/shellMain.c + + # src/os/src/windows/wEnv.c + sed -i "s/C:\/TDengine/C:\/KingHistorian/g" ${top_dir}/src/os/src/windows/wEnv.c # src/rpc/src/rpcMain.c sed -i "s/taos connections/kh connections/g" ${top_dir}/src/rpc/src/rpcMain.c # src/plugins/monitor/src/monMain.c @@ -133,6 +139,7 @@ function replace_community_kh() { sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/kinghistorian\"/g" ${top_dir}/packaging/tools/install.sh sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/kinghistorian\"/g" ${top_dir}/packaging/tools/install.sh sed -i "s/adapterName=\"taosadapter\"/adapterName=\"khadapter\"/g" ${top_dir}/packaging/tools/install.sh + sed -i "s/\${csudo}mkdir -p \${install_main_dir}\/examples/#\${csudo}mkdir -p \${install_main_dir}\/examples/g" ${top_dir}/packaging/tools/install.sh # packaging/tools/makeclient.sh sed -i "s/productName=\"TDengine\"/productName=\"KingHistorian\"/g" ${top_dir}/packaging/tools/makeclient.sh diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index 2c9d3e4c1e321a69a89be6d8d11a5763a3cca699..bdacf7c8aa348dc3ef68b3d585dbd2015b076da5 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -171,11 +171,11 @@ function install_main_path() { ${csudo}mkdir -p ${install_main_dir} ${csudo}mkdir -p ${install_main_dir}/cfg ${csudo}mkdir -p ${install_main_dir}/bin -# ${csudo}mkdir -p ${install_main_dir}/connector + # ${csudo}mkdir -p ${install_main_dir}/connector ${csudo}mkdir -p ${install_main_dir}/driver ${csudo}mkdir -p ${install_main_dir}/examples ${csudo}mkdir -p ${install_main_dir}/include -# ${csudo}mkdir -p ${install_main_dir}/init.d + # ${csudo}mkdir -p ${install_main_dir}/init.d if [ "$verMode" == "cluster" ]; then ${csudo}mkdir -p ${nginx_dir} fi @@ -193,7 +193,7 @@ function install_bin() { ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || : ${csudo}rm -f ${bin_link_dir}/tarbitrator || : ${csudo}rm -f ${bin_link_dir}/set_core || : - ${csudo}rm -f ${bin_link_dir}/run_taosd_and_${adapterName}.sh || : + ${csudo}rm -f ${bin_link_dir}/run_${serverName}_and_${adapterName}.sh || : ${csudo}cp -r ${script_dir}/bin/* ${install_main_dir}/bin && ${csudo}chmod 0555 ${install_main_dir}/bin/* @@ -203,7 +203,7 @@ function install_bin() { [ -x ${install_main_dir}/bin/${adapterName} ] && ${csudo}ln -s ${install_main_dir}/bin/${adapterName} ${bin_link_dir}/${adapterName} || : [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript} || : [ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || : - [ -x ${install_main_dir}/bin/run_taosd_and_${adapterName}.sh ] && ${csudo}ln -s ${install_main_dir}/bin/run_taosd_and_${adapterName}.sh ${bin_link_dir}/run_taosd_and_${adapterName}.sh || : + [ -x ${install_main_dir}/bin/run_${serverName}_and_${adapterName}.sh ] && ${csudo}ln -s ${install_main_dir}/bin/run_${serverName}_and_${adapterName}.sh ${bin_link_dir}/run_${serverName}_and_${adapterName}.sh || : [ -x ${install_main_dir}/bin/tarbitrator ] && ${csudo}ln -s ${install_main_dir}/bin/tarbitrator ${bin_link_dir}/tarbitrator || : if [ "$verMode" == "cluster" ]; then @@ -460,7 +460,7 @@ function local_fqdn_check() { fi } -function install_taosadapter_config() { +function install_adapter_config() { if [ ! -f "${cfg_install_dir}/${adapterName}.toml" ]; then ${csudo}mkdir -p ${cfg_install_dir} [ -f ${script_dir}/cfg/${adapterName}.toml ] && ${csudo}cp ${script_dir}/cfg/${adapterName}.toml ${cfg_install_dir} @@ -500,7 +500,6 @@ function install_config() { local_fqdn_check - # first full-qualified domain name (FQDN) for TDengine cluster system echo echo -e -n "${GREEN}Enter FQDN:port (like h1.${emailName}:6030) of an existing ${productName} cluster node to join${NC}" echo @@ -598,14 +597,14 @@ function install_service_on_sysvinit() { sleep 1 if ((${os_type} == 1)); then -# ${csudo}cp -f ${script_dir}/init.d/${serverName}.deb ${install_main_dir}/init.d/${serverName} + # ${csudo}cp -f ${script_dir}/init.d/${serverName}.deb ${install_main_dir}/init.d/${serverName} ${csudo}cp ${script_dir}/init.d/${serverName}.deb ${service_config_dir}/${serverName} && ${csudo}chmod a+x ${service_config_dir}/${serverName} -# ${csudo}cp -f ${script_dir}/init.d/tarbitratord.deb ${install_main_dir}/init.d/tarbitratord + # ${csudo}cp -f ${script_dir}/init.d/tarbitratord.deb ${install_main_dir}/init.d/tarbitratord ${csudo}cp ${script_dir}/init.d/tarbitratord.deb ${service_config_dir}/tarbitratord && ${csudo}chmod a+x ${service_config_dir}/tarbitratord elif ((${os_type} == 2)); then -# ${csudo}cp -f ${script_dir}/init.d/${serverName}.rpm ${install_main_dir}/init.d/${serverName} + # ${csudo}cp -f ${script_dir}/init.d/${serverName}.rpm ${install_main_dir}/init.d/${serverName} ${csudo}cp ${script_dir}/init.d/${serverName}.rpm ${service_config_dir}/${serverName} && ${csudo}chmod a+x ${service_config_dir}/${serverName} -# ${csudo}cp -f ${script_dir}/init.d/tarbitratord.rpm ${install_main_dir}/init.d/tarbitratord + # ${csudo}cp -f ${script_dir}/init.d/tarbitratord.rpm ${install_main_dir}/init.d/tarbitratord ${csudo}cp ${script_dir}/init.d/tarbitratord.rpm ${service_config_dir}/tarbitratord && ${csudo}chmod a+x ${service_config_dir}/tarbitratord fi @@ -682,7 +681,7 @@ function install_service_on_systemd() { fi } -function install_taosadapter_service() { +function install_adapter_service() { if ((${service_mod} == 0)); then [ -f ${script_dir}/cfg/${adapterName}.service ] && ${csudo}cp ${script_dir}/cfg/${adapterName}.service \ @@ -755,7 +754,7 @@ function is_version_compatible() { esac } -function update_TDengine() { +function updateProduct() { # Check if version compatible if ! is_version_compatible; then echo -e "${RED}Version incompatible${NC}" @@ -770,7 +769,7 @@ function update_TDengine() { tar -zxf ${tarName} install_jemalloc - echo -e "${GREEN}Start to update TDengine...${NC}" + echo -e "${GREEN}Start to update ${productName}...${NC}" # Stop the service if running if pidof ${serverName} &>/dev/null; then if ((${service_mod} == 0)); then @@ -801,16 +800,16 @@ function update_TDengine() { install_log install_header install_lib -# if [ "$pagMode" != "lite" ]; then -# install_connector -# fi + # if [ "$pagMode" != "lite" ]; then + # install_connector + # fi install_examples if [ -z $1 ]; then install_bin install_service - install_taosadapter_service + install_adapter_service install_config - install_taosadapter_config + install_adapter_config openresty_work=false if [ "$verMode" == "cluster" ]; then @@ -828,13 +827,13 @@ function update_TDengine() { echo echo -e "${GREEN_DARK}To configure ${productName} ${NC}: edit ${cfg_install_dir}/${configFile}" - echo -e "${GREEN_DARK}To configure Taos Adapter (if has) ${NC}: edit ${cfg_install_dir}/${adapterName}.toml" + echo -e "${GREEN_DARK}To configure Adapter (if has) ${NC}: edit ${cfg_install_dir}/${adapterName}.toml" if ((${service_mod} == 0)); then echo -e "${GREEN_DARK}To start ${productName} ${NC}: ${csudo}systemctl start ${serverName}${NC}" elif ((${service_mod} == 1)); then echo -e "${GREEN_DARK}To start ${productName} ${NC}: ${csudo}service ${serverName} start${NC}" else - echo -e "${GREEN_DARK}To start Taos Adapter (if has)${NC}: ${adapterName} &${NC}" + echo -e "${GREEN_DARK}To start Adapter (if has)${NC}: ${adapterName} &${NC}" echo -e "${GREEN_DARK}To start ${productName} ${NC}: ./${serverName}${NC}" fi @@ -861,7 +860,7 @@ function update_TDengine() { rm -rf $(tar -tf ${tarName}) } -function install_TDengine() { +function installProduct() { # Start to install if [ ! -e ${tarName} ]; then echo "File ${tarName} does not exist" @@ -884,17 +883,17 @@ function install_TDengine() { #install_avro lib #install_avro lib64 -# if [ "$pagMode" != "lite" ]; then -# install_connector -# fi + # if [ "$pagMode" != "lite" ]; then + # install_connector + # fi install_examples if [ -z $1 ]; then # install service and client # For installing new install_bin install_service - install_taosadapter_service - install_taosadapter_config + install_adapter_service + install_adapter_config openresty_work=false if [ "$verMode" == "cluster" ]; then @@ -920,7 +919,7 @@ function install_TDengine() { elif ((${service_mod} == 1)); then echo -e "${GREEN_DARK}To start ${productName} ${NC}: ${csudo}service ${serverName} start${NC}" else - echo -e "${GREEN_DARK}To start Taos Adapter (if has)${NC}: ${adapterName} &${NC}" + echo -e "${GREEN_DARK}To start Adapter (if has)${NC}: ${adapterName} &${NC}" echo -e "${GREEN_DARK}To start ${productName} ${NC}: ${serverName}${NC}" fi @@ -963,18 +962,18 @@ if [ "$verType" == "server" ]; then # Install server and client if [ -x ${bin_dir}/${serverName} ]; then update_flag=1 - update_TDengine + updateProduct else - install_TDengine + installProduct fi elif [ "$verType" == "client" ]; then interactiveFqdn=no # Only install client if [ -x ${bin_dir}/${clientName} ]; then update_flag=1 - update_TDengine client + updateProduct client else - install_TDengine client + installProduct client fi else echo "please input correct verType" diff --git a/packaging/tools/install_client.sh b/packaging/tools/install_client.sh index 2d5dd83d1d5af692c8fe7cb4c9447dad69f37cb2..d4febd3cc38777b1afedee1b9169d4871707534b 100755 --- a/packaging/tools/install_client.sh +++ b/packaging/tools/install_client.sh @@ -83,9 +83,11 @@ function install_main_path() { ${csudo}mkdir -p ${install_main_dir} ${csudo}mkdir -p ${install_main_dir}/cfg ${csudo}mkdir -p ${install_main_dir}/bin - ${csudo}mkdir -p ${install_main_dir}/connector ${csudo}mkdir -p ${install_main_dir}/driver - ${csudo}mkdir -p ${install_main_dir}/examples + if [ $productName == "TDengine" ]; then + ${csudo}mkdir -p ${install_main_dir}/connector + ${csudo}mkdir -p ${install_main_dir}/examples + fi ${csudo}mkdir -p ${install_main_dir}/include } @@ -249,9 +251,9 @@ function update_TDengine() { install_header install_lib install_jemalloc - if [ "$pagMode" != "lite" ]; then - install_connector - fi +# if [ "$pagMode" != "lite" ]; then +# install_connector +# fi install_examples install_bin install_config @@ -277,9 +279,9 @@ function install_TDengine() { install_header install_lib install_jemalloc - if [ "$pagMode" != "lite" ]; then - install_connector - fi +# if [ "$pagMode" != "lite" ]; then +# install_connector +# fi install_examples install_bin install_config diff --git a/packaging/tools/makeclient.sh b/packaging/tools/makeclient.sh index f1a9d30c917e3b358eaa26d259ef2fffd1bc5126..58c1fdd739db91ea0b9dacff421bc62cab0e03ff 100755 --- a/packaging/tools/makeclient.sh +++ b/packaging/tools/makeclient.sh @@ -20,13 +20,13 @@ configFile="taos.cfg" tarName="taos.tar.gz" if [ "$osType" != "Darwin" ]; then - script_dir="$(dirname $(readlink -f $0))" - top_dir="$(readlink -f ${script_dir}/../..)" + script_dir="$(dirname $(readlink -f $0))" + top_dir="$(readlink -f ${script_dir}/../..)" else - script_dir=`dirname $0` - cd ${script_dir} - script_dir="$(pwd)" - top_dir=${script_dir}/../.. + script_dir=$(dirname $0) + cd ${script_dir} + script_dir="$(pwd)" + top_dir=${script_dir}/../.. fi # create compressed install file. @@ -37,13 +37,12 @@ release_dir="${top_dir}/release" #package_name='linux' if [ "$verMode" == "cluster" ]; then - install_dir="${release_dir}/${productName}-enterprise-client-${version}" + install_dir="${release_dir}/${productName}-enterprise-client-${version}" else - install_dir="${release_dir}/${productName}-client-${version}" + install_dir="${release_dir}/${productName}-client-${version}" fi # Directories and files. - if [ "$osType" != "Darwin" ]; then if [ "$pagMode" == "lite" ]; then strip ${build_dir}/bin/${clientName} @@ -77,94 +76,97 @@ mkdir -p ${install_dir}/cfg && cp ${cfg_dir}/${configFile} ${install_dir}/cfg/${ mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* if [ -f ${build_dir}/bin/jemalloc-config ]; then - mkdir -p ${install_dir}/jemalloc/{bin,lib,lib/pkgconfig,include/jemalloc,share/doc/jemalloc,share/man/man3} - cp ${build_dir}/bin/jemalloc-config ${install_dir}/jemalloc/bin - if [ -f ${build_dir}/bin/jemalloc.sh ]; then - cp ${build_dir}/bin/jemalloc.sh ${install_dir}/jemalloc/bin - fi - if [ -f ${build_dir}/bin/jeprof ]; then - cp ${build_dir}/bin/jeprof ${install_dir}/jemalloc/bin - fi - if [ -f ${build_dir}/include/jemalloc/jemalloc.h ]; then - cp ${build_dir}/include/jemalloc/jemalloc.h ${install_dir}/jemalloc/include/jemalloc - fi - if [ -f ${build_dir}/lib/libjemalloc.so.2 ]; then - cp ${build_dir}/lib/libjemalloc.so.2 ${install_dir}/jemalloc/lib - ln -sf libjemalloc.so.2 ${install_dir}/jemalloc/lib/libjemalloc.so - fi - if [ -f ${build_dir}/lib/libjemalloc.a ]; then - cp ${build_dir}/lib/libjemalloc.a ${install_dir}/jemalloc/lib - fi - if [ -f ${build_dir}/lib/libjemalloc_pic.a ]; then - cp ${build_dir}/lib/libjemalloc_pic.a ${install_dir}/jemalloc/lib - fi - if [ -f ${build_dir}/lib/pkgconfig/jemalloc.pc ]; then - cp ${build_dir}/lib/pkgconfig/jemalloc.pc ${install_dir}/jemalloc/lib/pkgconfig - fi - if [ -f ${build_dir}/share/doc/jemalloc/jemalloc.html ]; then - cp ${build_dir}/share/doc/jemalloc/jemalloc.html ${install_dir}/jemalloc/share/doc/jemalloc - fi - if [ -f ${build_dir}/share/man/man3/jemalloc.3 ]; then - cp ${build_dir}/share/man/man3/jemalloc.3 ${install_dir}/jemalloc/share/man/man3 - fi + mkdir -p ${install_dir}/jemalloc/{bin,lib,lib/pkgconfig,include/jemalloc,share/doc/jemalloc,share/man/man3} + cp ${build_dir}/bin/jemalloc-config ${install_dir}/jemalloc/bin + if [ -f ${build_dir}/bin/jemalloc.sh ]; then + cp ${build_dir}/bin/jemalloc.sh ${install_dir}/jemalloc/bin + fi + if [ -f ${build_dir}/bin/jeprof ]; then + cp ${build_dir}/bin/jeprof ${install_dir}/jemalloc/bin + fi + if [ -f ${build_dir}/include/jemalloc/jemalloc.h ]; then + cp ${build_dir}/include/jemalloc/jemalloc.h ${install_dir}/jemalloc/include/jemalloc + fi + if [ -f ${build_dir}/lib/libjemalloc.so.2 ]; then + cp ${build_dir}/lib/libjemalloc.so.2 ${install_dir}/jemalloc/lib + ln -sf libjemalloc.so.2 ${install_dir}/jemalloc/lib/libjemalloc.so + fi + if [ -f ${build_dir}/lib/libjemalloc.a ]; then + cp ${build_dir}/lib/libjemalloc.a ${install_dir}/jemalloc/lib + fi + if [ -f ${build_dir}/lib/libjemalloc_pic.a ]; then + cp ${build_dir}/lib/libjemalloc_pic.a ${install_dir}/jemalloc/lib + fi + if [ -f ${build_dir}/lib/pkgconfig/jemalloc.pc ]; then + cp ${build_dir}/lib/pkgconfig/jemalloc.pc ${install_dir}/jemalloc/lib/pkgconfig + fi + if [ -f ${build_dir}/share/doc/jemalloc/jemalloc.html ]; then + cp ${build_dir}/share/doc/jemalloc/jemalloc.html ${install_dir}/jemalloc/share/doc/jemalloc + fi + if [ -f ${build_dir}/share/man/man3/jemalloc.3 ]; then + cp ${build_dir}/share/man/man3/jemalloc.3 ${install_dir}/jemalloc/share/man/man3 + fi fi cd ${install_dir} if [ "$osType" != "Darwin" ]; then - tar -zcv -f ${tarName} * --remove-files || : + tar -zcv -f ${tarName} * --remove-files || : else - tar -zcv -f ${tarName} * || : - mv ${tarName} .. - rm -rf ./* - mv ../${tarName} . + tar -zcv -f ${tarName} * || : + mv ${tarName} .. + rm -rf ./* + mv ../${tarName} . fi cd ${curr_dir} cp ${install_files} ${install_dir} if [ "$osType" == "Darwin" ]; then - sed 's/osType=Linux/osType=Darwin/g' ${install_dir}/install_client.sh >> install_client_temp.sh - mv install_client_temp.sh ${install_dir}/install_client.sh + sed 's/osType=Linux/osType=Darwin/g' ${install_dir}/install_client.sh >>install_client_temp.sh + mv install_client_temp.sh ${install_dir}/install_client.sh fi if [ "$pagMode" == "lite" ]; then - sed 's/pagMode=full/pagMode=lite/g' ${install_dir}/install_client.sh >> install_client_temp.sh - mv install_client_temp.sh ${install_dir}/install_client.sh + sed 's/pagMode=full/pagMode=lite/g' ${install_dir}/install_client.sh >>install_client_temp.sh + mv install_client_temp.sh ${install_dir}/install_client.sh fi chmod a+x ${install_dir}/install_client.sh -# Copy example code -mkdir -p ${install_dir}/examples -examples_dir="${top_dir}/examples" -cp -r ${examples_dir}/c ${install_dir}/examples -if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then - cp -r ${examples_dir}/JDBC ${install_dir}/examples - cp -r ${examples_dir}/matlab ${install_dir}/examples - cp -r ${examples_dir}/python ${install_dir}/examples - cp -r ${examples_dir}/R ${install_dir}/examples - cp -r ${examples_dir}/go ${install_dir}/examples - cp -r ${examples_dir}/nodejs ${install_dir}/examples - cp -r ${examples_dir}/C# ${install_dir}/examples +if [[ $productName == "TDengine" ]]; then + # Copy example code + mkdir -p ${install_dir}/examples + examples_dir="${top_dir}/examples" + cp -r ${examples_dir}/c ${install_dir}/examples + if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then + cp -r ${examples_dir}/JDBC ${install_dir}/examples + cp -r ${examples_dir}/matlab ${install_dir}/examples + cp -r ${examples_dir}/python ${install_dir}/examples + cp -r ${examples_dir}/R ${install_dir}/examples + cp -r ${examples_dir}/go ${install_dir}/examples + cp -r ${examples_dir}/nodejs ${install_dir}/examples + cp -r ${examples_dir}/C# ${install_dir}/examples + fi + + # Copy connector + connector_dir="${code_dir}/connector" + mkdir -p ${install_dir}/connector + if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then + if [ "$osType" != "Darwin" ]; then + cp ${build_dir}/lib/*.jar ${install_dir}/connector || : + fi + if find ${connector_dir}/go -mindepth 1 -maxdepth 1 | read; then + cp -r ${connector_dir}/go ${install_dir}/connector + else + echo "WARNING: go connector not found, please check if want to use it!" + fi + cp -r ${connector_dir}/python ${install_dir}/connector + cp -r ${connector_dir}/nodejs ${install_dir}/connector + fi fi + # Copy driver mkdir -p ${install_dir}/driver cp ${lib_files} ${install_dir}/driver -# Copy connector -connector_dir="${code_dir}/connector" -mkdir -p ${install_dir}/connector - -if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then - if [ "$osType" != "Darwin" ]; then - cp ${build_dir}/lib/*.jar ${install_dir}/connector ||: - fi - if find ${connector_dir}/go -mindepth 1 -maxdepth 1 | read; then - cp -r ${connector_dir}/go ${install_dir}/connector - else - echo "WARNING: go connector not found, please check if want to use it!" - fi - cp -r ${connector_dir}/python ${install_dir}/connector - cp -r ${connector_dir}/nodejs ${install_dir}/connector -fi # Copy release note # cp ${script_dir}/release_note ${install_dir} @@ -187,12 +189,12 @@ if [ "$pagMode" == "lite" ]; then fi if [ "$osType" != "Darwin" ]; then - tar -zcv -f "$(basename ${pkg_name}).tar.gz" $(basename ${install_dir}) --remove-files || : + tar -zcv -f "$(basename ${pkg_name}).tar.gz" $(basename ${install_dir}) --remove-files || : else - tar -zcv -f "$(basename ${pkg_name}).tar.gz" $(basename ${install_dir}) || : - mv "$(basename ${pkg_name}).tar.gz" .. - rm -rf ./* - mv ../"$(basename ${pkg_name}).tar.gz" . + tar -zcv -f "$(basename ${pkg_name}).tar.gz" $(basename ${install_dir}) || : + mv "$(basename ${pkg_name}).tar.gz" .. + rm -rf ./* + mv ../"$(basename ${pkg_name}).tar.gz" . fi cd ${curr_dir} diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index 13ab6f13543dd991a1891bde3df95e58378c8a3f..88d534f055c30d715f3ec397660c30f094ad1fe5 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -106,8 +106,6 @@ if [ -f "${compile_dir}/test/cfg/taosadapter.service" ]; then cp ${compile_dir}/test/cfg/taosadapter.service ${install_dir}/cfg || : fi - - if [ -f "${cfg_dir}/${serverName}.service" ]; then cp ${cfg_dir}/${serverName}.service ${install_dir}/cfg || : fi @@ -137,7 +135,8 @@ if [ $adapterName != "taosadapter" ]; then sed -i "s/taosadapter/${adapterName}/g" ${install_dir}/cfg/$adapterName.service mv ${install_dir}/bin/taosadapter ${install_dir}/bin/${adapterName} - mv ${install_dir}/bin/run_taosd_and_taosadapter.sh ${install_dir}/bin/run_taosd_and_${adapterName}.sh + mv ${install_dir}/bin/run_taosd_and_taosadapter.sh ${install_dir}/bin/run_${serverName}_and_${adapterName}.sh + mv ${install_dir}/bin/taosd-dump-cfg.gdb ${install_dir}/bin/${serverName}-dump-cfg.gdb fi if [ -n "${taostools_bin_files}" ]; then @@ -240,38 +239,41 @@ if [ "$pagMode" == "lite" ]; then fi chmod a+x ${install_dir}/install.sh -# Copy example code -mkdir -p ${install_dir}/examples -examples_dir="${top_dir}/examples" -cp -r ${examples_dir}/c ${install_dir}/examples -if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then - if [ -d ${examples_dir}/JDBC/connectionPools/target ]; then - rm -rf ${examples_dir}/JDBC/connectionPools/target - fi - if [ -d ${examples_dir}/JDBC/JDBCDemo/target ]; then - rm -rf ${examples_dir}/JDBC/JDBCDemo/target - fi - if [ -d ${examples_dir}/JDBC/mybatisplus-demo/target ]; then - rm -rf ${examples_dir}/JDBC/mybatisplus-demo/target - fi - if [ -d ${examples_dir}/JDBC/springbootdemo/target ]; then - rm -rf ${examples_dir}/JDBC/springbootdemo/target +if [[ $dbName == "taos" ]]; then + # Copy example code + mkdir -p ${install_dir}/examples + examples_dir="${top_dir}/examples" + cp -r ${examples_dir}/c ${install_dir}/examples + if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then + if [ -d ${examples_dir}/JDBC/connectionPools/target ]; then + rm -rf ${examples_dir}/JDBC/connectionPools/target + fi + if [ -d ${examples_dir}/JDBC/JDBCDemo/target ]; then + rm -rf ${examples_dir}/JDBC/JDBCDemo/target + fi + if [ -d ${examples_dir}/JDBC/mybatisplus-demo/target ]; then + rm -rf ${examples_dir}/JDBC/mybatisplus-demo/target + fi + if [ -d ${examples_dir}/JDBC/springbootdemo/target ]; then + rm -rf ${examples_dir}/JDBC/springbootdemo/target + fi + if [ -d ${examples_dir}/JDBC/SpringJdbcTemplate/target ]; then + rm -rf ${examples_dir}/JDBC/SpringJdbcTemplate/target + fi + if [ -d ${examples_dir}/JDBC/taosdemo/target ]; then + rm -rf ${examples_dir}/JDBC/taosdemo/target + fi + + cp -r ${examples_dir}/JDBC ${install_dir}/examples + cp -r ${examples_dir}/matlab ${install_dir}/examples + cp -r ${examples_dir}/python ${install_dir}/examples + cp -r ${examples_dir}/R ${install_dir}/examples + cp -r ${examples_dir}/go ${install_dir}/examples + cp -r ${examples_dir}/nodejs ${install_dir}/examples + cp -r ${examples_dir}/C# ${install_dir}/examples fi - if [ -d ${examples_dir}/JDBC/SpringJdbcTemplate/target ]; then - rm -rf ${examples_dir}/JDBC/SpringJdbcTemplate/target - fi - if [ -d ${examples_dir}/JDBC/taosdemo/target ]; then - rm -rf ${examples_dir}/JDBC/taosdemo/target - fi - - cp -r ${examples_dir}/JDBC ${install_dir}/examples - cp -r ${examples_dir}/matlab ${install_dir}/examples - cp -r ${examples_dir}/python ${install_dir}/examples - cp -r ${examples_dir}/R ${install_dir}/examples - cp -r ${examples_dir}/go ${install_dir}/examples - cp -r ${examples_dir}/nodejs ${install_dir}/examples - cp -r ${examples_dir}/C# ${install_dir}/examples fi + # Copy driver mkdir -p ${install_dir}/driver && cp ${lib_files} ${install_dir}/driver && echo "${versionComp}" >${install_dir}/driver/vercomp.txt diff --git a/packaging/tools/remove.sh b/packaging/tools/remove.sh index f44e3aa067ef8cdb4c04e80546946244b71f0cfb..be7d8191d9f6e74a6a163eee04bc85abee2299c5 100755 --- a/packaging/tools/remove.sh +++ b/packaging/tools/remove.sh @@ -59,26 +59,13 @@ else service_mod=2 fi -function kill_taosadapter() { - pid=$(ps -ef | grep ${adapterName} | grep -v "grep" | awk '{print $2}') +function kill_process() { + pid=$(ps -ef | grep "$1" | grep -v "grep" | awk '{print $2}') if [ -n "$pid" ]; then ${csudo}kill -9 $pid || : fi } -function kill_taosd() { - pid=$(ps -ef | grep "${serverName}" | grep -v "grep" | awk '{print $2}') - if [ -n "$pid" ]; then - ${csudo}kill -9 $pid || : - fi -} - -function kill_tarbitrator() { - pid=$(ps -ef | grep "tarbitrator" | grep -v "grep" | awk '{print $2}') - if [ -n "$pid" ]; then - ${csudo}kill -9 $pid || : - fi -} function clean_bin() { # Remove link ${csudo}rm -f ${bin_link_dir}/${clientName} || : @@ -87,7 +74,7 @@ function clean_bin() { ${csudo}rm -f ${bin_link_dir}/${uninstallScript} || : ${csudo}rm -f ${bin_link_dir}/tarbitrator || : ${csudo}rm -f ${bin_link_dir}/set_core || : - ${csudo}rm -f ${bin_link_dir}/run_taosd_and_${adapterName}.sh || : + ${csudo}rm -f ${bin_link_dir}/run_${serverName}_and_${adapterName}.sh || : } function clean_lib() { @@ -200,9 +187,9 @@ function clean_service() { elif ((${service_mod} == 1)); then clean_service_on_sysvinit else - kill_taosadapter - kill_taosd - kill_tarbitrator + kill_process ${adapterName} + kill_process ${serverName} + kill_process "tarbitrator" fi }