# Contributor: Sören Tempel # Contributor: Łukasz Jendrysik # Contributor: Carlo Landmeter # Maintainer: Natanael Copa pkgname=mariadb pkgver=10.1.9 pkgrel=2 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" install="$pkgname.pre-install" source="https://downloads.mariadb.org/interstitial/mariadb-$pkgver/source/mariadb-$pkgver.tar.gz $pkgname.initd fix-mysql-install-db-path.patch musl-fix-inttype.patch 0001-Fix-segfault-with-musl-libc-due-to-bad-use-of-strerr.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 \ -DPLUGIN_TOKUDB=NO \ -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 -Dm 640 -o mysql "$pkgdir"/usr/share/mysql/my-medium.cnf \ "$pkgdir"/etc/mysql/my.cnf || return 1 install -dDo mysql "$pkgdir"/var/log/mysql || 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="71d0e2408a671e1125c1310ce657f688 mariadb-10.1.9.tar.gz 2cf887d864e05947f5b831bd7ca06b74 mariadb.initd bcaee4dbbf77f4432ecd9796714be75b fix-mysql-install-db-path.patch 14adb188bde2359d94a5d661ab793cee musl-fix-inttype.patch b32eed97ab575140685eeae4a56205a2 0001-Fix-segfault-with-musl-libc-due-to-bad-use-of-strerr.patch" sha256sums="8e9c5826722cedb4209bf06ae61069664513149479a6634e3d8115961edfe110 mariadb-10.1.9.tar.gz 49bab0ec69432d5c56c53ff83488bfa5eb2859bc95a12e8fc7f12d1f0403f0c6 mariadb.initd 52e3827529b53c02a9ba263bd395bde773d2666853b252a131e824bb256f36d5 fix-mysql-install-db-path.patch 2a66efddb9c5e8076da3d9c602bbfb9413917ab4b5d1015459f550da8ac10c87 musl-fix-inttype.patch 2253fa4b0470d4bcfb183967f7658f04867a31b3ce1ffbe22926a52bf595c616 0001-Fix-segfault-with-musl-libc-due-to-bad-use-of-strerr.patch" sha512sums="0a271f2b169c569f65c222e83fcfeebc621c73ade76af4293ca4739f51c2fee2e34b1128d18339e6f1864dee7b9aed83ac15085325d477dc412e3fb2a4716b55 mariadb-10.1.9.tar.gz 53d28d688fc9b45684f8368971c01424e5388d39dfaad8b2c432c54d5fabadf2388786303e92c5ca734cb95b4618863c23f7be2a618efc97854536c3a9dc1240 mariadb.initd 4aca6e42f4dec9d7122388b1d1bc40762a4677a1beafcf448b900d443a2f778a8fd52bc7f1b5c9697e0ad13473e6d01eb29607a40de195ac07857cd4dfc2a1fe fix-mysql-install-db-path.patch 17ee255222ec9d7601554e607586ac1d0a0b818a4547e30a2739e7163df0439357b011f6848fbff4d28e93830256165a29ce8b20f25256d493d4605f253061ef musl-fix-inttype.patch ff1390b4718cfa6cd02947a82a404ea51483678a5cb52651c3b9d243dbc17c3b37df1013aeab618fa1077f930e75ac104168d7853880b0e2e95a32a9bcd5a2f2 0001-Fix-segfault-with-musl-libc-due-to-bad-use-of-strerr.patch"