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.

569 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. +sudo
  227. TITLE:=MariaDB database server base
  228. USERID:=mariadb=376:mariadb=376
  229. endef
  230. define Package/mariadb-server-base/conffiles
  231. $(CONF_DIR)/my.cnf
  232. $(CONF_DIR)/conf.d/50-server.cnf
  233. $(CONF_DIR)/conf.d/60-galera.cnf
  234. /etc/config/mysqld
  235. endef
  236. define Package/mariadb-server-base/description
  237. $(call Package/mariadb/description/Default)
  238. This package provides the foundation for mariadb-server. It installs the
  239. init script, support files (configuration etc.), the user "mariadb" and
  240. the dependencies.
  241. endef
  242. define Package/mariadb-server-extra
  243. $(call Package/mariadb/Default)
  244. TITLE:=MariaDB database server extra
  245. DEPENDS:=mariadb-server
  246. endef
  247. define Package/mariadb-server-extra/description
  248. $(call Package/mariadb/description/Default)
  249. This package includes the following extra server binaries:
  250. $(subst $(space),$(newline),$(MARIADB_SERVER_EXTRA))
  251. endef
  252. # We won't need unit tests
  253. CMAKE_OPTIONS += -DWITH_UNIT_TESTS=0
  254. # This value is determined automatically during straight compile by compiling
  255. # and running a test code. You cannot do that during cross-compile. However the
  256. # stack grows downward in most if not all modern systems. The only exception
  257. # according to buildroot is PA-RISC which is not supported by OpenWrt as far as
  258. # I know. Therefore it makes sense to hardcode the value. If an arch is added
  259. # the stack of which grows up one should expect unpredictable behavior at run
  260. # time.
  261. CMAKE_OPTIONS += -DSTACK_DIRECTION=-1
  262. # Make it explicit that we are cross-compiling
  263. CMAKE_OPTIONS += -DCMAKE_CROSSCOMPILING=1
  264. # Explicitly disable dtrace to avoid detection of a host version
  265. CMAKE_OPTIONS += -DENABLE_DTRACE=0
  266. # Prevent MariaDB from messing with OpenWrt's C(XX)FLAGS
  267. CMAKE_OPTIONS += -DSECURITY_HARDENED=OFF
  268. ifeq ($(CONFIG_PACKAGE_mariadb-server),)
  269. CMAKE_OPTIONS += -DWITHOUT_SERVER=ON
  270. else
  271. # Enable the auth_socket plugin and let unix user root access MariaDB without a
  272. # separate password.
  273. CMAKE_OPTIONS += -DWITHOUT_SERVER=OFF -DPLUGIN_AUTH_SOCKET=STATIC
  274. endif
  275. CMAKE_OPTIONS += \
  276. -DCONNECT_WITH_JDBC=NO \
  277. -DCONNECT_WITH_LIBXML2=system \
  278. -DCONNECT_WITH_MONGO=NO \
  279. -DCONNECT_WITH_ODBC=NO \
  280. -DDISABLE_SHARED=NO \
  281. -DDEFAULT_CHARSET=utf8mb4 \
  282. -DDEFAULT_COLLATION=utf8mb4_general_ci \
  283. -DENABLED_PROFILING=OFF \
  284. -DENABLE_STATIC_LIBS=OFF \
  285. -DINSTALL_DOCDIR=share/doc/mariadb \
  286. -DINSTALL_DOCREADMEDIR=share/doc/mariadb \
  287. -DINSTALL_INFODIR=share/info \
  288. -DINSTALL_MANDIR=share/man \
  289. -DINSTALL_MYSQLSHAREDIR=share/mariadb \
  290. -DINSTALL_MYSQLTESTDIR="" \
  291. -DINSTALL_PAMDATADIR="/etc/security" \
  292. -DINSTALL_PAMDIR="/lib/security" \
  293. -DINSTALL_PLUGINDIR=lib/mariadb/plugin \
  294. -DINSTALL_PREFIX="/usr" \
  295. -DINSTALL_SBINDIR=bin \
  296. -DINSTALL_SCRIPTDIR=bin \
  297. -DINSTALL_SQLBENCHDIR="" \
  298. -DINSTALL_SUPPORTFILESDIR=share/mariadb \
  299. -DINSTALL_UNIX_ADDRDIR=$(MARIADB_SOCKET) \
  300. -DMYSQL_DATADIR=/srv/mysql \
  301. -DMYSQL_UNIX_ADDR=$(MARIADB_SOCKET) \
  302. -DSKIP_TESTS=ON \
  303. -DWITH_DEBUG=OFF \
  304. -DWITH_EMBEDDED_SERVER=OFF \
  305. -DWITH_INNODB_BZIP2=OFF \
  306. -DWITH_INNODB_LZ4=OFF \
  307. -DWITH_INNODB_LZMA=ON \
  308. -DWITH_INNODB_LZO=OFF \
  309. -DWITH_INNODB_SNAPPY=OFF \
  310. -DWITH_JEMALLOC=OFF \
  311. -DWITH_LIBARCHIVE=OFF \
  312. -DWITH_LIBWRAP=OFF \
  313. -DWITH_MARIABACKUP=ON \
  314. -DWITH_NUMA=OFF \
  315. -DWITH_PCRE=system \
  316. -DWITH_SAFEMALLOC=OFF \
  317. -DWITH_SSL=system \
  318. -DWITH_SYSTEMD=no \
  319. -DWITH_VALGRIND=OFF \
  320. -DWITH_ZLIB=system
  321. # Help MariaDB find the correct libiconv.
  322. # nls.mk sets it up so that with CONFIG_BUILD_NLS libiconv-full would be used,
  323. # otherwise libiconv-stub (independent of the selected libc). MariaDB needs a
  324. # leg up to find/pick the right lib.
  325. CMAKE_OPTIONS += \
  326. -DICONV_INCLUDE_DIR=$(ICONV_PREFIX)/include \
  327. -DICONV_LIBRARIES=$(ICONV_PREFIX)/lib/libiconv.$(if $(CONFIG_BUILD_NLS),so,a)
  328. CMAKE_OPTIONS += \
  329. $(foreach p,$(MARIADB_SERVER_PLUGINS),-D$(plugin-$(p))=$(if $(CONFIG_PACKAGE_$(PKG_NAME)-server-plugin-$(subst _,-,$(p))),DYNAMIC,NO))
  330. # Disable some client library plugins
  331. CMAKE_OPTIONS += \
  332. -DCLIENT_PLUGIN_AUTH_GSSAPI_CLIENT=OFF \
  333. -DCLIENT_PLUGIN_REMOTE_IO=OFF
  334. # Set CMAKE_FIND_ROOT_PATH_MODE_INCLUDE and CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
  335. # to BOTH as otherwise the host build will not find some required dependencies
  336. # installed on the host machine, like ncurses.
  337. #
  338. # Add "$(STAGING_DIR_HOSTPKG)/lib" to the RPATH of the host helpers,
  339. # otherwise they might not find the location of a library at run time.
  340. CMAKE_HOST_OPTIONS += \
  341. -DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE \
  342. -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH \
  343. -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH \
  344. -DCMAKE_INSTALL_RPATH="$(STAGING_DIR_HOSTPKG)/lib" \
  345. -DCMAKE_SKIP_RPATH=FALSE \
  346. -DWITHOUT_SERVER=OFF
  347. # Some helpers must be compiled for host in order to crosscompile MariaDB for
  348. # the target. They are then included by import_executables.cmake which is
  349. # generated during the build of the host helpers. It is not necessary to build
  350. # the whole host package, only the "import_executables" target.
  351. # -DIMPORT_EXECUTABLES=$(HOST_BUILD_DIR)/import_executables.cmake
  352. # must then be passed to cmake during target build.
  353. # See also https://mariadb.com/kb/en/mariadb/cross-compiling-mariadb/
  354. CMAKE_OPTIONS += -DIMPORT_EXECUTABLES=$(STAGING_DIR_HOSTPKG)/share/mariadb/import_executables.cmake
  355. # Disable some engines/plugins here as well - decreases the number of cmake checks.
  356. define Host/Prepare
  357. $(call Host/Prepare/Default)
  358. $(foreach e,$(MARIADB_DISABLE_ENGINES),$(call Package/mariadb/disable/engine,$(HOST_BUILD_DIR),$(e));)
  359. $(foreach p,$(MARIADB_DISABLE_PLUGINS),$(call Package/mariadb/disable/plugin,$(HOST_BUILD_DIR),$(p));)
  360. endef
  361. define Host/Compile
  362. $(call Host/Compile/Default,import_executables)
  363. endef
  364. define Host/Install
  365. $(SED) 's|$(HOST_BUILD_DIR)|$(STAGING_DIR_HOSTPKG)/share/mariadb|' $(HOST_BUILD_DIR)/import_executables.cmake
  366. $(INSTALL_DIR) $(1)/share/mariadb/{dbug,extra,scripts,sql}
  367. $(INSTALL_BIN) $(HOST_BUILD_DIR)/dbug/factorial $(1)/share/mariadb/dbug
  368. $(INSTALL_BIN) $(HOST_BUILD_DIR)/extra/comp_err $(1)/share/mariadb/extra
  369. $(INSTALL_BIN) $(HOST_BUILD_DIR)/scripts/comp_sql $(1)/share/mariadb/scripts
  370. $(INSTALL_BIN) $(HOST_BUILD_DIR)/sql/{gen_lex_hash,gen_lex_token} $(1)/share/mariadb/sql
  371. $(INSTALL_DATA) $(HOST_BUILD_DIR)/import_executables.cmake $(1)/share/mariadb
  372. endef
  373. # LIBICONV_PLUG is used in GNU's libiconv for redefinition of exports [e.g.
  374. # from libiconv_open() to iconv_open()]. But in OpenWrt this variable is not set
  375. # when building libiconv-full. So when MariaDB sets LIBICONV_PLUG it expects
  376. # iconv_open() to be available for example, which is not the case - only
  377. # libiconv_open() is. To address this prevent the variable from being set.
  378. # libiconv-stub does not use this variable, so there is no harm in always doing
  379. # this.
  380. define Build/Prepare
  381. $(call Build/Prepare/Default)
  382. $(SED) '/ADD_DEFINITIONS(-DLIBICONV_PLUG)/d' $(PKG_BUILD_DIR)/libmariadb/libmariadb/CMakeLists.txt
  383. $(foreach e,$(MARIADB_DISABLE_ENGINES),$(call Package/mariadb/disable/engine,$(PKG_BUILD_DIR),$(e));)
  384. $(foreach p,$(MARIADB_DISABLE_PLUGINS),$(call Package/mariadb/disable/plugin,$(PKG_BUILD_DIR),$(p));)
  385. endef
  386. define Package/mariadb-client/install
  387. $(INSTALL_DIR) $(1)/usr/bin
  388. $(foreach b,$(MARIADB_CLIENT),$(call Package/mariadb/install/bin,$(1),$(b));)
  389. # Install convenience links for mysqlcheck multi-call binary
  390. cd $(1)/usr/bin; $(LN) mysqlcheck mysqlanalyze
  391. cd $(1)/usr/bin; $(LN) mysqlcheck mysqlrepair
  392. cd $(1)/usr/bin; $(LN) mysqlcheck mysqloptimize
  393. endef
  394. define Package/mariadb-client-extra/install
  395. $(INSTALL_DIR) $(1)/usr/bin
  396. $(foreach b,$(MARIADB_CLIENT_EXTRA),$(call Package/mariadb/install/bin,$(1),$(b));)
  397. endef
  398. define Package/mariadb-server/install
  399. $(INSTALL_DIR) $(1)/usr/bin
  400. $(foreach b,$(MARIADB_SERVER),$(call Package/mariadb/install/bin,$(1),$(b));)
  401. endef
  402. define Package/mariadb-server-base/install
  403. $(INSTALL_DIR) $(1)$(CONF_DIR)/conf.d
  404. $(INSTALL_DIR) $(1)$(SHARE_DIR)/charsets
  405. $(INSTALL_DIR) $(1)$(SHARE_DIR)/english
  406. $(INSTALL_DIR) $(1)/etc/config
  407. $(INSTALL_DIR) $(1)/etc/init.d
  408. $(INSTALL_BIN) files/mysqld.init $(1)/etc/init.d/mysqld
  409. $(SED) '/^[a-z]/s/^/#/' $(PKG_INSTALL_DIR)$(SHARE_DIR)/wsrep.cnf
  410. $(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/wsrep.cnf $(1)$(CONF_DIR)/conf.d/60-galera.cnf
  411. $(INSTALL_DATA) conf/50-server.cnf $(1)$(CONF_DIR)/conf.d
  412. $(INSTALL_DATA) conf/my.cnf $(1)$(CONF_DIR)
  413. $(INSTALL_CONF) files/mysqld.config $(1)/etc/config/mysqld
  414. $(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/charsets/* $(1)$(SHARE_DIR)/charsets
  415. $(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/english/errmsg.sys $(1)$(SHARE_DIR)/english
  416. $(INSTALL_DATA) $(PKG_INSTALL_DIR)$(SHARE_DIR)/*.sql $(1)$(SHARE_DIR)
  417. endef
  418. define Package/mariadb-server-extra/install
  419. $(INSTALL_DIR) $(1)/usr/bin
  420. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/bin/wsrep_sst_common $(1)/usr/bin
  421. $(SED) 's,/bin/bash,/bin/sh,g' $(PKG_INSTALL_DIR)/usr/bin/wsrep_sst_*
  422. $(foreach b,$(MARIADB_SERVER_EXTRA),$(call Package/mariadb/install/bin,$(1),$(b));)
  423. cd $(1)/usr/bin; $(LN) mariabackup mariadb-backup
  424. endef
  425. define BuildPlugin
  426. define Package/mariadb-server-plugin-$(subst _,-,$(1))
  427. $(call Package/mariadb/Default)
  428. TITLE:=mariadb-server plugin
  429. DEPENDS:=mariadb-server $(patsubst +%,+PACKAGE_mariadb-server-plugin-$(subst _,-,$(1)):%,$(2))
  430. ifeq ($(1),auth_pam)
  431. # Directory "auth_pam_tool_dir" is installed with mode 0750 and is only
  432. # accessible by root and the group mariadb. This way mariadb can access
  433. # the SUID binary "auth_pam_tool" contained within while others cannot.
  434. FILE_MODES:=/usr/lib/mariadb/plugin/auth_pam_tool_dir:root:mariadb:0750
  435. endif
  436. endef
  437. define Package/mariadb-server-plugin-$(subst _,-,$(1))/description
  438. $(call Package/mariadb/description/Default)
  439. This package provides the $(1) plugin.
  440. endef
  441. define Package/mariadb-server-plugin-$(subst _,-,$(1))/install
  442. $(INSTALL_DIR) $$(1)$(PLUGIN_DIR)
  443. $(call Package/mariadb/install/plugin,$$(1),$(1))
  444. ifeq ($(1),auth_pam)
  445. $(INSTALL_DIR) $$(1)$(PLUGIN_DIR)/auth_pam_tool_dir
  446. $(INSTALL_SUID) \
  447. $(PKG_INSTALL_DIR)$(PLUGIN_DIR)/auth_pam_tool_dir/auth_pam_tool \
  448. $$(1)$(PLUGIN_DIR)/auth_pam_tool_dir
  449. $(INSTALL_DIR) $$(1)/etc/security
  450. $(INSTALL_DATA) \
  451. $(PKG_INSTALL_DIR)/etc/security/user_map.conf \
  452. $$(1)/etc/security
  453. $(INSTALL_DIR) $$(1)/lib/security
  454. $(INSTALL_DATA) \
  455. $(PKG_INSTALL_DIR)/lib/security/pam_user_map.so \
  456. $$(1)/lib/security
  457. endif
  458. endef
  459. $$(eval $$(call BuildPackage,mariadb-server-plugin-$(subst _,-,$(1))))
  460. endef
  461. $(eval $(call HostBuild))
  462. $(eval $(call BuildPackage,mariadb-client))
  463. $(eval $(call BuildPackage,mariadb-client-extra))
  464. $(eval $(call BuildPackage,mariadb-server))
  465. $(eval $(call BuildPackage,mariadb-server-base))
  466. $(eval $(call BuildPackage,mariadb-server-extra))
  467. $(eval $(call BuildPlugin,auth_ed25519,))
  468. $(eval $(call BuildPlugin,auth_gssapi,+krb5-libs))
  469. $(eval $(call BuildPlugin,auth_pam,+libpam))
  470. $(eval $(call BuildPlugin,auth_pam_v1,+libpam))
  471. $(eval $(call BuildPlugin,disks,))
  472. $(eval $(call BuildPlugin,feedback,))
  473. $(eval $(call BuildPlugin,file_key_management,))
  474. $(eval $(call BuildPlugin,ha_archive,))
  475. $(eval $(call BuildPlugin,ha_blackhole,))
  476. $(eval $(call BuildPlugin,ha_connect,+libxml2))
  477. $(eval $(call BuildPlugin,ha_federated,))
  478. $(eval $(call BuildPlugin,ha_federatedx,))
  479. $(eval $(call BuildPlugin,ha_sphinx,))
  480. $(eval $(call BuildPlugin,ha_spider,))
  481. $(eval $(call BuildPlugin,handlersocket,))
  482. $(eval $(call BuildPlugin,locales,))
  483. $(eval $(call BuildPlugin,metadata_lock_info,))
  484. $(eval $(call BuildPlugin,query_cache_info,))
  485. $(eval $(call BuildPlugin,query_response_time,))
  486. $(eval $(call BuildPlugin,server_audit,))
  487. $(eval $(call BuildPlugin,simple_password_check,))
  488. $(eval $(call BuildPlugin,sql_errlog,))
  489. $(eval $(call BuildPlugin,wsrep_info,))