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