You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

568 lines
18 KiB

mariadb: improve packaging and configuration At present there are some flaws related to configuration, also related to the packaging of mariadb. For starters there are complaints that the configuration is too static. To address this a new configuration layout is introduced. The primary configuration file (my.cnf) is changed so that it now only includes further configuration files in the directory /etc/mysql/conf.d. More default configuration files are added for the server and the client. This is the new default configuration. With these changes it's possible for the user to select if they want to change the default configuration (in conf.d/*.cnf) or if they want to drop their own files into conf.d instead. If the user .cnf files are read after the default .cnf files (files are included in alphabetical order), they will overwrite the settings from the default configuration. The other flaw is that the my.cnf file is included in mariadb-server. But that doesn't really fit the requirements, as the client also uses the configuration file(s). To accomodate this a new package mariadb-common is added. It installs the shared my.cnf file. The remaining changes add base packages, both for the server and the client. These are meant as foundation for the packages containing the respective binaries. In summary they will install the configuration, small miscellaneous files (SQL scripts etc.) and the user "mariadb". That means that everything is ready for the binaries, like mysql and mysqld. If there is not enough space left on flash memory, the user can just drop the binaries on a pendrive, link them to /usr/bin and get started. The ideas and configuration files were copied from Debian. Some amendments were made. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
6 years ago
mariadb: improve packaging and configuration At present there are some flaws related to configuration, also related to the packaging of mariadb. For starters there are complaints that the configuration is too static. To address this a new configuration layout is introduced. The primary configuration file (my.cnf) is changed so that it now only includes further configuration files in the directory /etc/mysql/conf.d. More default configuration files are added for the server and the client. This is the new default configuration. With these changes it's possible for the user to select if they want to change the default configuration (in conf.d/*.cnf) or if they want to drop their own files into conf.d instead. If the user .cnf files are read after the default .cnf files (files are included in alphabetical order), they will overwrite the settings from the default configuration. The other flaw is that the my.cnf file is included in mariadb-server. But that doesn't really fit the requirements, as the client also uses the configuration file(s). To accomodate this a new package mariadb-common is added. It installs the shared my.cnf file. The remaining changes add base packages, both for the server and the client. These are meant as foundation for the packages containing the respective binaries. In summary they will install the configuration, small miscellaneous files (SQL scripts etc.) and the user "mariadb". That means that everything is ready for the binaries, like mysql and mysqld. If there is not enough space left on flash memory, the user can just drop the binaries on a pendrive, link them to /usr/bin and get started. The ideas and configuration files were copied from Debian. Some amendments were made. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
6 years ago
mariadb: improve packaging and configuration At present there are some flaws related to configuration, also related to the packaging of mariadb. For starters there are complaints that the configuration is too static. To address this a new configuration layout is introduced. The primary configuration file (my.cnf) is changed so that it now only includes further configuration files in the directory /etc/mysql/conf.d. More default configuration files are added for the server and the client. This is the new default configuration. With these changes it's possible for the user to select if they want to change the default configuration (in conf.d/*.cnf) or if they want to drop their own files into conf.d instead. If the user .cnf files are read after the default .cnf files (files are included in alphabetical order), they will overwrite the settings from the default configuration. The other flaw is that the my.cnf file is included in mariadb-server. But that doesn't really fit the requirements, as the client also uses the configuration file(s). To accomodate this a new package mariadb-common is added. It installs the shared my.cnf file. The remaining changes add base packages, both for the server and the client. These are meant as foundation for the packages containing the respective binaries. In summary they will install the configuration, small miscellaneous files (SQL scripts etc.) and the user "mariadb". That means that everything is ready for the binaries, like mysql and mysqld. If there is not enough space left on flash memory, the user can just drop the binaries on a pendrive, link them to /usr/bin and get started. The ideas and configuration files were copied from Debian. Some amendments were made. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
6 years ago
mariadb: improve packaging and configuration At present there are some flaws related to configuration, also related to the packaging of mariadb. For starters there are complaints that the configuration is too static. To address this a new configuration layout is introduced. The primary configuration file (my.cnf) is changed so that it now only includes further configuration files in the directory /etc/mysql/conf.d. More default configuration files are added for the server and the client. This is the new default configuration. With these changes it's possible for the user to select if they want to change the default configuration (in conf.d/*.cnf) or if they want to drop their own files into conf.d instead. If the user .cnf files are read after the default .cnf files (files are included in alphabetical order), they will overwrite the settings from the default configuration. The other flaw is that the my.cnf file is included in mariadb-server. But that doesn't really fit the requirements, as the client also uses the configuration file(s). To accomodate this a new package mariadb-common is added. It installs the shared my.cnf file. The remaining changes add base packages, both for the server and the client. These are meant as foundation for the packages containing the respective binaries. In summary they will install the configuration, small miscellaneous files (SQL scripts etc.) and the user "mariadb". That means that everything is ready for the binaries, like mysql and mysqld. If there is not enough space left on flash memory, the user can just drop the binaries on a pendrive, link them to /usr/bin and get started. The ideas and configuration files were copied from Debian. Some amendments were made. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
6 years ago
mariadb: improve packaging and configuration At present there are some flaws related to configuration, also related to the packaging of mariadb. For starters there are complaints that the configuration is too static. To address this a new configuration layout is introduced. The primary configuration file (my.cnf) is changed so that it now only includes further configuration files in the directory /etc/mysql/conf.d. More default configuration files are added for the server and the client. This is the new default configuration. With these changes it's possible for the user to select if they want to change the default configuration (in conf.d/*.cnf) or if they want to drop their own files into conf.d instead. If the user .cnf files are read after the default .cnf files (files are included in alphabetical order), they will overwrite the settings from the default configuration. The other flaw is that the my.cnf file is included in mariadb-server. But that doesn't really fit the requirements, as the client also uses the configuration file(s). To accomodate this a new package mariadb-common is added. It installs the shared my.cnf file. The remaining changes add base packages, both for the server and the client. These are meant as foundation for the packages containing the respective binaries. In summary they will install the configuration, small miscellaneous files (SQL scripts etc.) and the user "mariadb". That means that everything is ready for the binaries, like mysql and mysqld. If there is not enough space left on flash memory, the user can just drop the binaries on a pendrive, link them to /usr/bin and get started. The ideas and configuration files were copied from Debian. Some amendments were made. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
6 years ago
mariadb: improve packaging and configuration At present there are some flaws related to configuration, also related to the packaging of mariadb. For starters there are complaints that the configuration is too static. To address this a new configuration layout is introduced. The primary configuration file (my.cnf) is changed so that it now only includes further configuration files in the directory /etc/mysql/conf.d. More default configuration files are added for the server and the client. This is the new default configuration. With these changes it's possible for the user to select if they want to change the default configuration (in conf.d/*.cnf) or if they want to drop their own files into conf.d instead. If the user .cnf files are read after the default .cnf files (files are included in alphabetical order), they will overwrite the settings from the default configuration. The other flaw is that the my.cnf file is included in mariadb-server. But that doesn't really fit the requirements, as the client also uses the configuration file(s). To accomodate this a new package mariadb-common is added. It installs the shared my.cnf file. The remaining changes add base packages, both for the server and the client. These are meant as foundation for the packages containing the respective binaries. In summary they will install the configuration, small miscellaneous files (SQL scripts etc.) and the user "mariadb". That means that everything is ready for the binaries, like mysql and mysqld. If there is not enough space left on flash memory, the user can just drop the binaries on a pendrive, link them to /usr/bin and get started. The ideas and configuration files were copied from Debian. Some amendments were made. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
6 years ago
mariadb: improve packaging and configuration At present there are some flaws related to configuration, also related to the packaging of mariadb. For starters there are complaints that the configuration is too static. To address this a new configuration layout is introduced. The primary configuration file (my.cnf) is changed so that it now only includes further configuration files in the directory /etc/mysql/conf.d. More default configuration files are added for the server and the client. This is the new default configuration. With these changes it's possible for the user to select if they want to change the default configuration (in conf.d/*.cnf) or if they want to drop their own files into conf.d instead. If the user .cnf files are read after the default .cnf files (files are included in alphabetical order), they will overwrite the settings from the default configuration. The other flaw is that the my.cnf file is included in mariadb-server. But that doesn't really fit the requirements, as the client also uses the configuration file(s). To accomodate this a new package mariadb-common is added. It installs the shared my.cnf file. The remaining changes add base packages, both for the server and the client. These are meant as foundation for the packages containing the respective binaries. In summary they will install the configuration, small miscellaneous files (SQL scripts etc.) and the user "mariadb". That means that everything is ready for the binaries, like mysql and mysqld. If there is not enough space left on flash memory, the user can just drop the binaries on a pendrive, link them to /usr/bin and get started. The ideas and configuration files were copied from Debian. Some amendments were made. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
6 years ago
mariadb: improve packaging and configuration At present there are some flaws related to configuration, also related to the packaging of mariadb. For starters there are complaints that the configuration is too static. To address this a new configuration layout is introduced. The primary configuration file (my.cnf) is changed so that it now only includes further configuration files in the directory /etc/mysql/conf.d. More default configuration files are added for the server and the client. This is the new default configuration. With these changes it's possible for the user to select if they want to change the default configuration (in conf.d/*.cnf) or if they want to drop their own files into conf.d instead. If the user .cnf files are read after the default .cnf files (files are included in alphabetical order), they will overwrite the settings from the default configuration. The other flaw is that the my.cnf file is included in mariadb-server. But that doesn't really fit the requirements, as the client also uses the configuration file(s). To accomodate this a new package mariadb-common is added. It installs the shared my.cnf file. The remaining changes add base packages, both for the server and the client. These are meant as foundation for the packages containing the respective binaries. In summary they will install the configuration, small miscellaneous files (SQL scripts etc.) and the user "mariadb". That means that everything is ready for the binaries, like mysql and mysqld. If there is not enough space left on flash memory, the user can just drop the binaries on a pendrive, link them to /usr/bin and get started. The ideas and configuration files were copied from Debian. Some amendments were made. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
6 years ago
mariadb: improve packaging and configuration At present there are some flaws related to configuration, also related to the packaging of mariadb. For starters there are complaints that the configuration is too static. To address this a new configuration layout is introduced. The primary configuration file (my.cnf) is changed so that it now only includes further configuration files in the directory /etc/mysql/conf.d. More default configuration files are added for the server and the client. This is the new default configuration. With these changes it's possible for the user to select if they want to change the default configuration (in conf.d/*.cnf) or if they want to drop their own files into conf.d instead. If the user .cnf files are read after the default .cnf files (files are included in alphabetical order), they will overwrite the settings from the default configuration. The other flaw is that the my.cnf file is included in mariadb-server. But that doesn't really fit the requirements, as the client also uses the configuration file(s). To accomodate this a new package mariadb-common is added. It installs the shared my.cnf file. The remaining changes add base packages, both for the server and the client. These are meant as foundation for the packages containing the respective binaries. In summary they will install the configuration, small miscellaneous files (SQL scripts etc.) and the user "mariadb". That means that everything is ready for the binaries, like mysql and mysqld. If there is not enough space left on flash memory, the user can just drop the binaries on a pendrive, link them to /usr/bin and get started. The ideas and configuration files were copied from Debian. Some amendments were made. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
6 years ago
mariadb: improve packaging and configuration At present there are some flaws related to configuration, also related to the packaging of mariadb. For starters there are complaints that the configuration is too static. To address this a new configuration layout is introduced. The primary configuration file (my.cnf) is changed so that it now only includes further configuration files in the directory /etc/mysql/conf.d. More default configuration files are added for the server and the client. This is the new default configuration. With these changes it's possible for the user to select if they want to change the default configuration (in conf.d/*.cnf) or if they want to drop their own files into conf.d instead. If the user .cnf files are read after the default .cnf files (files are included in alphabetical order), they will overwrite the settings from the default configuration. The other flaw is that the my.cnf file is included in mariadb-server. But that doesn't really fit the requirements, as the client also uses the configuration file(s). To accomodate this a new package mariadb-common is added. It installs the shared my.cnf file. The remaining changes add base packages, both for the server and the client. These are meant as foundation for the packages containing the respective binaries. In summary they will install the configuration, small miscellaneous files (SQL scripts etc.) and the user "mariadb". That means that everything is ready for the binaries, like mysql and mysqld. If there is not enough space left on flash memory, the user can just drop the binaries on a pendrive, link them to /usr/bin and get started. The ideas and configuration files were copied from Debian. Some amendments were made. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
6 years ago
mariadb: improve packaging and configuration At present there are some flaws related to configuration, also related to the packaging of mariadb. For starters there are complaints that the configuration is too static. To address this a new configuration layout is introduced. The primary configuration file (my.cnf) is changed so that it now only includes further configuration files in the directory /etc/mysql/conf.d. More default configuration files are added for the server and the client. This is the new default configuration. With these changes it's possible for the user to select if they want to change the default configuration (in conf.d/*.cnf) or if they want to drop their own files into conf.d instead. If the user .cnf files are read after the default .cnf files (files are included in alphabetical order), they will overwrite the settings from the default configuration. The other flaw is that the my.cnf file is included in mariadb-server. But that doesn't really fit the requirements, as the client also uses the configuration file(s). To accomodate this a new package mariadb-common is added. It installs the shared my.cnf file. The remaining changes add base packages, both for the server and the client. These are meant as foundation for the packages containing the respective binaries. In summary they will install the configuration, small miscellaneous files (SQL scripts etc.) and the user "mariadb". That means that everything is ready for the binaries, like mysql and mysqld. If there is not enough space left on flash memory, the user can just drop the binaries on a pendrive, link them to /usr/bin and get started. The ideas and configuration files were copied from Debian. Some amendments were made. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
6 years ago
mariadb: improve packaging and configuration At present there are some flaws related to configuration, also related to the packaging of mariadb. For starters there are complaints that the configuration is too static. To address this a new configuration layout is introduced. The primary configuration file (my.cnf) is changed so that it now only includes further configuration files in the directory /etc/mysql/conf.d. More default configuration files are added for the server and the client. This is the new default configuration. With these changes it's possible for the user to select if they want to change the default configuration (in conf.d/*.cnf) or if they want to drop their own files into conf.d instead. If the user .cnf files are read after the default .cnf files (files are included in alphabetical order), they will overwrite the settings from the default configuration. The other flaw is that the my.cnf file is included in mariadb-server. But that doesn't really fit the requirements, as the client also uses the configuration file(s). To accomodate this a new package mariadb-common is added. It installs the shared my.cnf file. The remaining changes add base packages, both for the server and the client. These are meant as foundation for the packages containing the respective binaries. In summary they will install the configuration, small miscellaneous files (SQL scripts etc.) and the user "mariadb". That means that everything is ready for the binaries, like mysql and mysqld. If there is not enough space left on flash memory, the user can just drop the binaries on a pendrive, link them to /usr/bin and get started. The ideas and configuration files were copied from Debian. Some amendments were made. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
6 years ago
  1. #
  2. # Copyright (C) 2018 Sebastian Kemper <sebastian_ml@gmx.net>
  3. # Copyright (C) 2021 Michal Hrusecky <michal@hrusecky.net>
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=mariadb
  10. PKG_VERSION:=10.6.4
  11. PKG_RELEASE:=$(AUTORELEASE)
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL := https://archive.mariadb.org/$(PKG_NAME)-$(PKG_VERSION)/source
  14. PKG_HASH:=75bf9b147a95d38160d01a73b098d50a1960563b46d16a235971fff64d99643c
  15. PKG_MAINTAINER:=Michal Hrusecky <Michal@Hrusecky.net>
  16. PKG_LICENSE:=GPL-2.0-only
  17. PKG_LICENSE_FILES:=COPYING THIRDPARTY
  18. PKG_CPE_ID:=cpe:/a:mariadb:mariadb
  19. PKG_USE_MIPS16:=0
  20. HOST_BUILD_DEPENDS:=libxml2/host
  21. # Without libevent2 tests/async_queries sporadically fails on the bots
  22. PKG_BUILD_DEPENDS:=libevent2 mariadb/host
  23. CONF_DIR:=/etc/mysql
  24. PLUGIN_DIR:=/usr/lib/mariadb/plugin
  25. SHARE_DIR:=/usr/share/mariadb
  26. MARIADB_SOCKET=/var/run/mysql/mysql.sock
  27. MARIADB_DISABLE_ENGINES := \
  28. cassandra \
  29. columnstore \
  30. example \
  31. mroonga \
  32. oqgraph \
  33. rocksdb \
  34. test_sql_discovery \
  35. tokudb
  36. MARIADB_DISABLE_PLUGINS := \
  37. audit_null \
  38. auth_examples \
  39. aws_key_management \
  40. cracklib_password_check \
  41. daemon_example \
  42. debug_key_management \
  43. example_key_management \
  44. fulltext \
  45. versioning
  46. MARIADB_SERVER_PLUGINS := \
  47. auth_ed25519 \
  48. auth_gssapi \
  49. auth_pam \
  50. auth_pam_v1 \
  51. disks \
  52. feedback \
  53. file_key_management \
  54. ha_archive \
  55. ha_blackhole \
  56. ha_connect \
  57. ha_federated \
  58. ha_federatedx \
  59. ha_sphinx \
  60. ha_spider \
  61. handlersocket \
  62. locales \
  63. metadata_lock_info \
  64. query_cache_info \
  65. query_response_time \
  66. server_audit \
  67. simple_password_check \
  68. sql_errlog \
  69. wsrep_info
  70. PKG_CONFIG_DEPENDS := \
  71. $(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-server-plugin-%,$(subst _,-,$(MARIADB_SERVER_PLUGINS))) \
  72. CONFIG_KERNEL_IO_URING \
  73. CONFIG_PACKAGE_mariadb-server
  74. plugin-auth_ed25519 := PLUGIN_AUTH_ED25519
  75. plugin-auth_gssapi := PLUGIN_AUTH_GSSAPI
  76. plugin-auth_pam := PLUGIN_AUTH_PAM
  77. plugin-auth_pam_v1 := PLUGIN_AUTH_PAM_V1
  78. plugin-disks := PLUGIN_DISKS
  79. plugin-feedback := PLUGIN_FEEDBACK
  80. plugin-file_key_management := PLUGIN_FILE_KEY_MANAGEMENT
  81. plugin-ha_archive := PLUGIN_ARCHIVE
  82. plugin-ha_blackhole := PLUGIN_BLACKHOLE
  83. plugin-ha_connect := PLUGIN_CONNECT
  84. plugin-ha_federated := PLUGIN_FEDERATED
  85. plugin-ha_federatedx := PLUGIN_FEDERATEDX
  86. plugin-ha_sphinx := PLUGIN_SPHINX
  87. plugin-ha_spider := PLUGIN_SPIDER
  88. plugin-handlersocket := PLUGIN_HANDLERSOCKET
  89. plugin-locales := PLUGIN_LOCALES
  90. plugin-metadata_lock_info := PLUGIN_METADATA_LOCK_INFO
  91. plugin-query_cache_info := PLUGIN_QUERY_CACHE_INFO
  92. plugin-query_response_time := PLUGIN_QUERY_RESPONSE_TIME
  93. plugin-server_audit := PLUGIN_SERVER_AUDIT
  94. plugin-simple_password_check := PLUGIN_SIMPLE_PASSWORD_CHECK
  95. plugin-sql_errlog := PLUGIN_SQL_ERRLOG
  96. plugin-wsrep_info := PLUGIN_WSREP_INFO
  97. MARIADB_CLIENT := \
  98. mysql \
  99. mysqlcheck
  100. MARIADB_CLIENT_EXTRA := \
  101. msql2mysql \
  102. mysql_find_rows \
  103. mysql_plugin \
  104. mysql_waitpid \
  105. mysqlaccess \
  106. mysqlbinlog \
  107. mysqldump \
  108. mysqlimport \
  109. mysqlshow \
  110. mysqlslap \
  111. mytop
  112. MARIADB_SERVER := \
  113. innochecksum \
  114. my_print_defaults \
  115. mysql_install_db \
  116. mysql_upgrade \
  117. mysqladmin \
  118. mysqld
  119. MARIADB_SERVER_EXTRA := \
  120. aria_chk \
  121. aria_dump_log \
  122. aria_ftdump \
  123. aria_pack \
  124. aria_read_log \
  125. mariabackup \
  126. myisam_ftdump \
  127. myisamchk \
  128. myisamlog \
  129. myisampack \
  130. mysql_convert_table_format \
  131. mysql_fix_extensions \
  132. mysql_secure_installation \
  133. mysql_setpermission \
  134. mysql_tzinfo_to_sql \
  135. mysqld_multi \
  136. mysqld_safe \
  137. mysqld_safe_helper \
  138. mysqldumpslow \
  139. mysqlhotcopy \
  140. perror \
  141. replace \
  142. resolve_stack_dump \
  143. wsrep_sst_mariabackup \
  144. wsrep_sst_mysqldump \
  145. wsrep_sst_rsync \
  146. wsrep_sst_rsync_wan
  147. include $(INCLUDE_DIR)/package.mk
  148. include $(INCLUDE_DIR)/host-build.mk
  149. include $(INCLUDE_DIR)/nls.mk
  150. include $(INCLUDE_DIR)/cmake.mk
  151. MARIADB_COMMON_DEPENDS := \
  152. $(ICONV_DEPENDS) \
  153. +libatomic \
  154. +libopenssl \
  155. +libstdcpp \
  156. +zlib
  157. # Pass CPPFLAGS in the CFLAGS as otherwise the build system will
  158. # ignore them.
  159. TARGET_CFLAGS+=$(TARGET_CPPFLAGS)
  160. define Package/mariadb/disable/engine
  161. echo > $(1)/storage/$(2)/CMakeLists.txt
  162. endef
  163. define Package/mariadb/disable/plugin
  164. echo > $(1)/plugin/$(2)/CMakeLists.txt
  165. endef
  166. define Package/mariadb/install/bin
  167. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $(1)/usr/bin
  168. [ $(2) = $(subst mysql,mariadb,$(2)) ] || ln -s $(2) $(1)/usr/bin/$(subst mysql,mariadb,$(2))
  169. [ $(2) = $(subst mariadb,mysql,$(2)) ] || ln -s $(2) $(1)/usr/bin/$(subst mariadb,mysql,$(2))
  170. endef
  171. define Package/mariadb/install/plugin
  172. $(INSTALL_BIN) $(PKG_INSTALL_DIR)$(PLUGIN_DIR)/$(2).so $(1)$(PLUGIN_DIR)
  173. endef
  174. define Package/mariadb/description/Default
  175. MariaDB is a very fast and robust SQL database server.
  176. endef
  177. define Package/mariadb/Default
  178. SECTION:=utils
  179. CATEGORY:=Utilities
  180. URL:=https://mariadb.org/
  181. SUBMENU:=Database
  182. endef
  183. define Package/mariadb-client
  184. $(call Package/mariadb/Default)
  185. TITLE:=MariaDB database client
  186. MENU:=1
  187. DEPENDS:=$(MARIADB_COMMON_DEPENDS) \
  188. +libedit
  189. endef
  190. define Package/mariadb-client/description
  191. $(call Package/mariadb/description/Default)
  192. This package includes the following core client binaries:
  193. $(subst $(space),$(newline),$(MARIADB_CLIENT))
  194. endef
  195. define Package/mariadb-client-extra
  196. $(call Package/mariadb/Default)
  197. TITLE:=MariaDB database client extra
  198. DEPENDS:=mariadb-client
  199. endef
  200. define Package/mariadb-client-extra/description
  201. $(call Package/mariadb/description/Default)
  202. This package includes the following extra client binaries:
  203. $(subst $(space),$(newline),$(MARIADB_CLIENT_EXTRA))
  204. endef
  205. define Package/mariadb-server
  206. $(call Package/mariadb/Default)
  207. DEPENDS:=mariadb-server-base
  208. TITLE:=MariaDB database server
  209. MENU:=1
  210. PROVIDES:=mysql-server
  211. endef
  212. define Package/mariadb-server/description
  213. $(call Package/mariadb/description/Default)
  214. This package includes the following core server binaries:
  215. $(subst $(space),$(newline),$(MARIADB_SERVER))
  216. endef
  217. define Package/mariadb-server-base
  218. $(call Package/mariadb/Default)
  219. DEPENDS:= \
  220. $(MARIADB_COMMON_DEPENDS) \
  221. +!KERNEL_IO_URING:libaio \
  222. +KERNEL_IO_URING:liburing \
  223. +liblzma \
  224. +libpcre2 \
  225. +resolveip
  226. TITLE:=MariaDB database server base
  227. USERID:=mariadb=376:mariadb=376
  228. endef
  229. define Package/mariadb-server-base/conffiles
  230. $(CONF_DIR)/my.cnf
  231. $(CONF_DIR)/conf.d/50-server.cnf
  232. $(CONF_DIR)/conf.d/60-galera.cnf
  233. /etc/config/mysqld
  234. endef
  235. define Package/mariadb-server-base/description
  236. $(call Package/mariadb/description/Default)
  237. This package provides the foundation for mariadb-server. It installs the
  238. init script, support files (configuration etc.), the user "mariadb" and
  239. the dependencies.
  240. endef
  241. define Package/mariadb-server-extra
  242. $(call Package/mariadb/Default)
  243. TITLE:=MariaDB database server extra
  244. DEPENDS:=mariadb-server
  245. endef
  246. define Package/mariadb-server-extra/description
  247. $(call Package/mariadb/description/Default)
  248. This package includes the following extra server binaries:
  249. $(subst $(space),$(newline),$(MARIADB_SERVER_EXTRA))
  250. endef
  251. # We won't need unit tests
  252. CMAKE_OPTIONS += -DWITH_UNIT_TESTS=0
  253. # This value is determined automatically during straight compile by compiling
  254. # and running a test code. You cannot do that during cross-compile. However the
  255. # stack grows downward in most if not all modern systems. The only exception
  256. # according to buildroot is PA-RISC which is not supported by OpenWrt as far as
  257. # I know. Therefore it makes sense to hardcode the value. If an arch is added
  258. # the stack of which grows up one should expect unpredictable behavior at run
  259. # time.
  260. CMAKE_OPTIONS += -DSTACK_DIRECTION=-1
  261. # Make it explicit that we are cross-compiling
  262. CMAKE_OPTIONS += -DCMAKE_CROSSCOMPILING=1
  263. # Explicitly disable dtrace to avoid detection of a host version
  264. CMAKE_OPTIONS += -DENABLE_DTRACE=0
  265. # Prevent MariaDB from messing with OpenWrt's C(XX)FLAGS
  266. CMAKE_OPTIONS += -DSECURITY_HARDENED=OFF
  267. ifeq ($(CONFIG_PACKAGE_mariadb-server),)
  268. CMAKE_OPTIONS += -DWITHOUT_SERVER=ON
  269. else
  270. # Enable the auth_socket plugin and let unix user root access MariaDB without a
  271. # separate password.
  272. CMAKE_OPTIONS += -DWITHOUT_SERVER=OFF -DPLUGIN_AUTH_SOCKET=STATIC
  273. endif
  274. CMAKE_OPTIONS += \
  275. -DCONNECT_WITH_JDBC=NO \
  276. -DCONNECT_WITH_LIBXML2=system \
  277. -DCONNECT_WITH_MONGO=NO \
  278. -DCONNECT_WITH_ODBC=NO \
  279. -DDISABLE_SHARED=NO \
  280. -DDEFAULT_CHARSET=utf8mb4 \
  281. -DDEFAULT_COLLATION=utf8mb4_general_ci \
  282. -DENABLED_PROFILING=OFF \
  283. -DENABLE_STATIC_LIBS=OFF \
  284. -DINSTALL_DOCDIR=share/doc/mariadb \
  285. -DINSTALL_DOCREADMEDIR=share/doc/mariadb \
  286. -DINSTALL_INFODIR=share/info \
  287. -DINSTALL_MANDIR=share/man \
  288. -DINSTALL_MYSQLSHAREDIR=share/mariadb \
  289. -DINSTALL_MYSQLTESTDIR="" \
  290. -DINSTALL_PAMDATADIR="/etc/security" \
  291. -DINSTALL_PAMDIR="/lib/security" \
  292. -DINSTALL_PLUGINDIR=lib/mariadb/plugin \
  293. -DINSTALL_PREFIX="/usr" \
  294. -DINSTALL_SBINDIR=bin \
  295. -DINSTALL_SCRIPTDIR=bin \
  296. -DINSTALL_SQLBENCHDIR="" \
  297. -DINSTALL_SUPPORTFILESDIR=share/mariadb \
  298. -DINSTALL_UNIX_ADDRDIR=$(MARIADB_SOCKET) \
  299. -DMYSQL_DATADIR=/srv/mysql \
  300. -DMYSQL_UNIX_ADDR=$(MARIADB_SOCKET) \
  301. -DSKIP_TESTS=ON \
  302. -DWITH_DEBUG=OFF \
  303. -DWITH_EMBEDDED_SERVER=OFF \
  304. -DWITH_INNODB_BZIP2=OFF \
  305. -DWITH_INNODB_LZ4=OFF \
  306. -DWITH_INNODB_LZMA=ON \
  307. -DWITH_INNODB_LZO=OFF \
  308. -DWITH_INNODB_SNAPPY=OFF \
  309. -DWITH_JEMALLOC=OFF \
  310. -DWITH_LIBARCHIVE=OFF \
  311. -DWITH_LIBWRAP=OFF \
  312. -DWITH_MARIABACKUP=ON \
  313. -DWITH_NUMA=OFF \
  314. -DWITH_PCRE=system \
  315. -DWITH_SAFEMALLOC=OFF \
  316. -DWITH_SSL=system \
  317. -DWITH_SYSTEMD=no \
  318. -DWITH_VALGRIND=OFF \
  319. -DWITH_ZLIB=system
  320. # Help MariaDB find the correct libiconv.
  321. # nls.mk sets it up so that with CONFIG_BUILD_NLS libiconv-full would be used,
  322. # otherwise libiconv-stub (independent of the selected libc). MariaDB needs a
  323. # leg up to find/pick the right lib.
  324. CMAKE_OPTIONS += \
  325. -DICONV_INCLUDE_DIR=$(ICONV_PREFIX)/include \
  326. -DICONV_LIBRARIES=$(ICONV_PREFIX)/lib/libiconv.$(if $(CONFIG_BUILD_NLS),so,a)
  327. CMAKE_OPTIONS += \
  328. $(foreach p,$(MARIADB_SERVER_PLUGINS),-D$(plugin-$(p))=$(if $(CONFIG_PACKAGE_$(PKG_NAME)-server-plugin-$(subst _,-,$(p))),DYNAMIC,NO))
  329. # Disable some client library plugins
  330. CMAKE_OPTIONS += \
  331. -DCLIENT_PLUGIN_AUTH_GSSAPI_CLIENT=OFF \
  332. -DCLIENT_PLUGIN_REMOTE_IO=OFF
  333. # Set CMAKE_FIND_ROOT_PATH_MODE_INCLUDE and CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
  334. # to BOTH as otherwise the host build will not find some required dependencies
  335. # installed on the host machine, like ncurses.
  336. #
  337. # Add "$(STAGING_DIR_HOSTPKG)/lib" to the RPATH of the host helpers,
  338. # otherwise they might not find the location of a library at run time.
  339. CMAKE_HOST_OPTIONS += \
  340. -DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE \
  341. -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH \
  342. -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH \
  343. -DCMAKE_INSTALL_RPATH="$(STAGING_DIR_HOSTPKG)/lib" \
  344. -DCMAKE_SKIP_RPATH=FALSE \
  345. -DWITHOUT_SERVER=OFF
  346. # Some helpers must be compiled for host in order to crosscompile MariaDB for
  347. # the target. They are then included by import_executables.cmake which is
  348. # generated during the build of the host helpers. It is not necessary to build
  349. # the whole host package, only the "import_executables" target.
  350. # -DIMPORT_EXECUTABLES=$(HOST_BUILD_DIR)/import_executables.cmake
  351. # must then be passed to cmake during target build.
  352. # See also https://mariadb.com/kb/en/mariadb/cross-compiling-mariadb/
  353. CMAKE_OPTIONS += -DIMPORT_EXECUTABLES=$(STAGING_DIR_HOSTPKG)/share/mariadb/import_executables.cmake
  354. # Disable some engines/plugins here as well - decreases the number of cmake checks.
  355. define Host/Prepare
  356. $(call Host/Prepare/Default)
  357. $(foreach e,$(MARIADB_DISABLE_ENGINES),$(call Package/mariadb/disable/engine,$(HOST_BUILD_DIR),$(e));)
  358. $(foreach p,$(MARIADB_DISABLE_PLUGINS),$(call Package/mariadb/disable/plugin,$(HOST_BUILD_DIR),$(p));)
  359. endef
  360. define Host/Compile
  361. $(call Host/Compile/Default,import_executables)
  362. endef
  363. define Host/Install
  364. $(SED) 's|$(HOST_BUILD_DIR)|$(STAGING_DIR_HOSTPKG)/share/mariadb|' $(HOST_BUILD_DIR)/import_executables.cmake
  365. $(INSTALL_DIR) $(1)/share/mariadb/{dbug,extra,scripts,sql}
  366. $(INSTALL_BIN) $(HOST_BUILD_DIR)/dbug/factorial $(1)/share/mariadb/dbug
  367. $(INSTALL_BIN) $(HOST_BUILD_DIR)/extra/comp_err $(1)/share/mariadb/extra
  368. $(INSTALL_BIN) $(HOST_BUILD_DIR)/scripts/comp_sql $(1)/share/mariadb/scripts
  369. $(INSTALL_BIN) $(HOST_BUILD_DIR)/sql/{gen_lex_hash,gen_lex_token} $(1)/share/mariadb/sql
  370. $(INSTALL_DATA) $(HOST_BUILD_DIR)/import_executables.cmake $(1)/share/mariadb
  371. endef
  372. # LIBICONV_PLUG is used in GNU's libiconv for redefinition of exports [e.g.
  373. # from libiconv_open() to iconv_open()]. But in OpenWrt this variable is not set
  374. # when building libiconv-full. So when MariaDB sets LIBICONV_PLUG it expects
  375. # iconv_open() to be available for example, which is not the case - only
  376. # libiconv_open() is. To address this prevent the variable from being set.
  377. # libiconv-stub does not use this variable, so there is no harm in always doing
  378. # this.
  379. define Build/Prepare
  380. $(call Build/Prepare/Default)
  381. $(SED) '/ADD_DEFINITIONS(-DLIBICONV_PLUG)/d' $(PKG_BUILD_DIR)/libmariadb/libmariadb/CMakeLists.txt
  382. $(foreach e,$(MARIADB_DISABLE_ENGINES),$(call Package/mariadb/disable/engine,$(PKG_BUILD_DIR),$(e));)
  383. $(foreach p,$(MARIADB_DISABLE_PLUGINS),$(call Package/mariadb/disable/plugin,$(PKG_BUILD_DIR),$(p));)
  384. endef
  385. define Package/mariadb-client/install
  386. $(INSTALL_DIR) $(1)/usr/bin
  387. $(foreach b,$(MARIADB_CLIENT),$(call Package/mariadb/install/bin,$(1),$(b));)
  388. # Install convenience links for mysqlcheck multi-call binary
  389. cd $(1)/usr/bin; $(LN) mysqlcheck mysqlanalyze
  390. cd $(1)/usr/bin; $(LN) mysqlcheck mysqlrepair
  391. cd $(1)/usr/bin; $(LN) mysqlcheck mysqloptimize
  392. endef
  393. define Package/mariadb-client-extra/install
  394. $(INSTALL_DIR) $(1)/usr/bin
  395. $(foreach b,$(MARIADB_CLIENT_EXTRA),$(call Package/mariadb/install/bin,$(1),$(b));)
  396. endef
  397. define Package/mariadb-server/install
  398. $(INSTALL_DIR) $(1)/usr/bin
  399. $(foreach b,$(MARIADB_SERVER),$(call Package/mariadb/install/bin,$(1),$(b));)
  400. endef
  401. define Package/mariadb-server-base/install
  402. $(INSTALL_DIR) $(1)$(CONF_DIR)/conf.d
  403. $(INSTALL_DIR) $(1)$(SHARE_DIR)/charsets
  404. $(INSTALL_DIR) $(1)$(SHARE_DIR)/english
  405. $(INSTALL_DIR) $(1)/etc/config
  406. $(INSTALL_DIR) $(1)/etc/init.d
  407. $(INSTALL_BIN) files/mysqld.init $(1)/etc/init.d/mysqld
  408. $(SED) '/^[a-z]/s/^/#/' $(PKG_INSTALL_DIR)$(SHARE_DIR)/wsrep.cnf
  409. $(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/wsrep.cnf $(1)$(CONF_DIR)/conf.d/60-galera.cnf
  410. $(INSTALL_DATA) conf/50-server.cnf $(1)$(CONF_DIR)/conf.d
  411. $(INSTALL_DATA) conf/my.cnf $(1)$(CONF_DIR)
  412. $(INSTALL_CONF) files/mysqld.config $(1)/etc/config/mysqld
  413. $(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/charsets/* $(1)$(SHARE_DIR)/charsets
  414. $(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/english/errmsg.sys $(1)$(SHARE_DIR)/english
  415. $(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/*.sql $(1)$(SHARE_DIR)
  416. endef
  417. define Package/mariadb-server-extra/install
  418. $(INSTALL_DIR) $(1)/usr/bin
  419. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/bin/wsrep_sst_common $(1)/usr/bin
  420. $(SED) 's,/bin/bash,/bin/sh,g' $(PKG_INSTALL_DIR)/usr/bin/wsrep_sst_*
  421. $(foreach b,$(MARIADB_SERVER_EXTRA),$(call Package/mariadb/install/bin,$(1),$(b));)
  422. cd $(1)/usr/bin; $(LN) mariabackup mariadb-backup
  423. endef
  424. define BuildPlugin
  425. define Package/mariadb-server-plugin-$(subst _,-,$(1))
  426. $(call Package/mariadb/Default)
  427. TITLE:=mariadb-server plugin
  428. DEPENDS:=mariadb-server $(patsubst +%,+PACKAGE_mariadb-server-plugin-$(subst _,-,$(1)):%,$(2))
  429. ifeq ($(1),auth_pam)
  430. # Directory "auth_pam_tool_dir" is installed with mode 0750 and is only
  431. # accessible by root and the group mariadb. This way mariadb can access
  432. # the SUID binary "auth_pam_tool" contained within while others cannot.
  433. FILE_MODES:=/usr/lib/mariadb/plugin/auth_pam_tool_dir:root:mariadb:0750
  434. endif
  435. endef
  436. define Package/mariadb-server-plugin-$(subst _,-,$(1))/description
  437. $(call Package/mariadb/description/Default)
  438. This package provides the $(1) plugin.
  439. endef
  440. define Package/mariadb-server-plugin-$(subst _,-,$(1))/install
  441. $(INSTALL_DIR) $$(1)$(PLUGIN_DIR)
  442. $(call Package/mariadb/install/plugin,$$(1),$(1))
  443. ifeq ($(1),auth_pam)
  444. $(INSTALL_DIR) $$(1)$(PLUGIN_DIR)/auth_pam_tool_dir
  445. $(INSTALL_SUID) \
  446. $(PKG_INSTALL_DIR)$(PLUGIN_DIR)/auth_pam_tool_dir/auth_pam_tool \
  447. $$(1)$(PLUGIN_DIR)/auth_pam_tool_dir
  448. $(INSTALL_DIR) $$(1)/etc/security
  449. $(INSTALL_DATA) \
  450. $(PKG_INSTALL_DIR)/etc/security/user_map.conf \
  451. $$(1)/etc/security
  452. $(INSTALL_DIR) $$(1)/lib/security
  453. $(INSTALL_DATA) \
  454. $(PKG_INSTALL_DIR)/lib/security/pam_user_map.so \
  455. $$(1)/lib/security
  456. endif
  457. endef
  458. $$(eval $$(call BuildPackage,mariadb-server-plugin-$(subst _,-,$(1))))
  459. endef
  460. $(eval $(call HostBuild))
  461. $(eval $(call BuildPackage,mariadb-client))
  462. $(eval $(call BuildPackage,mariadb-client-extra))
  463. $(eval $(call BuildPackage,mariadb-server))
  464. $(eval $(call BuildPackage,mariadb-server-base))
  465. $(eval $(call BuildPackage,mariadb-server-extra))
  466. $(eval $(call BuildPlugin,auth_ed25519,))
  467. $(eval $(call BuildPlugin,auth_gssapi,+krb5-libs))
  468. $(eval $(call BuildPlugin,auth_pam,+libpam))
  469. $(eval $(call BuildPlugin,auth_pam_v1,+libpam))
  470. $(eval $(call BuildPlugin,disks,))
  471. $(eval $(call BuildPlugin,feedback,))
  472. $(eval $(call BuildPlugin,file_key_management,))
  473. $(eval $(call BuildPlugin,ha_archive,))
  474. $(eval $(call BuildPlugin,ha_blackhole,))
  475. $(eval $(call BuildPlugin,ha_connect,+libxml2))
  476. $(eval $(call BuildPlugin,ha_federated,))
  477. $(eval $(call BuildPlugin,ha_federatedx,))
  478. $(eval $(call BuildPlugin,ha_sphinx,))
  479. $(eval $(call BuildPlugin,ha_spider,))
  480. $(eval $(call BuildPlugin,handlersocket,))
  481. $(eval $(call BuildPlugin,locales,))
  482. $(eval $(call BuildPlugin,metadata_lock_info,))
  483. $(eval $(call BuildPlugin,query_cache_info,))
  484. $(eval $(call BuildPlugin,query_response_time,))
  485. $(eval $(call BuildPlugin,server_audit,))
  486. $(eval $(call BuildPlugin,simple_password_check,))
  487. $(eval $(call BuildPlugin,sql_errlog,))
  488. $(eval $(call BuildPlugin,wsrep_info,))