2014-12-05 16:47:24 +00:00
|
|
|
# Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
|
2016-07-24 21:17:42 +00:00
|
|
|
# Maintainer: Christian Hesse <mail@eworm.de>
|
2014-12-05 16:47:24 +00:00
|
|
|
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
|
|
# - disable mroonga storage engine (doesn't build on ARM)
|
2017-06-03 00:38:43 +00:00
|
|
|
# - patch to link (unused) static libs against libatomic on v5/v6 to fix FTBFS
|
2014-12-05 16:47:24 +00:00
|
|
|
|
|
|
|
pkgbase=mariadb
|
2019-01-18 13:29:56 +00:00
|
|
|
pkgname=('mariadb-libs' 'mariadb-clients' 'mariadb' 'mytop')
|
|
|
|
pkgdesc='Fast SQL database server, derived from MySQL'
|
|
|
|
pkgver=10.3.12
|
|
|
|
pkgrel=2
|
2017-12-31 00:00:39 +00:00
|
|
|
arch=('x86_64')
|
2014-12-05 16:47:24 +00:00
|
|
|
license=('GPL')
|
2018-08-09 21:12:37 +00:00
|
|
|
url='https://mariadb.org/'
|
2018-02-12 13:55:58 +00:00
|
|
|
makedepends=('boost' 'bzip2' 'cmake' 'jemalloc' 'libaio' 'libxml2' 'lz4' 'lzo'
|
2019-01-18 13:29:56 +00:00
|
|
|
'openssl' 'systemd' 'zlib' 'zstd')
|
2016-10-04 13:32:14 +00:00
|
|
|
validpgpkeys=('199369E5404BD5FC7D2FE43BCBCB082A1BB943DB') # MariaDB Package Signing Key <package-signing-key@mariadb.org>
|
2019-01-18 13:29:56 +00:00
|
|
|
source=("https://ftp.heanet.ie/mirrors/mariadb/mariadb-$pkgver/source/mariadb-$pkgver.tar.gz"{,.asc}
|
2017-12-31 00:00:39 +00:00
|
|
|
'atomic.patch')
|
2019-01-18 13:29:56 +00:00
|
|
|
sha256sums=('f7449a34c25e0455928d7983dae83fd2069fe1f16c4c5f4aeed9ed9d3f081ff6'
|
2016-10-04 13:32:14 +00:00
|
|
|
'SKIP'
|
2019-01-18 13:29:56 +00:00
|
|
|
'7769fd8eb2bb3a6644a2200d01918ff887be25638d79dbec25897fe0d87badc4')
|
2014-12-05 16:47:24 +00:00
|
|
|
|
2016-07-24 21:17:42 +00:00
|
|
|
prepare() {
|
2017-06-01 12:35:49 +00:00
|
|
|
cd $pkgbase-$pkgver/
|
2017-05-15 23:47:24 +00:00
|
|
|
|
2016-07-24 21:17:42 +00:00
|
|
|
# Changes to the upstream unit files:
|
|
|
|
# * remove the alias from unit files, we install symlinks in package function
|
|
|
|
# * enable PrivateTmp for a little bit more security
|
2019-01-18 13:29:56 +00:00
|
|
|
# * force preloading jemalloc for memory management
|
2016-07-24 21:17:42 +00:00
|
|
|
sed -i -e '/^Alias/d' \
|
|
|
|
-e '/^PrivateTmp/c PrivateTmp=true' \
|
2019-01-18 13:29:56 +00:00
|
|
|
-e '/# Environment="LD_/a Environment="LD_PRELOAD=/usr/lib/libjemalloc.so"' \
|
2017-05-15 23:47:24 +00:00
|
|
|
support-files/mariadb{,@}.service.in
|
|
|
|
|
2017-12-31 00:00:39 +00:00
|
|
|
# let's create the datadir from tmpfiles
|
|
|
|
echo 'd @MYSQL_DATADIR@ 0700 @MYSQLD_USER@ @MYSQLD_USER@ -' >> support-files/tmpfiles.conf.in
|
|
|
|
|
2019-01-18 13:29:56 +00:00
|
|
|
# instantiated configs are not subject to be included from main config
|
|
|
|
sed -i 's|@sysconf2dir@|@sysconfdir@|' support-files/mariadb@.service.in
|
|
|
|
|
|
|
|
# fix path to our config
|
|
|
|
sed -i 's|my.cnf.d|mysql/my.cnf.d|' support-files/rpm/{my.cnf,enable_encryption.preset}
|
|
|
|
|
2017-06-03 00:38:43 +00:00
|
|
|
if [[ $CARCH == arm || $CARCH == armv6h ]]; then
|
|
|
|
patch -p0 -i ../atomic.patch
|
|
|
|
fi
|
2016-07-24 21:17:42 +00:00
|
|
|
}
|
|
|
|
|
2014-12-05 16:47:24 +00:00
|
|
|
build() {
|
2019-01-18 13:29:56 +00:00
|
|
|
local _cmake_options=(
|
|
|
|
# build options
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
|
|
|
-Wno-dev
|
|
|
|
|
|
|
|
# file paths
|
|
|
|
# /etc
|
|
|
|
-DINSTALL_SYSCONFDIR=/etc/mysql
|
|
|
|
-DINSTALL_SYSCONF2DIR=/etc/mysql/my.cnf.d
|
|
|
|
# /run
|
|
|
|
-DINSTALL_UNIX_ADDRDIR=/run/mysqld/mysqld.sock
|
|
|
|
# /usr
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr
|
|
|
|
# /usr/bin /usr/include
|
|
|
|
-DINSTALL_SCRIPTDIR=bin
|
|
|
|
-DINSTALL_INCLUDEDIR=include/mysql
|
|
|
|
# /usr/lib
|
|
|
|
-DINSTALL_PLUGINDIR=lib/mysql/plugin
|
|
|
|
-DINSTALL_SYSTEMD_UNITDIR=/usr/lib/systemd/system/
|
|
|
|
-DINSTALL_SYSTEMD_SYSUSERSDIR=/usr/lib/sysusers.d/
|
|
|
|
-DINSTALL_SYSTEMD_TMPFILESDIR=/usr/lib/tmpfiles.d/
|
|
|
|
# /usr/share
|
|
|
|
-DINSTALL_SHAREDIR=share
|
|
|
|
-DINSTALL_SUPPORTFILESDIR=share/mysql
|
|
|
|
-DINSTALL_MYSQLSHAREDIR=share/mysql
|
|
|
|
-DINSTALL_DOCREADMEDIR=share/doc/mariadb
|
|
|
|
-DINSTALL_DOCDIR=share/doc/mariadb
|
|
|
|
-DINSTALL_MANDIR=share/man
|
|
|
|
# /var
|
|
|
|
-DMYSQL_DATADIR=/var/lib/mysql
|
|
|
|
|
|
|
|
# default settings
|
|
|
|
-DDEFAULT_CHARSET=utf8mb4
|
|
|
|
-DDEFAULT_COLLATION=utf8mb4_unicode_ci
|
|
|
|
|
|
|
|
# features
|
|
|
|
-DENABLED_LOCAL_INFILE=ON
|
|
|
|
-DPLUGIN_EXAMPLE=NO
|
|
|
|
-DPLUGIN_FEDERATED=NO
|
|
|
|
-DPLUGIN_FEEDBACK=NO
|
|
|
|
-DWITHOUT_MROONGA_STORAGE_ENGINE=1
|
|
|
|
-DWITH_EMBEDDED_SERVER=ON
|
|
|
|
-DWITH_EXTRA_CHARSETS=complex
|
|
|
|
-DWITH_JEMALLOC=ON
|
|
|
|
-DWITH_LIBWRAP=OFF
|
|
|
|
-DWITH_PCRE=bundled
|
|
|
|
-DWITH_READLINE=ON
|
|
|
|
-DWITH_SSL=system
|
|
|
|
-DWITH_SYSTEMD=yes
|
|
|
|
-DWITH_UNIT_TESTS=OFF
|
|
|
|
-DWITH_ZLIB=system
|
|
|
|
)
|
|
|
|
|
2014-12-05 16:47:24 +00:00
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
|
2019-01-18 13:29:56 +00:00
|
|
|
cmake ../"$pkgbase-$pkgver" "${_cmake_options[@]}"
|
2014-12-05 16:47:24 +00:00
|
|
|
|
|
|
|
make
|
|
|
|
}
|
|
|
|
|
2019-01-18 13:29:56 +00:00
|
|
|
check() {
|
|
|
|
cd build/mysql-test
|
|
|
|
|
|
|
|
# Takes *really* long, so disabled by default.
|
|
|
|
#./mtr --parallel=5 --mem --force --max-test-fail=0
|
|
|
|
}
|
|
|
|
|
|
|
|
package_mariadb-libs() {
|
|
|
|
pkgdesc='MariaDB libraries'
|
2018-02-12 13:55:58 +00:00
|
|
|
depends=('bzip2' 'libaio' 'lz4' 'lzo' 'openssl' 'xz' 'zlib')
|
2019-01-18 13:29:56 +00:00
|
|
|
conflicts=('libmysqlclient' 'libmariadbclient' 'mariadb-connector-c')
|
|
|
|
provides=('libmariadbclient' 'mariadb-connector-c')
|
|
|
|
replaces=('libmariadbclient')
|
2014-12-05 16:47:24 +00:00
|
|
|
|
|
|
|
cd build
|
2017-06-01 12:35:49 +00:00
|
|
|
|
2019-01-18 13:29:56 +00:00
|
|
|
for dir in libmariadb libmysqld libservices include; do
|
|
|
|
make -C "$dir" DESTDIR="$pkgdir" install
|
2014-12-05 16:47:24 +00:00
|
|
|
done
|
|
|
|
|
2019-01-18 13:29:56 +00:00
|
|
|
ln -s mariadb_config "$pkgdir"/usr/bin/mysql_config
|
|
|
|
install -D -m0644 "$srcdir"/"$pkgbase-$pkgver"/man/mysql_config.1 "$pkgdir"/usr/share/man/man1/mysql_config.1
|
2017-06-01 12:35:49 +00:00
|
|
|
|
|
|
|
install -D -m0644 support-files/mariadb.pc "$pkgdir"/usr/share/pkgconfig/mariadb.pc
|
2019-01-18 13:29:56 +00:00
|
|
|
install -D -m0644 "$srcdir"/"$pkgbase-$pkgver"/support-files/mysql.m4 "$pkgdir"/usr/share/aclocal/mysql.m4
|
2014-12-05 16:47:24 +00:00
|
|
|
|
2017-06-01 12:35:49 +00:00
|
|
|
# remove static libraries
|
|
|
|
rm "$pkgdir"/usr/lib/*.a
|
2014-12-05 16:47:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package_mariadb-clients() {
|
|
|
|
pkgdesc='MariaDB client tools'
|
2019-01-18 13:29:56 +00:00
|
|
|
depends=("mariadb-libs=${pkgver}" 'jemalloc')
|
2014-12-05 16:47:24 +00:00
|
|
|
conflicts=('mysql-clients')
|
|
|
|
provides=("mysql-clients=$pkgver")
|
|
|
|
|
|
|
|
cd build
|
2017-06-01 12:35:49 +00:00
|
|
|
|
2014-12-05 16:47:24 +00:00
|
|
|
make -C client DESTDIR="$pkgdir" install
|
|
|
|
|
|
|
|
# install man pages
|
2017-06-01 12:35:49 +00:00
|
|
|
for man in mysql mysql_plugin mysql_upgrade mysqladmin mysqlbinlog mysqlcheck mysqldump mysqlimport mysqlshow mysqlslap mysqltest; do
|
2019-01-18 13:29:56 +00:00
|
|
|
install -D -m0644 "$srcdir"/"$pkgbase-$pkgver"/man/"$man.1" "$pkgdir"/usr/share/man/man1/"$man.1"
|
2014-12-05 16:47:24 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
package_mariadb() {
|
2019-01-18 13:29:56 +00:00
|
|
|
pkgdesc='Fast SQL database server, derived from MySQL'
|
2017-06-01 12:35:49 +00:00
|
|
|
backup=('etc/mysql/my.cnf'
|
2019-01-18 13:29:56 +00:00
|
|
|
'etc/mysql/my.cnf.d/client.cnf'
|
|
|
|
'etc/mysql/my.cnf.d/enable_encryption.preset'
|
|
|
|
'etc/mysql/my.cnf.d/mysql-clients.cnf'
|
|
|
|
'etc/mysql/my.cnf.d/server.cnf')
|
2014-12-05 16:47:24 +00:00
|
|
|
install=mariadb.install
|
2019-01-18 13:29:56 +00:00
|
|
|
depends=("mariadb-clients=${pkgver}" 'inetutils' 'libsystemd' 'libxml2' 'zstd')
|
2017-07-06 12:28:49 +00:00
|
|
|
optdepends=('galera: for MariaDB cluster with Galera WSREP'
|
|
|
|
'perl-dbd-mysql: for mysqlhotcopy, mysql_convert_table_format and mysql_setpermission')
|
2014-12-05 16:47:24 +00:00
|
|
|
conflicts=('mysql')
|
|
|
|
provides=("mysql=$pkgver")
|
|
|
|
options=('emptydirs')
|
|
|
|
|
|
|
|
cd build
|
2017-06-01 12:35:49 +00:00
|
|
|
|
2014-12-05 16:47:24 +00:00
|
|
|
make DESTDIR="$pkgdir" install
|
|
|
|
|
2017-01-08 16:59:42 +00:00
|
|
|
cd "$pkgdir"
|
|
|
|
|
2019-01-18 13:29:56 +00:00
|
|
|
# no SysV init, please!
|
|
|
|
rm -r etc/mysql/{init.d,logrotate.d}
|
|
|
|
rm usr/bin/rcmysql
|
|
|
|
rm usr/share/mysql/{binary-configure,mysql{,d_multi}.server}
|
2014-12-05 16:47:24 +00:00
|
|
|
|
2019-01-18 13:29:56 +00:00
|
|
|
# these should have useful names
|
2017-12-31 00:00:39 +00:00
|
|
|
mv usr/lib/sysusers.d/{sysusers,mariadb}.conf
|
|
|
|
mv usr/lib/tmpfiles.d/{tmpfiles,mariadb}.conf
|
|
|
|
|
2019-01-18 13:29:56 +00:00
|
|
|
# links service files with old name for compatibility
|
2017-01-08 16:59:42 +00:00
|
|
|
ln -s mariadb.service usr/lib/systemd/system/mysqld.service
|
|
|
|
ln -s mariadb@.service usr/lib/systemd/system/mysqld@.service
|
|
|
|
|
|
|
|
# move to proper licenses directories
|
|
|
|
install -d usr/share/licenses/mariadb
|
|
|
|
mv usr/share/doc/mariadb/COPYING* usr/share/licenses/mariadb/
|
|
|
|
|
2019-01-18 13:29:56 +00:00
|
|
|
# move it where one might look for it
|
|
|
|
#mv usr/share/{groonga,doc/mariadb/}
|
|
|
|
#mv usr/share/{groonga-normalizer-mysql,doc/mariadb/}
|
2015-05-08 12:45:16 +00:00
|
|
|
|
2019-01-18 13:29:56 +00:00
|
|
|
# already installed to real systemd unit directory or useless
|
|
|
|
rm -r usr/share/mysql/systemd/
|
|
|
|
rm -r usr/lib/systemd/system/mariadb@bootstrap.service.d
|
2017-12-31 00:00:39 +00:00
|
|
|
|
2019-01-18 13:29:56 +00:00
|
|
|
# provided by mariadb-libs
|
|
|
|
rm usr/bin/mariadb_config
|
2017-06-01 12:35:49 +00:00
|
|
|
rm usr/bin/mysql_config
|
2014-12-05 16:47:24 +00:00
|
|
|
rm -r usr/include/
|
2019-01-18 13:29:56 +00:00
|
|
|
rm usr/share/man/man1/mysql_config.1
|
|
|
|
rm -r usr/share/{aclocal,pkgconfig}
|
|
|
|
rm usr/lib/lib*
|
|
|
|
rm usr/lib/mysql/plugin/{auth_gssapi_client,caching_sha2_password,dialog,mysql_clear_password,sha256_password}.so
|
|
|
|
rm -r usr/lib/pkgconfig/
|
2014-12-05 16:47:24 +00:00
|
|
|
|
|
|
|
# provided by mariadb-clients
|
2017-06-01 12:35:49 +00:00
|
|
|
rm usr/bin/{mysql,mysql_plugin,mysql_upgrade,mysqladmin,mysqlbinlog,mysqlcheck,mysqldump,mysqlimport,mysqlshow,mysqlslap,mysqltest}
|
|
|
|
rm usr/share/man/man1/{mysql,mysql_plugin,mysql_upgrade,mysqladmin,mysqlbinlog,mysqlcheck,mysqldump,mysqlimport,mysqlshow,mysqlslap,mysqltest}.1
|
2014-12-05 16:47:24 +00:00
|
|
|
|
|
|
|
# provided by mytop
|
|
|
|
rm usr/bin/mytop
|
|
|
|
|
|
|
|
# not needed
|
|
|
|
rm -r usr/{data,mysql-test,sql-bench}
|
|
|
|
rm usr/share/man/man1/mysql-test-run.pl.1
|
|
|
|
}
|
2019-01-18 13:29:56 +00:00
|
|
|
|
|
|
|
package_mytop() {
|
|
|
|
pkgdesc='Top clone for MariaDB'
|
|
|
|
depends=('perl' 'perl-dbd-mysql' 'perl-term-readkey')
|
|
|
|
|
|
|
|
cd build
|
|
|
|
|
|
|
|
install -D -m0755 scripts/mytop "$pkgdir"/usr/bin/mytop
|
|
|
|
}
|