Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | SUMMARY = "A robust, scalable, and reliable SQL server" |
| 2 | HOMEPAGE = "http://mariadb.org" |
| 3 | SECTION = "libs" |
| 4 | LICENSE = "GPLv2" |
Brad Bishop | c8f4712 | 2019-06-24 09:36:18 -0400 | [diff] [blame] | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=b1becf0cfa3366e0f4d854d1d264f311" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 6 | |
Brad Bishop | 63ae878 | 2019-10-09 09:56:13 -0400 | [diff] [blame] | 7 | SRC_URI = "http://archive.mariadb.org/${BP}/source/${BP}.tar.gz \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 8 | 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 Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 15 | file://support-files-CMakeLists.txt-fix-do_populate_sysroot.patch \ |
| 16 | file://sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 17 | file://0001-disable-ucontext-on-musl.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 18 | file://c11_atomics.patch \ |
| 19 | file://clang_version_header_conflict.patch \ |
| 20 | file://fix-arm-atomic.patch \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 21 | " |
Brad Bishop | c8f4712 | 2019-06-24 09:36:18 -0400 | [diff] [blame] | 22 | SRC_URI[md5sum] = "11220d0b94c5c24caa2e1e9eaba38e31" |
| 23 | SRC_URI[sha256sum] = "39e9723eaf620afd99b0925b2c2a5a50a89110ba50040adf14cce7cf89e5e21b" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 24 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 25 | UPSTREAM_CHECK_URI = "https://github.com/MariaDB/server/releases" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 26 | |
| 27 | S = "${WORKDIR}/mariadb-${PV}" |
| 28 | |
| 29 | BINCONFIG_GLOB = "mysql_config" |
| 30 | |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 31 | inherit cmake gettext binconfig update-rc.d useradd systemd multilib_script |
| 32 | |
| 33 | MULTILIB_SCRIPTS = "${PN}-server:${bindir}/mysql_install_db ${PN}-server:${bindir}/mysqld_safe" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 34 | |
| 35 | INITSCRIPT_PACKAGES = "${PN}-server ${PN}-setupdb" |
| 36 | INITSCRIPT_NAME_${PN}-server = "mysqld" |
| 37 | INITSCRIPT_PARAMS_${PN}-server ?= "start 45 5 . stop 45 0 6 1 ." |
| 38 | |
| 39 | USERADD_PACKAGES = "${PN}-server" |
| 40 | USERADD_PARAM_${PN}-server = "--system --home-dir /var/mysql -g mysql --shell /bin/false mysql" |
| 41 | GROUPADD_PARAM_${PN}-server = "--system mysql" |
| 42 | |
| 43 | INITSCRIPT_NAME_${PN}-setupdb = "install_db" |
| 44 | INITSCRIPT_PARAMS_${PN}-setupdb ?= "defaults 44 44" |
| 45 | |
| 46 | SYSTEMD_PACKAGES = "${PN}-server ${PN}-setupdb" |
| 47 | SYSTEMD_SERVICE_${PN}-server = "mysqld.service" |
| 48 | SYSTEMD_AUTO_ENABLE_${PN}-server ?= "disable" |
| 49 | |
| 50 | SYSTEMD_SERVICE_${PN}-setupdb = "install_db.service" |
| 51 | SYSTEMD_AUTO_ENABLE_${PN}-setupdb ?= "enable" |
| 52 | ALLOW_EMPTY_${PN}-setupdb ?= "1" |
| 53 | FILES_${PN}-setupdb = "${sysconfdir}/init.d/install_db" |
| 54 | |
| 55 | EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'" |
| 56 | |
| 57 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} setupdb" |
| 58 | PACKAGECONFIG_class-native = "" |
| 59 | PACKAGECONFIG[pam] = ",-DWITHOUT_AUTH_PAM=TRUE,libpam" |
| 60 | PACKAGECONFIG[valgrind] = "-DWITH_VALGRIND=TRUE,-DWITH_VALGRIND=FALSE,valgrind" |
| 61 | PACKAGECONFIG[libedit] = "-DLIBEDIT_INTERFACE=TRUE,-DLIBEDIT_INTERFACE=FALSE,libedit" |
| 62 | PACKAGECONFIG[krb5] = ", ,krb5" |
| 63 | PACKAGECONFIG[setupdb] = ", ,,${PN}-setupdb" |
| 64 | |
| 65 | # MariaDB doesn't link properly with gold |
| 66 | # https://mariadb.atlassian.net/browse/MDEV-5982 |
| 67 | TARGET_CFLAGS += "-fuse-ld=bfd" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 68 | LDFLAGS += " -pthread" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 69 | BUILD_CFLAGS += "-fuse-ld=bfd" |
| 70 | BUILD_CXXFLAGS += "-fuse-ld=bfd" |
| 71 | |
| 72 | EXTRA_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. |
| 91 | OECMAKE_GENERATOR = "Unix Makefiles" |
| 92 | |
| 93 | ARM_INSTRUCTION_SET_armv4 = "arm" |
| 94 | ARM_INSTRUCTION_SET_armv5 = "arm" |
| 95 | |
| 96 | do_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 | |
| 104 | do_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 | |
| 111 | do_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 Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 126 | # 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | SYSROOT_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 | # |
| 140 | mariadb_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 | |
| 145 | do_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 | |
| 172 | PACKAGES = "${PN}-dbg ${PN} \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 173 | libmysqlclient-r libmysqlclient-r-dev libmysqlclient-r-staticdev \ |
| 174 | libmysqlclient libmysqlclient-dev libmysqlclient-staticdev \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 175 | libmysqld libmysqld-dev ${PN}-client ${PN}-server ${PN}-setupdb ${PN}-leftovers" |
| 176 | CONFFILES_${PN}-server += "${sysconfdir}/my.cnf ${sysconfdir}/my.cnf.d/server.cnf" |
| 177 | CONFFILES_${PN}-client += "${sysconfdir}/my.cnf.d/mysql-clients.cnf" |
| 178 | CONFFILES_libmysqlclient += "${sysconfdir}/my.cnf.d/client.cnf" |
| 179 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 180 | RPROVIDES_${PN}-dbg += "libmysqlclient-r-dbg libmysqlclient-dbg" |
| 181 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 182 | FILES_${PN} = " " |
| 183 | RDEPENDS_${PN} = "${PN}-client ${PN}-server" |
| 184 | ALLOW_EMPTY_${PN} = "1" |
| 185 | |
| 186 | RDEPENDS_${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" |
| 189 | RDEPENDS_${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 Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 192 | ${PN}-client ${PN}-setupdb libdbi-perl libdbd-mysql-perl" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 193 | RDEPENDS_${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 Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 198 | perl-module-io-socket-inet perl-module-io-select bash" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 199 | RDEPENDS_${PN}-setupdb = "coreutils" |
| 200 | |
| 201 | # Allow old code to link to the backward compatible library |
| 202 | RDEPENDS_libmysqlclient-dev = "libmysqlclient-r-dev" |
| 203 | |
| 204 | FILES_libmysqlclient = "\ |
| 205 | ${libdir}/libmysqlclient.so.* \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 206 | ${libdir}/libmariadb.so.* \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 207 | ${sysconfdir}/my.cnf.d/client.cnf" |
| 208 | FILES_libmysqlclient-dev = " \ |
| 209 | ${includedir}/mysql/ \ |
| 210 | ${libdir}/libmysqlclient.so \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 211 | ${libdir}/libmariadb.so \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 212 | ${sysconfdir}/aclocal \ |
| 213 | ${bindir}/mysql_config" |
| 214 | FILES_libmysqlclient-staticdev = "\ |
| 215 | ${libdir}/*.a" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 216 | |
| 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) |
| 220 | INSANE_SKIP_libmysqlclient_append_x86 = " textrel" |
| 221 | |
| 222 | FILES_libmysqlclient-r = "${libdir}/libmysqlclient_r.so.*" |
| 223 | FILES_libmysqlclient-r-dev = "\ |
| 224 | ${libdir}/libmysqlclient_r.so" |
| 225 | FILES_libmysqlclient-r-staticdev = "${libdir}/libmysqlclient_r.a" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 226 | |
| 227 | FILES_libmysqld = "\ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 228 | ${libdir}/libmysqld.so.* \ |
| 229 | ${libdir}/libmariadbd.so.*" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 230 | FILES_libmysqld-dev = "\ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 231 | ${libdir}/libmysqld.so \ |
| 232 | ${libdir}/libmariadbd.so" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 233 | |
| 234 | FILES_${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 | |
| 255 | FILES_${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 | |
| 308 | DESCRIPTION_${PN}-leftovers = "unpackaged and probably unneeded files for ${PN}" |
| 309 | FILES_${PN}-leftovers = "/" |