From 3d707d2b4fa6362cb37754f6c5fbb06240f5faf5 Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Fri, 16 Dec 2016 14:26:51 -0800 Subject: [PATCH] mysql: rename package to oracle-mysql, make a virtual package This commit turns mysql into a virtual package, after renaming the original mysql package to oracle-mysql. This way, all existing packages that "depends on" or "select" BR2_PACKAGE_MYSQL continue to work with no modification. Signed-off-by: Ryan Coe Signed-off-by: Thomas Petazzoni --- package/Config.in | 1 - package/mariadb/Config.in | 32 ----- package/mariadb/mariadb.mk | 1 + package/mysql/Config.in | 74 ++++++++-- package/mysql/mysql.mk | 130 +---------------- .../0000-ac_cache_check.patch | 0 .../0001-configure-ps-cache-check.patch | 0 .../0002-use-new-readline-iface.patch | 0 .../0003-ac_stack_direction-is-unset.patch | 0 .../0004-Fix-gen_lex_hash-execution.patch | 0 ...05-bison_3_breaks_mysql_server_build.patch | 0 .../0006-no-force-static-build.patch | 0 ...0007-dont-install-in-mysql-directory.patch | 0 package/{mysql => oracle-mysql}/S97mysqld | 0 .../{mysql => oracle-mysql}/mysqld.service | 0 .../oracle-mysql.hash} | 0 package/oracle-mysql/oracle-mysql.mk | 136 ++++++++++++++++++ 17 files changed, 204 insertions(+), 170 deletions(-) delete mode 100644 package/mariadb/Config.in rename package/{mysql => oracle-mysql}/0000-ac_cache_check.patch (100%) rename package/{mysql => oracle-mysql}/0001-configure-ps-cache-check.patch (100%) rename package/{mysql => oracle-mysql}/0002-use-new-readline-iface.patch (100%) rename package/{mysql => oracle-mysql}/0003-ac_stack_direction-is-unset.patch (100%) rename package/{mysql => oracle-mysql}/0004-Fix-gen_lex_hash-execution.patch (100%) rename package/{mysql => oracle-mysql}/0005-bison_3_breaks_mysql_server_build.patch (100%) rename package/{mysql => oracle-mysql}/0006-no-force-static-build.patch (100%) rename package/{mysql => oracle-mysql}/0007-dont-install-in-mysql-directory.patch (100%) rename package/{mysql => oracle-mysql}/S97mysqld (100%) rename package/{mysql => oracle-mysql}/mysqld.service (100%) rename package/{mysql/mysql.hash => oracle-mysql/oracle-mysql.hash} (100%) create mode 100644 package/oracle-mysql/oracle-mysql.mk diff --git a/package/Config.in b/package/Config.in index 8ed3622356..f7e8c0ab9b 100644 --- a/package/Config.in +++ b/package/Config.in @@ -925,7 +925,6 @@ menu "Database" source "package/kompexsqlite/Config.in" source "package/leveldb/Config.in" source "package/libpqxx/Config.in" - source "package/mariadb/Config.in" source "package/mongodb/Config.in" source "package/mysql/Config.in" source "package/postgresql/Config.in" diff --git a/package/mariadb/Config.in b/package/mariadb/Config.in deleted file mode 100644 index 86de194cca..0000000000 --- a/package/mariadb/Config.in +++ /dev/null @@ -1,32 +0,0 @@ -config BR2_PACKAGE_MARIADB - bool "mariadb" - depends on BR2_INSTALL_LIBSTDCPP - depends on BR2_USE_MMU # fork() - depends on BR2_TOOLCHAIN_HAS_THREADS - depends on BR2_PACKAGE_LIBAIO_ARCH_SUPPORTS - depends on !BR2_PACKAGE_MYSQL - select BR2_PACKAGE_LIBAIO - select BR2_PACKAGE_LIBXML2 - select BR2_PACKAGE_NCURSES - select BR2_PACKAGE_OPENSSL - select BR2_PACKAGE_READLINE - help - MariaDB is one of the most popular database servers in the world. - It's made by the original developers of MySQL and guaranteed to - stay open source. - - http://www.mariadb.org/ - -if BR2_PACKAGE_MARIADB - -config BR2_PACKAGE_MARIADB_SERVER - bool "mariadb server" - help - Install the mariadb server on the target. - -endif - -comment "mariadb needs a toolchain w/ C++, threads" - depends on BR2_USE_MMU - depends on BR2_PACKAGE_LIBAIO_ARCH_SUPPORTS - depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/mariadb/mariadb.mk b/package/mariadb/mariadb.mk index 7b47557bdd..6c609da60f 100644 --- a/package/mariadb/mariadb.mk +++ b/package/mariadb/mariadb.mk @@ -10,6 +10,7 @@ MARIADB_SITE = https://downloads.mariadb.org/interstitial/mariadb-$(MARIADB_VERS MARIADB_LICENSE = GPLv2 (server), GPLv2 with FLOSS exception (GPL client library), LGPLv2 (LGPL client library) MARIADB_LICENSE_FILES = README COPYING COPYING.LESSER MARIADB_INSTALL_STAGING = YES +MARIADB_PROVIDES = mysql MARIADB_DEPENDENCIES = \ host-mariadb \ diff --git a/package/mysql/Config.in b/package/mysql/Config.in index 7e7d22450d..e485d6b99f 100644 --- a/package/mysql/Config.in +++ b/package/mysql/Config.in @@ -1,25 +1,83 @@ config BR2_PACKAGE_MYSQL - bool "MySQL" + bool "mysql support" + help + Select the desired mysql provider. + +if BR2_PACKAGE_MYSQL + +choice + prompt "mysql variant" + default BR2_PACKAGE_ORACLE_MYSQL + help + Select either the oracle mysql server or the mariadb server + +config BR2_PACKAGE_MARIADB + bool "mariadb" + depends on BR2_INSTALL_LIBSTDCPP + depends on BR2_USE_MMU # fork() + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_PACKAGE_LIBAIO_ARCH_SUPPORTS + select BR2_PACKAGE_LIBAIO + select BR2_PACKAGE_LIBXML2 + select BR2_PACKAGE_NCURSES + select BR2_PACKAGE_OPENSSL + select BR2_PACKAGE_READLINE + select BR2_PACKAGE_HAS_MYSQL + help + MariaDB is one of the most popular database servers in the world. + It's made by the original developers of MySQL and guaranteed to + stay open source. + + http://www.mariadb.org/ + +config BR2_PACKAGE_ORACLE_MYSQL + bool "oracle mysql" depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_MMU # fork() depends on BR2_TOOLCHAIN_HAS_THREADS - depends on !BR2_PACKAGE_MARIADB select BR2_PACKAGE_NCURSES select BR2_PACKAGE_READLINE + select BR2_PACKAGE_HAS_MYSQL help The MySQL Open Source Database System http://www.mysql.com/ -if BR2_PACKAGE_MYSQL +endchoice -config BR2_PACKAGE_MYSQL_SERVER - bool "MySQL server" +comment "mariadb needs a toolchain w/ C++, threads" + depends on BR2_USE_MMU + depends on BR2_PACKAGE_LIBAIO_ARCH_SUPPORTS + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS + +comment "oracle mysql needs a toolchain w/ C++, threads" + depends on BR2_USE_MMU + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS + +if BR2_PACKAGE_MARIADB + +config BR2_PACKAGE_MARIADB_SERVER + bool "mariadb server" + help + Install the mariadb server on the target. + +endif + +if BR2_PACKAGE_ORACLE_MYSQL + +config BR2_PACKAGE_ORACLE_MYSQL_SERVER + bool "oracle mysql server" help Install the MySQL server on the target. endif -comment "MySQL needs a toolchain w/ C++, threads" - depends on BR2_USE_MMU - depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS +config BR2_PACKAGE_HAS_MYSQL + bool + +config BR2_PACKAGE_PROVIDES_MYSQL + string + default "mariadb" if BR2_PACKAGE_MARIADB + default "oracle-mysql" if BR2_PACKAGE_ORACLE_MYSQL + +endif diff --git a/package/mysql/mysql.mk b/package/mysql/mysql.mk index ea330f2515..d65562563d 100644 --- a/package/mysql/mysql.mk +++ b/package/mysql/mysql.mk @@ -4,132 +4,4 @@ # ################################################################################ -MYSQL_VERSION_MAJOR = 5.1 -MYSQL_VERSION = $(MYSQL_VERSION_MAJOR).73 -MYSQL_SOURCE = mysql-$(MYSQL_VERSION).tar.gz -MYSQL_SITE = http://dev.mysql.com/get/Downloads/MySQL-$(MYSQL_VERSION_MAJOR) -MYSQL_INSTALL_STAGING = YES -MYSQL_DEPENDENCIES = readline ncurses -MYSQL_AUTORECONF = YES -MYSQL_LICENSE = GPLv2 -MYSQL_LICENSE_FILES = README COPYING - -# Unix socket. This variable can also be consulted by other buildroot packages -MYSQL_SOCKET = /run/mysql/mysql.sock - -MYSQL_CONF_ENV = \ - ac_cv_sys_restartable_syscalls=yes \ - ac_cv_path_PS=/bin/ps \ - ac_cv_FIND_PROC="/bin/ps p \$\$PID | grep -v grep | grep mysqld > /dev/null" \ - ac_cv_have_decl_HAVE_IB_ATOMIC_PTHREAD_T_GCC=yes \ - ac_cv_have_decl_HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS=no \ - ac_cv_have_decl_HAVE_IB_GCC_ATOMIC_BUILTINS=yes \ - mysql_cv_new_rl_interface=yes - -MYSQL_CONF_OPTS = \ - --without-ndb-binlog \ - --without-docs \ - --without-man \ - --without-libedit \ - --without-readline \ - --with-low-memory \ - --enable-thread-safe-client \ - --with-unix-socket-path=$(MYSQL_SOCKET) \ - --disable-mysql-maintainer-mode - -# host-mysql only installs what is needed to build mysql, i.e. the -# gen_lex_hash tool, and it only builds the parts that are needed to -# create this tool -HOST_MYSQL_DEPENDENCIES = host-zlib host-ncurses - -HOST_MYSQL_CONF_OPTS = \ - --with-embedded-server \ - --disable-mysql-maintainer-mode - -define HOST_MYSQL_BUILD_CMDS - $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/include my_config.h - $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/mysys libmysys.a - $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/strings libmystrings.a - $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/vio libvio.a - $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/dbug libdbug.a - $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/regex libregex.a - $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/sql gen_lex_hash -endef - -define HOST_MYSQL_INSTALL_CMDS - $(INSTALL) -m 0755 $(@D)/sql/gen_lex_hash $(HOST_DIR)/usr/bin/ -endef - -ifeq ($(BR2_PACKAGE_OPENSSL),y) -MYSQL_DEPENDENCIES += openssl -endif - -ifeq ($(BR2_PACKAGE_ZLIB),y) -MYSQL_DEPENDENCIES += zlib -endif - -ifeq ($(BR2_PACKAGE_MYSQL_SERVER),y) -MYSQL_DEPENDENCIES += host-mysql host-bison - -MYSQL_CONF_OPTS += \ - --localstatedir=/var/mysql \ - --with-atomic-ops=up \ - --with-embedded-server \ - --without-query-cache \ - --without-plugin-partition \ - --without-plugin-daemon_example \ - --without-plugin-ftexample \ - --without-plugin-archive \ - --without-plugin-blackhole \ - --without-plugin-example \ - --without-plugin-federated \ - --without-plugin-ibmdb2i \ - --without-plugin-innobase \ - --without-plugin-innodb_plugin \ - --without-plugin-ndbcluster - -# Debugging is only available for the server, so no need for -# this if-block outside of the server if-block -ifeq ($(BR2_ENABLE_DEBUG),y) -MYSQL_CONF_OPTS += --with-debug=full -else -MYSQL_CONF_OPTS += --without-debug -endif - -define MYSQL_USERS - mysql -1 nogroup -1 * /var/mysql - - MySQL daemon -endef - -define MYSQL_ADD_FOLDER - $(INSTALL) -d $(TARGET_DIR)/var/mysql -endef - -MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_ADD_FOLDER - -define MYSQL_INSTALL_INIT_SYSV - $(INSTALL) -D -m 0755 package/mysql/S97mysqld \ - $(TARGET_DIR)/etc/init.d/S97mysqld -endef - -define MYSQL_INSTALL_INIT_SYSTEMD - $(INSTALL) -D -m 644 package/mysql/mysqld.service \ - $(TARGET_DIR)/usr/lib/systemd/system/mysqld.service - mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants - ln -sf ../../../../usr/lib/systemd/system/mysqld.service \ - $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mysqld.service -endef - -else -MYSQL_CONF_OPTS += \ - --without-server -endif - - -define MYSQL_REMOVE_TEST_PROGS - rm -rf $(TARGET_DIR)/usr/mysql-test $(TARGET_DIR)/usr/sql-bench -endef - -MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_REMOVE_TEST_PROGS - -$(eval $(autotools-package)) -$(eval $(host-autotools-package)) +$(eval $(virtual-package)) diff --git a/package/mysql/0000-ac_cache_check.patch b/package/oracle-mysql/0000-ac_cache_check.patch similarity index 100% rename from package/mysql/0000-ac_cache_check.patch rename to package/oracle-mysql/0000-ac_cache_check.patch diff --git a/package/mysql/0001-configure-ps-cache-check.patch b/package/oracle-mysql/0001-configure-ps-cache-check.patch similarity index 100% rename from package/mysql/0001-configure-ps-cache-check.patch rename to package/oracle-mysql/0001-configure-ps-cache-check.patch diff --git a/package/mysql/0002-use-new-readline-iface.patch b/package/oracle-mysql/0002-use-new-readline-iface.patch similarity index 100% rename from package/mysql/0002-use-new-readline-iface.patch rename to package/oracle-mysql/0002-use-new-readline-iface.patch diff --git a/package/mysql/0003-ac_stack_direction-is-unset.patch b/package/oracle-mysql/0003-ac_stack_direction-is-unset.patch similarity index 100% rename from package/mysql/0003-ac_stack_direction-is-unset.patch rename to package/oracle-mysql/0003-ac_stack_direction-is-unset.patch diff --git a/package/mysql/0004-Fix-gen_lex_hash-execution.patch b/package/oracle-mysql/0004-Fix-gen_lex_hash-execution.patch similarity index 100% rename from package/mysql/0004-Fix-gen_lex_hash-execution.patch rename to package/oracle-mysql/0004-Fix-gen_lex_hash-execution.patch diff --git a/package/mysql/0005-bison_3_breaks_mysql_server_build.patch b/package/oracle-mysql/0005-bison_3_breaks_mysql_server_build.patch similarity index 100% rename from package/mysql/0005-bison_3_breaks_mysql_server_build.patch rename to package/oracle-mysql/0005-bison_3_breaks_mysql_server_build.patch diff --git a/package/mysql/0006-no-force-static-build.patch b/package/oracle-mysql/0006-no-force-static-build.patch similarity index 100% rename from package/mysql/0006-no-force-static-build.patch rename to package/oracle-mysql/0006-no-force-static-build.patch diff --git a/package/mysql/0007-dont-install-in-mysql-directory.patch b/package/oracle-mysql/0007-dont-install-in-mysql-directory.patch similarity index 100% rename from package/mysql/0007-dont-install-in-mysql-directory.patch rename to package/oracle-mysql/0007-dont-install-in-mysql-directory.patch diff --git a/package/mysql/S97mysqld b/package/oracle-mysql/S97mysqld similarity index 100% rename from package/mysql/S97mysqld rename to package/oracle-mysql/S97mysqld diff --git a/package/mysql/mysqld.service b/package/oracle-mysql/mysqld.service similarity index 100% rename from package/mysql/mysqld.service rename to package/oracle-mysql/mysqld.service diff --git a/package/mysql/mysql.hash b/package/oracle-mysql/oracle-mysql.hash similarity index 100% rename from package/mysql/mysql.hash rename to package/oracle-mysql/oracle-mysql.hash diff --git a/package/oracle-mysql/oracle-mysql.mk b/package/oracle-mysql/oracle-mysql.mk new file mode 100644 index 0000000000..ed3c0ea983 --- /dev/null +++ b/package/oracle-mysql/oracle-mysql.mk @@ -0,0 +1,136 @@ +################################################################################ +# +# oracle-mysql +# +################################################################################ + +ORACLE_MYSQL_VERSION_MAJOR = 5.1 +ORACLE_MYSQL_VERSION = $(ORACLE_MYSQL_VERSION_MAJOR).73 +ORACLE_MYSQL_SOURCE = mysql-$(ORACLE_MYSQL_VERSION).tar.gz +ORACLE_MYSQL_SITE = http://dev.mysql.com/get/Downloads/MySQL-$(ORACLE_MYSQL_VERSION_MAJOR) +ORACLE_MYSQL_INSTALL_STAGING = YES +ORACLE_MYSQL_DEPENDENCIES = readline ncurses +ORACLE_MYSQL_AUTORECONF = YES +ORACLE_MYSQL_LICENSE = GPLv2 +ORACLE_MYSQL_LICENSE_FILES = README COPYING +ORACLE_MYSQL_PROVIDES = mysql + +# Unix socket. This variable can also be consulted by other buildroot packages +MYSQL_SOCKET = /run/mysql/mysql.sock + +ORACLE_MYSQL_CONF_ENV = \ + ac_cv_sys_restartable_syscalls=yes \ + ac_cv_path_PS=/bin/ps \ + ac_cv_FIND_PROC="/bin/ps p \$\$PID | grep -v grep | grep mysqld > /dev/null" \ + ac_cv_have_decl_HAVE_IB_ATOMIC_PTHREAD_T_GCC=yes \ + ac_cv_have_decl_HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS=no \ + ac_cv_have_decl_HAVE_IB_GCC_ATOMIC_BUILTINS=yes \ + mysql_cv_new_rl_interface=yes + +ORACLE_MYSQL_CONF_OPTS = \ + --without-ndb-binlog \ + --without-docs \ + --without-man \ + --without-libedit \ + --without-readline \ + --with-low-memory \ + --enable-thread-safe-client \ + --with-unix-socket-path=$(MYSQL_SOCKET) \ + --disable-mysql-maintainer-mode + +# host-oracle-mysql only installs what is needed to build mysql, i.e. the +# gen_lex_hash tool, and it only builds the parts that are needed to +# create this tool +HOST_ORACLE_MYSQL_DEPENDENCIES = host-zlib host-ncurses + +HOST_ORACLE_MYSQL_CONF_OPTS = \ + --with-embedded-server \ + --disable-mysql-maintainer-mode + +define HOST_ORACLE_MYSQL_BUILD_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/include my_config.h + $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/mysys libmysys.a + $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/strings libmystrings.a + $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/vio libvio.a + $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/dbug libdbug.a + $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/regex libregex.a + $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/sql gen_lex_hash +endef + +define HOST_ORACLE_MYSQL_INSTALL_CMDS + $(INSTALL) -m 0755 $(@D)/sql/gen_lex_hash $(HOST_DIR)/usr/bin/ +endef + +ifeq ($(BR2_PACKAGE_OPENSSL),y) +ORACLE_MYSQL_DEPENDENCIES += openssl +endif + +ifeq ($(BR2_PACKAGE_ZLIB),y) +ORACLE_MYSQL_DEPENDENCIES += zlib +endif + +ifeq ($(BR2_PACKAGE_ORACLE_MYSQL_SERVER),y) +ORACLE_MYSQL_DEPENDENCIES += host-oracle-mysql host-bison + +ORACLE_MYSQL_CONF_OPTS += \ + --localstatedir=/var/mysql \ + --with-atomic-ops=up \ + --with-embedded-server \ + --without-query-cache \ + --without-plugin-partition \ + --without-plugin-daemon_example \ + --without-plugin-ftexample \ + --without-plugin-archive \ + --without-plugin-blackhole \ + --without-plugin-example \ + --without-plugin-federated \ + --without-plugin-ibmdb2i \ + --without-plugin-innobase \ + --without-plugin-innodb_plugin \ + --without-plugin-ndbcluster + +# Debugging is only available for the server, so no need for +# this if-block outside of the server if-block +ifeq ($(BR2_ENABLE_DEBUG),y) +ORACLE_MYSQL_CONF_OPTS += --with-debug=full +else +ORACLE_MYSQL_CONF_OPTS += --without-debug +endif + +define ORACLE_MYSQL_USERS + mysql -1 nogroup -1 * /var/mysql - - MySQL daemon +endef + +define ORACLE_MYSQL_ADD_FOLDER + $(INSTALL) -d $(TARGET_DIR)/var/mysql +endef + +ORACLE_MYSQL_POST_INSTALL_TARGET_HOOKS += ORACLE_MYSQL_ADD_FOLDER + +define ORACLE_MYSQL_INSTALL_INIT_SYSV + $(INSTALL) -D -m 0755 package/oracle-mysql/S97mysqld \ + $(TARGET_DIR)/etc/init.d/S97mysqld +endef + +define ORACLE_MYSQL_INSTALL_INIT_SYSTEMD + $(INSTALL) -D -m 644 package/mysql/mysqld.service \ + $(TARGET_DIR)/usr/lib/systemd/system/mysqld.service + mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants + ln -sf ../../../../usr/lib/systemd/system/mysqld.service \ + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mysqld.service +endef + +else +ORACLE_MYSQL_CONF_OPTS += \ + --without-server +endif + + +define ORACLE_MYSQL_REMOVE_TEST_PROGS + rm -rf $(TARGET_DIR)/usr/mysql-test $(TARGET_DIR)/usr/sql-bench +endef + +ORACLE_MYSQL_POST_INSTALL_TARGET_HOOKS += ORACLE_MYSQL_REMOVE_TEST_PROGS + +$(eval $(autotools-package)) +$(eval $(host-autotools-package))