# Contributor: Sergei Lukin # Contributor: Sören Tempel # Contributor: Łukasz Jendrysik # Contributor: Carlo Landmeter # Contributor: TBK # Maintainer: Natanael Copa pkgname=mariadb pkgver=10.3.10 pkgrel=1 pkgdesc="A fast SQL database server" url="http://www.mariadb.org" pkgusers="mysql" pkggroups="mysql" arch="all" license="GPL-2.0-or-later" depends="$pkgname-common" checkdepends="perl" _mytopdeps="perl perl-dbi perl-dbd-mysql perl-getopt-long perl-socket perl-term-readkey" depends_dev="openssl-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 $_mytopdeps" install="$pkgname.pre-install $pkgname-common.post-upgrade" 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-mytop $pkgname-server-utils:_server_utils mysql mysql-client:_compat_client mysql-bench:_compat_bench" options="!checkroot" _enable_rocksdb=YES case "$CARCH" in x86|s390x) _enable_rocksdb=NO;; esac if [ "$_enable_rocksdb" = "YES" ]; then subpackages="$subpackages $pkgname-plugin-rocksdb:_plugin_rocksdb" fi source="https://downloads.mariadb.org/interstitial/mariadb-$pkgver/source/mariadb-$pkgver.tar.gz $pkgname.initd fix-c11-atomics-check.patch fix-mysql-install-db-path.patch fix-ucontext-check.patch fix-pthread-detach.patch ppc-remove-glibc-dep.patch pcre.cmake.patch " # dbug test fails under rootbld #options="!check" builddir="$srcdir/$pkgname-$pkgver" # secfixes: # 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 # 10.1.22-r0: # - CVE-2017-3313 # - CVE-2017-3302 # 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 # Notes: # Available plugins https://mariadb.com/kb/en/library/list-of-plugins/ # All cmake configuration options can be displayed with: cmake ../server -LH build() { cd "$builddir" cmake . -DBUILD_CONFIG=mysql_release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DSYSCONFDIR=/etc \ -DSYSCONF2DIR=/etc/my.cnf.d \ -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/info \ -DINSTALL_MANDIR=share/man \ -DINSTALL_PLUGINDIR=lib/$pkgname/plugin \ -DINSTALL_SCRIPTDIR=bin \ -DINSTALL_INCLUDEDIR=include/mysql \ -DINSTALL_DOCREADMEDIR=share/doc/$pkgname \ -DINSTALL_SUPPORTFILESDIR=share/$pkgname \ -DINSTALL_MYSQLSHAREDIR=share/$pkgname \ -DINSTALL_DOCDIR=share/doc/$pkgname \ -DTMPDIR=/var/tmp \ -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=$_enable_rocksdb \ -DPLUGIN_SPHINX=NO \ -DPLUGIN_TOKUDB=NO \ -DPLUGIN_AUTH_PAM=NO \ -DPLUGIN_AUTH_GSSAPI=NO \ -DPLUGIN_AUTH_GSSAPI_CLIENT=OFF \ -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_ROCKSDB_BZIP2=OFF \ -DWITH_ROCKSDB_JEMALLOC=OFF \ -DWITH_ROCKSDB_LZ4=OFF \ -DWITH_ROCKSDB_ZSTD=OFF \ -DWITH_ROCKSDB_SNAPPY=OFF \ -DWITH_JEMALLOC=NO \ -DWITH_LIBARCHIVE=system \ -DWITH_LIBNUMA=NO \ -DWITH_LIBWRAP=OFF \ -DWITH_LIBWSEP=OFF \ -DWITH_MARIABACKUP=ON \ -DWITH_PCRE=system \ -DWITH_READLINE=ON \ -DWITH_SYSTEMD=no \ -DWITH_SSL=system \ -DWITH_VALGRIND=OFF \ -DWITH_ZLIB=system \ -DSKIP_TESTS=ON # Disables the client lib tests since a running server is needed # print config options to log cmake -L make } check() { cd "$builddir" # exclude test-connect which seems to be buggy. testsuite does not set port env var # ma_test_loghandler_readonly seems to fail if /etc/my.conf.d is missing ctest -E '(test-connect|ma_test_loghandler_readonly)' } package() { cd "$builddir" make DESTDIR="$pkgdir/" install install -Dm 755 "$startdir"/$pkgname.initd \ "$pkgdir"/etc/init.d/$pkgname mkdir -p "$pkgdir"/etc/my.cnf.d # 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 # 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 \ "$pkgdir"/usr/lib/$pkgname/plugin/sha256_password.so \ "$pkgdir"/usr/lib/libmysqlclient.so \ "$pkgdir"/usr/lib/libmysqlclient_r.so \ "$pkgdir"/usr/lib/libmariadb.so* cat >"$pkgdir"/etc/my.cnf<<-EOF # This group is read both both by the client and the server # use it for options that affect everything [client-server] # This group is read by the server [mysqld] # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # include all files from the config directory !includedir /etc/my.cnf.d EOF cat >"$pkgdir"/etc/my.cnf.d/mariadb-server.cnf<<-EOF # # These groups are read by MariaDB server. # Use it for options that only the server (but not clients) should see # this is read by the standalone daemon and embedded servers [server] # this is only for the mysqld standalone daemon [mysqld] skip-networking # Galera-related settings [galera] # Mandatory settings #wsrep_on=ON #wsrep_provider= #wsrep_cluster_address= #binlog_format=row #default_storage_engine=InnoDB #innodb_autoinc_lock_mode=2 # # Allow server to accept connections on all interfaces. # #bind-address=0.0.0.0 # # Optional setting #wsrep_slave_threads=1 #innodb_flush_log_at_trx_commit=0 # this is only for embedded server [embedded] # This group is only read by MariaDB servers, not by MySQL. # If you use the same .cnf file for MySQL and MariaDB, # you can put MariaDB-only options here [mariadb] # This group is only read by MariaDB-10.3 servers. # If you use the same .cnf file for MariaDB of different versions, # use this group for options that older servers don't understand [mariadb-10.3] EOF } dev() { default_dev replaces="libmysqlclient mysql-dev" provides="mysql-dev=$pkgver-r$pkgrel" mkdir -p "$subpkgdir"/usr/bin } common() { pkgdesc="MariaDB common files for both server and client" replaces="mysql-common" depends= mkdir -p "$subpkgdir"/usr/share/$pkgname \ "$subpkgdir"/etc/mysql \ "$subpkgdir"/usr/lib/$pkgname/plugin mv "$pkgdir"/etc/my.* "$subpkgdir"/etc/ 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/$pkgname/$l \ "$subpkgdir"/usr/share/$pkgname/ done } mytest() { pkgdesc="The test suite distributed with MariaDB" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/mysql_client_test \ "$pkgdir"/usr/bin/my_safe_process \ "$pkgdir"/usr/bin/mysqltest \ "$pkgdir"/usr/bin/mysqltest_embedded \ "$subpkgdir"/usr/bin/ mv "$pkgdir"/usr/mysql-test \ "$subpkgdir"/usr/ } client() { pkgdesc="Client for the MariaDB database" depends="mariadb-common=$pkgver-r$pkgrel" install="" local bins="myisam_ftdump mysql mysqlaccess mysqladmin mysqlcheck mysqldump mysqldumpslow mysql_find_rows mysql_fix_extensions mysqlimport mysqlshow mysql_waitpid" mkdir -p "$subpkgdir"/usr/bin/ for i in $bins; do mv "$pkgdir"/usr/bin/${i} "$subpkgdir"/usr/bin/ 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; } 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/libmariadbd.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/ } mytop() { pkgdesc="Command line tool used for monitoring MariaDB performance" depends="$_mytopdeps" mkdir -p "$subpkgdir"/usr/bin/ mv "$pkgdir"/usr/bin/mytop "$subpkgdir"/usr/bin/ } _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/ } _plugin_rocksdb() { pkgdesc="MariaDB plugin for RocksDB (MyRocks)" url="https://mariadb.com/kb/en/library/myrocks/" depends="$pkgname=$pkgver-r$pkgrel" mkdir -p "$subpkgdir"/usr/lib/mariadb/plugin mv "$pkgdir"/usr/lib/mariadb/plugin/ha_rocksdb.so \ "$subpkgdir"/usr/lib/mariadb/plugin/ha_rocksdb.so } sha512sums="dee7789dff359a6352ceacb2db6bcb4730940e9458adda4e23894f9bfa0a7ff8c238060bffca58a60b662275e52a31ea1784d51fae114312b003c024e9412b31 mariadb-10.3.10.tar.gz 06751768cb00d2e433655635c38d267ef25084a5830ff40e719ac579223c7192dc34b43f919ab6faf480094632327511cbd22456064dde2d04dc15648b9e3b9f mariadb.initd b4469f2f0299e71c09b65c91373f2d72b7fe9a9cd58ad24737a78a8097473b29c32b7267e173a2dfe1158f2f7d40a7fb02fb1b35caeda44d16ae3b9e2602a75f fix-c11-atomics-check.patch 0c08198b907dad18c5a7ab89f37ff53da7cb102b0848fb58912900bd92468a0d4f853bc5c0116f655c500d5ed20dcbf20d3884dcd0040634e23c911dfeaf7001 fix-mysql-install-db-path.patch 2d42a3e4051aaeee49da52947dbc354d44d975ca50571777a0aba8bed032ccd6a07c29e0cbb9f74c396dce9937b5d16af19ab310638c285e418e0281361024f3 fix-ucontext-check.patch 60450ccc3b089953cb20ddd7c81aa1afbb52aa9d28211eeec0b9c04653b2bf5f56561315d8c8e0444d263cd412c28df91936d78daf1919dda9e402beb2243a43 fix-pthread-detach.patch e9ae4613f1d8c5f0a59b39a3548c46e50674ae78e7457d0e64c49f7e1573125c13634bbce7e29179bb8865a423171f852f43b96f7ef95619a95f02edcfc71efd ppc-remove-glibc-dep.patch 70da971aa78815495098205bcbd28428430aa83c3f1050fec0231ca86af9d9def2d2108a48ee08d86812c8dc5ad8ab1ef4e17a49b4936ed5187ae0f6a7ef8f63 pcre.cmake.patch"