MDEV-30203 Move mysql symlinks to different package

For both Deb and RPM, create mariadb-client-compat and
mariadb-server-compat containing the mysql links to the mariadb
named executables/scripts.

The mariadb-client-core mysqlcheck was moved to mariadb-client-compat.

The symlinks in MYSQL_ADD_EXECUTABLE is tagged as a
{Client,Server}Symlinks component and placed in
the symlinks packages.

Man pages are restructured be installed into compat package
if that matches the executable.

Columnstore has a workaround as it doesn't use the cmake/plugin.cmake.

Scripts likewise have compatibility symlinks are in
the {server,client}-compat packages.

Co-author: Andrew Hutchings <andrew@linuxjedi.co.uk>

Closes #2390
This commit is contained in:
Daniel Black 2023-02-11 20:04:46 +01:00 committed by Sergei Golubchik
parent 36ea5dffe7
commit 9656356b55
15 changed files with 222 additions and 67 deletions

View file

@ -14,8 +14,10 @@ SET(CPACK_COMPONENT_INIFILES_GROUP "server")
SET(CPACK_COMPONENT_SERVER_SCRIPTS_GROUP "server")
SET(CPACK_COMPONENT_SUPPORTFILES_GROUP "server")
SET(CPACK_COMPONENT_DEVELOPMENT_GROUP "devel")
SET(CPACK_COMPONENT_DEVELOPMENTSYMLINKS_GROUP "devel")
SET(CPACK_COMPONENT_MANPAGESDEVELOPMENT_GROUP "devel")
SET(CPACK_COMPONENT_TEST_GROUP "test")
SET(CPACK_COMPONENT_TESTSYMLINKS_GROUP "test")
SET(CPACK_COMPONENT_CLIENT_GROUP "client")
SET(CPACK_COMPONENT_README_GROUP "server")
SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "shared")
@ -23,10 +25,12 @@ SET(CPACK_COMPONENT_COMMON_GROUP "common")
SET(CPACK_COMPONENT_CLIENTPLUGINS_GROUP "common")
SET(CPACK_COMPONENT_COMPAT_GROUP "compat")
SET(CPACK_COMPONENT_BACKUP_GROUP "backup")
SET(CPACK_COMPONENT_BACKUPSYMLINKS_GROUP "backup")
SET(CPACK_COMPONENTS_ALL Server IniFiles Server_Scripts SupportFiles
Development ManPagesDevelopment Readme Test Common
Client SharedLibraries ClientPlugins Backup
TestSymlinks BackupSymlinks DevelopmentSymlinks
)
SET(CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
@ -175,6 +179,24 @@ MACRO(SETA var)
ENDFOREACH()
ENDMACRO(SETA)
FOREACH(SYM_COMPONENT Server Client)
STRING(TOLOWER ${SYM_COMPONENT}-compat SYM)
SET(SYMCOMP ${SYM_COMPONENT}Symlinks)
STRING(TOUPPER ${SYMCOMP} SYMCOMP_UPPER)
SET(CPACK_COMPONENT_${SYMCOMP_UPPER}_GROUP "${SYM}")
SET(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL}" "${SYMCOMP}")
SET(CPACK_RPM_${SYM}_PACKAGE_SUMMARY "MySQL compatible symlinks for MariaDB database ${SYM_COMPONENT} binaries/scripts")
SET(CPACK_RPM_${SYM}_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_DESCRIPTION}")
SET(CPACK_RPM_${SYM}_PACKAGE_ARCHITECTURE "noarch")
SET(CPACK_RPM_${SYM}_USER_FILELIST ${ignored})
STRING(TOLOWER ${SYM_COMPONENT} SYM_COMPONENT_LOWER)
SET(CPACK_RPM_${SYM}_PACKAGE_REQUIRES "MariaDB-${SYM_COMPONENT_LOWER} >= 11.0.0")
SETA(CPACK_RPM_${SYM_COMPONENT_LOWER}_PACKAGE_RECOMMENDS "MariaDB-${SYM}")
ENDFOREACH()
SETA(CPACK_RPM_client_symlinks_PACKAGE_CONFLICTS
"MariaDB-server < 11.0.0")
SETA(CPACK_RPM_client_PACKAGE_OBSOLETES
"mysql-client"
"MySQL-client"
@ -185,6 +207,8 @@ SETA(CPACK_RPM_client_PACKAGE_PROVIDES
"mytop")
SETA(CPACK_RPM_client_PACKAGE_CONFLICTS
"MariaDB-server < 11.0.0")
SETA(CPACK_RPM_client_PACKAGE_REQUIRES
"MariaDB-common")
SETA(CPACK_RPM_common_PACKAGE_CONFLICTS
"MariaDB-server < 10.6.1")

View file

@ -66,7 +66,7 @@ FUNCTION(INSTALL_MANPAGES COMP)
SET(dst "${CMAKE_CURRENT_BINARY_DIR}/${s}.${n}")
FILE(WRITE ${dst} ".so man${n}/${f}.${n}")
INSTALL(FILES ${dst} DESTINATION ${INSTALL_MANDIR}/man${n}
COMPONENT ${COMP})
COMPONENT ${COMP}Symlinks)
ENDIF()
ENDFOREACH()
ENDFUNCTION()

View file

@ -106,7 +106,7 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${link}
DESTINATION
${ARG_DESTINATION}
COMPONENT ${COMP})
COMPONENT ${COMP}Symlinks)
ELSE()
# Windows note:
# Here, hardlinks are used, because cmake can't install symlinks.

View file

@ -250,7 +250,10 @@ MACRO(MYSQL_ADD_PLUGIN)
ELSE()
SET(ver "")
ENDIF()
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT})
STRING(TOUPPER ${ARG_COMPONENT} ARG_COMPONENT_UPPER)
SET(CPACK_COMPONENT_${ARG_COMPONENT_UPPER}SYMLINKS_GROUP ${ARG_COMPONENT} PARENT_SCOPE)
SET(CPACK_COMPONENT_${ARG_COMPONENT_UPPER}_GROUP ${ARG_COMPONENT} PARENT_SCOPE)
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT} ${ARG_COMPONENT}Symlinks)
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE)
IF (NOT ARG_CLIENT)

128
debian/control vendored
View file

@ -544,7 +544,8 @@ Provides: default-mysql-client,
virtual-mysql-client
Recommends: libdbd-mariadb-perl | libdbd-mysql-perl,
libdbi-perl,
libterm-readkey-perl
libterm-readkey-perl,
mariadb-client-compat
Description: MariaDB database client binaries
MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
@ -554,6 +555,81 @@ Description: MariaDB database client binaries
This package includes the client binaries and the additional tools
innotop and mariadb-report (mysqlreport).
Package: mariadb-client-compat
Architecture: all
Depends: mariadb-client (>= ${source:Version})
Multi-Arch: foreign
Description: MySQL compatibility links to mariadb-client binaries/scripts.
Conflicts: mariadb-client (< 11.0.0),
mariadb-client-10.0,
mariadb-client-10.1,
mariadb-client-10.2,
mariadb-client-10.3,
mariadb-client-10.4,
mariadb-client-10.5,
mariadb-client-10.6,
mariadb-client-10.7,
mariadb-client-10.8,
mariadb-client-5.1,
mariadb-client-5.2,
mariadb-client-5.3,
mariadb-client-5.5,
mariadb-client-core (< 11.0.0),
mariadb-client-core-10.0,
mariadb-client-core-10.1,
mariadb-client-core-10.2,
mariadb-client-core-10.3,
mariadb-client-core-10.4,
mariadb-client-core-10.5,
mariadb-client-core-10.6,
mariadb-client-core-10.7,
mariadb-client-core-10.8,
mariadb-client-core-5.1,
mariadb-client-core-5.2,
mariadb-client-core-5.3,
mariadb-client-core-5.5,
mysql-client (<< 5.0.51),
mysql-client (<< 5.0.51),
mysql-client-5.0,
mysql-client-5.1,
mysql-client-5.5,
mysql-client-5.6,
mysql-client-5.7,
mysql-client-8.0,
mysql-client-core-5.0,
mysql-client-core-5.1,
mysql-client-core-5.5,
mysql-client-core-5.6,
mysql-client-core-5.7,
mysql-client-core-8.0,
mariadb-server (< 11.0.0),
mariadb-server-10.0,
mariadb-server-10.1,
mariadb-server-10.2,
mariadb-server-10.3,
mariadb-server-10.4,
mariadb-server-10.5,
mariadb-server-10.6,
mariadb-server-10.7,
mariadb-server-10.8,
mariadb-server-core (< 11.0.0),
mariadb-server-core-10.0,
mariadb-server-core-10.1,
mariadb-server-core-10.2,
mariadb-server-core-10.3,
mariadb-server-core-10.4,
mariadb-server-core-10.5,
mariadb-server-core-10.6,
mariadb-server-core-10.7,
mariadb-server-core-10.8,
mysql-server-core-8.0,
mysql-server-5.7,
percona-server-server-5.6,
percona-server-server,
percona-xtradb-cluster-server-5.6,
percona-xtradb-cluster-server-5.7,
percona-xtradb-cluster-server
Package: mariadb-server-core
Architecture: any
Depends: mariadb-common (>= ${source:Version}),
@ -668,7 +744,8 @@ Suggests: mailx,
mariadb-test,
netcat-openbsd
Recommends: libhtml-template-perl,
pv
pv,
mariadb-server-compat
Pre-Depends: adduser (>= 3.40),
debconf,
mariadb-common (>= ${source:Version})
@ -772,6 +849,53 @@ Description: MariaDB database server binaries
.
This package includes the server binaries.
Package: mariadb-server-compat
Architecture: all
Depends: mariadb-server (>= ${source:Version}),
Multi-Arch: foreign
Description: MySQL compatibility links to mariadb-server binaries/scripts.
Conflicts: mariadb-server-core (< 11.0.0),
mariadb-server-core-10.0,
mariadb-server-core-10.1,
mariadb-server-core-10.2,
mariadb-server-core-10.3,
mariadb-server-core-10.4,
mariadb-server-core-10.5,
mariadb-server-core-10.6,
mariadb-server-core-10.7,
mariadb-server-core-10.8,
mariadb-server-core-5.1,
mariadb-server-core-5.2,
mariadb-server-core-5.3,
mariadb-server-core-5.5,
mariadb-server (< 11.0.0),
mariadb-server-10.0,
mariadb-server-10.1,
mariadb-server-10.2,
mariadb-server-10.3,
mariadb-server-10.4,
mariadb-server-10.5,
mariadb-server-10.6,
mariadb-server-10.7,
mariadb-server-10.8,
mariadb-server-5.1,
mariadb-server-5.2,
mariadb-server-5.3,
mariadb-server-5.5,
mysql-server-5.0,
mysql-server-core-5.0,
mysql-server-core-5.1,
mysql-server-core-5.5,
mysql-server-core-5.6,
mysql-server-core-5.7,
mysql-server-core-8.0,
percona-server-server-5.6,
percona-server-server-5.7,
percona-server-server,
percona-xtradb-cluster-server-5.6,
percona-xtradb-cluster-server-5.7,
percona-xtradb-cluster-server
Package: mariadb-backup
Architecture: any
Breaks: mariadb-backup-10.1,

38
debian/mariadb-client-compat.install vendored Normal file
View file

@ -0,0 +1,38 @@
usr/bin/mysql
usr/bin/mysqlbinlog
usr/bin/mysql_convert_table_format
usr/bin/mysql_find_rows
usr/bin/mysql_fix_extensions
usr/bin/mysql_plugin
usr/bin/mysql_setpermission
usr/bin/mysql_tzinfo_to_sql
usr/bin/mysql_waitpid
usr/bin/mysqlaccess
usr/bin/mysqladmin
usr/bin/mysqlcheck
usr/bin/mysqldump
usr/bin/mysqldumpslow
usr/bin/mysqlhotcopy
usr/bin/mysqlimport
usr/bin/mysql_secure_installation
usr/bin/mysqlshow
usr/bin/mysqlslap
usr/share/man/man1/mysql.1
usr/share/man/man1/mysql_convert_table_format.1
usr/share/man/man1/mysql_find_rows.1
usr/share/man/man1/mysql_fix_extensions.1
usr/share/man/man1/mysql_plugin.1
usr/share/man/man1/mysql_secure_installation.1
usr/share/man/man1/mysql_setpermission.1
usr/share/man/man1/mysql_tzinfo_to_sql.1
usr/share/man/man1/mysql_waitpid.1
usr/share/man/man1/mysqlaccess.1
usr/share/man/man1/mysqladmin.1
usr/share/man/man1/mysqlbinlog.1
usr/share/man/man1/mysqldump.1
usr/share/man/man1/mysqldumpslow.1
usr/share/man/man1/mysqlhotcopy.1
usr/share/man/man1/mysqlimport.1
usr/share/man/man1/mysqlshow.1
usr/share/man/man1/mysqlslap.1
usr/share/man/man1/mysqlcheck.1

9
debian/mariadb-client-compat.links vendored Normal file
View file

@ -0,0 +1,9 @@
usr/bin/mariadb-check usr/bin/mysqlanalyze
usr/bin/mariadb-check usr/bin/mysqlcheck
usr/bin/mariadb-check usr/bin/mysqloptimize
usr/bin/mariadb-check usr/bin/mysqlrepair
usr/bin/mariadb-report usr/bin/mysqlreport
usr/share/man/man1/mariadb-check.1.gz usr/share/man/man1/mysqlanalyze.1.gz
usr/share/man/man1/mariadb-check.1.gz usr/share/man/man1/mysqloptimize.1.gz
usr/share/man/man1/mariadb-check.1.gz usr/share/man/man1/mysqlrepair.1.gz
usr/share/man/man1/mariadb-report.1.gz usr/share/man/man1/mysqlreport.1.gz

View file

@ -1,9 +1,6 @@
usr/bin/mariadb
usr/bin/mariadb-check
usr/bin/my_print_defaults
usr/bin/mysql
usr/share/man/man1/mariadb-check.1
usr/share/man/man1/mariadb.1
usr/share/man/man1/my_print_defaults.1
usr/share/man/man1/mysql.1
usr/share/man/man1/mysqlcheck.1

View file

@ -22,17 +22,6 @@ usr/bin/mariadb-slap
usr/bin/mariadb-tzinfo-to-sql
usr/bin/mariadb-waitpid
usr/bin/msql2mysql
usr/bin/mysql_find_rows
usr/bin/mysql_fix_extensions
usr/bin/mysql_waitpid
usr/bin/mysqlaccess
usr/bin/mysqladmin
usr/bin/mysqlcheck
usr/bin/mysqldump
usr/bin/mysqldumpslow
usr/bin/mysqlimport
usr/bin/mysqlshow
usr/bin/mysqlslap
usr/bin/mytop
usr/bin/perror
usr/bin/replace
@ -56,23 +45,6 @@ usr/share/man/man1/mariadb-slap.1
usr/share/man/man1/mariadb-tzinfo-to-sql.1
usr/share/man/man1/mariadb-waitpid.1
usr/share/man/man1/msql2mysql.1
usr/share/man/man1/mysql_convert_table_format.1
usr/share/man/man1/mysql_find_rows.1
usr/share/man/man1/mysql_fix_extensions.1
usr/share/man/man1/mysql_plugin.1
usr/share/man/man1/mysql_secure_installation.1
usr/share/man/man1/mysql_setpermission.1
usr/share/man/man1/mysql_tzinfo_to_sql.1
usr/share/man/man1/mysql_waitpid.1
usr/share/man/man1/mysqlaccess.1
usr/share/man/man1/mysqladmin.1
usr/share/man/man1/mysqlbinlog.1
usr/share/man/man1/mysqldump.1
usr/share/man/man1/mysqldumpslow.1
usr/share/man/man1/mysqlhotcopy.1
usr/share/man/man1/mysqlimport.1
usr/share/man/man1/mysqlshow.1
usr/share/man/man1/mysqlslap.1
usr/share/man/man1/mytop.1
usr/share/man/man1/perror.1
usr/share/man/man1/replace.1

View file

@ -2,16 +2,7 @@ usr/bin/mariadb-check usr/bin/mariadb-analyze
usr/bin/mariadb-check usr/bin/mariadb-optimize
usr/bin/mariadb-check usr/bin/mariadb-repair
usr/bin/mariadb-check usr/bin/mariadbcheck
usr/bin/mariadb-check usr/bin/mysqlanalyze
usr/bin/mariadb-check usr/bin/mysqlcheck
usr/bin/mariadb-check usr/bin/mysqloptimize
usr/bin/mariadb-check usr/bin/mysqlrepair
usr/bin/mariadb-report usr/bin/mysqlreport
usr/share/man/man1/mariadb-check.1.gz usr/share/man/man1/mariadb-analyze.1.gz
usr/share/man/man1/mariadb-check.1.gz usr/share/man/man1/mariadb-optimize.1.gz
usr/share/man/man1/mariadb-check.1.gz usr/share/man/man1/mariadb-repair.1.gz
usr/share/man/man1/mariadb-check.1.gz usr/share/man/man1/mariadbcheck.1.gz
usr/share/man/man1/mariadb-check.1.gz usr/share/man/man1/mysqlanalyze.1.gz
usr/share/man/man1/mariadb-check.1.gz usr/share/man/man1/mysqloptimize.1.gz
usr/share/man/man1/mariadb-check.1.gz usr/share/man/man1/mysqlrepair.1.gz
usr/share/man/man1/mariadb-report.1.gz usr/share/man/man1/mysqlreport.1.gz

12
debian/mariadb-server-compat.install vendored Normal file
View file

@ -0,0 +1,12 @@
usr/bin/mysqld_multi
usr/bin/mysqld_safe
usr/bin/mysqld_safe_helper
usr/bin/mysql_install_db
usr/bin/mysql_upgrade
usr/sbin/mysqld
usr/share/man/man1/mysqld_multi.1
usr/share/man/man1/mysqld_safe.1
usr/share/man/man1/mysqld_safe_helper.1
usr/share/man/man1/mysql_install_db.1
usr/share/man/man1/mysql_upgrade.1
usr/share/man/man8/mysqld.8

View file

@ -1,19 +1,13 @@
usr/bin/innochecksum
usr/bin/mariadb-install-db
usr/bin/mariadb-upgrade
usr/bin/mysql_install_db
usr/bin/mysql_upgrade
usr/bin/resolveip
usr/sbin/mariadbd
usr/sbin/mysqld
usr/share/man/man1/innochecksum.1
usr/share/man/man1/mariadb-install-db.1
usr/share/man/man1/mariadb-upgrade.1
usr/share/man/man1/mysql_install_db.1
usr/share/man/man1/mysql_upgrade.1
usr/share/man/man1/resolveip.1
usr/share/man/man8/mariadbd.8
usr/share/man/man8/mysqld.8
usr/share/mysql/bulgarian
usr/share/mysql/charsets
usr/share/mysql/chinese

View file

@ -27,16 +27,6 @@ usr/bin/myisam_ftdump
usr/bin/myisamchk
usr/bin/myisamlog
usr/bin/myisampack
usr/bin/mysql_convert_table_format
usr/bin/mysql_plugin
usr/bin/mysql_secure_installation
usr/bin/mysql_setpermission
usr/bin/mysql_tzinfo_to_sql
usr/bin/mysqlbinlog
usr/bin/mysqld_multi
usr/bin/mysqld_safe
usr/bin/mysqld_safe_helper
usr/bin/mysqlhotcopy
usr/bin/wsrep_sst_common
usr/bin/wsrep_sst_mariabackup
usr/bin/wsrep_sst_mysqldump
@ -80,9 +70,6 @@ usr/share/man/man1/myisam_ftdump.1
usr/share/man/man1/myisamchk.1
usr/share/man/man1/myisamlog.1
usr/share/man/man1/myisampack.1
usr/share/man/man1/mysqld_multi.1
usr/share/man/man1/mysqld_safe.1
usr/share/man/man1/mysqld_safe_helper.1
usr/share/man/man1/wsrep_sst_common.1
usr/share/man/man1/wsrep_sst_mariabackup.1
usr/share/man/man1/wsrep_sst_mysqldump.1

View file

@ -223,7 +223,7 @@ IF(UNIX AND NOT WITHOUT_SERVER)
DESTINATION ${INSTALL_SCRIPTDIR}
COMPONENT Server)
INSTALL_LINK(mariadb-install-db mysql_install_db ${INSTALL_SCRIPTDIR} Server)
INSTALL_LINK(mariadb-install-db mysql_install_db ${INSTALL_SCRIPTDIR} ServerSymlinks)
ENDIF()
SET(prefix "${CMAKE_INSTALL_PREFIX}")
@ -385,7 +385,7 @@ ELSE()
# Create symlink
IF (NOT ${binname} STREQUAL ${file})
INSTALL_LINK(${file} ${binname} ${INSTALL_BINDIR} ${${file}_COMPONENT})
INSTALL_LINK(${file} ${binname} ${INSTALL_BINDIR} ${${file}_COMPONENT}Symlinks)
ENDIF()
ENDFOREACH()
ENDIF()

View file

@ -28,10 +28,14 @@ CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
add_subdirectory(columnstore)
IF(TARGET columnstore)
# Redo logic in cmake/plugin to prevent the attempted creation of *Symlinks package
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} columnstore-engineSymlinks)
SET(CPACK_COMPONENT_COLUMNSTORE-ENGINESYMLINKS_GROUP columnstore-engine PARENT_SCOPE)
SET(CPACK_COMPONENT_COLUMNSTORE-ENGINE_GROUP columnstore-engine PARENT_SCOPE)
# Needed to bump the component changes up to the main scope
APPEND_FOR_CPACK(CPACK_COMPONENTS_ALL)
IF (RPM)
APPEND_FOR_CPACK(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES " binutils net-tools python3")
APPEND_FOR_CPACK(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES " binutils net-tools python3 MariaDB-client-compat MariaDB-server-compat")
APPEND_FOR_CPACK(CPACK_RPM_columnstore-engine_PACKAGE_RECOMMENDS " jemalloc")
APPEND_FOR_CPACK(CPACK_RPM_columnstore-engine_USER_FILELIST ";%ignore /var/lib;%ignore /var")
APPEND_FOR_CPACK(CPACK_RPM_columnstore-engine_PACKAGE_CONFLICTS " thrift MariaDB-columnstore-platform MariaDB-columnstore-libs")