# Contributor: Sergei Lukin # Contributor: Sören Tempel # Contributor: Łukasz Jendrysik # Contributor: Carlo Landmeter # Maintainer: Natanael Copa pkgname=mariadb pkgver=10.1.21 pkgrel=0 pkgdesc="A fast SQL database server" url="http://www.mariadb.org" pkgusers="mysql" pkggroups="mysql" arch="all" license="GPL" depends="$pkgname-common" depends_dev="libressl-dev zlib-dev" makedepends="cmake libressl-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 fix-ucontext-check.patch " # secfixes: # 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 subpackages="$pkgname-doc $pkgname-dev $pkgname-common $pkgname-client-libs:_client_libs $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 # 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" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/mysql_config "$subpkgdir"/usr/bin/ } _client_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 both server and client" replaces="mysql-common" depends= mkdir -p "$subpkgdir"/usr/share/mysql \ "$subpkgdir"/etc \ "$subpkgdir"/usr/lib/mysql/plugin mv "$pkgdir"/etc/mysql "$subpkgdir"/etc/ || return 1 mv "$pkgdir"/usr/lib/mysql/plugin/dialog.so \ "$pkgdir"/usr/lib/mysql/plugin/mysql_clear_password.so \ "$subpkgdir"/usr/lib/mysql/plugin/ || 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="ff8b96edeeb22425117309a249055310 mariadb-10.1.21.tar.gz 195f8bf24dfdbc5aa7ccd969a1b1283f mariadb.initd b233fb7015a9659f5b825cd8010d2b52 fix-mysql-install-db-path.patch 96b7247f919bf4e1de13a9d0ce7ef515 fix-ucontext-check.patch" sha256sums="5a816355781ea22a6c65a436d8162f19bd292ec90e2b7d9499c031ae4a659490 mariadb-10.1.21.tar.gz c37aa7c150c07a3ac478a6fd1b478b425c17ac412f9ba4f49b8a635edb6ed542 mariadb.initd 0f4d97cc9d512fc43cdb4b2f2a6dc16b37cb72a18c7d7a3e23e11a116d119904 fix-mysql-install-db-path.patch 3d9a12bf04fcf215567b6a395fe83fb6528602baf4283d42181bd73f93b5f538 fix-ucontext-check.patch" sha512sums="241467ce7c04603261509e45b3c476632a11754f15dead67434bb8a0fbad6ebcf44c63ffeb7075574e54d14039b22702d48732c1fd8a498948d8b6fc54d54714 mariadb-10.1.21.tar.gz 06751768cb00d2e433655635c38d267ef25084a5830ff40e719ac579223c7192dc34b43f919ab6faf480094632327511cbd22456064dde2d04dc15648b9e3b9f mariadb.initd f85e96490de56aa4e6115f931bf256bef4e1b93cadbe4ac947d6abdc03072bf2d0872e0268ae37cd98edf13538ece73e9f8b6efa8133bab23168a825c5066ab1 fix-mysql-install-db-path.patch 82fa93411483f5d1b57d978087a891bcab6a011e45c2d79b08d28718f5717994b423fc81d2170dad2fe65303153ac29655a81ce5039e73e37cebb159392a86cf fix-ucontext-check.patch"