diff --git a/README.en.md b/README.en.md deleted file mode 100644 index f10c67985c047f7ce3df0f5d4a32f099a1394936..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -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/) diff --git a/README.md b/README.md deleted file mode 100644 index b7ad81746d11223ede368fb91efcb4417c331441..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -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/) diff --git a/diff.patch b/diff.patch new file mode 100644 index 0000000000000000000000000000000000000000..55e484af9463dd1a1f0f9f6ee9c7f8e0a2bb0577 --- /dev/null +++ b/diff.patch @@ -0,0 +1,184 @@ +diff -uNr oceanbase-ce-4.2.1.8/deps/init/dep_create.sh oceanbase-ce-4.2.1.8_modify/deps/init/dep_create.sh +--- oceanbase-ce-4.2.1.8/deps/init/dep_create.sh 2024-10-30 06:18:24.000000000 +0000 ++++ oceanbase-ce-4.2.1.8_modify/deps/init/dep_create.sh 2024-11-22 02:07:03.268123767 +0000 +@@ -86,7 +86,7 @@ + version_ge "V10" && compat_centos8 && return + ;; + openEuler) +- version_ge "22" && compat_centos9 && return ++ version_ge "20" && compat_centos9 && return + ;; + opensuse-leap) + version_ge "15" && compat_centos7 && return +@@ -131,7 +131,7 @@ + version_ge "V10" && compat_centos8 && return + ;; + openEuler) +- version_ge "22" && compat_centos9 && return ++ version_ge "20" && compat_centos9 && return + ;; + ubuntu) + version_ge "22.04" && compat_centos9 && return +diff -uNr oceanbase-ce-4.2.1.8/deps/init/oceanbase.el7.aarch64.deps oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el7.aarch64.deps +--- oceanbase-ce-4.2.1.8/deps/init/oceanbase.el7.aarch64.deps 2024-10-30 06:18:24.000000000 +0000 ++++ oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el7.aarch64.deps 2024-11-22 10:33:37.980087893 +0000 +@@ -1,12 +1,12 @@ + [target-default] + os=7 + arch=aarch64 +-repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/7/aarch64/ ++repo=https://mirrors.oceanbase.com/oceanbase/development-kit/el/7/aarch64/ + + [target-community] + os=7 + arch=aarch64 +-repo=http://mirrors.aliyun.com/oceanbase/community/stable/el/7/aarch64/ ++repo=https://mirrors.oceanbase.com/oceanbase/community/stable/el/7/aarch64/ + + + [deps] +diff -uNr oceanbase-ce-4.2.1.8/deps/init/oceanbase.el7.x86_64.deps oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el7.x86_64.deps +--- oceanbase-ce-4.2.1.8/deps/init/oceanbase.el7.x86_64.deps 2024-10-30 06:18:24.000000000 +0000 ++++ oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el7.x86_64.deps 2024-11-22 10:33:37.980087893 +0000 +@@ -1,13 +1,13 @@ + [target-default] + os=7 + arch=x86_64 +-repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/7/x86_64/ ++repo=https://mirrors.oceanbase.com/oceanbase/development-kit/el/7/x86_64/ + + + [target-community] + os=7 + arch=x86_64 +-repo=http://mirrors.aliyun.com/oceanbase/community/stable/el/7/x86_64/ ++repo=https://mirrors.oceanbase.com/oceanbase/community/stable/el/7/x86_64/ + + + [deps] +diff -uNr oceanbase-ce-4.2.1.8/deps/init/oceanbase.el8.aarch64.deps oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el8.aarch64.deps +--- oceanbase-ce-4.2.1.8/deps/init/oceanbase.el8.aarch64.deps 2024-10-30 06:18:24.000000000 +0000 ++++ oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el8.aarch64.deps 2024-11-22 10:33:37.980087893 +0000 +@@ -1,12 +1,12 @@ + [target-default] + os=8 + arch=aarch64 +-repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/8/aarch64/ ++repo=https://mirrors.oceanbase.com/oceanbase/development-kit/el/8/aarch64/ + + [target-community] + os=8 + arch=aarch64 +-repo=http://mirrors.aliyun.com/oceanbase/community/stable/el/8/aarch64/ ++repo=https://mirrors.oceanbase.com/oceanbase/community/stable/el/8/aarch64/ + + + [deps] +diff -uNr oceanbase-ce-4.2.1.8/deps/init/oceanbase.el8.ppc64le.deps oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el8.ppc64le.deps +--- oceanbase-ce-4.2.1.8/deps/init/oceanbase.el8.ppc64le.deps 2024-10-30 06:18:24.000000000 +0000 ++++ oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el8.ppc64le.deps 2024-11-22 10:33:37.980087893 +0000 +@@ -1,12 +1,12 @@ + [target-default] + os=8 + arch=ppc64le +-repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/8/ppc64le/ ++repo=https://mirrors.oceanbase.com/oceanbase/development-kit/el/8/ppc64le/ + + [target-community] + os=8 + arch=ppc64le +-repo=http://mirrors.aliyun.com/oceanbase/community/stable/el/8/ppc64le/ ++repo=https://mirrors.oceanbase.com/oceanbase/community/stable/el/8/ppc64le/ + + [deps] + devdeps-apr-1.6.5-3.el8.ppc64le.rpm +diff -uNr oceanbase-ce-4.2.1.8/deps/init/oceanbase.el8.x86_64.deps oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el8.x86_64.deps +--- oceanbase-ce-4.2.1.8/deps/init/oceanbase.el8.x86_64.deps 2024-10-30 06:18:24.000000000 +0000 ++++ oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el8.x86_64.deps 2024-11-22 10:33:37.980087893 +0000 +@@ -1,12 +1,12 @@ + [target-default] + os=8 + arch=x86_64 +-repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/8/x86_64/ ++repo=https://mirrors.oceanbase.com/oceanbase/development-kit/el/8/x86_64/ + + [target-community] + os=8 + arch=x86_64 +-repo=http://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/ ++repo=https://mirrors.oceanbase.com/oceanbase/community/stable/el/8/x86_64/ + + + [deps] +diff -uNr oceanbase-ce-4.2.1.8/deps/init/oceanbase.el9.aarch64.deps oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el9.aarch64.deps +--- oceanbase-ce-4.2.1.8/deps/init/oceanbase.el9.aarch64.deps 2024-10-30 06:18:24.000000000 +0000 ++++ oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el9.aarch64.deps 2024-11-22 10:33:37.980087893 +0000 +@@ -1,17 +1,17 @@ + [target-default] + os=9 + arch=aarch64 +-repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/8/aarch64/ ++repo=https://mirrors.oceanbase.com/oceanbase/development-kit/el/8/aarch64/ + + [target-community] + os=9 + arch=aarch64 +-repo=http://mirrors.aliyun.com/oceanbase/community/stable/el/8/aarch64/ ++repo=https://mirrors.oceanbase.com/oceanbase/community/stable/el/8/aarch64/ + + [target-apr-el9] + os=9 + arch=aarch64 +-repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/9/aarch64/ ++repo=https://mirrors.oceanbase.com/oceanbase/development-kit/el/9/aarch64/ + + + [deps] +diff -uNr oceanbase-ce-4.2.1.8/deps/init/oceanbase.el9.ppc64le.deps oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el9.ppc64le.deps +--- oceanbase-ce-4.2.1.8/deps/init/oceanbase.el9.ppc64le.deps 2024-10-30 06:18:24.000000000 +0000 ++++ oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el9.ppc64le.deps 2024-11-22 10:33:37.980087893 +0000 +@@ -1,17 +1,17 @@ + [target-default] + os=9 + arch=ppc64le +-repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/8/ppc64le/ ++repo=https://mirrors.oceanbase.com/oceanbase/development-kit/el/8/ppc64le/ + + [target-community] + os=9 + arch=ppc64le +-repo=http://mirrors.aliyun.com/oceanbase/community/stable/el/8/ppc64le/ ++repo=https://mirrors.oceanbase.com/oceanbase/community/stable/el/8/ppc64le/ + + [target-el9] + os=9 + arch=ppc64le +-repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/9/ppc64le/ ++repo=https://mirrors.oceanbase.com/oceanbase/development-kit/el/9/ppc64le/ + + [deps] + devdeps-boost-1.74.0-1.el8.ppc64le.rpm +diff -uNr oceanbase-ce-4.2.1.8/deps/init/oceanbase.el9.x86_64.deps oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el9.x86_64.deps +--- oceanbase-ce-4.2.1.8/deps/init/oceanbase.el9.x86_64.deps 2024-10-30 06:18:24.000000000 +0000 ++++ oceanbase-ce-4.2.1.8_modify/deps/init/oceanbase.el9.x86_64.deps 2024-11-22 10:33:37.980087893 +0000 +@@ -1,17 +1,17 @@ + [target-default] + os=9 + arch=x86_64 +-repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/8/x86_64/ ++repo=https://mirrors.oceanbase.com/oceanbase/development-kit/el/8/x86_64/ + + [target-community] + os=9 + arch=x86_64 +-repo=http://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/ ++repo=https://mirrors.oceanbase.com/oceanbase/community/stable/el/8/x86_64/ + + [target-apr-el9] + os=9 + arch=x86_64 +-repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/9/x86_64/ ++repo=https://mirrors.oceanbase.com/oceanbase/development-kit/el/9/x86_64/ + + + [deps] diff --git a/oceanbase-ce-4.2.1.8.tar.gz b/oceanbase-ce-4.2.1.8.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e11a3666408d880f4679f1b03e8b9328ec4b7cb9 Binary files /dev/null and b/oceanbase-ce-4.2.1.8.tar.gz differ diff --git a/oceanbase-ce.spec b/oceanbase-ce.spec new file mode 100644 index 0000000000000000000000000000000000000000..06325436c3166c08ee8cfcf4aa88876ac74f461f --- /dev/null +++ b/oceanbase-ce.spec @@ -0,0 +1,232 @@ +%define euler_release 108000022024072217 + +Name: oceanbase-ce +Version: 4.2.1.8 +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_PACKAGE=ON -DENABLE_FATAL_ERROR_HANG=OFF -DENABLE_AUTO_FDO=ON -DENABLE_THIN_LTO=OFF \ + -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 +* Wed Nov 20 2024 wangzelin - 4.2.1.8-108000022024072217 +- new features: update version to 4.2.1.8 + +* Thu Apr 25 2024 wangzelin - 4.2.1.4-104000052024022918 +- new features: optimize systemd +- fix bugs: update license + +* Mon Mar 18 2024 wangzelin - 4.2.1.4-104000052024022918 +- new features: support for packaging with spec files +- new features: support for packaging on euler