diff --git a/clonecode.sh b/clonecode.sh new file mode 100644 index 0000000000000000000000000000000000000000..9f0e14f43a093573b0151e2a20122a4ff9d9fc32 --- /dev/null +++ b/clonecode.sh @@ -0,0 +1,17 @@ +version=2.1.0 +server_repo=https://gitee.com/opengauss/openGauss-server.git +git clone $server_repo openGauss-server-$version +cd openGauss-server-$version +gitcommit=$(git log 2>/dev/null | grep commit | head -1 | awk '{print $2}' | cut -b 1-8) +echo $gitcommit > ../COMMIT +rm -rf src/test/regress/jar +rm -rf src/test/regress/output +rm -rf src/test/regress/expected +rm -rf src/test/regress/sql +rm -rf src/test/regress/data +rm -rf src/test/regress/jdbc_test +rm -rf src/test/regress/input +rm -rf .git +rm -rf ./docker +cd .. +tar -zcf "openGauss-server-${version}.tar.gz" openGauss-server-$version diff --git a/openGauss-server-2.1.0.tar.gz b/openGauss-server-2.1.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c4fb480e1b4f82300e04a6c0585f46890c79fbd9 Binary files /dev/null and b/openGauss-server-2.1.0.tar.gz differ diff --git a/openGauss-server-2.1.0.tar.xz b/openGauss-server-2.1.0.tar.xz deleted file mode 100644 index f4a7fc03fd63c064f12621c11d4cdf708a5b2923..0000000000000000000000000000000000000000 Binary files a/openGauss-server-2.1.0.tar.xz and /dev/null differ diff --git a/opengauss-server.spec b/opengauss-server.spec index 8fcba753341db4cae87a8841b4107774861b8633..7bf8e24af735d436f77411a2d45382fd16266ca7 100644 --- a/opengauss-server.spec +++ b/opengauss-server.spec @@ -12,11 +12,11 @@ Name: opengauss Version: 2.1.0 -Release: 1 +Release: 2 Summary: openGauss is an open source relational database management system License: MulanPSL-2.0 and MIT and BSD and zlib and TCL and Apache-2.0 and BSL-1.0 URL: https://gitee.com/opengauss/openGauss-server -Source0: openGauss-server-%{version}.tar.xz +Source0: openGauss-server-%{version}.tar.gz Source1: %{cjson_name}-%{cjson_version}.tar.gz Source2: %{zlib_name}-%{zlib_version}.tar.gz Source3: %{protobuf_name}-%{protobuf_version}.tar.gz @@ -39,6 +39,9 @@ BuildRequires: bison flex DCF BuildRequires: numactl-devel %endif +%global _privatelibs lib(cjson|ecpg|z|pg|pq)\\.so* +%global __provides_exclude %{_privatelibs} +%global __requires_exclude %{_privatelibs} Requires: lz4-devel protobuf-devel snappy-devel zstd-devel boost-devel Requires: libcgroup-devel curl-devel unixODBC-devel jemalloc-devel @@ -51,8 +54,6 @@ Requires: numactl-devel %description openGauss kernel : openGauss is an open source relational database management system. -%global _privatelibs lib(cjson|ecpg|z|pg)\\.so* -%global __provides_exclude %{_privatelibs} %global debug_package %{nil} %prep @@ -146,7 +147,7 @@ popd pushd openGauss-server-%{version} chmod +x ./configure ./configure \ -CC=g++ CFLAGS='-O2 -g3' \ +CC=g++ CFLAGS='-O2' \ --prefix=%{apppath} \ --3rd=${build_target} \ --enable-thread-safety \ @@ -190,7 +191,6 @@ set_mini_configparam(){ then echo "postgresql.conf.sample does not exist" else - echo "set opengauss lite config parameters" while IFS= read -r line; do SUBSTRING=$(echo $line | cut -d'=' -f 1)"= " if grep -q "$SUBSTRING" $config_sample_file ; then @@ -201,12 +201,43 @@ set_mini_configparam(){ done < $config_mini_file fi fi +} + +start_opengauss(){ + process_id=$(ps -ef | grep /usr/local/opengauss/bin/gaussdb | grep /var/lib/opengauss/data | grep -v grep | awk '{print $2}') + if [ "$process_id" != "" ]; then + echo "A process of opengauss already exists. Use command (ps -ef | grep /var/lib/opengauss/data) to confirm." + echo "Please kill the process and reinstall opengauss." + return 0 + fi + + if [ "`ls -A /var/lib/opengauss/data`" != "" ]; then + echo "Datanode dir(/var/lib/opengauss/data) is not empty." + echo "Please delete dir and reinstall opengauss." + return 0 + fi + result=`su - opengauss -c "source ~/.bash_profile; gs_initdb -D /var/lib/opengauss/data -U opengauss --nodename=single_node"` + if [ $? -ne 0 ]; then + echo "Init openGauss database failed." + echo $result + else + echo "Init openGauss database success." + result=`su - opengauss -c "source ~/.bash_profile; gs_ctl start -D /var/lib/opengauss/data"` + if [ $? -ne 0 ]; then + echo "Start openGauss database failed." + echo $result + else + echo "Start openGauss database success." + fi + fi } -set_mini_configparam -su - opengauss -c "source ~/.bash_profile; gs_initdb -D /var/lib/opengauss/data -U opengauss --nodename=single_node" -su - opengauss -c "source ~/.bash_profile; gs_ctl start -D /var/lib/opengauss/data" +# for install step +if [ $1 = 1 ]; then + set_mini_configparam + start_opengauss +fi %files @@ -220,5 +251,9 @@ su - opengauss -c "source ~/.bash_profile; gs_ctl start -D /var/lib/opengauss/da %changelog +* Mon Dec 13 2021 zhangxubo - 2.1.0-2 +- Fix bugs: Mask dependencies acquired during installation + + * Wed Dec 1 2021 zhangxubo - 2.1.0-1 - Package init