From a009cbdcafc9c3d2e3feedee574507a9616d4c9b Mon Sep 17 00:00:00 2001 From: zyyang Date: Fri, 31 Dec 2021 14:07:25 +0800 Subject: [PATCH] change --- packaging/release.sh | 229 ++++++++++++++++++------------------- packaging/tools/makepkg.sh | 220 ++++++++++++++++++----------------- 2 files changed, 228 insertions(+), 221 deletions(-) diff --git a/packaging/release.sh b/packaging/release.sh index 46bdb7c45e..afeab30248 100755 --- a/packaging/release.sh +++ b/packaging/release.sh @@ -22,83 +22,82 @@ source ./sed_jh.sh # -H [ false | true] # set parameters by default value -verMode=edge # [cluster, edge] -verType=stable # [stable, beta] -cpuType=x64 # [aarch32 | aarch64 | x64 | x86 | mips64 ...] -osType=Linux # [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | Ningsi60 | Ningsi80 |...] -pagMode=full # [full | lite] -soMode=dynamic # [static | dynamic] -dbName=taos # [taos | power | tq | pro | kh | jh] -allocator=glibc # [glibc | jemalloc] +verMode=edge # [cluster, edge] +verType=stable # [stable, beta] +cpuType=x64 # [aarch32 | aarch64 | x64 | x86 | mips64 ...] +osType=Linux # [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | Ningsi60 | Ningsi80 |...] +pagMode=full # [full | lite] +soMode=dynamic # [static | dynamic] +dbName=taos # [taos | power | tq | pro | kh | jh] +allocator=glibc # [glibc | jemalloc] verNumber="" verNumberComp="1.0.0.0" httpdBuild=false -while getopts "hv:V:c:o:l:s:d:a:n:m:H:" arg -do +while getopts "hv:V:c:o:l:s:d:a:n:m:H:" arg; do case $arg in - v) - #echo "verMode=$OPTARG" - verMode=$( echo $OPTARG ) - ;; - V) - #echo "verType=$OPTARG" - verType=$(echo $OPTARG) - ;; - c) - #echo "cpuType=$OPTARG" - cpuType=$(echo $OPTARG) - ;; - l) - #echo "pagMode=$OPTARG" - pagMode=$(echo $OPTARG) - ;; - s) - #echo "soMode=$OPTARG" - soMode=$(echo $OPTARG) - ;; - d) - #echo "dbName=$OPTARG" - dbName=$(echo $OPTARG) - ;; - a) - #echo "allocator=$OPTARG" - allocator=$(echo $OPTARG) - ;; - n) - #echo "verNumber=$OPTARG" - verNumber=$(echo $OPTARG) - ;; - m) - #echo "verNumberComp=$OPTARG" - verNumberComp=$(echo $OPTARG) - ;; - o) - #echo "osType=$OPTARG" - osType=$(echo $OPTARG) - ;; - H) - #echo "httpdBuild=$OPTARG" - httpdBuild=$(echo $OPTARG) - ;; - h) - echo "Usage: `basename $0` -v [cluster | edge] " - echo " -c [aarch32 | aarch64 | x64 | x86 | mips64 ...] " - echo " -o [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | Ningsi60 | Ningsi80 |...] " - echo " -V [stable | beta] " - echo " -l [full | lite] " - echo " -a [glibc | jemalloc] " - echo " -s [static | dynamic] " - echo " -d [taos | power | tq | pro | kh | jh] " - echo " -n [version number] " - echo " -m [compatible version number] " - echo " -H [false | true] " - exit 0 - ;; - ?) #unknow option - echo "unkonw argument" - exit 1 - ;; + v) + #echo "verMode=$OPTARG" + verMode=$(echo $OPTARG) + ;; + V) + #echo "verType=$OPTARG" + verType=$(echo $OPTARG) + ;; + c) + #echo "cpuType=$OPTARG" + cpuType=$(echo $OPTARG) + ;; + l) + #echo "pagMode=$OPTARG" + pagMode=$(echo $OPTARG) + ;; + s) + #echo "soMode=$OPTARG" + soMode=$(echo $OPTARG) + ;; + d) + #echo "dbName=$OPTARG" + dbName=$(echo $OPTARG) + ;; + a) + #echo "allocator=$OPTARG" + allocator=$(echo $OPTARG) + ;; + n) + #echo "verNumber=$OPTARG" + verNumber=$(echo $OPTARG) + ;; + m) + #echo "verNumberComp=$OPTARG" + verNumberComp=$(echo $OPTARG) + ;; + o) + #echo "osType=$OPTARG" + osType=$(echo $OPTARG) + ;; + H) + #echo "httpdBuild=$OPTARG" + httpdBuild=$(echo $OPTARG) + ;; + h) + echo "Usage: $(basename $0) -v [cluster | edge] " + echo " -c [aarch32 | aarch64 | x64 | x86 | mips64 ...] " + echo " -o [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | Ningsi60 | Ningsi80 |...] " + echo " -V [stable | beta] " + echo " -l [full | lite] " + echo " -a [glibc | jemalloc] " + echo " -s [static | dynamic] " + echo " -d [taos | power | tq | pro | kh | jh] " + echo " -n [version number] " + echo " -m [compatible version number] " + echo " -H [false | true] " + exit 0 + ;; + ?) #unknow option + echo "unkonw argument" + exit 1 + ;; esac done @@ -110,7 +109,7 @@ if [ "$osType" != "Darwin" ]; then script_dir="$(dirname $(readlink -f $0))" top_dir="$(readlink -f ${script_dir}/..)" else - script_dir=`dirname $0` + script_dir=$(dirname $0) cd ${script_dir} script_dir="$(pwd)" top_dir=${script_dir}/.. @@ -131,7 +130,7 @@ function is_valid_version() { return 1 } -function vercomp () { +function vercomp() { if [[ $1 == $2 ]]; then echo 0 exit 0 @@ -141,11 +140,11 @@ function vercomp () { local i ver1=($1) ver2=($2) # fill empty fields in ver1 with zeros - for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)); do + for ((i = ${#ver1[@]}; i < ${#ver2[@]}; i++)); do ver1[i]=0 done - for ((i=0; i<${#ver1[@]}; i++)); do + for ((i = 0; i < ${#ver1[@]}; i++)); do if [[ -z ${ver2[i]} ]]; then # fill empty fields in ver2 with zeros ver2[i]=0 @@ -163,7 +162,7 @@ function vercomp () { } # 1. check version information -if ( ( ! is_valid_version $verNumber ) || ( ! is_valid_version $verNumberComp ) || [[ "$(vercomp $verNumber $verNumberComp)" == '2' ]] ); then +if ( (! is_valid_version $verNumber) || (! is_valid_version $verNumberComp) || [[ "$(vercomp $verNumber $verNumberComp)" == '2' ]]); then echo "please enter correct version" exit 0 fi @@ -199,9 +198,9 @@ fi cd ${compile_dir} if [[ "$allocator" == "jemalloc" ]]; then - allocator_macro="-DJEMALLOC_ENABLED=true" + allocator_macro="-DJEMALLOC_ENABLED=true" else - allocator_macro="" + allocator_macro="" fi if [[ "$dbName" != "taos" ]]; then @@ -209,26 +208,26 @@ if [[ "$dbName" != "taos" ]]; then fi if [[ "$httpdBuild" == "true" ]]; then - BUILD_HTTP=true + BUILD_HTTP=true else - BUILD_HTTP=false + BUILD_HTTP=false fi if [[ "$verMode" == "cluster" ]]; then - BUILD_HTTP=internal + BUILD_HTTP=internal fi if [[ "$pagMode" == "full" ]]; then - BUILD_TOOLS=true + BUILD_TOOLS=true else - BUILD_TOOLS=false + BUILD_TOOLS=false fi # check support cpu type -if [[ "$cpuType" == "x64" ]] || [[ "$cpuType" == "aarch64" ]] || [[ "$cpuType" == "aarch32" ]] || [[ "$cpuType" == "mips64" ]] ; then +if [[ "$cpuType" == "x64" ]] || [[ "$cpuType" == "aarch64" ]] || [[ "$cpuType" == "aarch32" ]] || [[ "$cpuType" == "mips64" ]]; then if [ "$verMode" != "cluster" ]; then # community-version compile - cmake ../ -DCPUTYPE=${cpuType} -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DPAGMODE=${pagMode} -DBUILD_HTTP=${BUILD_HTTP} -DBUILD_TOOLS=${BUILD_TOOLS} ${allocator_macro} + cmake ../ -DCPUTYPE=${cpuType} -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DPAGMODE=${pagMode} -DBUILD_HTTP=${BUILD_HTTP} -DBUILD_TOOLS=${BUILD_TOOLS} ${allocator_macro} else if [[ "$dbName" != "taos" ]]; then replace_enterprise_$dbName @@ -240,13 +239,13 @@ else exit 1 fi -CORES=`grep -c ^processor /proc/cpuinfo` +CORES=$(grep -c ^processor /proc/cpuinfo) if [[ "$allocator" == "jemalloc" ]]; then - # jemalloc need compile first, so disable parallel build - make -j ${CORES} && ${csudo}make install + # jemalloc need compile first, so disable parallel build + make -j ${CORES} && ${csudo}make install else - make -j ${CORES} && ${csudo}make install + make -j ${CORES} && ${csudo}make install fi cd ${curr_dir} @@ -267,16 +266,16 @@ if [ "$osType" != "Darwin" ]; then ${csudo}./makedeb.sh ${compile_dir} ${output_dir} ${verNumber} ${cpuType} ${osType} ${verMode} ${verType} if [[ "$pagMode" == "full" ]]; then - if [ -d ${top_dir}/src/kit/taos-tools/packaging/deb ]; then - cd ${top_dir}/src/kit/taos-tools/packaging/deb - [ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0" - - taos_tools_ver=$(git describe --tags|sed -e 's/ver-//g'|awk -F '-' '{print $1}') - ${csudo}./make-taos-tools-deb.sh ${top_dir} \ - ${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType} - fi + if [ -d ${top_dir}/src/kit/taos-tools/packaging/deb ]; then + cd ${top_dir}/src/kit/taos-tools/packaging/deb + [ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0" + + taos_tools_ver=$(git describe --tags | sed -e 's/ver-//g' | awk -F '-' '{print $1}') + ${csudo}./make-taos-tools-deb.sh ${top_dir} \ + ${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType} + fi fi - else + else echo "==========dpkg command not exist, so not release deb package!!!" fi ret='0' @@ -292,32 +291,26 @@ if [ "$osType" != "Darwin" ]; then ${csudo}./makerpm.sh ${compile_dir} ${output_dir} ${verNumber} ${cpuType} ${osType} ${verMode} ${verType} if [[ "$pagMode" == "full" ]]; then - if [ -d ${top_dir}/src/kit/taos-tools/packaging/rpm ]; then - cd ${top_dir}/src/kit/taos-tools/packaging/rpm - [ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0" - - taos_tools_ver=$(git describe --tags|sed -e 's/ver-//g'|awk -F '-' '{print $1}'|sed -e 's/-/_/g') - ${csudo}./make-taos-tools-rpm.sh ${top_dir} \ - ${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType} - fi + if [ -d ${top_dir}/src/kit/taos-tools/packaging/rpm ]; then + cd ${top_dir}/src/kit/taos-tools/packaging/rpm + [ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0" + + taos_tools_ver=$(git describe --tags | sed -e 's/ver-//g' | awk -F '-' '{print $1}' | sed -e 's/-/_/g') + ${csudo}./make-taos-tools-rpm.sh ${top_dir} \ + ${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType} + fi fi - else + else echo "==========rpmbuild command not exist, so not release rpm package!!!" fi fi echo "====do tar.gz package for all systems====" cd ${script_dir}/tools - - if [[ "$dbName" == "taos" ]]; then - ${csudo} ./makepkg.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${verNumberComp} - ${csudo} ./makeclient.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} - ${csudo} ./makearbi.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} - else - ${csudo} ./makepkg_$dbName.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${dbName} ${verNumberComp} - ${csudo} ./makeclient_$dbName.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${dbName} - ${csudo} ./makearbi_$dbName.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} - fi + + ${csudo} ./makepkg.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${verNumberComp} ${dbName} + ${csudo} ./makeclient.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${dbName} + ${csudo} ./makearbi.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${dbName} else # only make client for Darwin diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index 509f330c9d..11fd73c350 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -15,6 +15,7 @@ verMode=$6 verType=$7 pagMode=$8 versionComp=$9 +dbName=${10} script_dir="$(dirname $(readlink -f $0))" top_dir="$(readlink -f ${script_dir}/../..)" @@ -24,23 +25,37 @@ build_dir="${compile_dir}/build" code_dir="${top_dir}/src" release_dir="${top_dir}/release" +if [ $dbName == "power" ]; then + productName="PowerDB" +elif [ $dbName == "tq" ]; then + productName="TQ" +elif [ $dbName == "pro" ]; then + productName="ProDB" +elif [ $dbName == "kh" ]; then + productName="KingHistorian" +elif [ $dbName == "jh" ]; then + productName="jh_iot" +else + productName="TDengine" +fi + #package_name='linux' if [ "$verMode" == "cluster" ]; then - install_dir="${release_dir}/TDengine-enterprise-server-${version}" + install_dir="${release_dir}/${productName}-enterprise-server-${version}" else - install_dir="${release_dir}/TDengine-server-${version}" + install_dir="${release_dir}/${productName}-server-${version}" fi if [ -d ${top_dir}/src/kit/taos-tools/packaging/deb ]; then - cd ${top_dir}/src/kit/taos-tools/packaging/deb - [ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0" + cd ${top_dir}/src/kit/taos-tools/packaging/deb + [ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0" - taostools_ver=$(git describe --tags|sed -e 's/ver-//g'|awk -F '-' '{print $1}') - taostools_install_dir="${release_dir}/taos-tools-${taostools_ver}" + taostools_ver=$(git describe --tags | sed -e 's/ver-//g' | awk -F '-' '{print $1}') + taostools_install_dir="${release_dir}/${productName}-tools-${taostools_ver}" - cd ${curr_dir} + cd ${curr_dir} else - taostools_install_dir="${release_dir}/taos-tools-${version}" + taostools_install_dir="${release_dir}/${productName}-tools-${version}" fi # Directories and files @@ -93,25 +108,24 @@ mkdir -p ${install_dir} mkdir -p ${install_dir}/inc && cp ${header_files} ${install_dir}/inc mkdir -p ${install_dir}/cfg && cp ${cfg_dir}/taos.cfg ${install_dir}/cfg/taos.cfg - if [ -f "${compile_dir}/test/cfg/taosadapter.toml" ]; then - cp ${compile_dir}/test/cfg/taosadapter.toml ${install_dir}/cfg || : + cp ${compile_dir}/test/cfg/taosadapter.toml ${install_dir}/cfg || : fi if [ -f "${compile_dir}/test/cfg/taosadapter.service" ]; then - cp ${compile_dir}/test/cfg/taosadapter.service ${install_dir}/cfg || : + cp ${compile_dir}/test/cfg/taosadapter.service ${install_dir}/cfg || : fi if [ -f "${cfg_dir}/taosd.service" ]; then - cp ${cfg_dir}/taosd.service ${install_dir}/cfg || : + cp ${cfg_dir}/taosd.service ${install_dir}/cfg || : fi if [ -f "${cfg_dir}/tarbitratord.service" ]; then - cp ${cfg_dir}/tarbitratord.service ${install_dir}/cfg || : + cp ${cfg_dir}/tarbitratord.service ${install_dir}/cfg || : fi if [ -f "${cfg_dir}/nginxd.service" ]; then - cp ${cfg_dir}/nginxd.service ${install_dir}/cfg || : + cp ${cfg_dir}/nginxd.service ${install_dir}/cfg || : fi mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || : @@ -121,103 +135,103 @@ mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_deb} ${install_dir} mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_rpm} ${install_dir}/init.d/tarbitratord.rpm || : if [ -n "${taostools_bin_files}" ]; then - mkdir -p ${taostools_install_dir} || echo -e "failed to create ${taostools_install_dir}" - mkdir -p ${taostools_install_dir}/bin \ - && cp ${taostools_bin_files} ${taostools_install_dir}/bin \ - && chmod a+x ${taostools_install_dir}/bin/* || : - [ -f ${taostools_install_dir}/bin/taosBenchmark ] && \ - ln -sf ${taostools_install_dir}/bin/taosBenchmark \ - ${taostools_install_dir}/bin/taosdemo - - if [ -f ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh ]; then - cp ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh \ - ${taostools_install_dir}/ > /dev/null \ - && chmod a+x ${taostools_install_dir}/install-taostools.sh \ - || echo -e "failed to copy install-taostools.sh" - else - echo -e "install-taostools.sh not found" - fi - - if [ -f ${build_dir}/lib/libavro.so.23.0.0 ]; then - mkdir -p ${taostools_install_dir}/avro/{lib,lib/pkgconfig} || echo -e "failed to create ${taostools_install_dir}/avro" - cp ${build_dir}/lib/libavro.* ${taostools_install_dir}/avro/lib - cp ${build_dir}/lib/pkgconfig/avro-c.pc ${taostools_install_dir}/avro/lib/pkgconfig - fi + mkdir -p ${taostools_install_dir} || echo -e "failed to create ${taostools_install_dir}" + mkdir -p ${taostools_install_dir}/bin && + cp ${taostools_bin_files} ${taostools_install_dir}/bin && + chmod a+x ${taostools_install_dir}/bin/* || : + [ -f ${taostools_install_dir}/bin/taosBenchmark ] && + ln -sf ${taostools_install_dir}/bin/taosBenchmark \ + ${taostools_install_dir}/bin/taosdemo + + if [ -f ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh ]; then + cp ${top_dir}/src/kit/taos-tools/packaging/tools/install-taostools.sh \ + ${taostools_install_dir}/ >/dev/null && + chmod a+x ${taostools_install_dir}/install-taostools.sh || + echo -e "failed to copy install-taostools.sh" + else + echo -e "install-taostools.sh not found" + fi + + if [ -f ${build_dir}/lib/libavro.so.23.0.0 ]; then + mkdir -p ${taostools_install_dir}/avro/{lib,lib/pkgconfig} || echo -e "failed to create ${taostools_install_dir}/avro" + cp ${build_dir}/lib/libavro.* ${taostools_install_dir}/avro/lib + cp ${build_dir}/lib/pkgconfig/avro-c.pc ${taostools_install_dir}/avro/lib/pkgconfig + fi fi 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 if [ "$verMode" == "cluster" ]; then - sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/bin/remove.sh >> remove_temp.sh - mv remove_temp.sh ${install_dir}/bin/remove.sh - - mkdir -p ${install_dir}/nginxd && cp -r ${nginx_dir}/* ${install_dir}/nginxd - cp ${nginx_dir}/png/taos.png ${install_dir}/nginxd/admin/images/taos.png - rm -rf ${install_dir}/nginxd/png - - if [ "$cpuType" == "aarch64" ]; then - cp -f ${install_dir}/nginxd/sbin/arm/64bit/nginx ${install_dir}/nginxd/sbin/ - elif [ "$cpuType" == "aarch32" ]; then - cp -f ${install_dir}/nginxd/sbin/arm/32bit/nginx ${install_dir}/nginxd/sbin/ - fi - rm -rf ${install_dir}/nginxd/sbin/arm + sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/bin/remove.sh >>remove_temp.sh + mv remove_temp.sh ${install_dir}/bin/remove.sh + + mkdir -p ${install_dir}/nginxd && cp -r ${nginx_dir}/* ${install_dir}/nginxd + cp ${nginx_dir}/png/taos.png ${install_dir}/nginxd/admin/images/taos.png + rm -rf ${install_dir}/nginxd/png + + if [ "$cpuType" == "aarch64" ]; then + cp -f ${install_dir}/nginxd/sbin/arm/64bit/nginx ${install_dir}/nginxd/sbin/ + elif [ "$cpuType" == "aarch32" ]; then + cp -f ${install_dir}/nginxd/sbin/arm/32bit/nginx ${install_dir}/nginxd/sbin/ + fi + rm -rf ${install_dir}/nginxd/sbin/arm fi cd ${install_dir} -tar -zcv -f taos.tar.gz * --remove-files || : +tar -zcv -f taos.tar.gz * --remove-files || : exitcode=$? if [ "$exitcode" != "0" ]; then - echo "tar taos.tar.gz error !!!" - exit $exitcode + echo "tar taos.tar.gz error !!!" + exit $exitcode fi cd ${curr_dir} cp ${install_files} ${install_dir} if [ "$verMode" == "cluster" ]; then - sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/install.sh >> install_temp.sh - mv install_temp.sh ${install_dir}/install.sh + sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/install.sh >>install_temp.sh + mv install_temp.sh ${install_dir}/install.sh fi if [ "$pagMode" == "lite" ]; then - sed 's/pagMode=full/pagMode=lite/g' ${install_dir}/install.sh >> install_temp.sh - mv install_temp.sh ${install_dir}/install.sh + sed 's/pagMode=full/pagMode=lite/g' ${install_dir}/install.sh >>install_temp.sh + mv install_temp.sh ${install_dir}/install.sh fi chmod a+x ${install_dir}/install.sh # Copy example code mkdir -p ${install_dir}/examples examples_dir="${top_dir}/tests/examples" - cp -r ${examples_dir}/c ${install_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 @@ -238,29 +252,29 @@ if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then rm -rf ${examples_dir}/JDBC/taosdemo/target fi - cp -r ${examples_dir}/JDBC ${install_dir}/examples + 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}/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 + 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 +mkdir -p ${install_dir}/driver && cp ${lib_files} ${install_dir}/driver && echo "${versionComp}" >${install_dir}/driver/vercomp.txt # Copy connector connector_dir="${code_dir}/connector" mkdir -p ${install_dir}/connector if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then - cp ${build_dir}/lib/*.jar ${install_dir}/connector ||: + cp ${build_dir}/lib/*.jar ${install_dir}/connector || : 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 + 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} @@ -301,17 +315,17 @@ fi tar -zcv -f "$(basename ${pkg_name}).tar.gz" "$(basename ${install_dir})" --remove-files || : exitcode=$? if [ "$exitcode" != "0" ]; then - echo "tar ${pkg_name}.tar.gz error !!!" - exit $exitcode + echo "tar ${pkg_name}.tar.gz error !!!" + exit $exitcode fi if [ -n "${taostools_bin_files}" ]; then - tar -zcv -f "$(basename ${taostools_pkg_name}).tar.gz" "$(basename ${taostools_install_dir})" --remove-files || : - exitcode=$? - if [ "$exitcode" != "0" ]; then - echo "tar ${taostools_pkg_name}.tar.gz error !!!" - exit $exitcode - fi + tar -zcv -f "$(basename ${taostools_pkg_name}).tar.gz" "$(basename ${taostools_install_dir})" --remove-files || : + exitcode=$? + if [ "$exitcode" != "0" ]; then + echo "tar ${taostools_pkg_name}.tar.gz error !!!" + exit $exitcode + fi fi cd ${curr_dir} -- GitLab