blob: 23de69dd25aae05727b5c865008fa8cf160a5b83 [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 "
Brad Bishope42b3e32020-01-15 22:08:42 -050024SRC_URI[md5sum] = "d0de881ab8ead46928cafb7d558535c1"
25SRC_URI[sha256sum] = "4c076232b99433b09eb3c6d62f607192b3474d022703699b8f6aef4e79de3fb9"
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
171}
172
173PACKAGES = "${PN}-dbg ${PN} \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800174 libmysqlclient-r libmysqlclient-r-dev libmysqlclient-r-staticdev \
175 libmysqlclient libmysqlclient-dev libmysqlclient-staticdev \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400176 libmysqld libmysqld-dev ${PN}-client ${PN}-server ${PN}-setupdb ${PN}-leftovers"
177CONFFILES_${PN}-server += "${sysconfdir}/my.cnf ${sysconfdir}/my.cnf.d/server.cnf"
178CONFFILES_${PN}-client += "${sysconfdir}/my.cnf.d/mysql-clients.cnf"
179CONFFILES_libmysqlclient += "${sysconfdir}/my.cnf.d/client.cnf"
180
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800181RPROVIDES_${PN}-dbg += "libmysqlclient-r-dbg libmysqlclient-dbg"
182
Brad Bishop316dfdd2018-06-25 12:45:53 -0400183FILES_${PN} = " "
184RDEPENDS_${PN} = "${PN}-client ${PN}-server"
185ALLOW_EMPTY_${PN} = "1"
186
187RDEPENDS_${PN}-client = "perl perl-module-getopt-long perl-module-file-temp \
188 perl-module-fcntl perl-module-sys-hostname perl-module-ipc-open3 \
189 perl-module-exporter"
190RDEPENDS_${PN}-server = "perl perl-module-getopt-long perl-module-data-dumper \
191 perl-module-file-basename perl-module-file-path perl-module-sys-hostname \
192 perl-module-file-copy perl-module-file-temp perl-module-posix \
Brad Bishop19323692019-04-05 15:28:33 -0400193 ${PN}-client ${PN}-setupdb libdbi-perl libdbd-mysql-perl"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400194RDEPENDS_${PN}-leftovers = "perl perl-module-cwd perl-module-benchmark perl-module-getopt-long \
195 perl-module-posix perl-module-data-dumper perl-module-sigtrap perl-module-threads \
196 perl-module-threads-shared perl-module-io-socket perl-module-sys-hostname perl-module-file-copy \
197 perl-module-file-spec perl-module-file-find perl-module-file-basename perl-module-file-path \
198 perl-module-constant perl-module-lib perl-module-file-temp perl-module-file-spec-functions \
Brad Bishop19323692019-04-05 15:28:33 -0400199 perl-module-io-socket-inet perl-module-io-select bash"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400200RDEPENDS_${PN}-setupdb = "coreutils"
201
202# Allow old code to link to the backward compatible library
203RDEPENDS_libmysqlclient-dev = "libmysqlclient-r-dev"
204
205FILES_libmysqlclient = "\
206 ${libdir}/libmysqlclient.so.* \
Brad Bishop19323692019-04-05 15:28:33 -0400207 ${libdir}/libmariadb.so.* \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400208 ${sysconfdir}/my.cnf.d/client.cnf"
209FILES_libmysqlclient-dev = " \
210 ${includedir}/mysql/ \
211 ${libdir}/libmysqlclient.so \
Brad Bishop19323692019-04-05 15:28:33 -0400212 ${libdir}/libmariadb.so \
Brad Bishop316dfdd2018-06-25 12:45:53 -0400213 ${sysconfdir}/aclocal \
214 ${bindir}/mysql_config"
215FILES_libmysqlclient-staticdev = "\
216 ${libdir}/*.a"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400217
218# Avoid warnings about ha_xtradb.so.0.0.0 and ha_innodb_plugin.so.0.0.0
219# which are intentionally non-PIC on 32-bit x86 (see e.g.
220# storage/xtradb/plug.in in the source)
221INSANE_SKIP_libmysqlclient_append_x86 = " textrel"
222
223FILES_libmysqlclient-r = "${libdir}/libmysqlclient_r.so.*"
224FILES_libmysqlclient-r-dev = "\
225 ${libdir}/libmysqlclient_r.so"
226FILES_libmysqlclient-r-staticdev = "${libdir}/libmysqlclient_r.a"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400227
228FILES_libmysqld = "\
Brad Bishop19323692019-04-05 15:28:33 -0400229 ${libdir}/libmysqld.so.* \
230 ${libdir}/libmariadbd.so.*"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400231FILES_libmysqld-dev = "\
Brad Bishop19323692019-04-05 15:28:33 -0400232 ${libdir}/libmysqld.so \
233 ${libdir}/libmariadbd.so"
Brad Bishop316dfdd2018-06-25 12:45:53 -0400234
235FILES_${PN}-client = "\
236 ${bindir}/myisam_ftdump \
237 ${bindir}/mysql \
238 ${bindir}/mysql_client_test \
239 ${bindir}/mysql_client_test_embedded \
240 ${bindir}/mysql_find_rows \
241 ${bindir}/mysql_fix_extensions \
242 ${bindir}/mysql_waitpid \
243 ${bindir}/mysqlaccess \
244 ${bindir}/mysqladmin \
245 ${bindir}/mysqlbug \
246 ${bindir}/mysqlcheck \
247 ${bindir}/mysqldump \
248 ${bindir}/mysqldumpslow \
249 ${bindir}/mysqlimport \
250 ${bindir}/mysqlshow \
251 ${bindir}/mysqlslap \
252 ${bindir}/mysqltest_embedded \
253 ${libexecdir}/mysqlmanager \
254 ${sysconfdir}/my.cnf.d/mysql-clients.cnf"
255
256FILES_${PN}-server = "\
257 ${bindir}/comp_err \
258 ${bindir}/isamchk \
259 ${bindir}/isamlog \
260 ${bindir}/msql2mysql \
261 ${bindir}/my_print_defaults \
262 ${bindir}/myisamchk \
263 ${bindir}/myisamlog \
264 ${bindir}/myisampack \
265 ${bindir}/mysql_convert_table_format \
266 ${bindir}/mysql_fix_privilege_tables \
267 ${bindir}/mysql_install_db \
268 ${bindir}/mysql_secure_installation \
269 ${bindir}/mysql_setpermission \
270 ${bindir}/mysql-systemd-start \
271 ${bindir}/mysql_tzinfo_to_sql \
272 ${bindir}/mysql_upgrade \
273 ${bindir}/mysql_plugin \
274 ${bindir}/mysql_zap \
275 ${bindir}/mysqlbinlog \
276 ${bindir}/mysqld_multi \
277 ${bindir}/mysqld_safe \
278 ${bindir}/mysqld_safe_helper \
279 ${bindir}/mysqlhotcopy \
280 ${bindir}/mysqltest \
281 ${bindir}/ndb_delete_all \
282 ${bindir}/ndb_desc \
283 ${bindir}/ndb_drop_index \
284 ${bindir}/ndb_drop_table \
285 ${bindir}/ndb_mgm \
286 ${bindir}/ndb_restore \
287 ${bindir}/ndb_select_all \
288 ${bindir}/ndb_select_count \
289 ${bindir}/ndb_show_tables \
290 ${bindir}/ndb_waiter \
291 ${bindir}/pack_isam \
292 ${bindir}/perror \
293 ${bindir}/replace \
294 ${bindir}/resolve_stack_dump \
295 ${bindir}/resolveip \
296 ${libexecdir}/mysqld \
297 ${sbindir}/mysqld \
298 ${sbindir}/ndb_cpcd \
299 ${sbindir}/ndbd \
300 ${sbindir}/ndb_mgmd \
301 ${libdir}/plugin/*.so \
302 ${datadir}/mysql/ \
303 ${localstatedir}/mysql/ \
304 ${sysconfdir}/init.d/mysqld \
305 ${sysconfdir}/my.cnf \
306 ${sysconfdir}/my.cnf.d/server.cnf \
307 ${sysconfdir}/tmpfiles.d"
308
309DESCRIPTION_${PN}-leftovers = "unpackaged and probably unneeded files for ${PN}"
310FILES_${PN}-leftovers = "/"