debianutils: bump to version 4.8.1
[buildroot-gz.git] / package / mariadb / mariadb.mk
blob6c609da60f7bac84e7897cd23041584c80aac1af
1 ################################################################################
3 # mariadb
5 ################################################################################
7 MARIADB_VERSION = 10.1.20
8 MARIADB_SOURCE = mariadb-$(MARIADB_VERSION).tar.gz
9 MARIADB_SITE = https://downloads.mariadb.org/interstitial/mariadb-$(MARIADB_VERSION)/source
10 MARIADB_LICENSE = GPLv2 (server), GPLv2 with FLOSS exception (GPL client library), LGPLv2 (LGPL client library)
11 MARIADB_LICENSE_FILES = README COPYING COPYING.LESSER
12 MARIADB_INSTALL_STAGING = YES
13 MARIADB_PROVIDES = mysql
15 MARIADB_DEPENDENCIES = \
16 host-mariadb \
17 ncurses \
18 openssl \
19 zlib \
20 libaio \
21 libxml2 \
22 readline
24 # We won't need unit tests
25 MARIADB_CONF_OPTS += -DWITH_UNIT_TESTS=0
27 # Mroonga needs libstemmer. Some work still needs to be done before it can be
28 # included in buildroot. Disable it for now.
29 MARIADB_CONF_OPTS += -DWITHOUT_MROONGA=1
31 # This value is determined automatically during straight compile by compiling
32 # and running a test code. You cannot do that during cross-compile. However the
33 # stack grows downward in most if not all modern systems. The only exception I
34 # am aware of is PA-RISC which is not supported by buildroot. Therefore it makes
35 # sense to hardcode the value. If an arch is added the stack of which grows up
36 # one should expect unpredictable behavior at run time.
37 MARIADB_CONF_OPTS += -DSTACK_DIRECTION=-1
39 # Jemalloc was added for TokuDB. Since its configure script seems somewhat broken
40 # when it comes to cross-compilation we shall disable it and also disable TokuDB.
41 MARIADB_CONF_OPTS += -DWITH_JEMALLOC=no -DWITHOUT_TOKUDB=1
43 # Make it explicit that we are cross-compiling
44 MARIADB_CONF_OPTS += -DCMAKE_CROSSCOMPILING=1
46 ifeq ($(BR2_PACKAGE_MARIADB_SERVER),y)
47 MARIADB_CONF_OPTS += -DWITH_EMBEDDED_SERVER=ON
48 else
49 MARIADB_CONF_OPTS += -DWITHOUT_SERVER=ON
50 endif
52 MARIADB_CONF_OPTS += \
53 -DINSTALL_DOCDIR=share/doc/mariadb-$(MARIADB_VERSION) \
54 -DINSTALL_DOCREADMEDIR=share/doc/mariadb-$(MARIADB_VERSION) \
55 -DINSTALL_MANDIR=share/man \
56 -DINSTALL_MYSQLSHAREDIR=share/mysql \
57 -DINSTALL_MYSQLTESTDIR=share/mysql/test \
58 -DINSTALL_PLUGINDIR=lib/mysql/plugin \
59 -DINSTALL_SBINDIR=sbin \
60 -DINSTALL_SCRIPTDIR=bin \
61 -DINSTALL_SQLBENCHDIR=share/mysql/bench \
62 -DINSTALL_SUPPORTFILESDIR=share/mysql \
63 -DMYSQL_DATADIR=/var/lib/mysql \
64 -DMYSQL_UNIX_ADDR=$(MYSQL_SOCKET)
66 # Some helpers must be compiled for host in order to crosscompile mariadb for
67 # the target. They are then included by import_executables.cmake which is
68 # generated during the build of the host helpers. It is not necessary to build
69 # the whole host package, only the "import_executables" target.
70 # -DIMPORT_EXECUTABLES=$(HOST_MARIADB_BUILDDIR)/import_executables.cmake
71 # must then be passed to cmake during target build.
72 # see also https://mariadb.com/kb/en/mariadb/cross-compiling-mariadb/
73 HOST_MARIADB_MAKE_OPTS = import_executables
75 MARIADB_CONF_OPTS += \
76 -DIMPORT_EXECUTABLES=$(HOST_MARIADB_BUILDDIR)/import_executables.cmake
78 # Don't install host-mariadb. We just need to build import_executable
79 # Therefore only run 'true' and do nothing, not even the default action.
80 HOST_MARIADB_INSTALL_CMDS = true
82 ifeq ($(BR2_PACKAGE_MARIADB_SERVER),y)
83 define MARIADB_USERS
84 mysql -1 mysql -1 * /var/lib/mysql - - MySQL Server
85 endef
87 define MARIADB_INSTALL_INIT_SYSV
88 $(INSTALL) -D -m 0755 package/mariadb/S97mysqld \
89 $(TARGET_DIR)/etc/init.d/S97mysqld
90 endef
92 define MARIADB_INSTALL_INIT_SYSTEMD
93 $(INSTALL) -D -m 644 package/mariadb/mysqld.service \
94 $(TARGET_DIR)/usr/lib/systemd/system/mysqld.service
95 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
96 ln -sf ../../../../usr/lib/systemd/system/mysqld.service \
97 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mysqld.service
98 endef
99 endif
101 define MARIADB_POST_INSTALL
102 mkdir -p $(TARGET_DIR)/var/lib/mysql
103 $(INSTALL) -D -m 644 $(TARGET_DIR)/usr/share/mysql/my-small.cnf \
104 $(TARGET_DIR)/etc/mysql/my.cnf
105 # We don't need this on the target as it's only useful in staging
106 $(RM) $(TARGET_DIR)/usr/bin/mysql_config
107 # Remove test suite
108 $(RM) -r $(TARGET_DIR)/usr/share/mysql/test
109 endef
111 MARIADB_POST_INSTALL_TARGET_HOOKS += MARIADB_POST_INSTALL
113 $(eval $(cmake-package))
114 $(eval $(host-cmake-package))