--- ./CMakeLists.txt_orig	2020-01-25 03:07:52 +0000
+++ ./CMakeLists.txt	2020-01-25 03:09:11 +0000
@@ -82,10 +82,10 @@
 # glibc: check if fnmatch.h has FNM_CASEFOLD symbol
 include(CheckSymbolExists)
 list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
-check_symbol_exists(FNM_CASEFOLD "fnmatch.h" HAS_FNM_CASEFOLD)
-if(NOT HAS_FNM_CASEFOLD)
-    message(SEND_ERROR "FNM_CASEFOLD is not available in fnmatch.h")
-endif()
+#check_symbol_exists(FNM_CASEFOLD "fnmatch.h" HAS_FNM_CASEFOLD)
+#if(NOT HAS_FNM_CASEFOLD)
+#    message(SEND_ERROR "FNM_CASEFOLD is not available in fnmatch.h")
+#endif()
 
 # python
 if(WITH_BINDINGS)
--- ./libdnf/conf/ConfigMain.cpp_orig	2020-01-25 03:22:51 +0000
+++ ./libdnf/conf/ConfigMain.cpp	2020-01-25 03:23:45 +0000
@@ -185,7 +185,7 @@
     OptionNumber<std::int32_t> log_size{1024 * 1024, strToBytes};
     OptionNumber<std::int32_t> log_rotate{4, 0};
     OptionStringList varsdir{VARS_DIRS};
-    OptionStringList reposdir{{"/etc/yum.repos.d", "/etc/yum/repos.d", "/etc/distro.repos.d"}};
+    OptionStringList reposdir{{"/opt/freeware/etc/yum.repos.d", "/opt/freeware/etc/yum/repos.d", "/opt/freeware/etc/distro.repos.d"}};
     OptionBool debug_solver{false};
     OptionStringList installonlypkgs{INSTALLONLYPKGS};
     OptionStringList group_package_types{GROUP_PACKAGE_TYPES};
--- ./libdnf/dnf-cmd.cpp_orig	2020-01-25 03:23:58 +0000
+++ ./libdnf/dnf-cmd.cpp	2020-01-25 03:24:19 +0000
@@ -506,7 +506,7 @@
     }
 
     if (!opt_reposdir)
-        opt_reposdir = g_strdup("/etc/yum.repos.d");
+        opt_reposdir = g_strdup("/opt/freeware/etc/yum.repos.d");
 
     /* add filter if specified */
     priv->context = dnf_context_new();
--- ./libdnf/dnf-repo.cpp_orig	2020-01-25 03:24:35 +0000
+++ ./libdnf/dnf-repo.cpp	2020-01-25 03:25:13 +0000
@@ -1620,7 +1620,7 @@
 
     /* download to known location */
     g_debug("Downloading %s to %s", gpgkey, key_tmp);
-    fd = g_open(key_tmp, O_CLOEXEC | O_CREAT | O_RDWR, 0774);
+    fd = g_open(key_tmp, O_CREAT | O_RDWR, 0774);
     if (fd < 0) {
         g_set_error(error,
                     DNF_ERROR,
--- ./libdnf/hy-iutil.cpp_orig	2020-01-25 03:25:25 +0000
+++ ./libdnf/hy-iutil.cpp	2020-01-25 03:26:43 +0000
@@ -22,7 +22,11 @@
 #include <errno.h>
 #include <dirent.h>
 #include <fcntl.h>
+#ifndef _AIX
 #include <linux/limits.h>
+#else
+#include <limits.h>
+#endif
 #include <pwd.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -298,7 +302,7 @@
         *(strrchr(p, '/')) = '\0';
         ret = mkcachedir(p);
         if (g_str_has_suffix(path, "XXXXXX")) {
-            char *retptr = mkdtemp(path);
+            char *retptr = mktemp(path);
             if (retptr == NULL)
                 ret |= 1;
         } else
--- ./libdnf/hy-util.cpp_orig	2020-01-25 03:26:56 +0000
+++ ./libdnf/hy-util.cpp	2020-01-25 03:28:38 +0000
@@ -24,7 +24,9 @@
 #include <ctype.h>
 #include <sys/utsname.h>
 #include <sys/stat.h>
+#ifndef _AIX
 #include <sys/auxv.h>
+#endif
 
 // hawkey
 #include "dnf-types.h"
@@ -101,6 +103,7 @@
     if (uname(&un) < 0)
         return DNF_ERROR_FAILED;
 
+#if 0
     if (!strncmp(un.machine, "armv", 4)) {
         /* un.machine is armvXE, where X is version number and E is
          * endianness (b or l); we need to add modifiers such as
@@ -118,13 +121,14 @@
         *modifier++ = endian;
         *modifier = 0;
     }
+#endif
 #ifdef __MIPSEL__
     if (!strcmp(un.machine, "mips"))
         strcpy(un.machine, "mipsel");
     else if (!strcmp(un.machine, "mips64"))
         strcpy(un.machine, "mips64el");
 #endif
-    *arch = g_strdup(un.machine);
+    *arch = g_strdup(un.sysname);
     return 0;
 }
 
--- ./libdnf/repo/Repo.cpp_orig	2020-01-25 03:28:41 +0000
+++ ./libdnf/repo/Repo.cpp	2020-01-25 03:29:46 +0000
@@ -710,7 +710,7 @@
 
     // set GPG home dir
     char tmpdir[] = "/tmp/tmpdir.XXXXXX";
-    mkdtemp(tmpdir);
+    mktemp(tmpdir);
     Finalizer tmpDirRemover([&tmpdir](){
         dnf_remove_recursive(tmpdir, NULL);
     });
@@ -1147,7 +1147,7 @@
 {
     auto logger(Log::getLogger());
     char tmpdir[] = "/tmp/tmpdir.XXXXXX";
-    mkdtemp(tmpdir);
+    mktemp(tmpdir);
     Finalizer tmpDirRemover([&tmpdir](){
         dnf_remove_recursive(tmpdir, NULL);
     });
@@ -1217,7 +1217,7 @@
     auto logger(Log::getLogger());
     LrYumRepo *yum_repo;
     char tmpdir[] = "/tmp/tmpdir.XXXXXX";
-    mkdtemp(tmpdir);
+    mktemp(tmpdir);
     Finalizer tmpDirRemover([&tmpdir](){
         dnf_remove_recursive(tmpdir, NULL);
     });
@@ -1256,7 +1256,7 @@
                                              destdir, errTxt));
     }
     auto tmpdir = destdir + "/tmpdir.XXXXXX";
-    if (!mkdtemp(&tmpdir.front())) {
+    if (!mktemp(&tmpdir.front())) {
         const char * errTxt = strerror(errno);
         throw std::runtime_error(tfm::format(_("Cannot create repo temporary directory \"%s\": %s"),
                                              tmpdir.c_str(), errTxt));
--- ./libdnf/sack/query.cpp_orig	2020-01-25 03:30:00 +0000
+++ ./libdnf/sack/query.cpp	2020-01-25 03:32:02 +0000
@@ -49,7 +49,20 @@
 #include "libdnf/repo/solvable/Dependency.hpp"
 #include "libdnf/repo/solvable/DependencyContainer.hpp"
 
-
+ #ifndef HAVE_STRCASESTR
+ const char *strcasestr(const char *a, const char *b)
+ {
+     size_t l;
+     char f[3];
+ 
+     snprintf(f, sizeof(f), "%c%c", tolower(*b), toupper(*b));
+     for (l = strcspn(a, f); l != strlen(a); l += strcspn(a + l + 1, f) + 1)
+         if (strncasecmp(a + l, b, strlen(b)) == 0)
+             return(a + l);
+     return(NULL);
+ }
+ #endif
+ 
 namespace std {
 
 template<>
@@ -1152,7 +1165,7 @@
                     continue;
                 }
                 if (cmpType & HY_GLOB) {
-                    if (fnmatch(match, name, FNM_CASEFOLD) == 0)
+                    if (fnmatch(match, name, 0) == 0)
                         MAPSET(m, id);
                     continue;
                 }
@@ -1236,7 +1249,7 @@
 {
     Pool *pool = dnf_sack_get_pool(sack);
     int cmp_type = f.getCmpType();
-    int fn_flags = (HY_ICASE & cmp_type) ? FNM_CASEFOLD : 0;
+    int fn_flags = (HY_ICASE & cmp_type) ? 0 : 0;
     auto resultPset = result.get();
 
     for (auto match : f.getMatches()) {
--- ./python/hawkey/CMakeLists.txt_orig	2020-01-25 03:32:10 +0000
+++ ./python/hawkey/CMakeLists.txt	2020-01-25 03:32:23 +0000
@@ -50,4 +50,4 @@
 install(FILES __init__.py DESTINATION ${PYTHON_INSTALL_DIR}/hawkey)
 install(TARGETS _hawkeymodule LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}/hawkey)
 
-add_subdirectory(tests)
+#add_subdirectory(tests)
--- ./libdnf/conf/Const.hpp_orig	2020-05-23 07:44:09 +0000
+++ ./libdnf/conf/Const.hpp	2020-05-23 07:46:06 +0000
@@ -29,10 +29,10 @@
 constexpr const char * PERSISTDIR = "/var/lib/dnf";
 constexpr const char * SYSTEM_CACHEDIR = "/var/cache/dnf";
 
-constexpr const char * CONF_FILENAME = "/etc/dnf/dnf.conf";
+constexpr const char * CONF_FILENAME = "/opt/freeware/etc/dnf/dnf.conf";
 
 // More important varsdirs must be on the end of vector
-const std::vector<std::string> VARS_DIRS{"/etc/yum/vars", "/etc/dnf/vars"};
+const std::vector<std::string> VARS_DIRS{"/opt/freeware/etc/yum/vars", "/opt/freeware/etc/dnf/vars"};
 
 const std::vector<std::string> GROUP_PACKAGE_TYPES{"mandatory", "default", "conditional"};
 const std::vector<std::string> INSTALLONLYPKGS{"kernel", "kernel-PAE",
--- ./libdnf/module/ModulePackageContainer.cpp_orig	2020-05-23 07:51:47 +0000
+++ ./libdnf/module/ModulePackageContainer.cpp	2020-05-23 07:52:34 +0000
@@ -242,7 +242,7 @@
     repoImpl->needs_internalizing = 1;
     pImpl->installRoot = installRoot;
     g_autofree gchar * path = g_build_filename(pImpl->installRoot.c_str(),
-                                              "/etc/dnf/modules.d", NULL);
+                                              "/opt/freeware/etc/dnf/modules.d", NULL);
     std::unique_ptr<DIR> dir(opendir(path));
     if (dir) {
         struct dirent * ent;
@@ -299,7 +299,7 @@
 void ModulePackageContainer::addDefaultsFromDisk()
 {
     g_autofree gchar * dirPath = g_build_filename(
-            pImpl->installRoot.c_str(), "/etc/dnf/modules.defaults.d/", NULL);
+            pImpl->installRoot.c_str(), "/opt/freeware/etc/dnf/modules.defaults.d/", NULL);
 
     for (const auto &file : filesystem::getDirContent(dirPath)) {
         std::string yamlContent = getFileContent(file);
@@ -1067,7 +1067,7 @@
 
 void ModulePackageContainer::save()
 {
-    pImpl->persistor->save(pImpl->installRoot, "/etc/dnf/modules.d");
+    pImpl->persistor->save(pImpl->installRoot, "/opt/freeware/etc/dnf/modules.d");
 }
 
 void ModulePackageContainer::rollback()
