blob: f1c71feebe6c6242f486fbaec5d7ea8960fb4951 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001SUMMARY = "A robust, scalable, and reliable SQL server"
2HOMEPAGE = "http://mariadb.org"
3SECTION = "libs"
4LICENSE = "GPLv2"
Brad Bishopc8f47122019-06-24 09:36:18 -04005LIC_FILES_CHKSUM = "file://COPYING;md5=b1becf0cfa3366e0f4d854d1d264f311"
Brad Bishop316dfdd2018-06-25 12:45:53 -04006
Brad Bishop63ae8782019-10-09 09:56:13 -04007SRC_URI = "http://archive.mariadb.org/${BP}/source/${BP}.tar.gz \
Brad Bishop316dfdd2018-06-25 12:45:53 -04008 file://my.cnf \
9 file://mysqld.service \
10 file://install_db.service \
11 file://install_db \
12 file://mysql-systemd-start \
13 file://configure.cmake-fix-valgrind.patch \
14 file://fix-a-building-failure.patch \
Brad Bishop19323692019-04-05 15:28:33 -040015 file://support-files-CMakeLists.txt-fix-do_populate_sysroot.patch \
16 file://sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch \
Brad Bishop316dfdd2018-06-25 12:45:53 -040017 file://0001-disable-ucontext-on-musl.patch \
Brad Bishop19323692019-04-05 15:28:33 -040018 file://c11_atomics.patch \
19 file://clang_version_header_conflict.patch \
20 file://fix-arm-atomic.patch \
Brad Bishop316dfdd2018-06-25 12:45:53 -040021 "
Brad Bishopc8f47122019-06-24 09:36:18 -040022SRC_URI[md5sum] = "11220d0b94c5c24caa2e1e9eaba38e31"
23SRC_URI[sha256sum] = "39e9723eaf620afd99b0925b2c2a5a50a89110ba50040adf14cce7cf89e5e21b"
Brad Bishop316dfdd2018-06-25 12:45:53 -040024
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080025UPSTREAM_CHECK_URI = "https://github.com/MariaDB/server/releases"
Brad Bishop316dfdd2018-06-25 12:45:53 -040026
27S = "${WORKDIR}/mariadb-${PV}"
28
29BINCONFIG_GLOB = "mysql_config"
30
Brad Bishopc1d34332019-09-09 14:56:00 -040031inherit cmake gettext binconfig update-rc.d useradd systemd multilib_script
32
33MULTILIB_SCRIPTS = "${PN}-server:${bindir}/mysql_install_db ${PN}-server:${bindir}/mysqld_safe"
Brad Bishop316dfdd2018-06-25 12:45:53 -040034
35INITSCRIPT_PACKAGES = "${PN}-server ${PN}-setupdb"
36INITSCRIPT_NAME_${PN}-server = "mysqld"
37INITSCRIPT_PARAMS_${PN}-server ?= "start 45 5 . stop 45 0 6 1 ."
38
39USERADD_PACKAGES = "${PN}-server"
40USERADD_PARAM_${PN}-server = "--system --home-dir /var/mysql -g mysql --shell /bin/false mysql"
41GROUPADD_PARAM_${PN}-server = "--system mysql"
42
43INITSCRIPT_NAME_${PN}-setupdb = "install_db"
44INITSCRIPT_PARAMS_${PN}-setupdb ?= "defaults 44 44"
45
46SYSTEMD_PACKAGES = "${PN}-server ${PN}-setupdb"
47SYSTEMD_SERVICE_${PN}-server = "mysqld.service"
48SYSTEMD_AUTO_ENABLE_${PN}-server ?= "disable"
49
50SYSTEMD_SERVICE_${PN}-setupdb = "install_db.service"
51SYSTEMD_AUTO_ENABLE_${PN}-setupdb ?= "enable"
52ALLOW_EMPTY_${PN}-setupdb ?= "1"
53FILES_${PN}-setupdb = "${sysconfdir}/init.d/install_db"
54
55EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'"
56
57PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} setupdb"
58PACKAGECONFIG_class-native = ""
59PACKAGECONFIG[pam] = ",-DWITHOUT_AUTH_PAM=TRUE,libpam"
60PACKAGECONFIG[valgrind] = "-DWITH_VALGRIND=TRUE,-DWITH_VALGRIND=FALSE,valgrind"
61PACKAGECONFIG[libedit] = "-DLIBEDIT_INTERFACE=TRUE,-DLIBEDIT_INTERFACE=FALSE,libedit"
62PACKAGECONFIG[krb5] = ", ,krb5"
63PACKAGECONFIG[setupdb] = ", ,,${PN}-setupdb"
64
65# MariaDB doesn't link properly with gold
66# https://mariadb.atlassian.net/browse/MDEV-5982
67TARGET_CFLAGS += "-fuse-ld=bfd"
Brad Bishop19323692019-04-05 15:28:33 -040068LDFLAGS += " -pthread"
Brad Bishop316dfdd2018-06-25 12:45:53 -040069BUILD_CFLAGS += "-fuse-ld=bfd"
70BUILD_CXXFLAGS += "-fuse-ld=bfd"
71
72EXTRA_OECMAKE = "-DWITH_EMBEDDED_SERVER=ON \
73 -DWITH_JEMALLOC=no \
74 -DWITHOUT_TOKUDB=TRUE \
75 -DCMAKE_DISABLE_FIND_PACKAGE_Boost=TRUE \
76 -DGROFF=FALSE \
77 -DNROFF=FALSE \
78 -DENABLE_DTRACE=FALSE \
79 -DWITH_PIC=ON \
80 -DINSTALL_LAYOUT=RPM \
81 -DINSTALL_DOCDIR:PATH=${datadir}/doc/${BPN} \
82 -DINSTALL_LIBDIR:PATH=${baselib} \
83 -DINSTALL_PLUGINDIR:PATH=${baselib}/plugin \
84 -DINSTALL_SYSCONFDIR:PATH=${sysconfdir} \
85 -DMYSQL_DATADIR:PATH=/var/mysql \
86 -DCAT_EXECUTABLE=`which cat` \
87 -DCMAKE_AR:FILEPATH=${AR}"
88
89# With Ninja it fails with:
90# make: *** No rule to make target `install'. Stop.
91OECMAKE_GENERATOR = "Unix Makefiles"
92
93ARM_INSTRUCTION_SET_armv4 = "arm"
94ARM_INSTRUCTION_SET_armv5 = "arm"
95
96do_configure_append() {
97 # handle distros with different values of ${libexecdir}
98 libexecdir2=`echo ${libexecdir} | sed -e 's+/usr/++g'`
99 sed -i -e "s:/libexec:/$libexecdir2:g" ${S}/scripts/mysql_install_db.sh
100 sed -i -e "s:mysqld libexec:mysqld $libexecdir2:g" ${S}/scripts/mysql_install_db.sh
101 sed -i -e "s:/libexec:/$libexecdir2:g" ${S}/scripts/mysqld_safe.sh
102}
103
104do_generate_toolchain_file_append_class-native () {
105 # If these are set cmake will assume we're cross-compiling, which will
106 # result in certain things we want being disabled
107 sed -i "/set( CMAKE_SYSTEM_NAME/d" ${WORKDIR}/toolchain.cmake
108 sed -i "/set( CMAKE_SYSTEM_PROCESSOR/d" ${WORKDIR}/toolchain.cmake
109}
110
111do_compile_prepend_class-target () {
112 # These need to be in-tree or make will think they need to be built,
113 # and since we're cross-compiling that is disabled
114 cp ${STAGING_BINDIR_NATIVE}/comp_err ${S}/extra
115 cp ${STAGING_BINDIR_NATIVE}/comp_sql ${S}/scripts
116
117 if [ "${@bb.utils.contains('PACKAGECONFIG', 'krb5', 'yes', 'no', d)}" = "no" ]; then
118 if ! [ -e ${B}/include/openssl/kssl.h ] ; then
119 mkdir -p ${B}/include/openssl
120 echo "#ifndef KSSL_H" >${B}/include/openssl/kssl.h
121 echo "#define KSSL_H" >>${B}/include/openssl/kssl.h
122 echo "#include <openssl/opensslconf.h>">>${B}/include/openssl/kssl.h
123 echo "#endif" >>${B}/include/openssl/kssl.h
124 fi
125 fi
Brad Bishop19323692019-04-05 15:28:33 -0400126 # workaround to handle out-of-source build from source package
127 yacc_files="sql_yacc.hh sql_yacc.cc sql_yacc_ora.hh sql_yacc_ora.cc"
128 for yacc_file in ${yacc_files}; do
129 cp ${S}/sql/${yacc_file} ${B}/sql/${yacc_file}
130 done
Brad Bishop316dfdd2018-06-25 12:45:53 -0400131}
132
133SYSROOT_PREPROCESS_FUNCS += "mariadb_sysroot_preprocess"
134
135# We need to append this so it runs *after* binconfig's preprocess function
136#
137# We really don't care exactly what the directories were set to originally.
138# plugindir is not fixed, but we don't create any plugins.
139#
140mariadb_sysroot_preprocess () {
141 sed -i -es,^pkgincludedir=.*,pkgincludedir=\'${STAGING_INCDIR}/mysql\', ${SYSROOT_DESTDIR}${bindir_crossscripts}/mysql_config
142 sed -i -es,^pkglibdir=.*,pkglibdir=\'${STAGING_LIBDIR}\', ${SYSROOT_DESTDIR}${bindir_crossscripts}/mysql_config
143}
144
145do_install() {
146 oe_runmake 'DESTDIR=${D}' install
147
148 install -d ${D}/${sysconfdir}/init.d
149 install -m 0644 ${WORKDIR}/my.cnf ${D}/${sysconfdir}/
150 install -m 0755 ${WORKDIR}/install_db ${D}/${sysconfdir}/init.d/
151 mv ${D}/${sysconfdir}/init.d/mysql ${D}/${sysconfdir}/init.d/mysqld
152
153 install -d ${D}${systemd_unitdir}/system
154 install -m 0644 ${WORKDIR}/mysqld.service ${D}${systemd_unitdir}/system
155 install -m 0644 ${WORKDIR}/install_db.service ${D}${systemd_unitdir}/system
156 sed -i -e 's,@BINDIR@,${bindir},g' -e 's,@PREFIX@,${prefix},g' ${D}${systemd_unitdir}/system/mysqld.service \
157 ${D}${systemd_unitdir}/system/install_db.service
158
159 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
160 install -d ${D}${sysconfdir}/tmpfiles.d
161 echo "f /var/log/mysqld.err 0640 mysql mysql -" \
162 > ${D}${sysconfdir}/tmpfiles.d/99-mysqld.conf
163 fi
164 install -d ${D}${bindir}
165 install -m 755 ${WORKDIR}/mysql-systemd-start ${D}${bindir}
166 install -d ${D}${datadir}/doc/${PN}
167 if [ -f ${D}${datadir}/doc/README ]; then
168 mv ${D}${datadir}/doc/README ${D}${datadir}/doc/${PN}/
169 fi
170}
171
172PACKAGES = "${PN}-dbg ${PN} \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800173 libmysqlclient-r libmysqlclient-r-dev libmysqlclient-r-staticdev \
174 libmysqlclient libmysqlclient-dev libmysqlclient-staticdev \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400175 libmysqld libmysqld-dev ${PN}-client ${PN}-server ${PN}-setupdb ${PN}-leftovers"
176CONFFILES_${PN}-server += "${sysconfdir}/my.cnf ${sysconfdir}/my.cnf.d/server.cnf"
177CONFFILES_${PN}-client += "${sysconfdir}/my.cnf.d/mysql-clients.cnf"
178CONFFILES_libmysqlclient += "${sysconfdir}/my.cnf.d/client.cnf"
179
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800180RPROVIDES_${PN}-dbg += "libmysqlclient-r-dbg libmysqlclient-dbg"
181
Brad Bishop316dfdd2018-06-25 12:45:53 -0400182FILES_${PN} = " "
183RDEPENDS_${PN} = "${PN}-client ${PN}-server"
184ALLOW_EMPTY_${PN} = "1"
185
186RDEPENDS_${PN}-client = "perl perl-module-getopt-long perl-module-file-temp \
187 perl-module-fcntl perl-module-sys-hostname perl-module-ipc-open3 \
188 perl-module-exporter"
189RDEPENDS_${PN}-server = "perl perl-module-getopt-long perl-module-data-dumper \
190 perl-module-file-basename perl-module-file-path perl-module-sys-hostname \
191 perl-module-file-copy perl-module-file-temp perl-module-posix \
Brad Bishop19323692019-04-05 15:28:33 -0400192 ${PN}-client ${PN}-setupdb libdbi-perl libdbd-mysql-perl"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400193RDEPENDS_${PN}-leftovers = "perl perl-module-cwd perl-module-benchmark perl-module-getopt-long \
194 perl-module-posix perl-module-data-dumper perl-module-sigtrap perl-module-threads \
195 perl-module-threads-shared perl-module-io-socket perl-module-sys-hostname perl-module-file-copy \
196 perl-module-file-spec perl-module-file-find perl-module-file-basename perl-module-file-path \
197 perl-module-constant perl-module-lib perl-module-file-temp perl-module-file-spec-functions \
Brad Bishop19323692019-04-05 15:28:33 -0400198 perl-module-io-socket-inet perl-module-io-select bash"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400199RDEPENDS_${PN}-setupdb = "coreutils"
200
201# Allow old code to link to the backward compatible library
202RDEPENDS_libmysqlclient-dev = "libmysqlclient-r-dev"
203
204FILES_libmysqlclient = "\
205 ${libdir}/libmysqlclient.so.* \
Brad Bishop19323692019-04-05 15:28:33 -0400206 ${libdir}/libmariadb.so.* \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400207 ${sysconfdir}/my.cnf.d/client.cnf"
208FILES_libmysqlclient-dev = " \
209 ${includedir}/mysql/ \
210 ${libdir}/libmysqlclient.so \
Brad Bishop19323692019-04-05 15:28:33 -0400211 ${libdir}/libmariadb.so \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400212 ${sysconfdir}/aclocal \
213 ${bindir}/mysql_config"
214FILES_libmysqlclient-staticdev = "\
215 ${libdir}/*.a"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400216
217# Avoid warnings about ha_xtradb.so.0.0.0 and ha_innodb_plugin.so.0.0.0
218# which are intentionally non-PIC on 32-bit x86 (see e.g.
219# storage/xtradb/plug.in in the source)
220INSANE_SKIP_libmysqlclient_append_x86 = " textrel"
221
222FILES_libmysqlclient-r = "${libdir}/libmysqlclient_r.so.*"
223FILES_libmysqlclient-r-dev = "\
224 ${libdir}/libmysqlclient_r.so"
225FILES_libmysqlclient-r-staticdev = "${libdir}/libmysqlclient_r.a"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400226
227FILES_libmysqld = "\
Brad Bishop19323692019-04-05 15:28:33 -0400228 ${libdir}/libmysqld.so.* \
229 ${libdir}/libmariadbd.so.*"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400230FILES_libmysqld-dev = "\
Brad Bishop19323692019-04-05 15:28:33 -0400231 ${libdir}/libmysqld.so \
232 ${libdir}/libmariadbd.so"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400233
234FILES_${PN}-client = "\
235 ${bindir}/myisam_ftdump \
236 ${bindir}/mysql \
237 ${bindir}/mysql_client_test \
238 ${bindir}/mysql_client_test_embedded \
239 ${bindir}/mysql_find_rows \
240 ${bindir}/mysql_fix_extensions \
241 ${bindir}/mysql_waitpid \
242 ${bindir}/mysqlaccess \
243 ${bindir}/mysqladmin \
244 ${bindir}/mysqlbug \
245 ${bindir}/mysqlcheck \
246 ${bindir}/mysqldump \
247 ${bindir}/mysqldumpslow \
248 ${bindir}/mysqlimport \
249 ${bindir}/mysqlshow \
250 ${bindir}/mysqlslap \
251 ${bindir}/mysqltest_embedded \
252 ${libexecdir}/mysqlmanager \
253 ${sysconfdir}/my.cnf.d/mysql-clients.cnf"
254
255FILES_${PN}-server = "\
256 ${bindir}/comp_err \
257 ${bindir}/isamchk \
258 ${bindir}/isamlog \
259 ${bindir}/msql2mysql \
260 ${bindir}/my_print_defaults \
261 ${bindir}/myisamchk \
262 ${bindir}/myisamlog \
263 ${bindir}/myisampack \
264 ${bindir}/mysql_convert_table_format \
265 ${bindir}/mysql_fix_privilege_tables \
266 ${bindir}/mysql_install_db \
267 ${bindir}/mysql_secure_installation \
268 ${bindir}/mysql_setpermission \
269 ${bindir}/mysql-systemd-start \
270 ${bindir}/mysql_tzinfo_to_sql \
271 ${bindir}/mysql_upgrade \
272 ${bindir}/mysql_plugin \
273 ${bindir}/mysql_zap \
274 ${bindir}/mysqlbinlog \
275 ${bindir}/mysqld_multi \
276 ${bindir}/mysqld_safe \
277 ${bindir}/mysqld_safe_helper \
278 ${bindir}/mysqlhotcopy \
279 ${bindir}/mysqltest \
280 ${bindir}/ndb_delete_all \
281 ${bindir}/ndb_desc \
282 ${bindir}/ndb_drop_index \
283 ${bindir}/ndb_drop_table \
284 ${bindir}/ndb_mgm \
285 ${bindir}/ndb_restore \
286 ${bindir}/ndb_select_all \
287 ${bindir}/ndb_select_count \
288 ${bindir}/ndb_show_tables \
289 ${bindir}/ndb_waiter \
290 ${bindir}/pack_isam \
291 ${bindir}/perror \
292 ${bindir}/replace \
293 ${bindir}/resolve_stack_dump \
294 ${bindir}/resolveip \
295 ${libexecdir}/mysqld \
296 ${sbindir}/mysqld \
297 ${sbindir}/ndb_cpcd \
298 ${sbindir}/ndbd \
299 ${sbindir}/ndb_mgmd \
300 ${libdir}/plugin/*.so \
301 ${datadir}/mysql/ \
302 ${localstatedir}/mysql/ \
303 ${sysconfdir}/init.d/mysqld \
304 ${sysconfdir}/my.cnf \
305 ${sysconfdir}/my.cnf.d/server.cnf \
306 ${sysconfdir}/tmpfiles.d"
307
308DESCRIPTION_${PN}-leftovers = "unpackaged and probably unneeded files for ${PN}"
309FILES_${PN}-leftovers = "/"