extra/mariadb to 10.3.12-2

This commit is contained in:
Kevin Mihelich 2019-01-18 13:29:56 +00:00
parent 675bab0bd6
commit f6614b5533
4 changed files with 148 additions and 1112 deletions

File diff suppressed because it is too large Load diff

View file

@ -6,22 +6,21 @@
# - patch to link (unused) static libs against libatomic on v5/v6 to fix FTBFS # - patch to link (unused) static libs against libatomic on v5/v6 to fix FTBFS
pkgbase=mariadb pkgbase=mariadb
pkgname=('libmariadbclient' 'mariadb-clients' 'mytop' 'mariadb') pkgname=('mariadb-libs' 'mariadb-clients' 'mariadb' 'mytop')
pkgver=10.1.37 pkgdesc='Fast SQL database server, derived from MySQL'
pkgrel=1 pkgver=10.3.12
pkgrel=2
arch=('x86_64') arch=('x86_64')
license=('GPL') license=('GPL')
url='https://mariadb.org/' url='https://mariadb.org/'
makedepends=('boost' 'bzip2' 'cmake' 'jemalloc' 'libaio' 'libxml2' 'lz4' 'lzo' makedepends=('boost' 'bzip2' 'cmake' 'jemalloc' 'libaio' 'libxml2' 'lz4' 'lzo'
'openssl' 'systemd' 'zlib') 'openssl' 'systemd' 'zlib' 'zstd')
validpgpkeys=('199369E5404BD5FC7D2FE43BCBCB082A1BB943DB') # MariaDB Package Signing Key <package-signing-key@mariadb.org> validpgpkeys=('199369E5404BD5FC7D2FE43BCBCB082A1BB943DB') # MariaDB Package Signing Key <package-signing-key@mariadb.org>
source=("https://mirrors.n-ix.net/mariadb/mariadb-$pkgver/source/mariadb-$pkgver.tar.gz"{,.asc} source=("https://ftp.heanet.ie/mirrors/mariadb/mariadb-$pkgver/source/mariadb-$pkgver.tar.gz"{,.asc}
'0001-openssl-1-1-0.patch'
'atomic.patch') 'atomic.patch')
sha256sums=('8cd516b0a7f7aa36a7c1d6e687dbbad8c0b08c92d5fd60c6e691b19a6cab4d46' sha256sums=('f7449a34c25e0455928d7983dae83fd2069fe1f16c4c5f4aeed9ed9d3f081ff6'
'SKIP' 'SKIP'
'fe26d22f0150e7460daa83d71d35735b3031cfc97e99bfbb8d6d74c11a28ccea' '7769fd8eb2bb3a6644a2200d01918ff887be25638d79dbec25897fe0d87badc4')
'2ddfe7dc5eae905ed77d7438d6869f9bb26684945c2f82cc19f84926b1cb849f')
prepare() { prepare() {
cd $pkgbase-$pkgver/ cd $pkgbase-$pkgver/
@ -29,91 +28,113 @@ prepare() {
# Changes to the upstream unit files: # Changes to the upstream unit files:
# * remove the alias from unit files, we install symlinks in package function # * remove the alias from unit files, we install symlinks in package function
# * enable PrivateTmp for a little bit more security # * enable PrivateTmp for a little bit more security
# * force preloading jemalloc for memory management
sed -i -e '/^Alias/d' \ sed -i -e '/^Alias/d' \
-e '/^PrivateTmp/c PrivateTmp=true' \ -e '/^PrivateTmp/c PrivateTmp=true' \
-e '/# Environment="LD_/a Environment="LD_PRELOAD=/usr/lib/libjemalloc.so"' \
support-files/mariadb{,@}.service.in support-files/mariadb{,@}.service.in
# openssl 1.1.0
patch -Np1 < "${srcdir}"/0001-openssl-1-1-0.patch
# let's create the datadir from tmpfiles # let's create the datadir from tmpfiles
echo 'd @MYSQL_DATADIR@ 0700 @MYSQLD_USER@ @MYSQLD_USER@ -' >> support-files/tmpfiles.conf.in echo 'd @MYSQL_DATADIR@ 0700 @MYSQLD_USER@ @MYSQLD_USER@ -' >> support-files/tmpfiles.conf.in
# 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}
if [[ $CARCH == arm || $CARCH == armv6h ]]; then if [[ $CARCH == arm || $CARCH == armv6h ]]; then
patch -p0 -i ../atomic.patch patch -p0 -i ../atomic.patch
fi fi
} }
build() { build() {
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
)
mkdir build mkdir build
cd build cd build
cmake ../$pkgbase-$pkgver \ cmake ../"$pkgbase-$pkgver" "${_cmake_options[@]}"
-DCMAKE_AR=/usr/bin/gcc-ar \
-DCMAKE_RANLIB=/usr/bin/gcc-ranlib \
-DBUILD_CONFIG=mysql_release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DMYSQL_DATADIR=/var/lib/mysql \
-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_unicode_ci \
-DENABLED_LOCAL_INFILE=ON \
-DINSTALL_DOCDIR=share/doc/mariadb \
-DINSTALL_DOCREADMEDIR=share/doc/mariadb \
-DINSTALL_MANDIR=share/man \
-DINSTALL_PLUGINDIR=lib/mysql/plugin \
-DINSTALL_SCRIPTDIR=bin \
-DINSTALL_SYSCONFDIR=/etc/mysql \
-DINSTALL_SYSCONF2DIR=/etc/mysql \
-DINSTALL_INCLUDEDIR=include/mysql \
-DINSTALL_SUPPORTFILESDIR=share/mysql \
-DINSTALL_MYSQLSHAREDIR=share/mysql \
-DINSTALL_SHAREDIR=share/mysql \
-DINSTALL_SYSTEMD_SYSUSERSDIR=/usr/lib/sysusers.d/ \
-DINSTALL_SYSTEMD_TMPFILESDIR=/usr/lib/tmpfiles.d/ \
-DINSTALL_SYSTEMD_UNITDIR=/usr/lib/systemd/system/ \
-DWITH_SYSTEMD=yes \
-DWITH_READLINE=ON \
-DWITH_ZLIB=system \
-DWITH_SSL=system \
-DWITH_PCRE=bundled \
-DWITH_LIBWRAP=OFF \
-DWITH_JEMALLOC=ON \
-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 \
-DWITH_TOKUDB_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITHOUT_FEDERATED_STORAGE_ENGINE=1 \
-DWITHOUT_PBXT_STORAGE_ENGINE=1 \
-DCMAKE_EXE_LINKER_FLAGS='-ljemalloc' \
-DWITHOUT_MROONGA_STORAGE_ENGINE=1 \
-DCMAKE_C_FLAGS="-fPIC $CFLAGS -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer -fno-delete-null-pointer-checks" \
-DCMAKE_CXX_FLAGS="-fPIC $CXXFLAGS -fno-strict-aliasing -DBIG_JOINS=1 -felide-constructors -fno-rtti -fno-delete-null-pointer-checks" \
-DWITH_MYSQLD_LDFLAGS="-pie ${LDFLAGS},-z,now"
make make
} }
package_libmariadbclient() { check() {
pkgdesc='MariaDB client libraries' 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'
depends=('bzip2' 'libaio' 'lz4' 'lzo' 'openssl' 'xz' 'zlib') depends=('bzip2' 'libaio' 'lz4' 'lzo' 'openssl' 'xz' 'zlib')
conflicts=('libmysqlclient') conflicts=('libmysqlclient' 'libmariadbclient' 'mariadb-connector-c')
provides=('libmariadbclient' 'mariadb-connector-c')
replaces=('libmariadbclient')
cd build cd build
for dir in libmysql libmysqld libservices include; do for dir in libmariadb libmysqld libservices include; do
make -C $dir DESTDIR="$pkgdir" install make -C "$dir" DESTDIR="$pkgdir" install
done done
install -D -m0755 scripts/mysql_config "$pkgdir"/usr/bin/mysql_config 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 install -D -m0644 "$srcdir"/"$pkgbase-$pkgver"/man/mysql_config.1 "$pkgdir"/usr/share/man/man1/mysql_config.1
install -D -m0644 support-files/mariadb.pc "$pkgdir"/usr/share/pkgconfig/mariadb.pc install -D -m0644 support-files/mariadb.pc "$pkgdir"/usr/share/pkgconfig/mariadb.pc
install -D -m0644 "$srcdir"/$pkgbase-$pkgver/support-files/mysql.m4 "$pkgdir"/usr/share/aclocal/mysql.m4 install -D -m0644 "$srcdir"/"$pkgbase-$pkgver"/support-files/mysql.m4 "$pkgdir"/usr/share/aclocal/mysql.m4
# remove static libraries # remove static libraries
rm "$pkgdir"/usr/lib/*.a rm "$pkgdir"/usr/lib/*.a
@ -121,7 +142,7 @@ package_libmariadbclient() {
package_mariadb-clients() { package_mariadb-clients() {
pkgdesc='MariaDB client tools' pkgdesc='MariaDB client tools'
depends=("libmariadbclient=${pkgver}" 'jemalloc') depends=("mariadb-libs=${pkgver}" 'jemalloc')
conflicts=('mysql-clients') conflicts=('mysql-clients')
provides=("mysql-clients=$pkgver") provides=("mysql-clients=$pkgver")
@ -131,25 +152,19 @@ package_mariadb-clients() {
# install man pages # install man pages
for man in mysql mysql_plugin mysql_upgrade mysqladmin mysqlbinlog mysqlcheck mysqldump mysqlimport mysqlshow mysqlslap mysqltest; do for man in mysql mysql_plugin mysql_upgrade mysqladmin mysqlbinlog mysqlcheck mysqldump mysqlimport mysqlshow mysqlslap mysqltest; do
install -D -m0644 "$srcdir"/$pkgbase-$pkgver/man/$man.1 "$pkgdir"/usr/share/man/man1/$man.1 install -D -m0644 "$srcdir"/"$pkgbase-$pkgver"/man/"$man.1" "$pkgdir"/usr/share/man/man1/"$man.1"
done done
} }
package_mytop() {
pkgdesc='Top clone for MariaDB'
depends=('perl' 'perl-dbd-mysql' 'perl-term-readkey')
cd build
install -Dm0755 scripts/mytop "$pkgdir"/usr/bin/mytop
}
package_mariadb() { package_mariadb() {
pkgdesc='Fast SQL database server, drop-in replacement for MySQL' pkgdesc='Fast SQL database server, derived from MySQL'
backup=('etc/mysql/my.cnf' backup=('etc/mysql/my.cnf'
'etc/mysql/wsrep.cnf') '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')
install=mariadb.install install=mariadb.install
depends=("mariadb-clients=${pkgver}" 'inetutils' 'libsystemd' 'libxml2') depends=("mariadb-clients=${pkgver}" 'inetutils' 'libsystemd' 'libxml2' 'zstd')
optdepends=('galera: for MariaDB cluster with Galera WSREP' optdepends=('galera: for MariaDB cluster with Galera WSREP'
'perl-dbd-mysql: for mysqlhotcopy, mysql_convert_table_format and mysql_setpermission') 'perl-dbd-mysql: for mysqlhotcopy, mysql_convert_table_format and mysql_setpermission')
conflicts=('mysql') conflicts=('mysql')
@ -162,16 +177,16 @@ package_mariadb() {
cd "$pkgdir" cd "$pkgdir"
# We specified INSTALL_SYSCONFDIR and INSTALL_SYSCONF2DIR to have proper paths # no SysV init, please!
# in binaries and support file. But we want our own files... rm -r etc/mysql/{init.d,logrotate.d}
# TOOD: Change to upstream file layout with version 10.2.x? rm usr/bin/rcmysql
rm -r etc/ rm usr/share/mysql/{binary-configure,mysql{,d_multi}.server}
install -Dm0644 usr/share/mysql/my-medium.cnf etc/mysql/my.cnf
install -Dm0644 usr/share/mysql/wsrep.cnf etc/mysql/wsrep.cnf
# these should have useful names
mv usr/lib/sysusers.d/{sysusers,mariadb}.conf mv usr/lib/sysusers.d/{sysusers,mariadb}.conf
mv usr/lib/tmpfiles.d/{tmpfiles,mariadb}.conf mv usr/lib/tmpfiles.d/{tmpfiles,mariadb}.conf
# links service files with old name for compatibility
ln -s mariadb.service usr/lib/systemd/system/mysqld.service ln -s mariadb.service usr/lib/systemd/system/mysqld.service
ln -s mariadb@.service usr/lib/systemd/system/mysqld@.service ln -s mariadb@.service usr/lib/systemd/system/mysqld@.service
@ -179,18 +194,23 @@ package_mariadb() {
install -d usr/share/licenses/mariadb install -d usr/share/licenses/mariadb
mv usr/share/doc/mariadb/COPYING* usr/share/licenses/mariadb/ mv usr/share/doc/mariadb/COPYING* usr/share/licenses/mariadb/
# already installed to real systemd unit directory # move it where one might look for it
#mv usr/share/{groonga,doc/mariadb/}
#mv usr/share/{groonga-normalizer-mysql,doc/mariadb/}
# already installed to real systemd unit directory or useless
rm -r usr/share/mysql/systemd/ rm -r usr/share/mysql/systemd/
rm -r usr/lib/systemd/system/mariadb@bootstrap.service.d
# left over from sysvinit # provided by mariadb-libs
rm usr/bin/rcmysql rm usr/bin/mariadb_config
# provided by libmariadbclient
rm usr/bin/mysql_config rm usr/bin/mysql_config
rm usr/lib/libmysql*
rm usr/share/man/man1/mysql_config.1
rm -r usr/include/ rm -r usr/include/
rm -r usr/share/mysql/{aclocal,pkgconfig} 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/
# provided by mariadb-clients # provided by mariadb-clients
rm usr/bin/{mysql,mysql_plugin,mysql_upgrade,mysqladmin,mysqlbinlog,mysqlcheck,mysqldump,mysqlimport,mysqlshow,mysqlslap,mysqltest} rm usr/bin/{mysql,mysql_plugin,mysql_upgrade,mysqladmin,mysqlbinlog,mysqlcheck,mysqldump,mysqlimport,mysqlshow,mysqlslap,mysqltest}
@ -203,3 +223,12 @@ package_mariadb() {
rm -r usr/{data,mysql-test,sql-bench} rm -r usr/{data,mysql-test,sql-bench}
rm usr/share/man/man1/mysql-test-run.pl.1 rm usr/share/man/man1/mysql-test-run.pl.1
} }
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
}

View file

@ -1,6 +1,6 @@
--- libmysqld/CMakeLists.txt.orig 2017-06-02 07:40:08.506002423 -0600 --- libmysqld/CMakeLists.txt.orig 2019-01-04 08:28:48.000000000 -0700
+++ libmysqld/CMakeLists.txt 2017-06-02 07:40:21.575972304 -0600 +++ libmysqld/CMakeLists.txt 2019-01-17 06:52:10.668544469 -0700
@@ -137,6 +137,7 @@ @@ -150,6 +150,7 @@
${LIBWRAP} ${LIBCRYPT} ${LIBDL} ${LIBWRAP} ${LIBCRYPT} ${LIBDL}
${MYSQLD_STATIC_PLUGIN_LIBS} ${MYSQLD_STATIC_PLUGIN_LIBS}
sql_embedded sql_embedded
@ -8,9 +8,9 @@
) )
# Some storage engine were compiled for embedded specifically # Some storage engine were compiled for embedded specifically
--- sql/CMakeLists.txt.orig 2017-06-02 17:52:45.041823696 -0600 --- sql/CMakeLists.txt.orig 2019-01-04 08:28:49.000000000 -0700
+++ sql/CMakeLists.txt 2017-06-02 17:52:25.446874245 -0600 +++ sql/CMakeLists.txt 2019-01-17 06:52:10.672544438 -0700
@@ -176,7 +176,8 @@ @@ -169,7 +169,8 @@
${LIBWRAP} ${LIBCRYPT} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBWRAP} ${LIBCRYPT} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT}
${WSREP_LIB} ${WSREP_LIB}
${SSL_LIBRARIES} ${SSL_LIBRARIES}
@ -20,3 +20,14 @@
IF(WIN32) IF(WIN32)
SET(MYSQLD_SOURCE main.cc nt_servc.cc message.rc) SET(MYSQLD_SOURCE main.cc nt_servc.cc message.rc)
--- storage/rocksdb/build_rocksdb.cmake.orig 2019-01-17 07:52:59.896149354 -0700
+++ storage/rocksdb/build_rocksdb.cmake 2019-01-17 07:53:34.996081204 -0700
@@ -423,7 +423,7 @@
list(APPEND SOURCES ${CMAKE_CURRENT_BINARY_DIR}/build_version.cc)
ADD_CONVENIENCE_LIBRARY(rocksdblib ${SOURCES})
-target_link_libraries(rocksdblib ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
+target_link_libraries(rocksdblib ${THIRDPARTY_LIBS} ${SYSTEM_LIBS} atomic)
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_target_properties(rocksdblib PROPERTIES COMPILE_FLAGS "-fPIC -fno-builtin-memcmp -frtti")
endif()

View file

@ -1,11 +1,15 @@
#!/bin/sh #!/bin/sh
post_install() { post_install() {
echo ":: You need to initialize the MariaDB data directory prior to starting" echo ":: You need to initialize the MariaDB data directory prior to starting"
echo " the service. This can be done with mysql_install_db command, e.g.:" echo " the service. This can be done with mysql_install_db command, e.g.:"
echo " mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql" echo " mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql"
} }
post_upgrade(){
# show for feature release: 10.1 -> 10.2 -> 10.3 -> ...
if [ $(vercmp "${1%.*}" "${2%.*}") -ne 0 ]; then
echo ":: MariaDB was updated to a new feature release. To update the data run:"
echo " systemctl restart mariadb.service && mysql_upgrade -u root -p"
fi
}