[arch-commits] Commit in mariadb/repos (5 files)

Christian Hesse eworm at archlinux.org
Tue May 12 06:26:52 UTC 2020


    Date: Tuesday, May 12, 2020 @ 06:26:51
  Author: eworm
Revision: 383261

archrelease: copy trunk to testing-x86_64

Added:
  mariadb/repos/testing-x86_64/
  mariadb/repos/testing-x86_64/0001-arch-specific.patch
    (from rev 383260, mariadb/trunk/0001-arch-specific.patch)
  mariadb/repos/testing-x86_64/0004-MDEV-15526-systemd-unit-files-naming-and-installation.patch
    (from rev 383260, mariadb/trunk/0004-MDEV-15526-systemd-unit-files-naming-and-installation.patch)
  mariadb/repos/testing-x86_64/PKGBUILD
    (from rev 383260, mariadb/trunk/PKGBUILD)
  mariadb/repos/testing-x86_64/mariadb.install
    (from rev 383260, mariadb/trunk/mariadb.install)

------------------------------------------------------------------+
 0001-arch-specific.patch                                         |   91 ++++
 0004-MDEV-15526-systemd-unit-files-naming-and-installation.patch |   28 +
 PKGBUILD                                                         |  227 ++++++++++
 mariadb.install                                                  |   25 +
 4 files changed, 371 insertions(+)

Copied: mariadb/repos/testing-x86_64/0001-arch-specific.patch (from rev 383260, mariadb/trunk/0001-arch-specific.patch)
===================================================================
--- testing-x86_64/0001-arch-specific.patch	                        (rev 0)
+++ testing-x86_64/0001-arch-specific.patch	2020-05-12 06:26:51 UTC (rev 383261)
@@ -0,0 +1,91 @@
+From bf66e7d610de0d7d3651742342c01ed9ff93f363 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <mail at eworm.de>
+Date: Wed, 19 Feb 2020 13:10:17 +0100
+Subject: [PATCH 1/3] enable PrivateTmp for a little bit more security
+---
+ support-files/mariadb.service.in  | 2 +-
+ support-files/mariadb at .service.in | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in
+index e7665ed1219..a1fe69d61c4 100644
+--- a/support-files/mariadb.service.in
++++ b/support-files/mariadb.service.in
+@@ -129,7 +129,7 @@ UMask=007
+ 
+ # If you don't use the /tmp directory for SELECT ... OUTFILE and
+ # LOAD DATA INFILE you can enable PrivateTmp=true for a little more security.
+-PrivateTmp=false
++PrivateTmp=true
+ 
+ # Set an explicit Start and Stop timeout of 900 seconds (15 minutes!)
+ # this is the same value as used in SysV init scripts in the past
+diff --git a/support-files/mariadb at .service.in b/support-files/mariadb at .service.in
+index ffefc2f22d8..f8b0b8aad8d 100644
+--- a/support-files/mariadb at .service.in
++++ b/support-files/mariadb at .service.in
+@@ -241,7 +241,7 @@ UMask=007
+ 
+ # If you don't use the /tmp directory for SELECT ... OUTFILE and
+ # LOAD DATA INFILE you can enable PrivateTmp=true for a little more security.
+-PrivateTmp=false
++PrivateTmp=true
+ 
+ # Set an explicit Start and Stop timeout of 900 seconds (15 minutes!)
+ # this is the same value as used in SysV init scripts in the past
+
+From 00aab78891a19a14a92039fcc6a73e391a3bb471 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <mail at eworm.de>
+Date: Wed, 19 Feb 2020 13:10:46 +0100
+Subject: [PATCH 2/3] force preloading jemalloc for memory management
+---
+ support-files/mariadb.service.in  | 1 +
+ support-files/mariadb at .service.in | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in
+index a1fe69d61c4..9a2941ae917 100644
+--- a/support-files/mariadb.service.in
++++ b/support-files/mariadb.service.in
+@@ -159,6 +159,7 @@ LimitNOFILE=16364
+ # Library substitutions. previously [mysqld_safe] malloc-lib with explicit paths
+ # (in LD_LIBRARY_PATH) and library name (in LD_PRELOAD).
+ # Environment="LD_LIBRARY_PATH=/path1 /path2" "LD_PRELOAD=
++Environment="LD_PRELOAD=/usr/lib/libjemalloc.so"
+ 
+ # Flush caches. previously [mysqld_safe] flush-caches=1
+ # ExecStartPre=sync
+diff --git a/support-files/mariadb at .service.in b/support-files/mariadb at .service.in
+index f8b0b8aad8d..3309127330c 100644
+--- a/support-files/mariadb at .service.in
++++ b/support-files/mariadb at .service.in
+@@ -282,6 +282,7 @@ LimitNOFILE=16364
+ # Library substitutions. previously [mysqld_safe] malloc-lib with explicit paths
+ # (in LD_LIBRARY_PATH) and library name (in LD_PRELOAD).
+ # Environment="LD_LIBRARY_PATH=/path1 /path2" "LD_PRELOAD=
++Environment="LD_PRELOAD=/usr/lib/libjemalloc.so"
+ 
+ # Flush caches. previously [mysqld_safe] flush-caches=1
+ # ExecStartPre=sync
+
+From a78ff18c83a5eb2556d4f3716f13786dcd8395d2 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <mail at eworm.de>
+Date: Wed, 19 Feb 2020 13:11:31 +0100
+Subject: [PATCH 3/3] Make systemd-tmpfiles create MYSQL_DATADIR
+
+This is a no-op if the directory exists, but makes sure it is created by
+systemd-tmpfiles with proper permissions otherwise.
+
+This solves packaging issues when the user MYSQLD_USER is created by
+systemd-sysusers and uid is not known in advance.
+---
+ support-files/tmpfiles.conf.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/support-files/tmpfiles.conf.in b/support-files/tmpfiles.conf.in
+index 03d66abc0c7..3c89cb258c9 100644
+--- a/support-files/tmpfiles.conf.in
++++ b/support-files/tmpfiles.conf.in
+@@ -1 +1,2 @@
+ d @MYSQL_UNIX_DIR@ 0755 @MYSQLD_USER@ @MYSQLD_USER@ -
++d @MYSQL_DATADIR@ 0700 @MYSQLD_USER@ @MYSQLD_USER@ -

Copied: mariadb/repos/testing-x86_64/0004-MDEV-15526-systemd-unit-files-naming-and-installation.patch (from rev 383260, mariadb/trunk/0004-MDEV-15526-systemd-unit-files-naming-and-installation.patch)
===================================================================
--- testing-x86_64/0004-MDEV-15526-systemd-unit-files-naming-and-installation.patch	                        (rev 0)
+++ testing-x86_64/0004-MDEV-15526-systemd-unit-files-naming-and-installation.patch	2020-05-12 06:26:51 UTC (rev 383261)
@@ -0,0 +1,28 @@
+commit 6af0bd69074725c8d8b10f07ed4ccc013d010322
+Author: Faustin Lammler <faustin at fala.red>
+Date:   Fri Jan 11 18:22:44 2019 -0300
+
+    MDEV-15526 systemd unit files naming and installation
+    
+    Drop Aliases from the service file directive. Aliases in the service
+    file only take effect when the service is enabled. This is the case
+    because Aliases in service files do not have to be unique across various
+    services.
+    
+    Shipping symlinks guarantees that one can always enable mariadb service
+    using `systemctl enable mysql` or `systemctl enable mysqld` and makes
+    the commands indempotent.
+
+diff --git a/support-files/mariadb.service.in b/support-files/mariadb.service.in
+index dca7a4c13a7..e61e35c52ee 100644
+--- a/support-files/mariadb.service.in
++++ b/support-files/mariadb.service.in
+@@ -26,8 +26,6 @@ After=network.target
+ 
+ [Install]
+ WantedBy=multi-user.target
+-Alias=mysql.service
+-Alias=mysqld.service
+ 
+ 
+ [Service]

Copied: mariadb/repos/testing-x86_64/PKGBUILD (from rev 383260, mariadb/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD	                        (rev 0)
+++ testing-x86_64/PKGBUILD	2020-05-12 06:26:51 UTC (rev 383261)
@@ -0,0 +1,227 @@
+# Maintainer: Bartłomiej Piotrowski <bpiotrowski at archlinux.org>
+# Maintainer: Christian Hesse <mail at eworm.de>
+
+pkgbase=mariadb
+pkgname=('mariadb-libs' 'mariadb-clients' 'mariadb' 'mytop')
+pkgdesc='Fast SQL database server, derived from MySQL'
+pkgver=10.4.13
+pkgrel=1
+arch=('x86_64')
+license=('GPL')
+url='https://mariadb.org/'
+makedepends=('boost' 'bzip2' 'cmake' 'jemalloc' 'libaio' 'libxml2' 'lz4' 'lzo'
+             'openssl' 'systemd' 'zlib' 'zstd')
+validpgpkeys=('199369E5404BD5FC7D2FE43BCBCB082A1BB943DB') # MariaDB Package Signing Key <package-signing-key at mariadb.org>
+# The default links with mirror redirection fail for signatures, specific
+# mirrors may be out of date every now and then. Let's use the upstream
+# rsync source and hope it does not hurt them too much.
+# https://mariadb.com/kb/en/library/mirror-sites-for-mariadb/
+source=("rsync://rsync.osuosl.org/mariadb/mariadb-${pkgver}/source/mariadb-${pkgver}.tar.gz"{,.asc}
+        '0001-arch-specific.patch'
+        '0004-MDEV-15526-systemd-unit-files-naming-and-installation.patch')
+sha256sums=('45bbbb12d1de8febd9edf630e940c23cf14efd60570c743b268069516a5d91df'
+            'SKIP'
+            'c97e36bd0aeb10f506f4843761a0cd13dbe2e7bc71c3e5cdcd1a5310338bffaf'
+            '1bb3b18afac8c95dbe964046e18b866288f41f8ec3a4a9c69875ca1620b89d29')
+
+prepare() {
+  cd $pkgbase-$pkgver/
+
+  # Arch Linux specific patches:
+  #  * enable PrivateTmp for a little bit more security
+  #  * force preloading jemalloc for memory management
+  #  * make systemd-tmpfiles create MYSQL_DATADIR
+  patch -Np1 < ../0001-arch-specific.patch
+
+  # MDEV-15526 systemd unit files naming and installation
+  patch -Np1 < ../0004-MDEV-15526-systemd-unit-files-naming-and-installation.patch
+}
+
+build() {
+  local _cmake_options=(
+    # build options
+    -DCOMPILATION_COMMENT="Arch Linux"
+    -DCMAKE_BUILD_TYPE=RelWithDebInfo
+    -Wno-dev
+
+    # file paths
+    # /etc
+    -DINSTALL_SYSCONFDIR=/etc
+    -DINSTALL_SYSCONF2DIR=/etc/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
+    -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
+  cd build
+
+  cmake ../"$pkgbase-$pkgver" "${_cmake_options[@]}"
+
+  make
+}
+
+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'
+  depends=('bzip2' 'libaio' 'lz4' 'lzo' 'openssl' 'xz' 'zlib')
+  conflicts=('libmysqlclient' 'libmariadbclient' 'mariadb-connector-c')
+  provides=('libmariadbclient' 'mariadb-connector-c')
+  replaces=('libmariadbclient')
+
+  cd build
+
+  for dir in libmariadb libmysqld libservices include; do
+    make -C "$dir" DESTDIR="$pkgdir" install
+  done
+
+  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 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
+
+  cd "$pkgdir"
+
+  # remove static libraries
+  rm usr/lib/*.a
+}
+
+package_mariadb-clients() {
+  pkgdesc='MariaDB client tools'
+  depends=("mariadb-libs=${pkgver}" 'jemalloc')
+  conflicts=('mysql-clients')
+  provides=("mysql-clients=$pkgver")
+
+  cd build
+
+  make -C client DESTDIR="$pkgdir" install
+
+  # install man pages
+  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"
+  done
+}
+
+package_mariadb() {
+  pkgdesc='Fast SQL database server, derived from MySQL'
+  backup=('etc/my.cnf'
+          'etc/my.cnf.d/client.cnf'
+          'etc/my.cnf.d/enable_encryption.preset'
+          'etc/my.cnf.d/mysql-clients.cnf'
+          'etc/my.cnf.d/server.cnf'
+          'etc/security/user_map.conf')
+  install=mariadb.install
+  depends=("mariadb-clients=${pkgver}" 'inetutils' 'systemd-libs' 'libxml2' 'zstd')
+  optdepends=('galera: for MariaDB cluster with Galera WSREP'
+              'perl-dbd-mysql: for mysqlhotcopy, mysql_convert_table_format and mysql_setpermission')
+  conflicts=('mysql')
+  provides=("mysql=$pkgver")
+  options=('emptydirs')
+
+  cd build
+
+  make DESTDIR="$pkgdir" install
+
+  cd "$pkgdir"
+
+  # no SysV init, please!
+  rm -r etc/logrotate.d
+  rm usr/bin/rcmysql
+  rm usr/share/mysql/{binary-configure,mysql{,d_multi}.server}
+
+  # link service files with old name for compatibility
+  ln -s mariadb.service usr/lib/systemd/system/mysqld.service
+  ln -s mariadb at .service usr/lib/systemd/system/mysqld at .service
+
+  # move to proper licenses directories
+  install -d usr/share/licenses/mariadb
+  mv usr/share/doc/mariadb/COPYING* usr/share/licenses/mariadb/
+
+  # move it where one might look for it
+  mv usr/share/{groonga{,-normalizer-mysql},doc/mariadb/}
+
+  # move to pam directories
+  install -d {etc,usr/lib}/security
+  mv usr/share/user_map.conf etc/security/
+  mv usr/share/pam_user_map.so usr/lib/security/
+
+  # already installed to real systemd unit directory or useless
+  rm -r usr/share/mysql/systemd/
+  rm -r usr/lib/systemd/system/mariadb at bootstrap.service.d
+
+  # provided by mariadb-libs
+  rm usr/bin/mariadb_config
+  rm usr/bin/mysql_config
+  rm -r usr/include/
+  rm usr/share/man/man1/mysql_config.1
+  rm -r usr/share/aclocal
+  rm usr/lib/lib*
+  rm -r usr/lib/pkgconfig
+  rm usr/lib/mysql/plugin/{auth_gssapi_client,caching_sha2_password,client_ed25519,dialog,mysql_clear_password,sha256_password}.so
+
+  # provided by mariadb-clients
+  rm usr/bin/mysql{,_plugin,_upgrade,admin,binlog,check,dump,import,show,slap,test}
+  rm usr/bin/mariadb{,-{admin,binlog,check,dump,import,plugin,show,slap,test,upgrade}}
+  rm usr/share/man/man1/mysql{,_plugin,_upgrade,admin,binlog,check,dump,import,show,slap,test}.1
+
+  # 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
+}
+
+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
+}

Copied: mariadb/repos/testing-x86_64/mariadb.install (from rev 383260, mariadb/trunk/mariadb.install)
===================================================================
--- testing-x86_64/mariadb.install	                        (rev 0)
+++ testing-x86_64/mariadb.install	2020-05-12 06:26:51 UTC (rev 383261)
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+post_install() {
+  echo ":: You need to initialize the MariaDB data directory prior to starting"
+  echo "   the service. This can be done with mariadb-install-db command, e.g.:"
+  echo "   mariadb-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 && mariadb-upgrade -u root -p"
+  fi
+
+  # return if old package version greater 10.4...
+  (( $(vercmp $2 '10.4') > 0 )) && return
+
+  # upgrade from pre-10.4...
+  echo ":: MariaDB configuration layout changed."
+  echo "   -> The main configuration file now is: /etc/my.cnf"
+  echo "   -> Instantiated services (mariadb at foo.service) do not longer read their"
+  echo "      own configuration file but use group suffix (configuration block"
+  echo "      '[mysqld.foo]') in main configuration file."
+}


More information about the arch-commits mailing list