Blame SOURCES/mysql-paths.patch

2aefdf
Some hard-coded paths make problems when package is built into chroot like
2aefdf
Software Collections. Removing these hard-coded paths should fix it.
2aefdf
2aefdf
Upstream report: https://mariadb.atlassian.net/browse/MDEV-6485
2aefdf
2aefdf
diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake
2aefdf
index 9f7945d8..6734cdfd 100644
2aefdf
--- a/cmake/install_layout.cmake
2aefdf
+++ b/cmake/install_layout.cmake
2aefdf
@@ -105,7 +105,7 @@ IF(UNIX)
2aefdf
     " Choose between ${VALID_INSTALL_LAYOUTS}" )
2aefdf
   ENDIF()
2aefdf
 
2aefdf
-  SET(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc"
2aefdf
+  SET(SYSCONFDIR "/etc"
2aefdf
     CACHE PATH "config directory (for my.cnf)")
2aefdf
   MARK_AS_ADVANCED(SYSCONFDIR)
2aefdf
 ENDIF()
2aefdf
@@ -189,6 +189,7 @@ SET(INSTALL_SECURE_FILE_PRIVDIR_TARGZ ${secure_file_priv_path})
2aefdf
 #
2aefdf
 SET(INSTALL_BINDIR_RPM                  "bin")
2aefdf
 SET(INSTALL_SBINDIR_RPM                 "sbin")
2aefdf
+SET(INSTALL_SYSCONFDIR_RPM              "/etc")
2aefdf
 #
2aefdf
 IF(CMAKE_SYSTEM_PROCESSOR IN_LIST KNOWN_64BIT_ARCHITECTURES)
2aefdf
   SET(INSTALL_LIBDIR_RPM                "lib64/mysql")
2aefdf
diff --git a/mysys/my_default.cc b/mysys/my_default.cc
2aefdf
index 290f1666..8403425f 100644
2aefdf
--- a/mysys/my_default.cc
2aefdf
+++ b/mysys/my_default.cc
2aefdf
@@ -1570,12 +1570,12 @@ static const char **init_default_directories(MEM_ROOT *alloc) {
2aefdf
 
2aefdf
 #else
2aefdf
 
2aefdf
-  errors += add_directory(alloc, "/etc/", dirs);
2aefdf
-  errors += add_directory(alloc, "/etc/mysql/", dirs);
2aefdf
-
2aefdf
 #if defined(DEFAULT_SYSCONFDIR)
2aefdf
   if (DEFAULT_SYSCONFDIR[0])
2aefdf
+  {
2aefdf
     errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs);
2aefdf
+    errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs);
2aefdf
+  }
2aefdf
 #endif /* DEFAULT_SYSCONFDIR */
2aefdf
 
2aefdf
 #endif
2aefdf
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
2aefdf
index 4149a764..b091d5e2 100644
2aefdf
--- a/scripts/CMakeLists.txt
2aefdf
+++ b/scripts/CMakeLists.txt
2aefdf
@@ -288,9 +288,9 @@ IF(UNIX)
2aefdf
 ENDIF(UNIX)
2aefdf
 
2aefdf
 SET(prefix "${CMAKE_INSTALL_PREFIX}")
2aefdf
-SET(sysconfdir ${prefix})
2aefdf
+SET(sysconfdir ${SYSCONFDIR})
2aefdf
 SET(bindir ${prefix}/${INSTALL_BINDIR})
2aefdf
-SET(libexecdir ${prefix}/${INSTALL_SBINDIR})
2aefdf
+SET(libexecdir ${prefix}/${INSTALL_LIBEXECDIR})
2aefdf
 SET(datadir ${prefix}/${INSTALL_MYSQLSHAREDIR})
2aefdf
 SET(libsubdir  ${INSTALL_LIBDIR})
2aefdf
 SET(pkgincludedir ${prefix}/${INSTALL_INCLUDEDIR})
2aefdf
diff --git a/scripts/mysqld_multi.pl.in b/scripts/mysqld_multi.pl.in
2aefdf
index 84dd4d7c..50397ddd 100644
2aefdf
--- a/scripts/mysqld_multi.pl.in
2aefdf
+++ b/scripts/mysqld_multi.pl.in
2aefdf
@@ -586,9 +586,7 @@ sub list_defaults_files
2aefdf
 
2aefdf
   my %seen;  # Don't list the same file more than once
2aefdf
   return grep { defined $_ and not $seen{$_}++ and -f $_ and -r $_ }
2aefdf
-              ('/etc/my.cnf',
2aefdf
-               '/etc/mysql/my.cnf',
2aefdf
-               '@sysconfdir@/my.cnf',
2aefdf
+              ('@sysconfdir@/my.cnf',
2aefdf
                ($ENV{MYSQL_HOME} ? "$ENV{MYSQL_HOME}/my.cnf" : undef),
2aefdf
                $opt{'extra-file'},
2aefdf
                ($ENV{HOME} ? "$ENV{HOME}/.my.cnf" : undef));