Compare commits
10 Commits
1a00397516
...
a1cdcf808a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1cdcf808a | ||
|
|
bf786d082a | ||
|
|
9058ac2634 | ||
|
|
e62a5e4b05 | ||
|
|
0fefc3e6b3 | ||
|
|
35001aa01d | ||
|
|
684c7c0487 | ||
|
|
788ba02213 | ||
|
|
94fb4bcafb | ||
|
|
749050c2ed |
2818
0001-add-loong64-support.patch
Normal file
2818
0001-add-loong64-support.patch
Normal file
File diff suppressed because it is too large
Load Diff
42
0001-fix-release-version.patch
Normal file
42
0001-fix-release-version.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From 3c62ba67a1cbb55636567909f6389e89fe6db7e8 Mon Sep 17 00:00:00 2001
|
||||
From: baizg1107 <preloyalwhite@163.com>
|
||||
Date: Mon, 11 Oct 2021 11:04:49 +0800
|
||||
Subject: [PATCH] fix release version
|
||||
|
||||
---
|
||||
Makefile | 12 ++++++++----
|
||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index c36dc47..24ec57e 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -32,6 +32,10 @@ GOTEST := $(GO) test -p $(P)
|
||||
OVERALLS := GO111MODULE=on overalls
|
||||
STATICCHECK := GO111MODULE=on staticcheck
|
||||
TIDB_EDITION ?= Community
|
||||
+RELEASE_VERSION ?= v4.0.14
|
||||
+TIDB_BUILDTS ?= None
|
||||
+TIDB_GITHASH ?= None
|
||||
+TIDB_GITBRANCH ?= None
|
||||
|
||||
# Ensure TIDB_EDITION is set to Community or Enterprise before running build process.
|
||||
ifneq "$(TIDB_EDITION)" "Community"
|
||||
@@ -51,10 +55,10 @@ FILES := $$(find $$($(PACKAGE_DIRECTORIES)) -name "*.go")
|
||||
FAILPOINT_ENABLE := $$(find $$PWD/ -type d | grep -vE "(\.git|tools)" | xargs tools/bin/failpoint-ctl enable)
|
||||
FAILPOINT_DISABLE := $$(find $$PWD/ -type d | grep -vE "(\.git|tools)" | xargs tools/bin/failpoint-ctl disable)
|
||||
|
||||
-LDFLAGS += -X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=$(shell git describe --tags --dirty --always)"
|
||||
-LDFLAGS += -X "github.com/pingcap/tidb/util/versioninfo.TiDBBuildTS=$(shell date -u '+%Y-%m-%d %I:%M:%S')"
|
||||
-LDFLAGS += -X "github.com/pingcap/tidb/util/versioninfo.TiDBGitHash=$(shell git rev-parse HEAD)"
|
||||
-LDFLAGS += -X "github.com/pingcap/tidb/util/versioninfo.TiDBGitBranch=$(shell git rev-parse --abbrev-ref HEAD)"
|
||||
+LDFLAGS += -X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=$(RELEASE_VERSION)"
|
||||
+LDFLAGS += -X "github.com/pingcap/tidb/util/versioninfo.TiDBBuildTS=$(TIDB_BUILDTS)"
|
||||
+LDFLAGS += -X "github.com/pingcap/tidb/util/versioninfo.TiDBGitHash=$(TIDB_GITHASH)"
|
||||
+LDFLAGS += -X "github.com/pingcap/tidb/util/versioninfo.TiDBGitBranch=$(TIDB_GITBRANCH)"
|
||||
LDFLAGS += -X "github.com/pingcap/tidb/util/versioninfo.TiDBEdition=$(TIDB_EDITION)"
|
||||
|
||||
TEST_LDFLAGS = -X "github.com/pingcap/tidb/config.checkBeforeDropLDFlag=1"
|
||||
--
|
||||
2.27.0
|
||||
|
||||
1272
add-riscv-support-for-vendor.patch
Normal file
1272
add-riscv-support-for-vendor.patch
Normal file
File diff suppressed because it is too large
Load Diff
12
add-riscv-support.patch
Normal file
12
add-riscv-support.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -ur tidb-4.0.14/util/sys/linux/sys_linux.go tidb-4.0.14/util/sys/linux/sys_linux.go
|
||||
--- tidb-4.0.14/util/sys/linux/sys_linux.go 2021-07-26 18:50:15.000000000 +0800
|
||||
+++ tidb-4.0.14/util/sys/linux/sys_linux.go 2023-07-19 09:54:54.386949713 +0800
|
||||
@@ -27,7 +27,7 @@
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
- charsToString := func(ca []int8) string {
|
||||
+ charsToString := func(ca []uint8) string {
|
||||
s := make([]byte, len(ca))
|
||||
var lens int
|
||||
for ; lens < len(ca); lens++ {
|
||||
@ -7,8 +7,8 @@ Wants=network-online.target
|
||||
User=mysql
|
||||
Group=mysql
|
||||
EnvironmentFile=-/etc/sysconfig/tidb-server
|
||||
ExecStart=/usr/bin/tidb-server \$OPTIONS
|
||||
ExecReload=/bin/kill -HUP \$MAINPID
|
||||
ExecStart=/usr/bin/tidb-server $OPTIONS
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
KillSignal=SIGINT
|
||||
Restart=on-failure
|
||||
LimitNOFILE=65536
|
||||
|
||||
59
tidb.spec
59
tidb.spec
@ -1,9 +1,9 @@
|
||||
Name: tidb
|
||||
Version: 4.0.14
|
||||
Release: 1
|
||||
Release: 5
|
||||
Summary: TiDB is a distributed NewSQL database compatible with MySQL protocol
|
||||
|
||||
License: QL and STRUTIL
|
||||
License: Apache 2.0
|
||||
URL: https://github.com/pingcap/tidb
|
||||
Source0: https://github.com/pingcap/tidb/archive/refs/tags/v4.0.14.tar.gz
|
||||
Source1: tidb-server.service
|
||||
@ -11,6 +11,13 @@ Source2: tidb-server.toml
|
||||
#Go mod for non-extranet environments
|
||||
Source3: vendor.tar.gz
|
||||
Patch0: Set-GOFLAG-to-go-mod-vendor.patch
|
||||
Patch1: 0001-fix-release-version.patch
|
||||
%ifarch riscv64
|
||||
Patch2: add-riscv-support.patch
|
||||
Patch3: add-riscv-support-for-vendor.patch
|
||||
%endif
|
||||
Patch4: 0001-add-loong64-support.patch
|
||||
|
||||
BuildRequires: golang >= 1.10.0
|
||||
Requires(pre): shadow-utils
|
||||
Requires(post): systemd
|
||||
@ -19,8 +26,23 @@ Requires(post): systemd
|
||||
TiDB is a distributed NewSQL database compatible with MySQL protocol
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
%ifarch riscv64
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
tar xvf %{SOURCE3} -C .
|
||||
%patch3
|
||||
%else
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
tar xvf %{SOURCE3} -C .
|
||||
%ifarch loongarch64
|
||||
%patch4 -p1
|
||||
%endif
|
||||
%endif
|
||||
|
||||
|
||||
%build
|
||||
%make_build
|
||||
@ -40,6 +62,23 @@ cp %{SOURCE2} %{buildroot}%{_sysconfdir}/tidb
|
||||
mkdir -p %{buildroot}%{_unitdir}
|
||||
cp %{SOURCE1} %{buildroot}%{_unitdir}
|
||||
|
||||
%pre
|
||||
# Add the "mysql" user
|
||||
getent group mysql >/dev/null || groupadd -r -g 27 mysql
|
||||
getent passwd mysql >/dev/null || useradd -r -u 27 -g 27 -s /sbin/nologin -d /var/lib/mysql mysql
|
||||
exit 0
|
||||
|
||||
%post
|
||||
%systemd_post tidb-server.service
|
||||
/usr/bin/mkdir -p /var/lib/mysql
|
||||
/usr/bin/chown -R mysql:mysql /var/lib/mysql
|
||||
|
||||
%preun
|
||||
%systemd_preun tidb-server.service
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart tidb-server.service
|
||||
|
||||
%files
|
||||
%{_bindir}/tidb-server
|
||||
%{_unitdir}/tidb-server.service
|
||||
@ -51,5 +90,17 @@ cp %{SOURCE1} %{buildroot}%{_unitdir}
|
||||
%license LICENSE
|
||||
|
||||
%changelog
|
||||
* Fri Aug 20 2021 huanghaitao <huanghaitao8@huawei.com>
|
||||
* Mon Jul 01 2024 zhangxianting <zhangxianting@uniontech.com> - 4.0.14-5
|
||||
- add loongarch64 support
|
||||
|
||||
* Mon Jul 17 2023 zhangxiang <zhangxiang@iscas.ac.cn> - 4.0.14-4
|
||||
- add riscv64 support
|
||||
|
||||
* Mon Oct 11 2021 baizhonggui <baizhonggui@huawei.com> - 4.0.14-3
|
||||
- Fix commond tidb-server -V 'Release Version' not displayed
|
||||
|
||||
* Thu Sep 02 2021 sunguoshuai <sunguoshuai@huawei.com> - 4.0.14-2
|
||||
- Fix tidb-server.service start failure
|
||||
|
||||
* Fri Aug 20 2021 huanghaitao <huanghaitao8@huawei.com> - 4.0.14-1
|
||||
- Package init
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user