APKBUILD 9.85 KB
Newer Older
1
# Contributor: Sergei Lukin <sergej.lukin@gmail.com>
2
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
3
4
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
5
# Contributor: TBK <alpine@jjtc.eu>
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
6
7
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mariadb
TBK's avatar
TBK committed
8
9
pkgver=10.2.15
pkgrel=0
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
10
11
12
13
pkgdesc="A fast SQL database server"
url="http://www.mariadb.org"
pkgusers="mysql"
pkggroups="mysql"
Timo Teräs's avatar
Timo Teräs committed
14
arch="all"
15
license="GPL-2.0"
16
depends="$pkgname-common"
Natanael Copa's avatar
Natanael Copa committed
17
checkdepends="perl"
18
19
20
depends_dev="libressl-dev zlib-dev mariadb-connector-c-dev"
makedepends="$depends_dev bison cmake curl-dev libaio-dev libarchive-dev libevent-dev
	libxml2-dev ncurses-dev pcre-dev readline-dev xz-dev linux-headers"
21
install="$pkgname.pre-install"
22
23
24
25
subpackages="$pkgname-static $pkgname-test:mytest $pkgname-embedded-dev:_embedded_dev
	$pkgname-doc $pkgname-dev $pkgname-common $pkgname-openrc
	$pkgname-client $pkgname-bench
	$pkgname-backup $pkgname-embedded $pkgname-server-utils:_server_utils
26
	mysql mysql-client:_compat_client mysql-bench:_compat_bench"
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
27
source="https://downloads.mariadb.org/interstitial/mariadb-$pkgver/source/mariadb-$pkgver.tar.gz
28
	$pkgname.initd
29
	fix-mysql-install-db-path.patch
30
	fix-ucontext-check.patch
31
	ppc-remove-glibc-dep.patch
32
	pcre.cmake.patch
33
	"
34
# dbug test fails under rootbld
35
#options="!check"
36
builddir="$srcdir/$pkgname-$pkgver"
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
37

38
# secfixes:
TBK's avatar
TBK committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#   10.2.15-r0:
#     - CVE-2018-2786
#     - CVE-2018-2759
#     - CVE-2018-2777
#     - CVE-2018-2810
#     - CVE-2018-2782
#     - CVE-2018-2784
#     - CVE-2018-2787
#     - CVE-2018-2766
#     - CVE-2018-2755
#     - CVE-2018-2819
#     - CVE-2018-2817
#     - CVE-2018-2761
#     - CVE-2018-2781
#     - CVE-2018-2771
#     - CVE-2018-2813 
55
56
57
#   10.1.22-r0:
#     - CVE-2017-3313
#     - CVE-2017-3302
58
59
60
61
62
63
64
65
66
67
68
69
70
#   10.1.21-r0:
#     - CVE-2016-6664
#     - CVE-2017-3238
#     - CVE-2017-3243
#     - CVE-2017-3244
#     - CVE-2017-3257
#     - CVE-2017-3258
#     - CVE-2017-3265
#     - CVE-2017-3291
#     - CVE-2017-3312
#     - CVE-2017-3317
#     - CVE-2017-3318

71
72
73
# Notes:
# Available plugins https://mariadb.com/kb/en/library/list-of-plugins/
# All cmake configuration options can be displayed with: cmake ../server -LH
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
74
build() {
75
	cd "$builddir"
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
76
77
78
79
	cmake . -DBUILD_CONFIG=mysql_release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DSYSCONFDIR=/etc/mysql \
		-DMYSQL_DATADIR=/var/lib/mysql \
80
81
82
83
		-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock \
		-DDEFAULT_CHARSET=utf8 \
		-DDEFAULT_COLLATION=utf8_general_ci \
		-DENABLED_LOCAL_INFILE=ON \
84
		-DINSTALL_INFODIR=share/info \
85
		-DINSTALL_MANDIR=share/man \
86
		-DINSTALL_PLUGINDIR=lib/$pkgname/plugin \
87
88
		-DINSTALL_SCRIPTDIR=bin \
		-DINSTALL_INCLUDEDIR=include/mysql \
89
90
91
92
93
		-DINSTALL_DOCREADMEDIR=share/doc/$pkgname \
		-DINSTALL_SUPPORTFILESDIR=share/$pkgname \
		-DINSTALL_MYSQLSHAREDIR=share/$pkgname \
		-DINSTALL_DOCDIR=share/doc/$pkgname \
		-DTMPDIR=/var/tmp \
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
		-DCONNECT_WITH_MYSQL=ON \
		-DCONNECT_WITH_LIBXML2=system \
		-DCONNECT_WITH_ODBC=NO \
		-DCONNECT_WITH_JDBC=NO \
		-DPLUGIN_ARCHIVE=YES \
		-DPLUGIN_ARIA=YES \
		-DPLUGIN_BLACKHOLE=YES \
		-DPLUGIN_CASSANDRA=NO \
		-DPLUGIN_CSV=YES \
		-DPLUGIN_MYISAM=YES \
		-DPLUGIN_MROONGA=NO \
		-DPLUGIN_OQGRAPH=NO \
		-DPLUGIN_PARTITION=YES \
		-DPLUGIN_ROCKSDB=NO \
		-DPLUGIN_SPHINX=NO \
		-DPLUGIN_TOKUDB=NO \
		-DPLUGIN_AUTH_PAM=NO \
		-DPLUGIN_AUTH_GSSAPI=NO \
		-DPLUGIN_AUTH_GSSAPI_CLIENT=NO \
		-DPLUGIN_CRACKLIB_PASSWORD_CHECK=NO \
		-DWITH_ASAN=OFF \
		-DWITH_EMBEDDED_SERVER=ON \
		-DWITH_EXTRA_CHARSETS=complex \
		-DWITH_INNODB_BZIP2=OFF \
		-DWITH_INNODB_LZ4=OFF \
		-DWITH_INNODB_LZMA=ON \
		-DWITH_INNODB_LZO=OFF \
		-DWITH_INNODB_SNAPPY=OFF \
		-DWITH_JEMALLOC=NO \
		-DWITH_LIBARCHIVE=system \
		-DWITH_LIBNUMA=NO \
		-DWITH_LIBWRAP=OFF \
		-DWITH_LIBWSEP=OFF \
		-DWITH_MARIABACKUP=ON \
		-DWITH_PCRE=system \
129
		-DWITH_READLINE=ON \
130
		-DWITH_SYSTEMD=no \
131
		-DWITH_SSL=system \
132
133
134
		-DWITH_VALGRIND=OFF \
		-DWITH_ZLIB=system \
		-DSKIP_TESTS=ON # Disables the client lib tests since a running server is needed
135
136
137
138
139

	# print config options to log
	cmake -L

	make
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
140
141
}

142
143
144
145
146
check() {
	cd "$builddir"
	make test
}

Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
147
package() {
148
	cd "$builddir"
A. Wilcox's avatar
A. Wilcox committed
149
	make DESTDIR="$pkgdir/" install
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
150

151
	install -Dm 755 "$startdir"/$pkgname.initd \
A. Wilcox's avatar
A. Wilcox committed
152
		"$pkgdir"/etc/init.d/$pkgname
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
153
154

	# use small example config as default, which has tcp disabled
155
	install -Dm 640 -o mysql  "$pkgdir"/usr/share/mariadb/my-medium.cnf \
A. Wilcox's avatar
A. Wilcox committed
156
		"$pkgdir"/etc/mysql/my.cnf
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
157
158
159
160
161
162
163

	# 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
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

	# mytop should be shipped in separate package
	rm "$pkgdir"/usr/bin/mytop

	# remove files provided by mariadb-connector-c
	rm \
		"$pkgdir"/usr/bin/mariadb_config \
		"$pkgdir"/usr/bin/mysql_config \
		"$pkgdir"/usr/include/mysql/errmsg.h \
		"$pkgdir"/usr/include/mysql/ma_list.h \
		"$pkgdir"/usr/include/mysql/ma_pvio.h \
		"$pkgdir"/usr/include/mysql/ma_tls.h \
		"$pkgdir"/usr/include/mysql/mariadb/ma_io.h \
		"$pkgdir"/usr/include/mysql/mariadb_com.h \
		"$pkgdir"/usr/include/mysql/mariadb_ctype.h \
		"$pkgdir"/usr/include/mysql/mariadb_dyncol.h \
		"$pkgdir"/usr/include/mysql/mariadb_stmt.h \
		"$pkgdir"/usr/include/mysql/mariadb_version.h \
		"$pkgdir"/usr/include/mysql/mysql.h \
		"$pkgdir"/usr/include/mysql/mysql/client_plugin.h \
		"$pkgdir"/usr/include/mysql/mysql/plugin_auth.h \
		"$pkgdir"/usr/include/mysql/mysql/plugin_auth_common.h \
		"$pkgdir"/usr/include/mysql/mysql_version.h \
		"$pkgdir"/usr/include/mysql/mysqld_error.h \
		"$pkgdir"/usr/lib/$pkgname/plugin/dialog.so \
		"$pkgdir"/usr/lib/$pkgname/plugin/mysql_clear_password.so \
Kaarle Ritvanen's avatar
Kaarle Ritvanen committed
190
		"$pkgdir"/usr/lib/$pkgname/plugin/sha256_password.so \
191
192
193
		"$pkgdir"/usr/lib/libmysqlclient.so \
		"$pkgdir"/usr/lib/libmysqlclient_r.so \
		"$pkgdir"/usr/lib/libmariadb.so*
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
194
195
}

196
dev() {
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
197
	default_dev
198
199
	replaces="libmysqlclient mysql-dev"
	provides="mysql-dev=$pkgver-r$pkgrel"
200
	mkdir -p "$subpkgdir"/usr/bin
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
201
202
203
}

common() {
204
	pkgdesc="MariaDB common files for both server and client"
205
	replaces="mysql-common"
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
206
	depends=
207
	mkdir -p "$subpkgdir"/usr/share/$pkgname \
208
		"$subpkgdir"/etc \
209
		"$subpkgdir"/usr/lib/$pkgname/plugin
A. Wilcox's avatar
A. Wilcox committed
210
	mv "$pkgdir"/etc/mysql "$subpkgdir"/etc/
211
212
213
214
215
	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
216
217
		mv "$pkgdir"/usr/share/$pkgname/$l \
			"$subpkgdir"/usr/share/$pkgname/
218
	done
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
219
220
221
222
}

mytest() {
	pkgdesc="The test suite distributed with MariaDB"
A. Wilcox's avatar
A. Wilcox committed
223
	mkdir -p "$subpkgdir"/usr/bin
224
	mv "$pkgdir"/usr/bin/mysql_client_test \
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
225
		"$pkgdir"/usr/bin/my_safe_process \
226
227
		"$pkgdir"/usr/bin/mysqltest \
		"$pkgdir"/usr/bin/mysqltest_embedded \
A. Wilcox's avatar
A. Wilcox committed
228
		"$subpkgdir"/usr/bin/
229
230
	mv "$pkgdir"/usr/mysql-test \
		"$subpkgdir"/usr/
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
231
232
233
}

client() {
234
	pkgdesc="Client for the MariaDB database"
235
	depends="mariadb-common=$pkgver-r$pkgrel"
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
236
	install=""
237
	local bins="myisam_ftdump mysql mysqlaccess mysqladmin
238
239
		mysqlcheck mysqldump mysqldumpslow mysql_find_rows
		mysql_fix_extensions mysqlimport mysqlshow mysql_waitpid"
A. Wilcox's avatar
A. Wilcox committed
240
	mkdir -p "$subpkgdir"/usr/bin/
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
241
	for i in $bins; do
A. Wilcox's avatar
A. Wilcox committed
242
		mv "$pkgdir"/usr/bin/${i} "$subpkgdir"/usr/bin/
Łukasz Jendrysik's avatar
Łukasz Jendrysik committed
243
244
245
246
247
248
249
250
251
252
	done
}

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

253
254
_compat() {
	pkgdesc="Dummy package for $1 migration"
255
	depends="$2"
256
257
258
	mkdir -p "$subpkgdir"
}

259
260
261
mysql() { _compat mysql mariadb; }
_compat_client() { _compat mysql-client mariadb-client; }
_compat_bench() { _compat mysql-bench mariadb-client; }
262

263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
static() {
	pkgdesc="Static libraries for mariadb"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
}

backup() {
	pkgdesc="The mariabackup tool for physical online backups"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/mariabackup \
		"$pkgdir"/usr/bin/mbstream \
		"$subpkgdir"/usr/bin/
}

embedded() {
	pkgdesc="MariaDB as an embeddable library"
	depends="$pkgname-common=$pkgver-r$pkgrel"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libmysqld.so.* "$subpkgdir"/usr/lib/
}


_embedded_dev() {
	pkgdesc="MariaDB as an embeddable library - development files"
	# this package only contains a symlink, but we want avoid pull in
	# libmysqld (embedded) unless needed
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libmysqld.so "$subpkgdir"/usr/lib/
}

_server_utils() {
	pkgdesc="Non-essential server utilities for MariaDB/MySQL applications"
	depends="perl $pkgname-common=$pkgver-r$pkgrel"
	mkdir -p "$subpkgdir"/usr/bin
	# perl utils
	mv \
		"$pkgdir"/usr/bin/mysql_convert_table_format \
		"$pkgdir"/usr/bin/mysql_setpermission \
		"$pkgdir"/usr/bin/mysqld_multi \
		"$pkgdir"/usr/bin/mysqlhotcopy \
		"$subpkgdir"/usr/bin/
	# tools that can be used remotely and other tools
	mv \
		"$pkgdir"/usr/bin/mysql_upgrade \
		"$pkgdir"/usr/bin/perror \
		"$pkgdir"/usr/bin/mysqld_safe_helper \
		"$subpkgdir"/usr/bin/
}

TBK's avatar
TBK committed
312
sha512sums="7702af8787973b15784dc8a89f9d56765725a420e2e68f1924b67c88c134c7d83d3249dddd16707fa9e5f05ed747f813f16feefbb477e999a6698b1dcfb5a88f  mariadb-10.2.15.tar.gz
Natanael Copa's avatar
Natanael Copa committed
313
06751768cb00d2e433655635c38d267ef25084a5830ff40e719ac579223c7192dc34b43f919ab6faf480094632327511cbd22456064dde2d04dc15648b9e3b9f  mariadb.initd
314
88d9084c8ca3a94e6e1a7fa91091f577ee063f4b13046cc805f61f3be37993b98c79665e5995d8b6b7fa10efbe00fcbde638db5b0b59f0d5e0e951b24b5108e9  fix-mysql-install-db-path.patch
TBK's avatar
TBK committed
315
2d42a3e4051aaeee49da52947dbc354d44d975ca50571777a0aba8bed032ccd6a07c29e0cbb9f74c396dce9937b5d16af19ab310638c285e418e0281361024f3  fix-ucontext-check.patch
316
317
81d2a95bfbce35fab6e1780f4201320e5621f470591020d707801dcf31f5fad3cb5d7b781a186b2914c6559a8fdc8f13e31e7cdde0af360ad56cedf80e491bc0  ppc-remove-glibc-dep.patch
70da971aa78815495098205bcbd28428430aa83c3f1050fec0231ca86af9d9def2d2108a48ee08d86812c8dc5ad8ab1ef4e17a49b4936ed5187ae0f6a7ef8f63  pcre.cmake.patch"