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