diff -ruN kdelibs4support-5.29.0-orig/cmake/FindDocBookXML4.cmake kdelibs4support-5.29.0/cmake/FindDocBookXML4.cmake
--- kdelibs4support-5.29.0-orig/cmake/FindDocBookXML4.cmake	2016-12-10 09:32:28.000000000 -0600
+++ kdelibs4support-5.29.0/cmake/FindDocBookXML4.cmake	2017-01-16 06:03:26.000000000 -0600
@@ -16,7 +16,7 @@
 
 
 if (NOT DocBookXML_FIND_VERSION)
-     set(DocBookXML_FIND_VERSION "4.2")
+     set(DocBookXML_FIND_VERSION "4.2.0")
 endif ()
 
 set (DocBookXML4_DTD_VERSION ${DocBookXML_FIND_VERSION}
@@ -30,6 +30,7 @@
 function (locate_version version found_dir)
 
     set (DTD_PATH_LIST
+        share/xml/dtd/docbookx/${version}
         share/xml/docbook/schema/dtd/${version}
         share/xml/docbook/xml-dtd-${version}
         share/sgml/docbook/xml-dtd-${version}
diff -ruN kdelibs4support-5.29.0-orig/src/CMakeLists.txt kdelibs4support-5.29.0/src/CMakeLists.txt
--- kdelibs4support-5.29.0-orig/src/CMakeLists.txt	2016-12-10 09:32:28.000000000 -0600
+++ kdelibs4support-5.29.0/src/CMakeLists.txt	2017-01-16 06:14:28.000000000 -0600
@@ -236,6 +236,7 @@
 endif ()
 
 if (APPLE)
+    add_definitions(-DBUNDLE_INSTALL_DIR="\\"${BUNDLE_INSTALL_DIR}\\"")
     set(libkdelibs4support_SRCS ${libkdelibs4support_SRCS}
                             kdecore/klocale_mac.cpp
                             )
@@ -584,12 +585,12 @@
    install(PROGRAMS kio/fileshareset DESTINATION ${KDE_INSTALL_LIBEXECDIR_KF5} )
 
    install(CODE "
-     set(FILESHARESET_PATH \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${KDE_INSTALL_LIBEXECDIR_KF5}/fileshareset\")
-        EXECUTE_PROCESS(COMMAND sh -c \"chown 0 '\${FILESHARESET_PATH}' && chmod u+s '\${FILESHARESET_PATH}'\")
+     set(FILESHARESET_PATH \"\$ENV{DESTDIR}${KDE_INSTALL_LIBEXECDIR_KF5}/fileshareset\")
+        EXECUTE_PROCESS(COMMAND sh -c \"chmod u+s '\${FILESHARESET_PATH}'\")
    ")
 
    # write a cmake script file which creates the symlink
-   file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_fileshare_symlink.cmake "exec_program(${CMAKE_COMMAND} ARGS -E create_symlink fileshareset \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${KDE_INSTALL_LIBEXECDIR_KF5}/filesharelist\")\n")
+   file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_fileshare_symlink.cmake "exec_program(${CMAKE_COMMAND} ARGS -E create_symlink fileshareset \"\$ENV{DESTDIR}${KDE_INSTALL_LIBEXECDIR_KF5}/filesharelist\")\n")
    # and add it as post-install script to any of the installed targets, so it will be executed during "make install"
    set_target_properties(KF5KDELibs4Support PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/make_fileshare_symlink.cmake)
 endif ()
diff -ruN kdelibs4support-5.29.0-orig/src/kdecore/kmimetyperepository.cpp kdelibs4support-5.29.0/src/kdecore/kmimetyperepository.cpp
--- kdelibs4support-5.29.0-orig/src/kdecore/kmimetyperepository.cpp	2016-12-10 09:32:28.000000000 -0600
+++ kdelibs4support-5.29.0/src/kdecore/kmimetyperepository.cpp	2017-01-16 06:03:26.000000000 -0600
@@ -148,6 +148,7 @@
 #elif defined(Q_OS_OPENBSD) || defined(Q_OS_NETBSD) || defined(Q_OS_SOLARIS)
     paths << QLatin1String("/usr/local/lib/pkgconfig"); // {Net,Open}BSD/OpenSolaris
 #elif defined (Q_OS_UNIX)
+    paths << QLatin1String("@FINK_PREFIX@/share/pkgconfig");
     paths << QLatin1String("/usr/share/pkgconfig"); // Linux and all other unix
 #endif
 }
diff -ruN kdelibs4support-5.29.0-orig/src/kdecore/kstandarddirs.cpp kdelibs4support-5.29.0/src/kdecore/kstandarddirs.cpp
--- kdelibs4support-5.29.0-orig/src/kdecore/kstandarddirs.cpp	2016-12-10 09:32:28.000000000 -0600
+++ kdelibs4support-5.29.0/src/kdecore/kstandarddirs.cpp	2017-01-16 06:16:16.000000000 -0600
@@ -1339,6 +1339,10 @@
         exePaths << KShell::tildeExpand(tokens[ i ]);
     }
 
+#ifdef Q_OS_MACOS
+    exePaths << QString::fromLatin1(BUNDLE_INSTALL_DIR);
+#endif
+
     return exePaths;
 }
 
@@ -1899,8 +1903,8 @@
     } else {
         xdgdirList = kdedirDataDirs;
 #ifndef Q_OS_WIN
-        xdgdirList.append(QString::fromLatin1("/usr/local/share/"));
-        xdgdirList.append(QString::fromLatin1("/usr/share/"));
+        xdgdirList.append(QString::fromLatin1("@KF5_SHAREDIR@/"));
+        xdgdirList.append(QString::fromLatin1("@FINK_PREFIX/share/"));
 #endif
     }
 
diff -ruN kdelibs4support-5.29.0-orig/src/kdeui/kaction.cpp kdelibs4support-5.29.0/src/kdeui/kaction.cpp
--- kdelibs4support-5.29.0-orig/src/kdeui/kaction.cpp	2016-12-10 09:32:28.000000000 -0600
+++ kdelibs4support-5.29.0/src/kdeui/kaction.cpp	2017-01-16 06:07:34.000000000 -0600
@@ -36,6 +36,38 @@
 
 #include <kdebug.h>
 
+#ifdef Q_OS_MACOS
+#include <kcmdlineargs.h>
+#include <k4aboutdata.h>
+
+static void setTextWithCorrectMenuRole( KAction *action, const QString &text )
+{
+    // texts containing "config, options, setup, settings or preferences" will get PreferencesRole
+    // from Qt unless they have a role set. We prevent that, because KDE has its own way of
+    // defining a the application preferences menu ("Configure <appName>") which should go under the OS X Preferences menu.
+    // But when a KAction is created with the standard preferences title ("Configure <appName>..."), this action
+    // is set to PreferencesRole .
+    action->setText(text);
+    if( text.contains("config", Qt::CaseInsensitive)
+        || text.contains("options", Qt::CaseInsensitive)
+        || text.contains("setup", Qt::CaseInsensitive)
+        || text.contains("settings", Qt::CaseInsensitive)
+        || text.contains("preferences", Qt::CaseInsensitive)
+    ){
+        const K4AboutData *aboutData = KCmdLineArgs::aboutData();
+        QString prefsText = i18n( "Configure %1...", (aboutData) ? aboutData->programName() : qApp->applicationName() );
+        if( text == prefsText || text == "&" % prefsText ){
+            qDebug() << "### Setting QAction::PreferencesRole from" << action->menuRole() << "for menuAction with text" << text;
+            action->setMenuRole(QAction::PreferencesRole);
+        }
+        else{
+            qDebug() << "### Setting QAction::NoRole from" << action->menuRole() << "for menuAction with text" << text;
+            action->setMenuRole(QAction::NoRole);
+        }
+    }
+}
+#endif //Q_OS_MACOS
+
 //---------------------------------------------------------------------
 // KActionPrivate
 //---------------------------------------------------------------------
@@ -80,13 +112,20 @@
     : QWidgetAction(parent), d(new KActionPrivate)
 {
     d->init(this);
+    // effective only on OS X : don't let Qt guesstimate where (in what menu)
+    // an as yet unnamed menu item should be added.
+    setMenuRole(QAction::NoRole);
 }
 
 KAction::KAction(const QString &text, QObject *parent)
     : QWidgetAction(parent), d(new KActionPrivate)
 {
     d->init(this);
+#ifdef Q_OS_MACOS
+    setTextWithCorrectMenuRole(this, text);
+#else
     setText(text);
+#endif //Q_OS_MACOS
 }
 
 KAction::KAction(const QIcon &icon, const QString &text, QObject *parent)
@@ -94,7 +133,11 @@
 {
     d->init(this);
     setIcon(icon);
+#ifdef Q_OS_MACOS
+    setTextWithCorrectMenuRole(this, text);
+#else
     setText(text);
+#endif //Q_OS_MACOS
 }
 
 KAction::~KAction()
diff -ruN kdelibs4support-5.29.0-orig/src/kdeui/kapplication.cpp kdelibs4support-5.29.0/src/kdeui/kapplication.cpp
--- kdelibs4support-5.29.0-orig/src/kdeui/kapplication.cpp	2016-12-10 09:32:28.000000000 -0600
+++ kdelibs4support-5.29.0/src/kdeui/kapplication.cpp	2017-01-16 06:17:51.000000000 -0600
@@ -762,7 +762,7 @@
     if (args && args->isSet("icon")) {
         q->setWindowIcon(QIcon::fromTheme(args->getOption("icon")));
     } else {
-        q->setWindowIcon(QIcon::fromTheme(componentData.aboutData()->programIconName()));
+        q->setWindowIcon(QIcon::fromTheme(componentData.aboutData()->programIconName(), q->windowIcon()));
     }
 
     if (!args) {
diff -ruN kdelibs4support-5.29.0-orig/src/kdeui/kglobalsettings.cpp kdelibs4support-5.29.0/src/kdeui/kglobalsettings.cpp
--- kdelibs4support-5.29.0-orig/src/kdeui/kglobalsettings.cpp	2016-12-10 09:32:28.000000000 -0600
+++ kdelibs4support-5.29.0/src/kdeui/kglobalsettings.cpp	2017-01-16 06:05:09.000000000 -0600
@@ -81,7 +81,12 @@
         , isX11(QX11Info::isPlatformX11())
 #endif
     {
+#ifdef Q_OS_MACOS
+        // provide support for all features unlocked when KDE_FULL_SESSION is set
+		kdeFullSession = true;
+#else
         kdeFullSession = !qgetenv("KDE_FULL_SESSION").isEmpty();
+#endif
     }
 
     QPalette createApplicationPalette(const KSharedConfigPtr &config);
diff -ruN kdelibs4support-5.29.0-orig/src/kio/fileshareset kdelibs4support-5.29.0/src/kio/fileshareset
--- kdelibs4support-5.29.0-orig/src/kio/fileshareset	2016-12-10 09:32:28.000000000 -0600
+++ kdelibs4support-5.29.0/src/kio/fileshareset	2017-01-16 06:03:26.000000000 -0600
@@ -6,7 +6,7 @@
 $nfs_exports::default_options = '*(ro,all_squash)';
 $nfs_exports::conf_file = '/etc/exports';
 $smb_exports::conf_file = '/etc/samba/smb.conf';
-my $authorisation_file = '/etc/security/fileshare.conf';
+my $authorisation_file = '@KF5_ETCDIR@/security/fileshare.conf';
 my $authorisation_group = 'fileshare';
 
 
diff -ruN kdelibs4support-5.29.0-orig/src/kio/kfileshare.cpp kdelibs4support-5.29.0/src/kio/kfileshare.cpp
--- kdelibs4support-5.29.0-orig/src/kio/kfileshare.cpp	2016-12-10 09:32:28.000000000 -0600
+++ kdelibs4support-5.29.0/src/kio/kfileshare.cpp	2017-01-16 06:03:26.000000000 -0600
@@ -42,18 +42,18 @@
 static QString s_fileShareGroup;
 static bool s_sharingEnabled;
 
-#define FILESHARECONF "/etc/security/fileshare.conf"
+#define FILESHARECONF "@KF5_ETCDIR@/security/fileshare.conf"
 
 static QString findExe(const char *exeName)
 {
     // Normally fileshareset and filesharelist are installed in libexec/kf5;
-    // allow distributions to move it somewhere else in the PATH or in /usr/sbin.
+    // allow distributions to move it somewhere else in the PATH or in @KF5_LIBEXECDIR@/sbin.
     QString exe = QStandardPaths::findExecutable(exeName);
     if (exe.isEmpty()) {
-        exe = QStandardPaths::findExecutable(exeName, QStringList() << "/usr/sbin");
+        exe = QStandardPaths::findExecutable(exeName, QStringList() << "@FINK_PREFIX@/sbin");
     }
     if (exe.isEmpty()) {
-        qWarning() << exeName << "not found in PATH nor in /usr/sbin";
+        qWarning() << exeName << "not found in PATH nor in @FINK_PREFIX@/sbin";
     }
     return exe;
 }
diff -ruN kdelibs4support-5.29.0-orig/src/kssl/kopenssl.cpp kdelibs4support-5.29.0/src/kssl/kopenssl.cpp
--- kdelibs4support-5.29.0-orig/src/kssl/kopenssl.cpp	2016-12-10 09:32:28.000000000 -0600
+++ kdelibs4support-5.29.0/src/kssl/kopenssl.cpp	2017-01-16 06:03:26.000000000 -0600
@@ -333,10 +333,9 @@
 #endif
             << "/usr/lib" KDELIBSUFF "/"
             << "/usr/ssl/lib" KDELIBSUFF "/"
-            << "/usr/local/lib" KDELIBSUFF "/"
-            << "/usr/local/openssl/lib" KDELIBSUFF "/"
-            << "/usr/local/ssl/lib" KDELIBSUFF "/"
-            << "/opt/openssl/lib" KDELIBSUFF "/"
+            << "@FINK_PREFIX@/lib" KDELIBSUFF "/"
+            << "@FINK_PREFIX@/openssl/lib" KDELIBSUFF "/"
+            << "@FINK_PREFIX@/ssl/lib" KDELIBSUFF "/"
             << "/lib" KDELIBSUFF "/"
             << "";
 
