From 5d363fcde73783e78b78f2c3289ce311872fafff3e4c872934530db9ddc6e88d Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Wed, 11 Jun 2014 22:25:45 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kauth?expand=0&rev=26 --- kauth.changes | 6 ++ kauth.spec | 5 ++ polkit-qt5-support.patch | 149 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 160 insertions(+) create mode 100644 polkit-qt5-support.patch diff --git a/kauth.changes b/kauth.changes index dcdd417..e39d6c8 100644 --- a/kauth.changes +++ b/kauth.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jun 11 22:24:49 UTC 2014 - hrvoje.senjan@gmail.com + +- Added polkit-qt5-support.patch, adds support for polkit-qt-1 Qt5 + port, https://git.reviewboard.kde.org/r/118264/ + ------------------------------------------------------------------- Sun Jun 1 18:02:37 UTC 2014 - hrvoje.senjan@gmail.com diff --git a/kauth.spec b/kauth.spec index 337eb60..8316b60 100644 --- a/kauth.spec +++ b/kauth.spec @@ -34,6 +34,8 @@ Group: System/GUI/KDE Url: http://www.kde.org Source: http://download.kde.org/unstable/frameworks/%{version}/%{name}-%{version}.tar.xz Source1: baselibs.conf +# PATCH-FIX-UPSTREAM polkit-qt5-support.patch -- add support for polkit-qt-1 Qt5 port, https://git.reviewboard.kde.org/r/118264/ +Patch0: polkit-qt5-support.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -62,6 +64,7 @@ Development files. %lang_package -n %lname %prep %setup -q +%patch0 -p1 %build %cmake_kf5 -d build -- -DSYSCONF_INSTALL_DIR=%{_kf5_sysconfdir} @@ -87,6 +90,8 @@ Development files. %doc COPYING* README* %{_kf5_libdir}/libKF5Auth.so.* %{_kf5_plugindir}/ +%dir %{_kf5_libdir}/libexec +%{_kf5_libdir}/libexec/kauth # Until security review is done! %exclude %{_kf5_sysconfdir}/dbus-1/system.d/org.kde.kf5auth.conf diff --git a/polkit-qt5-support.patch b/polkit-qt5-support.patch new file mode 100644 index 0000000..9295fc7 --- /dev/null +++ b/polkit-qt5-support.patch @@ -0,0 +1,149 @@ +diff --git a/cmake/KF5AuthMacros.cmake b/cmake/KF5AuthMacros.cmake +index 4cdf3ab..1bff105 100644 +--- a/cmake/KF5AuthMacros.cmake ++++ b/cmake/KF5AuthMacros.cmake +@@ -37,7 +37,7 @@ function(KAUTH_INSTALL_ACTIONS HELPER_ID ACTIONS_FILE) + if(KAUTH_BACKEND_NAME STREQUAL "APPLE") + get_target_property(kauth_policy_gen KF5::kauth-policy-gen LOCATION) + install(CODE "execute_process(COMMAND ${kauth_policy_gen} ${ACTIONS_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})") +- elseif(KAUTH_BACKEND_NAME STREQUAL "POLKITQT" OR KAUTH_BACKEND_NAME STREQUAL "POLKITQT-1") ++ elseif(KAUTH_BACKEND_NAME STREQUAL "POLKITQT" OR KAUTH_BACKEND_NAME STREQUAL "POLKITQT5-1") + set(_output ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.policy) + get_filename_component(_input ${ACTIONS_FILE} ABSOLUTE) + +diff --git a/src/ConfigureChecks.cmake b/src/ConfigureChecks.cmake +index aff05ed..fcd26d5 100644 +--- a/src/ConfigureChecks.cmake ++++ b/src/ConfigureChecks.cmake +@@ -1,7 +1,7 @@ + ####### checks for kdecore/kauth ############### + + set(KAUTH_BACKEND_NAME "" CACHE STRING "Specifies the KAuth backend to build. Current available options are +- PolkitQt, PolkitQt-1, Fake, Apple. Not setting this variable will build the most ++ PolkitQt, PolkitQt5-1, Fake, Apple. Not setting this variable will build the most + appropriate backend for your system") + + set(KAUTH_BACKEND ${KAUTH_BACKEND_NAME}) +@@ -14,19 +14,19 @@ if(NOT KAUTH_BACKEND) + if (APPLE) + set (KAUTH_BACKEND "OSX") + elseif (UNIX) +- find_package(PolkitQt-1 0.99.0) ++ find_package(PolkitQt5-1 0.99.0) + +- if (PolkitQt-1_FOUND) +- set (KAUTH_BACKEND "PolkitQt-1") ++ if (PolkitQt5-1_FOUND) ++ set (KAUTH_BACKEND "PolkitQt5-1") + +- set_package_properties(PolkitQt-1 PROPERTIES ++ set_package_properties(PolkitQt5-1 PROPERTIES + URL "http://techbase.kde.org/Polkit-Qt-1" + DESCRIPTION "PolicyKit API for Qt" + TYPE RECOMMENDED + PURPOSE "Support for executing priviledged actions in a controlled way (KAuth)" + ) + +- else (PolkitQt-1_FOUND) ++ else (PolkitQt5-1_FOUND) + find_package(PolkitQt) + + if (POLKITQT_FOUND) +@@ -40,7 +40,7 @@ if(NOT KAUTH_BACKEND) + + else (POLKITQT_FOUND) + # Nothing was found: notify and log the missing features +- set_package_properties(PolkitQt-1 PROPERTIES ++ set_package_properties(PolkitQt5-1 PROPERTIES + URL "http://techbase.kde.org/Polkit-Qt-1" + DESCRIPTION "PolicyKit API for Qt" + TYPE RECOMMENDED +@@ -50,11 +50,11 @@ if(NOT KAUTH_BACKEND) + URL "http://api.kde.org/polkit-qt" + DESCRIPTION "PolicyKit API for Qt" + TYPE RECOMMENDED +- PURPOSE "Support for executing priviledged actions in a controlled way (KAuth). Either this or PolkitQt-1 is required to make KAuth work, and hence enable certain workspace functionalities" ++ PURPOSE "Support for executing priviledged actions in a controlled way (KAuth). Either this or PolkitQt5-1 is required to make KAuth work, and hence enable certain workspace functionalities" + ) + set (KAUTH_BACKEND "Fake") + endif (POLKITQT_FOUND) +- endif (PolkitQt-1_FOUND) ++ endif (PolkitQt5-1_FOUND) + else(UNIX) + set (KAUTH_BACKEND "Fake") + endif(APPLE) +@@ -68,10 +68,10 @@ else(NOT KAUTH_BACKEND) + set (KAUTH_BACKEND ${KAUTH_BACKEND_UPPER}) + + # Check if the specified backend is valid. If it is not, we fall back to the Fake one +- if (NOT KAUTH_BACKEND STREQUAL "OSX" AND NOT KAUTH_BACKEND STREQUAL "POLKITQT" AND NOT KAUTH_BACKEND STREQUAL "POLKITQT-1" AND NOT KAUTH_BACKEND STREQUAL "FAKE") ++ if (NOT KAUTH_BACKEND STREQUAL "OSX" AND NOT KAUTH_BACKEND STREQUAL "POLKITQT" AND NOT KAUTH_BACKEND STREQUAL "POLKITQT5-1" AND NOT KAUTH_BACKEND STREQUAL "FAKE") + message ("WARNING: The KAuth Backend ${KAUTH_BACKEND} you specified does not exist. Falling back to Fake backend") + set (KAUTH_BACKEND "FAKE") +- endif (NOT KAUTH_BACKEND STREQUAL "OSX" AND NOT KAUTH_BACKEND STREQUAL "POLKITQT" AND NOT KAUTH_BACKEND STREQUAL "POLKITQT-1" AND NOT KAUTH_BACKEND STREQUAL "FAKE") ++ endif (NOT KAUTH_BACKEND STREQUAL "OSX" AND NOT KAUTH_BACKEND STREQUAL "POLKITQT" AND NOT KAUTH_BACKEND STREQUAL "POLKITQT5-1" AND NOT KAUTH_BACKEND STREQUAL "FAKE") + + # Check requirements for each backend. If not, fall back to the fake one + if (KAUTH_BACKEND STREQUAL "OSX" AND NOT APPLE) +@@ -85,7 +85,7 @@ else(NOT KAUTH_BACKEND) + URL "http://api.kde.org/polkit-qt" + DESCRIPTION "PolicyKit API for Qt" + TYPE RECOMMENDED +- PURPOSE "Support for executing priviledged actions in a controlled way (KAuth). Either this or PolkitQt-1 is required to make KAuth work, and hence enable certain workspace functionalities" ++ PURPOSE "Support for executing priviledged actions in a controlled way (KAuth). Either this or PolkitQt5-1 is required to make KAuth work, and hence enable certain workspace functionalities" + ) + if (NOT POLKITQT_FOUND) + message ("WARNING: You chose the PolkitQt KAuth backend but you don't have PolkitQt installed. +@@ -93,24 +93,24 @@ else(NOT KAUTH_BACKEND) + set (KAUTH_BACKEND "FAKE") + endif (NOT POLKITQT_FOUND) + endif (KAUTH_BACKEND STREQUAL "POLKITQT") +- if (KAUTH_BACKEND STREQUAL "POLKITQT-1") +- find_package(PolkitQt-1 0.99.0) +- set_package_properties(PolkitQt-1 PROPERTIES ++ if (KAUTH_BACKEND STREQUAL "POLKITQT5-1") ++ find_package(PolkitQt5-1 0.99.0) ++ set_package_properties(PolkitQt5-1 PROPERTIES + URL "http://techbase.kde.org/Polkit-Qt-1" + DESCRIPTION "PolicyKit API for Qt" + TYPE RECOMMENDED + PURPOSE "Support for executing priviledged actions in a controlled way (KAuth). Either this or PolkitQt is required to make KAuth work, and hence enable certain workspace functionalities" + ) +- if (NOT POLKITQT-1_FOUND) +- message ("WARNING: You chose the PolkitQt-1 KAuth backend but you don't have PolkitQt-1 installed. ++ if (NOT POLKITQT5-1_FOUND) ++ message ("WARNING: You chose the PolkitQt5-1 KAuth backend but you don't have PolkitQt5-1 installed. + Falling back to Fake backend") + set (KAUTH_BACKEND "FAKE") +- endif (NOT POLKITQT-1_FOUND) +- endif (KAUTH_BACKEND STREQUAL "POLKITQT-1") ++ endif (NOT POLKITQT5-1_FOUND) ++ endif (KAUTH_BACKEND STREQUAL "POLKITQT5-1") + endif(NOT KAUTH_BACKEND) + + set(KAUTH_BACKEND_NAME ${KAUTH_BACKEND} CACHE STRING "Specifies the KAuth backend to build. Current available options are +- PolkitQt, PolkitQt-1, Fake, Apple. Not setting this variable will build the most ++ PolkitQt, PolkitQt5-1, Fake, Apple. Not setting this variable will build the most + appropriate backend for your system" FORCE) + + # Add the correct libraries depending on the backend, and eventually set the policy files install location +@@ -139,8 +139,8 @@ elseif(KAUTH_BACKEND_NAME STREQUAL "POLKITQT") + + set(KAUTH_POLICY_FILES_INSTALL_DIR ${POLKITQT_POLICY_FILES_INSTALL_DIR} CACHE STRING + "Where policy files generated by KAuth will be installed" FORCE) +-elseif(KAUTH_BACKEND_NAME STREQUAL "POLKITQT-1") +- message(STATUS "Building PolkitQt-1 KAuth backend") ++elseif(KAUTH_BACKEND_NAME STREQUAL "POLKITQT5-1") ++ message(STATUS "Building PolkitQt5-1 KAuth backend") + + include_directories(${POLKITQT-1_INCLUDE_DIR}) + +@@ -177,7 +177,7 @@ if(KAUTH_BACKEND_NAME STREQUAL "OSX") + elseif(KAUTH_BACKEND_NAME STREQUAL "POLKITQT") + set(KAUTH_POLICY_GEN_SRCS ${KAUTH_POLICY_GEN_SRCS} + backends/policykit/kauth-policy-gen-polkit.cpp ) +-elseif(KAUTH_BACKEND_NAME STREQUAL "POLKITQT-1") ++elseif(KAUTH_BACKEND_NAME STREQUAL "POLKITQT5-1") + set(KAUTH_POLICY_GEN_SRCS ${KAUTH_POLICY_GEN_SRCS} + backends/polkit-1/kauth-policy-gen-polkit1.cpp ) + set(KAUTH_POLICY_GEN_LIBRARIES ${KAUTH_POLICY_GEN_LIBRARIES}