!4 Update to 22.03-LTS-SP4

From: @cuiyudong123 
Reviewed-by: @linguanren 
Signed-off-by: @linguanren
This commit is contained in:
openeuler-ci-bot 2024-06-07 11:30:35 +00:00 committed by Gitee
commit 12f877fef1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 1243 additions and 73 deletions

View File

@ -1,36 +0,0 @@
# oceanbase-ce
#### Description
OceanBase is a distributed relational database
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -1,37 +0,0 @@
# oceanbase-ce
#### 介绍
OceanBase is a distributed relational database
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

1014
diff.patch Normal file

File diff suppressed because it is too large Load Diff

BIN
oceanbase-ce-4.2.1.4.tar.gz Normal file

Binary file not shown.

229
oceanbase-ce.spec Normal file
View File

@ -0,0 +1,229 @@
%define euler_release 104000052024022918
Name: oceanbase-ce
Version: 4.2.1.4
Release: %{euler_release}
Summary: oceanbase-ce
Group: Applications/Databases
License: Mulan PubL v2
Url: https://open.oceanbase.com/
Vendor: OceanBase Inc.
Prefix: /home/admin/oceanbase
Requires: curl, jq, systemd, oceanbase-ce-libs = %{version}
BuildRequires: wget, rpm, cpio, make, glibc-devel, glibc-headers, binutils, m4, python3, libtool, libaio
Autoreq: 0
Source0: oceanbase-ce-%{version}.tar.gz
Patch0: diff.patch
%global daemon_name oceanbase
%define __os_install_post %{nil}
%define _prefix /home/admin/oceanbase
%description
OceanBase is a distributed relational database
%global __requires_exclude ^(/bin/bash|/usr/bin/.*)$
%define _unpackaged_files_terminate_build 0
%global _missing_build_ids_terminate_build 0
%global arch %{_arch}
%global lto_jobs 10
%global src_dir %{?src_dir}
%global _find_debuginfo_opts -g
%define __strip %{?src_dir}/deps/3rd/usr/local/oceanbase/devtools/bin/llvm-strip
%undefine __brp_mangle_shebangs
%global _buildsubdir %{name}-%{version}-%{release}.%{arch}
%define _debugsource_template %{nil}
%global debug_package %{nil}
%package debuginfo
Summary: Debug information for OceanBase
Group: Development/Debug
%description debuginfo
This package provides debug information for package oceanbase-ce.
Debug information is useful when developing applications that use this
package or when debugging this package.
%package libs
Summary: Libraries for OceanBase
Group: System Environment/Libraries
%description libs
This package contains libraries for OceanBase.
%package libs-debuginfo
Summary: Debug information for OceanBase Libs
Group: Development/Debug
%description libs-debuginfo
This package provides debug information for package oceanbase-ce-libs.
Debug information is useful when developing applications that use this
package or when debugging this package.
%package sql-parser
Summary: Sql Parser Libraries for OceanBase
Group: System Environment/Libraries
%description sql-parser
This package contains sql pareser libraries for OceanBase.
%package utils
Summary: Tools for OceanBase
Group: Development/Tools
%description utils
This package contains tools for OceanBase.
%package utils-debuginfo
Summary: Debug information for OceanBase Utils
Group: Development/Debug
%description utils-debuginfo
This package provides debug information for package oceanbase-ce-utils.
Debug information is useful when developing applications that use this
package or when debugging this package.
%prep
%setup -q
%patch0 -p1
%build
chmod u+x build.sh
bash build.sh clean
bash build.sh release -DOB_BUILD_RPM=ON -DENABLE_FATAL_ERROR_HANG=OFF -DENABLE_AUTO_FDO=ON -DENABLE_THIN_LTO=ON \
-DOB_STATIC_LINK_LGPL_DEPS=OFF -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLTO_JOBS=%{lto_jobs} --init
cd build_release
make observer ob_sql_proxy_parser_static obtable obtable_static ob_admin ob_error -j16;
make install DESTDIR=$RPM_BUILD_ROOT
mv %{_buildrootdir}/%{_buildsubdir}/%{_prefix}/bin/obshell %{_builddir}/obshell
%{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} %{_builddir}/%{_buildsubdir}; %{nil}
mv %{_builddir}/obshell %{_buildrootdir}/%{_buildsubdir}/%{_prefix}/bin/obshell
echo "/usr/lib/debug/%{_prefix}/bin/observer.debug" > %{buildroot}/debuginfo_filelist
echo "/usr/lib/debug/%{_prefix}/lib/libaio.so.debug" > %{buildroot}/libs_debuginfo_filelist
echo "/usr/lib/debug/%{_prefix}/lib/libaio.so.1.debug" >> %{buildroot}/libs_debuginfo_filelist
echo "/usr/lib/debug/%{_prefix}/lib/libaio.so.1.0.1.debug" >> %{buildroot}/libs_debuginfo_filelist
echo "/usr/lib/debug/%{_prefix}/lib/libmariadb.so.debug" >> %{buildroot}/libs_debuginfo_filelist
echo "/usr/lib/debug/%{_prefix}/lib/libmariadb.so.3.debug" >> %{buildroot}/libs_debuginfo_filelist
echo "/usr/lib/debug/usr/bin/ob_admin.debug" > %{buildroot}/utils_debuginfo_filelist
echo "/usr/lib/debug/usr/bin/ob_error.debug" >> %{buildroot}/utils_debuginfo_filelist
# package infomation
%files
%defattr(-,root,root,0777)
%{_prefix}/admin
%{_prefix}/bin/import_srs_data.py
%{_prefix}/bin/import_time_zone_info.py
%{_prefix}/bin/observer
%{_prefix}/bin/obshell
%{_prefix}/etc/default_srs_data_mysql.sql
%{_prefix}/etc/fill_help_tables-ob.sql
%{_prefix}/etc/oceanbase_upgrade_dep.yml
%{_prefix}/etc/timezone_V1.log
%{_prefix}/etc/upgrade_checker.py
%{_prefix}/etc/upgrade_health_checker.py
%{_prefix}/etc/upgrade_post.py
%{_prefix}/etc/upgrade_pre.py
%{_prefix}/profile
%files debuginfo -f %{buildroot}/debuginfo_filelist
%defattr(-,root,root,0777)
%files libs
%defattr(-,root,root,0777)
%{_prefix}/lib/libaio.so
%{_prefix}/lib/libaio.so.1
%{_prefix}/lib/libaio.so.1.0.1
%{_prefix}/lib/libmariadb.so
%{_prefix}/lib/libmariadb.so.3
%files libs-debuginfo -f %{buildroot}/libs_debuginfo_filelist
%defattr(-,root,root,0777)
%files sql-parser
%defattr(-,root,root,0777)
%{_prefix}/include/ob_item_type.h
%{_prefix}/include/ob_sql_mode.h
%{_prefix}/include/ob_sql_parser.h
%{_prefix}/include/parse_malloc.h
%{_prefix}/include/parse_node.h
%{_prefix}/include/parser_proxy_func.h
%{_prefix}/lib/libob_sql_proxy_parser_static.a
%files utils
%defattr(-,root,root,0777)
/usr/bin/ob_admin
/usr/bin/ob_error
%files utils-debuginfo -f %{buildroot}/utils_debuginfo_filelist
%defattr(-,root,root,0777)
%pre
echo "execute pre install script"
version=%{version}
if [ "$1" -gt 1 ]; then
parent_name=$(cat /proc/$PPID/comm)
if [[ "$parent_name" != "ocp_mgragent" ]]; then
echo "The upgrade of the oceanbase $version is not allowed." >&2
exit 1
fi
fi
%post
echo "execute post install script"
cp -f %{_prefix}/profile/oceanbase.service /etc/systemd/system/oceanbase.service
chmod 644 /etc/systemd/system/oceanbase.service
chmod +x %{_prefix}/profile/oceanbase-service.sh
cp -f %{_prefix}/profile/oceanbase.cnf /etc/oceanbase.cnf
systemctl daemon-reload
# telemetry
/bin/bash %{_prefix}/profile/telemetry.sh $1 >/dev/null 2>&1
GREEN='\033[32m'
NC="\033[0m"
echo -e "${GREEN}To configure OceanBase${NC} : edit /etc/oceanbase.cnf"
echo -e "${GREEN}To start OceanBase${NC} : systemctl start oceanbase"
echo -e "${GREEN}To enable OceanBase auto reboot ${NC} : systemctl enable oceanbase"
echo -e "${GREEN}To get more infomation${NC} : https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000640297"
%preun
echo "execute pre uninstall script"
systemctl stop %{daemon_name}
systemctl disable %{daemon_name}
/bin/bash %{_prefix}/profile/oceanbase-service.sh destroy
rm -f /etc/systemd/system/oceanbase.service /etc/oceanbase.cnf
systemctl daemon-reload
# telemetry
/bin/bash %{_prefix}/profile/telemetry.sh $1 >/dev/null 2>&1
%postun
echo "execute post uninstall script"
json_file=%{_prefix}/profile/oceanbase.json
GREEN='\033[32m'
NC="\033[0m"
if [ $1 -eq 0 ]; then
rm -rf %{_prefix}/.meta %{_prefix}/log_obshell
# prepare clean script
echo "find %{_prefix}/ -mindepth 1 -maxdepth 1 ! -name lib -exec rm -rf {} +" > %{_prefix}/oceanbase_clean.sh
if [ -f "$json_file" ] && [ -s "$json_file" ]; then
redo_dir=$(cat "$json_file" | jq -r '.oceanbase_ce.server.observerConfig.redoDir')
echo "rm -rf $redo_dir" >> %{_prefix}/oceanbase_clean.sh
data_dir=$(cat "$json_file" | jq -r '.oceanbase_ce.server.observerConfig.dataDir')
echo "rm -rf $data_dir" >> %{_prefix}/oceanbase_clean.sh
echo "echo OK" >>%{_prefix}/oceanbase_clean.sh
fi
echo "Clean oceanbase script can clean ob all configuration files and all data files."
echo -e "${GREEN}To clean OceanBase${NC} : bash %{_prefix}/oceanbase_clean.sh"
fi
%changelog
* Thu Apr 25 2024 wangzelin <wangzelin.wzl@oceanbase.com> - 4.2.1.4-104000052024022918
- new features: optimize systemd
- fix bugs: update license
* Mon Mar 18 2024 wangzelin <wangzelin.wzl@oceanbase.com> - 4.2.1.4-104000052024022918
- new features: support for packaging with spec files
- new features: support for packaging on euler