blob: dfea2719a4264b6da2a1af42cc896a1a59595e17 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# Maintainer: Xuanwo <xuanwo@archlinuxcn.org>
# Maintainer: Allen Zhong <pdev@zhoal.pw>
pkgname=tidb
pkgver=8.4.0
pkgrel=1
pkgdesc='A distributed HTAP database compatible with the MySQL protocol'
makedepends=('go' 'make')
arch=('x86_64')
url='https://github.com/pingcap/tidb'
license=('Apache')
provides=('tidb-server')
backup=(etc/tidb/tidb.toml)
depends=('tikv')
install=tidb.install
source=(tidb-${pkgver}.tar.gz::https://github.com/pingcap/tidb/archive/v${pkgver}.tar.gz
tidb.service
tidb-sysusers.conf
tidb-tmpfiles.conf
tidb.toml)
sha256sums=('857ede56b8cf49c9db39d26c4a0ddd26093b8eaaa69c81be110a3b7f75a792dd'
'22318c19bb89ff5a0852df5186cc1496214cd49f2264192413a326d1e8c93dc9'
'2b147d80985e714d5f861baf76591104c07058b9b6fa573bf0676d675cf8fc20'
'30ce83fbec8f102c30e438282bb5b18c026d08480f2386d68f1116c12481bf66'
'f32709894c0d2c105a4398dcaf027f1cbdee359a2a6747f43cac819e9df25517')
_gopkgname='github.com/pingcap/tidb'
prepare() {
export GOPATH="$srcdir/build"
rm -rf "$GOPATH/src/$_gopkgname"
mkdir -p `dirname "$GOPATH/src/$_gopkgname"`
mv -Tv "$srcdir/tidb-${pkgver}" "$GOPATH/src/$_gopkgname"
# patch Makefile
sed -i '/shell git /d' "$GOPATH/src/$_gopkgname/Makefile.common"
}
build() {
export GOPATH="$srcdir/build"
export PATH=$GOPATH/bin:$PATH
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
cd $GOPATH/src/$_gopkgname
_LDFLAGS="-X $_gopkgname/pkg/parser/mysql.TiDBReleaseVersion=$pkgver -X $_gopkgname/pkg/util/versioninfo.TiDBGitHash=v$pkgver -X $_gopkgname/pkg/util/versioninfo.TiDBGitBranch=release"
BUILD_FLAG=$GOFLAGS LDFLAGS=$_LDFLAGS make server
}
package() {
# Install binary
install -Dm755 "$srcdir/build/src/$_gopkgname/bin/tidb-server" "$pkgdir/usr/bin/tidb-server"
# Install systemd service
install -Dm644 "$srcdir/tidb.service" "$pkgdir/usr/lib/systemd/system/tidb.service"
# Install sysusers
install -Dm644 "$srcdir/tidb-sysusers.conf" "$pkgdir/usr/lib/sysusers.d/tidb.conf"
# Install tmpfiles
install -Dm644 "$srcdir/tidb-tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/tidb.conf"
# Install default config
install -Dm644 tidb.toml "$pkgdir/etc/tidb/tidb.toml"
}
# vim: ft=sh syn=sh et
|