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