Compare commits
11 Commits
ec828d2d7a
...
b7631721b6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7631721b6 | ||
|
|
b0573f51cb | ||
|
|
ebf398433b | ||
|
|
0084fbccda | ||
|
|
4f9bb33e1f | ||
|
|
18f4b4012c | ||
|
|
a3cb9997f7 | ||
|
|
f93eefc569 | ||
|
|
aaa7918a97 | ||
|
|
69c8c7394b | ||
|
|
d2f93ae4ff |
82
0002-add-kylinsec-platform.patch
Normal file
82
0002-add-kylinsec-platform.patch
Normal file
@ -0,0 +1,82 @@
|
||||
From 58207338fe6b98b5eee54757d99e40f8621e0f04 Mon Sep 17 00:00:00 2001
|
||||
From: panchenbo <panchenbo@kylinsec.com.cn>
|
||||
Date: Mon, 10 Apr 2023 10:15:12 +0800
|
||||
Subject: [PATCH] add support for KylinSec platform
|
||||
|
||||
---
|
||||
.../build/script/package_opengauss.sh | 10 ++++++----
|
||||
openGauss-server-2.1.0/src/get_PlatForm_str.sh | 13 +++++++++++++
|
||||
2 files changed, 19 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/openGauss-server-2.1.0/build/script/package_opengauss.sh b/openGauss-server-2.1.0/build/script/package_opengauss.sh
|
||||
index f6447b2..8b82cb1 100755
|
||||
--- a/openGauss-server-2.1.0/build/script/package_opengauss.sh
|
||||
+++ b/openGauss-server-2.1.0/build/script/package_opengauss.sh
|
||||
@@ -62,10 +62,12 @@ elif [ X"$kernel" == X"euleros" ]; then
|
||||
dist_version="EulerOS"
|
||||
elif [ X"$kernel" == X"kylin" ]; then
|
||||
dist_version="Kylin"
|
||||
+elif [ X"$kernel" == X"kylinsec" ]; then
|
||||
+ dist_version="KylinSec"
|
||||
elif [ X"$kernel" = X"ubuntu" ]; then
|
||||
dist_version="Ubuntu"
|
||||
else
|
||||
- echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64) and Ubuntu(x86) platform."
|
||||
+ echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64), KylinSec(aarch64) and Ubuntu(x86) platform."
|
||||
echo "Kernel is $kernel"
|
||||
exit 1
|
||||
fi
|
||||
@@ -122,8 +124,8 @@ done
|
||||
##add platform architecture information
|
||||
PLATFORM_ARCH=$(uname -p)
|
||||
if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
|
||||
- if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "Kylin" ] ; then
|
||||
- echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), Kylin(aarch64) platform."
|
||||
+ if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "Kylin" ] && [ "$dist_version" != "KylinSec" ] ; then
|
||||
+ echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), Kylin(aarch64), KylinSec(aarch64) platform."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -220,7 +222,7 @@ ROOT_DIR=$(dirname "$ROOT_DIR")
|
||||
PLAT_FORM_STR=$(sh "${ROOT_DIR}/src/get_PlatForm_str.sh")
|
||||
if [ "${PLAT_FORM_STR}"x == "Failed"x ]
|
||||
then
|
||||
- echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64) platform."
|
||||
+ echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64), KylinSec(aarch64) platform."
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
diff --git a/openGauss-server-2.1.0/src/get_PlatForm_str.sh b/openGauss-server-2.1.0/src/get_PlatForm_str.sh
|
||||
index 9fff29a..ce73a9c 100755
|
||||
--- a/openGauss-server-2.1.0/src/get_PlatForm_str.sh
|
||||
+++ b/openGauss-server-2.1.0/src/get_PlatForm_str.sh
|
||||
@@ -29,6 +29,9 @@ then
|
||||
elif [ -f "/etc/kylin-release" ]
|
||||
then
|
||||
kernel=$(cat /etc/kylin-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
|
||||
+elif [ -f "/etc/kylinsec-release" ]
|
||||
+then
|
||||
+ kernel=$(cat /etc/kylinsec-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
|
||||
else
|
||||
kernel=$(lsb_release -d | awk -F ' ' '{print $2}'| tr A-Z a-z)
|
||||
fi
|
||||
@@ -135,6 +138,16 @@ then
|
||||
plat_form_str=kylin_"$cpu_bit"
|
||||
fi
|
||||
|
||||
+##################################################################################
|
||||
+# kylinsec platform
|
||||
+# the result form like this: kylinsec_aarch64
|
||||
+##################################################################################
|
||||
+if [ "$kernel"x = "kylinsec"x ]
|
||||
+then
|
||||
+ plat_form_str=kylinsec_"$cpu_bit"
|
||||
+fi
|
||||
+
|
||||
+
|
||||
##################################################################################
|
||||
# ubuntu platform
|
||||
# the result form like this: ubuntu_x86_64
|
||||
--
|
||||
2.27.0
|
||||
|
||||
38
0004-add-custom-platform.patch
Normal file
38
0004-add-custom-platform.patch
Normal file
@ -0,0 +1,38 @@
|
||||
diff -Naur a/openGauss-server-2.1.0/build/script/package_opengauss.sh b/openGauss-server-2.1.0/build/script/package_opengauss.sh
|
||||
--- a/openGauss-server-2.1.0/build/script/package_opengauss.sh 2024-11-06 09:45:40.281917930 +0800
|
||||
+++ b/openGauss-server-2.1.0/build/script/package_opengauss.sh 2024-11-06 15:13:03.650408634 +0800
|
||||
@@ -66,6 +66,9 @@
|
||||
dist_version="KylinSec"
|
||||
elif [ X"$kernel" = X"ubuntu" ]; then
|
||||
dist_version="Ubuntu"
|
||||
+# as the last judgement condition, the CUSTOM_VENDOR_PLACEHOLDER will be replace by vendor macro in spec file
|
||||
+elif [ X"$kernel" = X"CUSTOM_VENDOR_PLACEHOLDER_LOWERCASE" ]; then
|
||||
+ dist_version="CUSTOM_VENDOR_PLACEHOLDER"
|
||||
else
|
||||
echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64), KylinSec(aarch64) and Ubuntu(x86) platform."
|
||||
echo "Kernel is $kernel"
|
||||
@@ -124,7 +127,7 @@
|
||||
##add platform architecture information
|
||||
PLATFORM_ARCH=$(uname -p)
|
||||
if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
|
||||
- if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "Kylin" ] && [ "$dist_version" != "KylinSec" ] ; then
|
||||
+ if [ "$dist_version" != "openEuler" ] && [ "$dist_version" != "EulerOS" ] && [ "$dist_version" != "Kylin" ] && [ "$dist_version" != "KylinSec" ] && [ "$dist_version" != "CUSTOM_VENDOR_PLACEHOLDER" ]; then
|
||||
echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), Kylin(aarch64), KylinSec(aarch64) platform."
|
||||
exit 1
|
||||
fi
|
||||
diff -Naur a/openGauss-server-2.1.0/src/get_PlatForm_str.sh b/openGauss-server-2.1.0/src/get_PlatForm_str.sh
|
||||
--- a/openGauss-server-2.1.0/src/get_PlatForm_str.sh 2024-11-06 09:45:40.281917930 +0800
|
||||
+++ b/openGauss-server-2.1.0/src/get_PlatForm_str.sh 2024-11-06 14:40:31.071558697 +0800
|
||||
@@ -163,6 +163,12 @@
|
||||
# other platform
|
||||
#
|
||||
##################################################################################
|
||||
+# as the last judgement condition, the CUSTOM_VENDOR_PLACEHOLDER will be replace by vendor macro in spec file
|
||||
+if [ -z "$plat_form_str" ] && [ "$kernel"x = "CUSTOM_VENDOR_PLACEHOLDER_LOWERCASE"x ]
|
||||
+then
|
||||
+ plat_form_str=CUSTOM_VENDOR_PLACEHOLDER_"$cpu_bit"
|
||||
+fi
|
||||
+
|
||||
if [ -z "$plat_form_str" ]
|
||||
then
|
||||
echo "Failed"
|
||||
1789
3000-add-sw_64-support.patch
Normal file
1789
3000-add-sw_64-support.patch
Normal file
File diff suppressed because it is too large
Load Diff
40
compile_2309.patch
Normal file
40
compile_2309.patch
Normal file
@ -0,0 +1,40 @@
|
||||
diff -crN '--exclude=.git' '--exclude=.gitee' openGauss-server-2.1.0/src/bin/pg_basebackup/pg_basebackup.cpp openGauss-server-2.1.0-edit/src/bin/pg_basebackup/pg_basebackup.cpp
|
||||
*** openGauss-server-2.1.0/src/bin/pg_basebackup/pg_basebackup.cpp 2021-12-13 16:23:09.000000000 +0800
|
||||
--- openGauss-server-2.1.0-edit/src/bin/pg_basebackup/pg_basebackup.cpp 2023-08-14 10:19:02.650301090 +0800
|
||||
***************
|
||||
*** 1584,1590 ****
|
||||
struct dirent* ent;
|
||||
while (1) {
|
||||
ent = readdir(dir);
|
||||
! if (ent <= 0) {
|
||||
break;
|
||||
}
|
||||
if ((strcmp(".", ent->d_name) == 0) || (strcmp("..", ent->d_name) == 0)) {
|
||||
--- 1584,1590 ----
|
||||
struct dirent* ent;
|
||||
while (1) {
|
||||
ent = readdir(dir);
|
||||
! if (ent == NULL) {
|
||||
break;
|
||||
}
|
||||
if ((strcmp(".", ent->d_name) == 0) || (strcmp("..", ent->d_name) == 0)) {
|
||||
diff -crN '--exclude=.git' '--exclude=.gitee' openGauss-server-2.1.0/src/gausskernel/runtime/opfusion/opfusion_util.cpp openGauss-server-2.1.0-edit/src/gausskernel/runtime/opfusion/opfusion_util.cpp
|
||||
*** openGauss-server-2.1.0/src/gausskernel/runtime/opfusion/opfusion_util.cpp 2021-12-13 16:23:09.000000000 +0800
|
||||
--- openGauss-server-2.1.0-edit/src/gausskernel/runtime/opfusion/opfusion_util.cpp 2023-08-14 10:18:07.476105895 +0800
|
||||
***************
|
||||
*** 405,411 ****
|
||||
|
||||
/* check whether to have order by */
|
||||
if (node->aggstrategy != AGG_PLAIN ||
|
||||
! node->groupingSets > 0) {
|
||||
return NOBYPASS_NOT_PLAIN_AGG;
|
||||
}
|
||||
|
||||
--- 405,411 ----
|
||||
|
||||
/* check whether to have order by */
|
||||
if (node->aggstrategy != AGG_PLAIN ||
|
||||
! node->groupingSets != NIL) {
|
||||
return NOBYPASS_NOT_PLAIN_AGG;
|
||||
}
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
[ -f /etc/profile ] && source /etc/profile
|
||||
|
||||
export GAUSSHOME=/usr/local/opengauss/
|
||||
export LD_LIBRARY_PATH=/usr/local/opengauss/lib:$LD_LIBRARY_PATH
|
||||
export PATH=/usr/local/opengauss/bin:$PATH
|
||||
|
||||
@ -9,10 +9,11 @@
|
||||
%define port 7654
|
||||
%define datapath /var/lib/opengauss
|
||||
%define apppath %{_prefix}/local/opengauss
|
||||
%define vendor_lowercase %{?_vendor:%(echo %{_vendor} | tr '[:upper:]' '[:lower:]')}%{!?_vendor:openeuler}
|
||||
|
||||
Name: opengauss
|
||||
Version: 2.1.0
|
||||
Release: 4
|
||||
Release: 12
|
||||
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
|
||||
@ -32,8 +33,12 @@ Patch21: 0002-zlib.patch
|
||||
Patch22: 0003-zlib.patch
|
||||
Patch23: makefile-miniunz.patch
|
||||
Patch40: 0001-orc.patch
|
||||
Patch41: 0002-add-kylinsec-platform.patch
|
||||
Patch42: 0004-add-custom-platform.patch
|
||||
Patch50: openssl3-adptor.patch
|
||||
Patch51: compile_2309.patch
|
||||
|
||||
Patch3000: 3000-add-sw_64-support.patch
|
||||
BuildRequires: cmake gcc gcc-c++ openssl-devel python
|
||||
BuildRequires: cjson lz4-devel protobuf-devel snappy-devel zstd-devel boost-devel
|
||||
BuildRequires: libcgroup-devel libcurl-devel unixODBC-devel jemalloc-devel krb5-devel
|
||||
@ -42,6 +47,9 @@ BuildRequires: bison flex DCF
|
||||
%ifnarch aarch64 %{arm}
|
||||
BuildRequires: numactl-devel
|
||||
%endif
|
||||
%ifarch sw_64
|
||||
BuildRequires: libatomic
|
||||
%endif
|
||||
|
||||
%global _privatelibs lib(cjson|ecpg|z|pg|pq)\\.so*
|
||||
%global __provides_exclude %{_privatelibs}
|
||||
@ -50,7 +58,7 @@ BuildRequires: numactl-devel
|
||||
Requires: lz4-devel protobuf-devel snappy-devel zstd-devel boost-devel
|
||||
Requires: libcgroup-devel libcurl-devel unixODBC-devel jemalloc-devel
|
||||
Requires: java-1.8.0-openjdk-devel libedit-devel libaio-devel
|
||||
Requires: DCF
|
||||
Requires: DCF lsof
|
||||
%ifnarch aarch64 %{arm}
|
||||
Requires: numactl-devel
|
||||
%endif
|
||||
@ -70,6 +78,7 @@ openGauss kernel : openGauss is an open source relational database management sy
|
||||
pushd openGauss-server-%{version}
|
||||
%patch0 -p1
|
||||
%patch50 -p1
|
||||
%patch51 -p1
|
||||
popd
|
||||
|
||||
pushd %{cjson_name}-%{cjson_version}
|
||||
@ -87,6 +96,17 @@ pushd %{orc_name}-%{orc_version}
|
||||
%patch40 -p1
|
||||
popd
|
||||
|
||||
%patch41 -p1
|
||||
# custom vendor
|
||||
%if "%{_vendor}" != "openEuler"
|
||||
sed -i 's/CUSTOM_VENDOR_PLACEHOLDER_LOWERCASE/%{vendor_lowercase}/g' %{PATCH42}
|
||||
sed -i 's/CUSTOM_VENDOR_PLACEHOLDER/%{_vendor}/g' %{PATCH42}
|
||||
%endif
|
||||
%patch42 -p1
|
||||
|
||||
%ifarch sw_64
|
||||
%patch3000 -p1
|
||||
%endif
|
||||
%build
|
||||
########### build cjson ###########
|
||||
build_target=$(pwd)/deps_binarylibs
|
||||
@ -102,12 +122,18 @@ CONFIGURE_EXTRA_FLAG="--64"
|
||||
%ifarch aarch64
|
||||
CONFIGURE_EXTRA_FLAG=""
|
||||
%endif
|
||||
%ifarch sw_64
|
||||
CONFIGURE_EXTRA_FLAG=""
|
||||
%endif
|
||||
./configure ${CONFIGURE_EXTRA_FLAG} --prefix=${build_target}/zlib
|
||||
sed -i '21a CFLAGS += -fPIC' Makefile
|
||||
MAKE_EXTRA_FLAG="-m64"
|
||||
%ifarch aarch64
|
||||
MAKE_EXTRA_FLAG=""
|
||||
%endif
|
||||
%ifarch sw_64
|
||||
MAKE_EXTRA_FLAG=""
|
||||
%endif
|
||||
make CFLAGS="-fPIE -fPIC" SFLAGS="-O2 -fPIC -fstack-protector-strong -Wl,-z,noexecstack -Wl,-z,relro,-z,now ${MAKE_EXTRA_FLAG} -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN" %{?_smp_mflags}
|
||||
make install
|
||||
cd contrib/minizip/
|
||||
@ -153,9 +179,15 @@ popd
|
||||
|
||||
########### build opengauss ###########
|
||||
pushd openGauss-server-%{version}
|
||||
echo "PRODUCT=openGauss" > build/script/gauss.spec
|
||||
echo "VERSION=2.1.0" >> build/script/gauss.spec
|
||||
chmod +x ./configure
|
||||
./configure \
|
||||
%ifarch sw_64
|
||||
CC=g++ CFLAGS='-O0' \
|
||||
%else
|
||||
CC=g++ CFLAGS='-O2' \
|
||||
%endif
|
||||
--prefix=%{apppath} \
|
||||
--3rd=${build_target} \
|
||||
--enable-thread-safety \
|
||||
@ -186,15 +218,28 @@ install -m 644 %{SOURCE6} %{buildroot}/%{apppath}/script/opengauss.service
|
||||
install -m 700 %{SOURCE7} %{buildroot}/%{apppath}/script/autostart.sh
|
||||
|
||||
%pre
|
||||
/usr/sbin/groupadd -g 39 -o -r opengauss >/dev/null 2>&1 || :
|
||||
/usr/sbin/useradd -M -N -g opengauss -o -r -d %{datapath} -s /bin/bash \
|
||||
-c "openGauss Server" -u 39 opengauss >/dev/null 2>&1 || :
|
||||
/usr/sbin/groupadd opengauss >/dev/null 2>&1 || :
|
||||
/usr/sbin/useradd -M -N -g opengauss -d %{datapath} -s /bin/bash \
|
||||
-c "openGauss Server" opengauss >/dev/null 2>&1 || :
|
||||
|
||||
# for install step
|
||||
if [ $1 = 1 ]; then
|
||||
portinfo=$(lsof -i:%{port})
|
||||
if [ "${portinfo}" != "" ]; then
|
||||
echo "The port[%{port}] is occupied. Please use command 'lsof -i:%{port} to check it.'"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
%post
|
||||
# set opengauss mini config parameters
|
||||
set_mini_configparam(){
|
||||
config_mini_file=%{apppath}/share/postgresql/opengauss_config_file_mini
|
||||
|
||||
# set guc parameters
|
||||
echo "port = %{port}" >> ${config_mini_file}
|
||||
echo "synchronous_commit = off" >> ${config_mini_file}
|
||||
echo "listen_addresses = '127.0.0.1'" >> ${config_mini_file}
|
||||
|
||||
config_sample_file=%{apppath}/share/postgresql/postgresql.conf.sample
|
||||
if [[ -f $config_mini_file ]]
|
||||
@ -229,13 +274,13 @@ start_opengauss(){
|
||||
return 0
|
||||
fi
|
||||
|
||||
result=`su - opengauss -c "source ~/.bash_profile; gs_initdb -D /var/lib/opengauss/data -U opengauss --nodename=single_node"`
|
||||
result=`su - opengauss -c "source /var/lib/opengauss/.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"`
|
||||
result=`su - opengauss -c "source /var/lib/opengauss/.bash_profile; gs_ctl start -D /var/lib/opengauss/data"`
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Start openGauss database failed."
|
||||
echo $result
|
||||
@ -266,7 +311,7 @@ remove_service(){
|
||||
fi
|
||||
}
|
||||
clear_database(){
|
||||
pid=$(ps -ef | grep /var/lib/opengauss/data | grep -v grep | awk '{print $2}')
|
||||
pid=$(ps -ef | grep /usr/local/opengauss/bin/gaussdb | grep -v grep | awk '{print $2}')
|
||||
if [ "$pid" != "" ]; then
|
||||
kill -9 $pid
|
||||
fi
|
||||
@ -290,9 +335,33 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Sat Feb 11 2023 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-4
|
||||
* Mon Nov 11 2024 xiaochn <xiaochuannan@inspur.com> - 2.1.0-12
|
||||
- fix build error when custom vendor
|
||||
|
||||
* Fri Aug 18 2023 panchenbo <panchenbo@kylinsec.com.cn> - 2.1.0-11
|
||||
- add sw_64 support
|
||||
|
||||
* Mon Aug 14 2023 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-10
|
||||
- Fix bugs: #I7QJRO
|
||||
|
||||
* Tue Jun 6 2023 dillon chen<dillon.chen@gmail.com> - 2.1.0-9
|
||||
- Fix bugs: #I677QX; add lsof
|
||||
|
||||
* Mon Apr 10 2023 panchenbo <panchenbo@kylinsec.com.cn> - 2.1.0-8
|
||||
- add /etc/kylinsec-release support for KylinSec
|
||||
|
||||
* Sat Feb 11 2023 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-7
|
||||
- Fix bugs: #I6ED94
|
||||
|
||||
* Wed Mar 30 2022 ouyangminxiang <ouyangminxiang@kylinsec.com.cn> - 2.1.0-6
|
||||
- add kylinsec platform
|
||||
|
||||
* Sat Mar 12 2022 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-5
|
||||
- Fix bugs: #I4VDYQ #I4V624 #I4UOUU #I4TCDB #I4TCB8
|
||||
|
||||
* Thu Jan 27 2022 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-4
|
||||
- Fix bugs: #I4SDWX
|
||||
|
||||
* Sat Jan 22 2022 zhangxubo <zhangxubo1@huawei.com> - 2.1.0-3
|
||||
- Fix bugs: #I4RVNX
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user