Browse Source

mariadb-common: Drop package and adjust configuration

The raison d'être of package mariadb-common was to provide common my.cnf
config file that was being used to include subdirectories and then to
push utf-8 as default everywhere. Let's make this file part of the
server package as there we actually set other options as well and drop
it from all clients. Instead let's set utf-8 as default in server,
client and client libraries. While at it also set socket to the more
common path and drop mysqld_safe script from the list of configuration
files and do other minor tweaks.

Signed-off-by: Michal Hrusecky <michal.hrusecky@turris.com>
lilik-openwrt-22.03
Michal Hrusecky 3 years ago
committed by Rosen Penev
parent
commit
d8ecded02d
6 changed files with 13 additions and 135 deletions
  1. +4
    -7
      libs/libmariadb/Makefile
  2. +0
    -21
      libs/libmariadb/conf/50-client.cnf
  3. +0
    -49
      utils/mariadb-common/Makefile
  4. +9
    -33
      utils/mariadb/Makefile
  5. +0
    -25
      utils/mariadb/conf/50-mysql-clients.cnf
  6. +0
    -0
      utils/mariadb/conf/my.cnf

+ 4
- 7
libs/libmariadb/Makefile View File

@ -29,7 +29,7 @@ MARIADB_CONF_DIR:=/etc/mysql
MARIADB_PLUGIN_DIR:=/usr/lib/mariadb/plugin
MARIADB_PORT=3306
MARIADB_SOCKET=/var/run/mysqld/mysqld.sock
MARIADB_SOCKET=/var/run/mysql/mysql.sock
MARIADB_CLIENT_PLUGINS := \
auth_gssapi_client \
@ -67,7 +67,7 @@ endef
define Package/$(PKG_NAME)
$(call Package/$(PKG_NAME)/Default)
DEPENDS:=+mariadb-common \
DEPENDS:= \
$(ICONV_DEPENDS) \
+libopenssl \
+zlib
@ -77,10 +77,6 @@ define Package/$(PKG_NAME)
ABI_VERSION:=3
endef
define Package/$(PKG_NAME)/conffiles
$(MARIADB_CONF_DIR)/conf.d/50-client.cnf
endef
define Package/$(PKG_NAME)/description
$(call Package/$(PKG_NAME)/description/Default)
@ -95,6 +91,8 @@ CMAKE_OPTIONS += -DWITH_UNIT_TESTS=0
CMAKE_OPTIONS += -DCMAKE_CROSSCOMPILING=1
CMAKE_OPTIONS += \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DINSTALL_INCLUDEDIR=include/mysql \
-DINSTALL_LIBDIR=lib \
-DINSTALL_PLUGINDIR=lib/mariadb/plugin \
@ -155,7 +153,6 @@ define Package/$(PKG_NAME)/install
$(PKG_INSTALL_DIR)$(MARIADB_PLUGIN_DIR)/sha256_password.so \
$(1)$(MARIADB_PLUGIN_DIR)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libmariadb.so.$(ABI_VERSION) $(1)/usr/lib
$(INSTALL_DATA) conf/50-client.cnf $(1)$(MARIADB_CONF_DIR)/conf.d
endef
define BuildPlugin


+ 0
- 21
libs/libmariadb/conf/50-client.cnf View File

@ -1,21 +0,0 @@
#
# This group is read by the client library
# Use it for options that affect all clients, but not the server
#
[client]
# Default is Latin1, if you need UTF-8 set this (also in server section)
default-character-set = utf8mb4
# Example of client certificate usage
# ssl-cert=/etc/mysql/client-cert.pem
# ssl-key=/etc/mysql/client-key.pem
#
# Allow only TLS encrypted connections
# ssl-verify-server-cert=on
# This group is *never* read by mysql client library
# If you use the same .cnf file for MySQL and MariaDB, use it for
# MariaDB-only client options
[client-mariadb]

+ 0
- 49
utils/mariadb-common/Makefile View File

@ -1,49 +0,0 @@
#
# Copyright (C) 2019 Sebastian Kemper <sebastian_ml@gmx.net>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=mariadb-common
PKG_VERSION:=1.0
PKG_RELEASE:=2
PKG_MAINTAINER:=
PKG_LICENSE:=GPL-2.0
CONF_DIR:=/etc/mysql
include $(INCLUDE_DIR)/package.mk
define Package/mariadb-common
SECTION:=utils
CATEGORY:=Utilities
URL:=https://mariadb.org/
SUBMENU:=Database
TITLE:=MariaDB database common files
DEPENDS:=
endef
define Package/mariadb-common/conffiles
$(CONF_DIR)/my.cnf
endef
define Package/mariadb-common/description
MariaDB is a very fast and robust SQL database server.
This package includes shared files, for example $(CONF_DIR)/my.cnf.
endef
define Package/mariadb-common/install
$(INSTALL_DIR) $(1)$(CONF_DIR)
$(INSTALL_DATA) conf/my.cnf $(1)$(CONF_DIR)
endef
define Build/Compile
endef
$(eval $(call BuildPackage,mariadb-common))

+ 9
- 33
utils/mariadb/Makefile View File

@ -32,7 +32,7 @@ CONF_DIR:=/etc/mysql
PLUGIN_DIR:=/usr/lib/mariadb/plugin
SHARE_DIR:=/usr/share/mariadb
MARIADB_SOCKET=/var/run/mysqld/mysqld.sock
MARIADB_SOCKET=/var/run/mysql/mysql.sock
MARIADB_DISABLE_ENGINES := \
cassandra \
@ -213,7 +213,8 @@ define Package/mariadb-client
$(call Package/mariadb/Default)
TITLE:=MariaDB database client
MENU:=1
DEPENDS:=mariadb-client-base
DEPENDS:=$(MARIADB_COMMON_DEPENDS) \
+libedit
endef
define Package/mariadb-client/description
@ -225,26 +226,6 @@ $(subst $(space),$(newline),$(MARIADB_CLIENT))
endef
define Package/mariadb-client-base
$(call Package/mariadb/Default)
TITLE:=MariaDB database client base
DEPENDS:=mariadb-common \
$(MARIADB_COMMON_DEPENDS) \
+libedit
endef
define Package/mariadb-client-base/conffiles
$(CONF_DIR)/conf.d/50-mysql-clients.cnf
endef
define Package/mariadb-client-base/description
$(call Package/mariadb/description/Default)
This package provides the foundation for mariadb-client. It installs the
configuration and the dependencies.
endef
define Package/mariadb-client-extra
$(call Package/mariadb/Default)
TITLE:=MariaDB database client extra
@ -268,10 +249,6 @@ define Package/mariadb-server
PROVIDES:=mysql-server
endef
define Package/mariadb-server/conffiles
/usr/bin/mysqld_safe
endef
define Package/mariadb-server/description
$(call Package/mariadb/description/Default)
@ -283,7 +260,7 @@ endef
define Package/mariadb-server-base
$(call Package/mariadb/Default)
DEPENDS:=mariadb-common \
DEPENDS:= \
$(MARIADB_COMMON_DEPENDS) \
+!KERNEL_IO_URING:libaio \
+KERNEL_IO_URING:liburing \
@ -295,6 +272,7 @@ define Package/mariadb-server-base
endef
define Package/mariadb-server-base/conffiles
$(CONF_DIR)/my.cnf
$(CONF_DIR)/conf.d/50-server.cnf
$(CONF_DIR)/conf.d/60-galera.cnf
/etc/config/mysqld
@ -359,6 +337,8 @@ CMAKE_OPTIONS += \
-DCONNECT_WITH_MONGO=NO \
-DCONNECT_WITH_ODBC=NO \
-DDISABLE_SHARED=NO \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DENABLED_PROFILING=OFF \
-DENABLE_STATIC_LIBS=OFF \
-DINSTALL_DOCDIR=share/doc/mariadb \
@ -370,6 +350,7 @@ CMAKE_OPTIONS += \
-DINSTALL_PAMDATADIR="/etc/security" \
-DINSTALL_PAMDIR="/lib/security" \
-DINSTALL_PLUGINDIR=lib/mariadb/plugin \
-DINSTALL_PREFIX="/usr" \
-DINSTALL_SBINDIR=bin \
-DINSTALL_SCRIPTDIR=bin \
-DINSTALL_SQLBENCHDIR="" \
@ -482,11 +463,6 @@ define Package/mariadb-client/install
cd $(1)/usr/bin; $(LN) mysqlcheck mysqloptimize
endef
define Package/mariadb-client-base/install
$(INSTALL_DIR) $(1)$(CONF_DIR)/conf.d
$(INSTALL_DATA) conf/50-mysql-clients.cnf $(1)$(CONF_DIR)/conf.d
endef
define Package/mariadb-client-extra/install
$(INSTALL_DIR) $(1)/usr/bin
$(foreach b,$(MARIADB_CLIENT_EXTRA),$(call Package/mariadb/install/bin,$(1),$(b));)
@ -507,6 +483,7 @@ define Package/mariadb-server-base/install
$(SED) '/^[a-z]/s/^/#/' $(PKG_INSTALL_DIR)$(SHARE_DIR)/wsrep.cnf
$(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/wsrep.cnf $(1)$(CONF_DIR)/conf.d/60-galera.cnf
$(INSTALL_DATA) conf/50-server.cnf $(1)$(CONF_DIR)/conf.d
$(INSTALL_DATA) conf/my.cnf $(1)$(CONF_DIR)
$(INSTALL_CONF) files/mysqld.config $(1)/etc/config/mysqld
$(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/charsets/* $(1)$(SHARE_DIR)/charsets
$(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/english/errmsg.sys $(1)$(SHARE_DIR)/english
@ -567,7 +544,6 @@ endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,mariadb-client))
$(eval $(call BuildPackage,mariadb-client-base))
$(eval $(call BuildPackage,mariadb-client-extra))
$(eval $(call BuildPackage,mariadb-server))
$(eval $(call BuildPackage,mariadb-server-base))


+ 0
- 25
utils/mariadb/conf/50-mysql-clients.cnf View File

@ -1,25 +0,0 @@
#
# These groups are read by MariaDB command-line tools
# Use it for options that affect only one utility
#
[mysql]
# Default is Latin1, if you need UTF-8 set this (also in server section)
default-character-set = utf8mb4
[mysql_upgrade]
[mysqladmin]
[mysqlbinlog]
[mysqlcheck]
[mysqldump]
[mysqlimport]
[mysqlshow]
[mysqlslap]

utils/mariadb-common/conf/my.cnf → utils/mariadb/conf/my.cnf View File


Loading…
Cancel
Save