Blame SOURCES/mysql-paths.patch

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