commit
f6e20feb39
17
clonecode.sh
Normal file
17
clonecode.sh
Normal file
@ -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
|
||||||
BIN
openGauss-server-2.1.0.tar.gz
Normal file
BIN
openGauss-server-2.1.0.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
@ -12,11 +12,11 @@
|
|||||||
|
|
||||||
Name: opengauss
|
Name: opengauss
|
||||||
Version: 2.1.0
|
Version: 2.1.0
|
||||||
Release: 1
|
Release: 2
|
||||||
Summary: openGauss is an open source relational database management system
|
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
|
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
|
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
|
Source1: %{cjson_name}-%{cjson_version}.tar.gz
|
||||||
Source2: %{zlib_name}-%{zlib_version}.tar.gz
|
Source2: %{zlib_name}-%{zlib_version}.tar.gz
|
||||||
Source3: %{protobuf_name}-%{protobuf_version}.tar.gz
|
Source3: %{protobuf_name}-%{protobuf_version}.tar.gz
|
||||||
@ -39,6 +39,9 @@ BuildRequires: bison flex DCF
|
|||||||
BuildRequires: numactl-devel
|
BuildRequires: numactl-devel
|
||||||
%endif
|
%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: lz4-devel protobuf-devel snappy-devel zstd-devel boost-devel
|
||||||
Requires: libcgroup-devel curl-devel unixODBC-devel jemalloc-devel
|
Requires: libcgroup-devel curl-devel unixODBC-devel jemalloc-devel
|
||||||
@ -51,8 +54,6 @@ Requires: numactl-devel
|
|||||||
%description
|
%description
|
||||||
openGauss kernel : openGauss is an open source relational database management system.
|
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}
|
%global debug_package %{nil}
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
@ -146,7 +147,7 @@ popd
|
|||||||
pushd openGauss-server-%{version}
|
pushd openGauss-server-%{version}
|
||||||
chmod +x ./configure
|
chmod +x ./configure
|
||||||
./configure \
|
./configure \
|
||||||
CC=g++ CFLAGS='-O2 -g3' \
|
CC=g++ CFLAGS='-O2' \
|
||||||
--prefix=%{apppath} \
|
--prefix=%{apppath} \
|
||||||
--3rd=${build_target} \
|
--3rd=${build_target} \
|
||||||
--enable-thread-safety \
|
--enable-thread-safety \
|
||||||
@ -190,7 +191,6 @@ set_mini_configparam(){
|
|||||||
then
|
then
|
||||||
echo "postgresql.conf.sample does not exist"
|
echo "postgresql.conf.sample does not exist"
|
||||||
else
|
else
|
||||||
echo "set opengauss lite config parameters"
|
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
SUBSTRING=$(echo $line | cut -d'=' -f 1)"= "
|
SUBSTRING=$(echo $line | cut -d'=' -f 1)"= "
|
||||||
if grep -q "$SUBSTRING" $config_sample_file ; then
|
if grep -q "$SUBSTRING" $config_sample_file ; then
|
||||||
@ -201,12 +201,43 @@ set_mini_configparam(){
|
|||||||
done < $config_mini_file
|
done < $config_mini_file
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
set_mini_configparam
|
|
||||||
|
|
||||||
su - opengauss -c "source ~/.bash_profile; gs_initdb -D /var/lib/opengauss/data -U opengauss --nodename=single_node"
|
start_opengauss(){
|
||||||
su - opengauss -c "source ~/.bash_profile; gs_ctl start -D /var/lib/opengauss/data"
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
# for install step
|
||||||
|
if [ $1 = 1 ]; then
|
||||||
|
set_mini_configparam
|
||||||
|
start_opengauss
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
@ -220,5 +251,9 @@ su - opengauss -c "source ~/.bash_profile; gs_ctl start -D /var/lib/opengauss/da
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Dec 13 2021 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-2
|
||||||
|
- Fix bugs: Mask dependencies acquired during installation
|
||||||
|
|
||||||
|
|
||||||
* Wed Dec 1 2021 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-1
|
* Wed Dec 1 2021 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-1
|
||||||
- Package init
|
- Package init
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user