aboutsummaryrefslogtreecommitdiffstats
path: root/main/mariadb/APKBUILD
blob: cc08004b210ea918d184bb6bb4b5c92c8b06422d (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>

pkgname=mariadb
pkgver=5.5.43
pkgrel=5
pkgdesc="A fast SQL database server"
url="http://www.mariadb.org"
pkgusers="mysql"
pkggroups="mysql"
arch="all"
license='GPL'
depends="$pkgname-common"
depends_dev="openssl-dev zlib-dev"
makedepends="cmake openssl-dev zlib-dev readline-dev libaio-dev ncurses-dev
	linux-headers"
source="https://downloads.mariadb.org/interstitial/mariadb-$pkgver/source/mariadb-$pkgver.tar.gz
	$pkgname.initd
	fix-mysql-install-db-path.patch
	mariadb-10.0.18-MDEV-8115.patch"

subpackages="$pkgname-doc $pkgname-dev $pkgname-common $pkgname-libs
	$pkgname-client $pkgname-bench $pkgname-test:mytest
	mysql mysql-client:_compat_client mysql-bench:_compat_bench"

_builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	cd "$_builddir"
	for i in $source; do
		case $i in
			*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	cmake . -DBUILD_CONFIG=mysql_release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DSYSCONFDIR=/etc/mysql \
		-DMYSQL_DATADIR=/var/lib/mysql \
		-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock \
		-DDEFAULT_CHARSET=utf8 \
		-DDEFAULT_COLLATION=utf8_general_ci \
		-DENABLED_LOCAL_INFILE=ON \
		-DINSTALL_INFODIR=share/mysql/docs \
		-DINSTALL_MANDIR=share/man \
		-DINSTALL_PLUGINDIR=lib/mysql/plugin \
		-DINSTALL_SCRIPTDIR=bin \
		-DINSTALL_INCLUDEDIR=include/mysql \
		-DINSTALL_DOCREADMEDIR=share/mysql \
		-DINSTALL_SUPPORTFILESDIR=share/mysql \
		-DINSTALL_MYSQLSHAREDIR=share/mysql \
		-DINSTALL_DOCDIR=share/mysql/docs \
		-DINSTALL_SHAREDIR=share/mysql \
		-DWITH_READLINE=ON \
		-DWITH_ZLIB=system \
		-DWITH_SSL=system \
		-DWITH_LIBWRAP=OFF \
		-DWITH_JEMALLOC=no \
		-DWITH_EXTRA_CHARSETS=complex \
		-DWITH_EMBEDDED_SERVER=ON \
		-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
		-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
		-DWITH_INNOBASE_STORAGE_ENGINE=1 \
		-DWITH_PARTITION_STORAGE_ENGINE=1 \
		-DWITHOUT_TOKUDB_STORAGE_ENGINE=1 \
		-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
		-DWITHOUT_FEDERATED_STORAGE_ENGINE=1 \
		-DWITHOUT_PBXT_STORAGE_ENGINE=1 \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir/" install || return 1

	install -Dm 755 "$startdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname || return 1

	# use small example config as default, which has tcp disabled
	install -D  "$pkgdir"/usr/share/mysql/my-medium.cnf \
		"$pkgdir"/etc/mysql/my.cnf || return 1

	install -dDo mysql "$pkgdir"/var/log/mysql || return 1
	install -dDo mysql "$pkgdir"/var/run/mysqld || return 1

	# libmysqlclient_r is no more.  Upstream tries to replace it with
	# symlinks but that really doesn't work (wrong soname in particular).
	# We'll keep just the devel libmysqlclient_r.so link, so that
	# rebuilding without any source change is enough to get rid of
	# dependency on libmysqlclient_r.
	rm -f "$pkgdir"/usr/lib/libmysqlclient_r.so*
	ln -s libmysqlclient.so "$pkgdir"/usr/lib/libmysqlclient_r.so

	# mysql-test includes one executable that doesn't belong under
	# /usr/share, so move it and provide a symlink
	mv "$pkgdir"/usr/mysql-test/lib/My/SafeProcess/my_safe_process \
		"$pkgdir"/usr/bin
	ln -s ../../../../bin/my_safe_process \
		"$pkgdir"/usr/mysql-test/lib/My/SafeProcess/my_safe_process
}

dev(){
	default_dev
	replaces="libmysqlclient mysql-dev"
	provides="mysql-dev=$pkgver-r$pkgrel"
}

libs() {
	pkgdesc="MariaDB client library"
	replaces="mariadb libmysqlclient"
	depends="mariadb-common"
	mkdir -p "$subpkgdir"/usr/lib \
		"$subpkgdir"/usr/share/mysql \
		|| return 1
	mv "$pkgdir"/usr/lib/libmysqlclient.so* \
		"$subpkgdir"/usr/lib/ \
		|| return 1
}

common() {
	pkgdesc="MariaDB common files for boh server and client"
	replaces="mysql-common"
	depends=
	mkdir -p "$subpkgdir"/usr/share/mysql
	mv "$pkgdir"/etc "$subpkgdir"/ || return 1
	local lang="charsets danish english french greek italian korean norwegian-ny
		portuguese russian slovak swedish czech dutch estonian german
		hungarian japanese norwegian polish romanian serbian spanish
		ukrainian"
	for l in $lang; do
		mv "$pkgdir"/usr/share/mysql/$l \
			"$subpkgdir"/usr/share/mysql/ || return 1
	done
}

mytest() {
	pkgdesc="The test suite distributed with MariaDB"
	mkdir -p "$subpkgdir"/usr/bin || return 1
	mv "$pkgdir"/usr/bin/mysql_client_test \
		"$pkgdir"/usr/mysql-test \
		"$pkgdir"/usr/bin/my_safe_process \
		"$subpkgdir"/usr/bin/ \
		|| return 1
}

client() {
	pkgdesc="client for the MariaDB database"
	depends="mariadb-common"
	install=""
	local bins="myisam_ftdump mysql mysqlaccess mysqladmin mysqlbug
		mysqlcheck mysqldump mysqldumpslow mysql_find_rows
		mysql_fix_extensions mysqlimport mysqlshow mysql_waitpid"
	mkdir -p "$subpkgdir"/usr/bin/ || return 1
	for i in $bins; do
		mv "$pkgdir"/usr/bin/${i} "$subpkgdir"/usr/bin/ || return 1
	done
}

bench() {
	pkgdesc="MariaDB benchmark scripts and data"
	replaces="mariadb"
	mkdir -p "$subpkgdir"/usr/share/
	mv "$pkgdir"/usr/sql-bench "$subpkgdir"/usr/share
}

_compat() {
	pkgdesc="Dummy package for $1 migration"
	depends="$2"
	mkdir -p "$subpkgdir"
}

mysql() { _compat mysql mariadb; }
_compat_client() { _compat mysql-client mariadb-client; }
_compat_bench() { _compat mysql-bench mariadb-client; }

md5sums="c8760d6b5890fc1de76c07af48092c88  mariadb-5.5.43.tar.gz
62fb1ce5bad87bb15cf8e289ce686885  mariadb.initd
bcaee4dbbf77f4432ecd9796714be75b  fix-mysql-install-db-path.patch
4be445c305df3cca61aa9a40a1886964  mariadb-10.0.18-MDEV-8115.patch"
sha256sums="a0709997140549154edb87c9dfab564cd4755b238251acbf42369118f9bb4d01  mariadb-5.5.43.tar.gz
696fa87b87f37b6c310da6c1ef5f8759bd5b4b1654fbcf0561c9f0592bfa8dd9  mariadb.initd
52e3827529b53c02a9ba263bd395bde773d2666853b252a131e824bb256f36d5  fix-mysql-install-db-path.patch
fee272aaaf1f3c427e986a4fa4c4c9362b45181ce4799e60f3ba856aedf2efa7  mariadb-10.0.18-MDEV-8115.patch"
sha512sums="fa9b463843ebf70e3a462ee5fdfa34aedd35194f3593f7ec1fc5f17663e798610ade46925b31f9f96e06503508ae840bfed54ae7b6661affa4d5b630d475f1db  mariadb-5.5.43.tar.gz
510207ba29ef40e017840fb39bc51285374d2e2ed0d70eb65916e5415e6a993af19b4fd3b579af89173b1e3b0d7c5115d8f43b22c16596b4a83a9f8353154400  mariadb.initd
4aca6e42f4dec9d7122388b1d1bc40762a4677a1beafcf448b900d443a2f778a8fd52bc7f1b5c9697e0ad13473e6d01eb29607a40de195ac07857cd4dfc2a1fe  fix-mysql-install-db-path.patch
e8e370bb0d09151ea718a5e09c4f92c4d9d2e05e59699e1a0fb2003bc161f16a0397cd1bc4ebca2a7e74595ad159bb225e559192658b1bdeb7534d8f80558d35  mariadb-10.0.18-MDEV-8115.patch"