From 492cc5fa1cb59bc8586616b63dc0c3877f4eb70cf97438d0ecc9e86d48182c0f Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Wed, 11 Jun 2014 12:47:58 +0000 Subject: [PATCH] osc copypac from project:KDE:Unstable:Frameworks package:polkit-qt5-1 revision:12 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/polkit-qt5-1?expand=0&rev=1 --- .gitattributes | 23 + .gitignore | 1 + ...ellable-handling-in-PolkitQtListener.patch | 44 + fixed-reference-counting-of-GObjects.patch | 96 +++ polkit-qt-1-0.103.0.tar.bz2 | 3 + polkit-qt5-1.changes | 5 + polkit-qt5-1.spec | 102 +++ qt5-support.patch | 783 ++++++++++++++++++ 8 files changed, 1057 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 fixed-GCancellable-handling-in-PolkitQtListener.patch create mode 100644 fixed-reference-counting-of-GObjects.patch create mode 100644 polkit-qt-1-0.103.0.tar.bz2 create mode 100644 polkit-qt5-1.changes create mode 100644 polkit-qt5-1.spec create mode 100644 qt5-support.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/fixed-GCancellable-handling-in-PolkitQtListener.patch b/fixed-GCancellable-handling-in-PolkitQtListener.patch new file mode 100644 index 0000000..583abef --- /dev/null +++ b/fixed-GCancellable-handling-in-PolkitQtListener.patch @@ -0,0 +1,44 @@ +From: Martin Briza +Date: Fri, 12 Jul 2013 13:37:05 +0000 +Subject: Fixed GCancellable handling in PolkitQtListener +X-Git-Url: http://quickgit.kde.org/?p=polkit-qt-1.git&a=commitdiff&h=57a81d0c90fc509fd197b30378cc0ada3b7afbf1 +--- +Fixed GCancellable handling in PolkitQtListener + +There was a race condition happening on two simultanneous requests to the agent, causing it to crash. + +BUGS: 270489 +--- + + +--- a/agent/polkitqtlistener.cpp ++++ b/agent/polkitqtlistener.cpp +@@ -115,6 +115,13 @@ + qDebug() << "Listener adapter polkit_qt_listener_initiate_authentication"; + PolkitQtListener *listener = POLKIT_QT_LISTENER(agent_listener); + ++ if (cancellable != NULL) { ++ g_cancellable_connect(cancellable, ++ G_CALLBACK(cancelled_cb), ++ agent_listener, ++ NULL); ++ } ++ + // The result of asynchronous method will be created here and it will be pushed to the listener. + GSimpleAsyncResult *result = g_simple_async_result_new((GObject *) listener, callback, user_data, agent_listener); + qDebug() << "GSimpleAsyncResult:" << result; +@@ -129,13 +136,6 @@ + cancellable, + result); + +- if (cancellable != NULL) { +- g_signal_connect(cancellable, +- "cancelled", +- G_CALLBACK(cancelled_cb), +- agent_listener); +- } +- + } + + static gboolean polkit_qt_listener_initiate_authentication_finish(PolkitAgentListener *listener, + diff --git a/fixed-reference-counting-of-GObjects.patch b/fixed-reference-counting-of-GObjects.patch new file mode 100644 index 0000000..1804b1f --- /dev/null +++ b/fixed-reference-counting-of-GObjects.patch @@ -0,0 +1,96 @@ +From: Martin Briza +Date: Fri, 22 Mar 2013 14:52:52 +0000 +Subject: Fixed reference counting of GObjects +X-Git-Url: http://quickgit.kde.org/?p=polkit-qt-1.git&a=commitdiff&h=4ed9c3fa043b70ee50176c4baacc07d1c73f1fce +--- +Fixed reference counting of GObjects + +Gets us rid of some crashes and reduces memory leaking. There's a change it fixes crashes~ + +BUGS: 257802, 286935, 291977, 307323 +--- + + +--- a/agent/polkitqt1-agent-listener.cpp ++++ b/agent/polkitqt1-agent-listener.cpp +@@ -62,6 +62,10 @@ + g_type_init(); + + d->listener = listener; ++ ++ if (d->listener != NULL) { ++ g_object_ref(d->listener); ++ } + } + + Listener::~Listener() + +--- a/agent/polkitqt1-agent-session.cpp ++++ b/agent/polkitqt1-agent-session.cpp +@@ -66,6 +66,9 @@ + , d(new Private) + { + d->polkitAgentSession = pkAgentSession; ++ if (d->polkitAgentSession) { ++ g_object_ref(d->polkitAgentSession); ++ } + g_signal_connect(G_OBJECT(d->polkitAgentSession), "completed", G_CALLBACK(Private::completed), this); + g_signal_connect(G_OBJECT(d->polkitAgentSession), "request", G_CALLBACK(Private::request), this); + g_signal_connect(G_OBJECT(d->polkitAgentSession), "show-error", G_CALLBACK(Private::showError), this); + +--- a/core/polkitqt1-details.cpp ++++ b/core/polkitqt1-details.cpp +@@ -35,11 +35,15 @@ + : QSharedData(other) + , polkitDetails(other.polkitDetails) + { +- g_object_ref(polkitDetails); ++ if (polkitDetails != NULL) { ++ g_object_ref(polkitDetails); ++ } + } + ~Data() + { +- g_object_unref(polkitDetails); ++ if (polkitDetails != NULL) { ++ g_object_unref(polkitDetails); ++ } + } + + PolkitDetails *polkitDetails; +@@ -57,6 +61,10 @@ + { + g_type_init(); + d->polkitDetails = pkDetails; ++ ++ if (d->polkitDetails != NULL) { ++ g_object_ref(d->polkitDetails); ++ } + } + + Details::~Details() + +--- a/core/polkitqt1-subject.cpp ++++ b/core/polkitqt1-subject.cpp +@@ -58,6 +58,10 @@ + { + g_type_init(); + d->subject = subject; ++ ++ if (d->subject != NULL) { ++ g_object_ref(d->subject); ++ } + } + + Subject::Subject(const PolkitQt1::Subject& other) +@@ -88,6 +92,9 @@ + + void Subject::setSubject(PolkitSubject *subject) + { ++ if (d->subject != NULL) { ++ g_object_unref(d->subject); ++ } + d->subject = subject; + } + + diff --git a/polkit-qt-1-0.103.0.tar.bz2 b/polkit-qt-1-0.103.0.tar.bz2 new file mode 100644 index 0000000..903c199 --- /dev/null +++ b/polkit-qt-1-0.103.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e32566b8e3d0fd7cf619497089763303c3dc08b7e5a666b2369720fced2274c +size 67592 diff --git a/polkit-qt5-1.changes b/polkit-qt5-1.changes new file mode 100644 index 0000000..822e4a4 --- /dev/null +++ b/polkit-qt5-1.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Mon Apr 14 17:23:15 UTC 2014 - hrvoje.senjan@gmail.com + +- Activate polkit-qt5-1 package + diff --git a/polkit-qt5-1.spec b/polkit-qt5-1.spec new file mode 100644 index 0000000..1799663 --- /dev/null +++ b/polkit-qt5-1.spec @@ -0,0 +1,102 @@ +# +# spec file for package polkit-qt5-1 +# +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +Name: polkit-qt5-1 +Version: 0.103.0 +Release: 0 +Summary: PolicyKit Library Qt Bindings +License: LGPL-2.1+ +Group: Development/Libraries/KDE +Url: http://api.kde.org/kdesupport-api/kdesupport-apidocs/polkit-qt/html/ +# ftp://ftp.kde.org/pub/kde/stable/apps/KDE4.x/admin/ +Source0: ftp://ftp.kde.org/pub/kde/stable/apps/KDE4.x/admin/polkit-qt-1-%{version}.tar.bz2 +# PATCH-FIX-UPSTREAM fixed-reference-counting-of-GObjects.patch (kde#257802, kde#286935, kde#291977, kde#307323) +Patch0: fixed-reference-counting-of-GObjects.patch +# PATCH-FIX-UPSTREAM fixed-GCancellable-handling-in-PolkitQtListener.patch (kde#270489) +Patch1: fixed-GCancellable-handling-in-PolkitQtListener.patch +# PATCH-FIX-UPSTREAM qt5-support.patch -- allow building with Qt5 +Patch2: qt5-support.patch +BuildRequires: cmake +BuildRequires: extra-cmake-modules +BuildRequires: kf5-filesystem +BuildRequires: libqt5-qtbase-devel +BuildRequires: polkit-devel +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +Polkit-qt-1 aims to make it easy for Qt developers to take advantage of +PolicyKit API. It is a convenience wrapper around QAction and +QAbstractButton that lets you integrate those two components easily +with PolicyKit. + +%package -n libpolkit-qt5-1-1 +Summary: PolicyKit Library Qt Bindings +Group: Development/Libraries/KDE + +%description -n libpolkit-qt5-1-1 +Polkit-qt aims to make it easy for Qt developers to take advantage of +PolicyKit API. It is a convenience wrapper around QAction and +QAbstractButton that lets you integrate those two components easily +with PolicyKit. + +%package -n libpolkit-qt5-1-devel +Summary: PolicyKit Library Qt Bindings +Group: Development/Libraries/KDE +Requires: libpolkit-qt5-1-1 = %{version} +Requires: polkit-devel + +%description -n libpolkit-qt5-1-devel +Polkit-qt aims to make it easy for Qt developers to take advantage of +PolicyKit API. It is a convenience wrapper around QAction and +QAbstractButton that lets you integrate those two components easily +with PolicyKit. + +%prep +%setup -q -n polkit-qt-1-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +%build + %cmake_kf5 -d build -- -DUSE_QT5=ON -DUSE_QT4=OFF + %make_jobs + +%install + %kf5_makeinstall -C build + +%post -n libpolkit-qt5-1-1 -p /sbin/ldconfig + +%postun -n libpolkit-qt5-1-1 -p /sbin/ldconfig + +%files -n libpolkit-qt5-1-devel +%defattr(-,root,root) +%doc AUTHORS README +%{_includedir}/polkit-qt5-1/ +%{_kf5_libdir}/pkgconfig/polkit-qt5* +%{_kf5_libdir}/libpolkit-qt5-gui-1.so +%{_kf5_libdir}/libpolkit-qt5-core-1.so +%{_kf5_libdir}/libpolkit-qt5-agent-1.so +%{_kf5_libdir}/cmake/PolkitQt5-1/ + +%files -n libpolkit-qt5-1-1 +%defattr(-,root,root) +%{_kf5_libdir}/libpolkit-qt5-gui-1.so.* +%{_kf5_libdir}/libpolkit-qt5-core-1.so.* +%{_kf5_libdir}/libpolkit-qt5-agent-1.so.* + +%changelog diff --git a/qt5-support.patch b/qt5-support.patch new file mode 100644 index 0000000..8141ece --- /dev/null +++ b/qt5-support.patch @@ -0,0 +1,783 @@ +diff --git a/polkit-qt-agent-1.pc.cmake b/polkit-qt-agent-1.pc.cmake +index 09f93234866770cd872e0445be39976dba67506f..6ccc6dde09f78e300d8196bf6624055c6f0714fe 100644 +--- a/polkit-qt-agent-1.pc.cmake ++++ b/polkit-qt-agent-1.pc.cmake +@@ -3,9 +3,9 @@ exec_prefix=@CMAKE_INSTALL_PREFIX@ + libdir=@LIB_INSTALL_DIR@ + includedir=@CMAKE_INSTALL_PREFIX@/include + +-Name: polkit-qt-agent-1 ++Name: @POLKITQT-1_AGENT_PCNAME@ + Description: Convenience library for using polkit Agent with a Qt-styled API + Version: @POLKITQT-1_VERSION_STRING@ + Requires: QtCore QtGui +-Libs: -L${libdir} -lpolkit-qt-agent-1 +-Cflags: -I${includedir} ++Libs: -L${libdir} -l@POLKITQT-1_AGENT_PCNAME@ ++Cflags: -I${includedir}/@POLKITQT-1_INCLUDE_PATH@ +diff --git a/polkit-qt-core-1.pc.cmake b/polkit-qt-core-1.pc.cmake +index f553b7b6991626e21351204544b85135edd057bb..a9e0750c9d4591498bc124a505eedbae4b2f039e 100644 +--- a/polkit-qt-core-1.pc.cmake ++++ b/polkit-qt-core-1.pc.cmake +@@ -3,9 +3,9 @@ exec_prefix=@CMAKE_INSTALL_PREFIX@ + libdir=@LIB_INSTALL_DIR@ + includedir=@CMAKE_INSTALL_PREFIX@/include + +-Name: polkit-qt-core-1 ++Name: @POLKITQT-1_CORE_PCNAME@ + Description: Convenience library for using polkit with a Qt-styled API, non-GUI classes + Version: @POLKITQT-1_VERSION_STRING@ + Requires: QtCore +-Libs: -L${libdir} -lpolkit-qt-core-1 +-Cflags: -I${includedir} ++Libs: -L${libdir} -l@POLKITQT-1_CORE_PCNAME@ ++Cflags: -I${includedir}/@POLKITQT-1_INCLUDE_PATH@ +diff --git a/polkit-qt-gui-1.pc.cmake b/polkit-qt-gui-1.pc.cmake +index 83d4e9a397e2cc5b44493007a0494d05f72736d9..6b9c2cf4053b77f7f7d504095c1466537cf597bc 100644 +--- a/polkit-qt-gui-1.pc.cmake ++++ b/polkit-qt-gui-1.pc.cmake +@@ -3,9 +3,9 @@ exec_prefix=@CMAKE_INSTALL_PREFIX@ + libdir=@LIB_INSTALL_DIR@ + includedir=@CMAKE_INSTALL_PREFIX@/include + +-Name: polkit-qt-gui-1 ++Name: @POLKITQT-1_GUI_PCNAME@ + Description: Convenience library for using polkit with a Qt-styled API, GUI classes + Version: @POLKITQT-1_VERSION_STRING@ +-Requires: QtCore QtGui polkit-qt-core-1 +-Libs: -L${libdir} -lpolkit-qt-gui-1 +-Cflags: -I${includedir} ++Requires: QtCore QtGui @POLKITQT-1_CORE_PCNAME@ ++Libs: -L${libdir} -l@POLKITQT-1_GUI_PCNAME@ ++Cflags: -I${includedir}/@POLKITQT-1_INCLUDE_PATH@ +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 7e7c9fd1fbeaf52f4ac3a948102dd7430f59a532..b44c92460af951d2b8ff60fcf7a418aeb39c5919 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -1,12 +1,10 @@ + enable_testing() + + include_directories( +- ${CMAKE_CURRENT_SOURCE_DIR} +- ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/agent + ) + +-automoc4_add_executable(polkit-qt-test ++add_executable(polkit-qt-test + test.cpp + ) + +@@ -14,7 +12,7 @@ target_link_libraries(polkit-qt-test + ${QT_QTCORE_LIBRARY} + ${QT_QTTEST_LIBRARY} + ${QT_QTGUI_LIBRARY} +- polkit-qt-core-1 ++ ${POLKITQT-1_CORE_PCNAME} + ) + + add_test(BaseTest ${CMAKE_CURRENT_BINARY_DIR}/polkit-qt-test) +diff --git a/examples/main.cpp b/examples/main.cpp +index e81f804091b28f21d77f9a99a955ab9bd18a5579..b18b614856db193d86eac08e20f1d6bb0e7367ad 100644 +--- a/examples/main.cpp ++++ b/examples/main.cpp +@@ -19,7 +19,7 @@ + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * + ***************************************************************************/ + +-#include ++#include + + #include "PkExample.h" + +diff --git a/examples/org.qt.policykit.examples.service.in b/examples/org.qt.policykit.examples.service.in +index ae5edffd87d84fdd8ae6221be6cd2c2cc73b324d..cf722c2fca03b37a5903f19bcac3790b9eb99020 100644 +--- a/examples/org.qt.policykit.examples.service.in ++++ b/examples/org.qt.policykit.examples.service.in +@@ -1,5 +1,5 @@ + [D-BUS Service] + Name=org.qt.policykit.examples +-Exec=@BIN_INSTALL_DIR@/polkit-example-helper ++Exec=@BIN_INSTALL_DIR@/@POLKITQT-1_EXAMPLE_HELPER@ + User=root + +diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt +index 44abb758299ecc699ea8fbf8a22dbdf86c972537..10b06ae8b8219d42d1b739a522796600aaa398a1 100644 +--- a/gui/CMakeLists.txt ++++ b/gui/CMakeLists.txt +@@ -1,26 +1,21 @@ +-include_directories( +- ${CMAKE_CURRENT_BINARY_DIR} +- ${CMAKE_CURRENT_SOURCE_DIR} +-) +- + set(polkit_qt_gui_SRCS + polkitqt1-gui-action.cpp + polkitqt1-gui-actionbutton.cpp + polkitqt1-gui-actionbuttons.cpp + ) + +-automoc4_add_library(polkit-qt-gui-1 SHARED ${polkit_qt_gui_SRCS}) ++add_library(${POLKITQT-1_GUI_PCNAME} SHARED ${polkit_qt_gui_SRCS}) + +-target_link_libraries(polkit-qt-gui-1 ++target_link_libraries(${POLKITQT-1_GUI_PCNAME} + ${QT_QTCORE_LIBRARY} + ${QT_QTGUI_LIBRARY} + ${QT_QTDBUS_LIBRARY} + ${POLKIT_LIBRARIES} +- polkit-qt-core-1 ++ ${POLKITQT-1_CORE_PCNAME} + ) + +-set_target_properties(polkit-qt-gui-1 PROPERTIES VERSION ${POLKITQT-1_LIBRARY_VERSION} ++set_target_properties(${POLKITQT-1_GUI_PCNAME} PROPERTIES VERSION ${POLKITQT-1_LIBRARY_VERSION} + SOVERSION ${POLKITQT-1_ABI_VERSION} + DEFINE_SYMBOL MAKE_POLKITQT1_LIB) + +-install(TARGETS polkit-qt-gui-1 ${INSTALL_TARGETS_DEFAULT_ARGS}) ++install(TARGETS ${POLKITQT-1_GUI_PCNAME} ${INSTALL_TARGETS_DEFAULT_ARGS}) +diff --git a/gui/polkitqt1-gui-action.h b/gui/polkitqt1-gui-action.h +index fed4cdc12c781cd7dff333b568bf7cf7703be25e..e5194e5b68fe63d4d768a9417495ad9126c4af2b 100644 +--- a/gui/polkitqt1-gui-action.h ++++ b/gui/polkitqt1-gui-action.h +@@ -24,7 +24,7 @@ + + #include "polkitqt1-export.h" + +-#include ++#include + + namespace PolkitQt1 + { +diff --git a/gui/polkitqt1-gui-action.cpp b/gui/polkitqt1-gui-action.cpp +index 82083d1348ffac69af078f44780713c1dfcea407..79425ed6f56d017424712f076c70bc2a015da35b 100644 +--- a/gui/polkitqt1-gui-action.cpp ++++ b/gui/polkitqt1-gui-action.cpp +@@ -512,4 +512,4 @@ QString Action::actionId() const + + } + +-#include "polkitqt1-gui-action.moc" ++#include "moc_polkitqt1-gui-action.cpp" +diff --git a/gui/polkitqt1-gui-actionbutton.cpp b/gui/polkitqt1-gui-actionbutton.cpp +index a9963dcb95565a34b2c8a66cd6a8ee684350e65a..f9bef3679ecc120a07015a7a0e79213cdd2bee26 100644 +--- a/gui/polkitqt1-gui-actionbutton.cpp ++++ b/gui/polkitqt1-gui-actionbutton.cpp +@@ -163,4 +163,4 @@ void ActionButtonPrivate::streamClicked(bool c) + + } + +-#include "polkitqt1-gui-actionbutton.moc" ++#include "moc_polkitqt1-gui-actionbutton.cpp" +diff --git a/gui/polkitqt1-gui-actionbutton_p.h b/gui/polkitqt1-gui-actionbutton_p.h +index 1f072b1e71ab1fdce4dca0192bfc2b0fa0f87b37..f8bdad6d7fe225ffdd19772aa8d64519e27d7d80 100644 +--- a/gui/polkitqt1-gui-actionbutton_p.h ++++ b/gui/polkitqt1-gui-actionbutton_p.h +@@ -24,7 +24,7 @@ + #include + + #include +-#include ++#include + + /** + * \internal +diff --git a/gui/polkitqt1-gui-actionbuttons.cpp b/gui/polkitqt1-gui-actionbuttons.cpp +index 242d41f71ca4e2a65bdbccb58d71297a0823f848..679bc6013d7e95a449daa87c18f747e0971a4e5c 100644 +--- a/gui/polkitqt1-gui-actionbuttons.cpp ++++ b/gui/polkitqt1-gui-actionbuttons.cpp +@@ -69,5 +69,3 @@ void ActionButtons::removeButton(QAbstractButton *button) + } + + } +- +-#include "polkitqt1-gui-actionbuttons.moc" +diff --git a/polkit-qt-1.pc.cmake b/polkit-qt-1.pc.cmake +index 0d7bd0808c31a8f32ef44037bc84cb93c4d0c1e0..2f332042d45ca9e5786801b45f852b4abfca4577 100644 +--- a/polkit-qt-1.pc.cmake ++++ b/polkit-qt-1.pc.cmake +@@ -3,9 +3,9 @@ exec_prefix=@CMAKE_INSTALL_PREFIX@ + libdir=@LIB_INSTALL_DIR@ + includedir=@CMAKE_INSTALL_PREFIX@/include + +-Name: polkit-qt-1 ++Name: @POLKITQT-1_PCNAME@ + Description: Convenience library for using polkit with a Qt-styled API + Version: @POLKITQT-1_VERSION_STRING@ +-Requires: polkit-qt-core-1 polkit-qt-gui-1 polkit-qt-agent-1 +-Libs: -L${libdir} -lpolkit-qt-core-1 -lpolkit-qt-gui-1 -lpolkit-qt-agent-1 +-Cflags: -I${includedir} ++Requires: @POLKITQT-1_CORE_PCNAME@ @POLKITQT-1_GUI_PCNAME@ @POLKITQT-1_AGENT_PCNAME@ ++Libs: -L${libdir} -l@POLKITQT-1_CORE_PCNAME@ -l@POLKITQT-1_GUI_PCNAME@ -l@POLKITQT-1_AGENT_PCNAME@ ++Cflags: -I${includedir}/@POLKITQT-1_INCLUDE_PATH@ +diff --git a/core/polkitqt1-authority.cpp b/core/polkitqt1-authority.cpp +index f134ca686f3f897e83c37b1715965696618dfc85..dd014cf99b8ecf1d4985c98ef44eb96e14db167a 100644 +--- a/core/polkitqt1-authority.cpp ++++ b/core/polkitqt1-authority.cpp +@@ -24,6 +24,7 @@ + #include "polkitqt1-authority.h" + + #include ++#include + #include + + #include +@@ -852,4 +853,4 @@ void Authority::revokeTemporaryAuthorizationCancel() + + } + +-#include "polkitqt1-authority.moc" ++#include "moc_polkitqt1-authority.cpp" +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index f6af3fa1061eb27c14950c84a1a52a93f1c9322d..eef79ec87a019ffac9321a9b8fffa90d9853fadf 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -2,8 +2,6 @@ + install(FILES org.qt.policykit.examples.policy DESTINATION ${SHARE_INSTALL_PREFIX}/polkit-1/actions/) + + include_directories( +- ${CMAKE_CURRENT_SOURCE_DIR} +- ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/gui + ) + +@@ -16,28 +14,24 @@ SET(polkit_example_RESOUCES + icons/icons.qrc + ) + +-QT4_WRAP_CPP(polkit_example_MOC_SRCS +- PkExample.h +-) +- + QT4_WRAP_UI(polkit_example_UI_SRCS + PkExample.ui + ) + + QT4_ADD_RESOURCES (qtsourceview_RC_SRCS ${polkit_example_RESOUCES}) + +-add_executable(polkit-example ++add_executable(${POLKITQT-1_EXAMPLE} + ${polkit_example_SRCS} +- ${polkit_example_MOC_SRCS} + ${polkit_example_UI_SRCS} + ${qtsourceview_RC_SRCS} + ) + +-target_link_libraries(polkit-example ++target_link_libraries(${POLKITQT-1_EXAMPLE} + ${QT_QTCORE_LIBRARY} ++ ${QT_QTDBUS_LIBRARY} + ${QT_QTGUI_LIBRARY} +- polkit-qt-gui-1 +- polkit-qt-core-1 ++ ${POLKITQT-1_GUI_PCNAME} ++ ${POLKITQT-1_CORE_PCNAME} + ) + + #--------Helper Application +@@ -65,22 +59,18 @@ qt4_add_dbus_adaptor(polkit_example_helper_SRCS + PkExampleHelper + ) + +-QT4_WRAP_CPP(polkit_example_helper_MOC_SRCS +- PkExampleHelper.h +-) +- +-add_executable(polkit-example-helper ++add_executable(${POLKITQT-1_EXAMPLE_HELPER} + ${polkit_example_helper_SRCS} +- ${polkit_example_helper_MOC_SRCS} + ) + + # see our helper is pretty small :D +-target_link_libraries(polkit-example-helper ++target_link_libraries(${POLKITQT-1_EXAMPLE_HELPER} + ${QT_QTCORE_LIBRARY} +- polkit-qt-core-1 ++ ${QT_QTXML_LIBRARY} ++ ${POLKITQT-1_GUI_PCNAME} + ) + +-install(TARGETS polkit-example-helper DESTINATION ${BIN_INSTALL_DIR}) ++install(TARGETS ${POLKITQT-1_EXAMPLE_HELPER} DESTINATION ${BIN_INSTALL_DIR}) + + dbus_add_activation_system_service(org.qt.policykit.examples.service.in) + +diff --git a/examples/agent/CMakeLists.txt b/examples/agent/CMakeLists.txt +index ba708cb464742f62b4729844d6f676dc3f42d892..1d792746cc24496cff50be9ab84d2fb23b9add8c 100644 +--- a/examples/agent/CMakeLists.txt ++++ b/examples/agent/CMakeLists.txt +@@ -1,6 +1,4 @@ + include_directories( +- ${CMAKE_CURRENT_SOURCE_DIR} +- ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/agent + ) + +@@ -10,15 +8,13 @@ set(polkit_agent_example_SRCS + klistener.cpp + ) + +-automoc4(polkit-agent-example polkit_agent_example_SRCS) +- +-add_executable(polkit-agent-example ++add_executable(${POLKITQT-1_AGENT_EXAMPLE} + ${polkit_agent_example_SRCS} + ) + +-target_link_libraries(polkit-agent-example ++target_link_libraries(${POLKITQT-1_AGENT_EXAMPLE} + ${QT_QTCORE_LIBRARY} + ${QT_QTGUI_LIBRARY} +- polkit-qt-agent-1 +- polkit-qt-core-1 ++ ${POLKITQT-1_AGENT_PCNAME} ++ ${POLKITQT-1_CORE_PCNAME} + ) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cc67452f2e0aafb8e7834cf79eaa0f105ec4acbe..021bf8855d4c22b622c8f778e2fbbfddd46074ca 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,27 +1,95 @@ + ## Polkit Qt Library + project("PolkitQt-1") + +-cmake_minimum_required(VERSION 2.6.0) ++cmake_minimum_required(VERSION 2.8.11) + +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH}) ++# Check whether we explicitely select the Qt version to be used or autodetect ++if(NOT USE_QT4 AND NOT USE_QT5) ++ # Autodetect, prefering Qt 5 ++ message(STATUS "Autodetecting Qt version to use") ++ find_package(Qt5Core QUIET) ++ if(Qt5Core_FOUND) ++ set(USE_QT5 TRUE) ++ endif() ++endif() + +-set(QT_MIN_VERSION "4.4.0") ++if(USE_QT5) ++ message(STATUS "Using Qt 5") ++ ++ find_package(ECM 0.0.6 REQUIRED NO_MODULE) ++ ++ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH}) ++ ++ set(REQUIRED_QT_VERSION 5.1.0) ++ ++ find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core DBus Widgets Xml) ++ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) ++ ++ set(POLKITQT-1_PCNAME "polkit-qt5-1") ++ set(POLKITQT-1_CORE_PCNAME "polkit-qt5-core-1") ++ set(POLKITQT-1_GUI_PCNAME "polkit-qt5-gui-1") ++ set(POLKITQT-1_AGENT_PCNAME "polkit-qt5-agent-1") ++ set(POLKITQT-1_CAMEL_NAME "PolkitQt5-1") ++ set(POLKITQT-1_EXAMPLE "polkit-example-qt5") ++ set(POLKITQT-1_EXAMPLE_HELPER "polkit-example-helper-qt5") ++ set(POLKITQT-1_AGENT_EXAMPLE "polkit-agent-example-qt5") ++ set(POLKITQT-1_INCLUDE_PATH "polkit-qt5-1") ++ ++ include (KDEInstallDirs) ++ ++ set(QT_QTCORE_LIBRARY Qt5::Core) ++ set(QT_QTXML_LIBRARY Qt5::Xml) ++ set(QT_QTDBUS_LIBRARY Qt5::DBus) ++ set(QT_QTTEST_LIBRARY Qt5::Test) ++ set(QT_QTGUI_LIBRARY Qt5::Widgets) ++ ++ macro(qt4_wrap_ui) ++ qt5_wrap_ui(${ARGN}) ++ endmacro() ++ ++ macro(qt4_add_resources) ++ qt5_add_resources(${ARGN}) ++ endmacro() ++ ++ macro(qt4_add_dbus_adaptor) ++ qt5_add_dbus_adaptor(${ARGN}) ++ endmacro() ++else() ++ message(STATUS "Using Qt 4") ++ ++ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH}) ++ ++ set(QT_MIN_VERSION "4.4.0") ++ ++ find_package(Qt4 REQUIRED) ++ ++ include (${QT_USE_FILE}) ++ include (InstallSettings) ++ ++ set(POLKITQT-1_PCNAME "polkit-qt-1") ++ set(POLKITQT-1_CORE_PCNAME "polkit-qt-core-1") ++ set(POLKITQT-1_GUI_PCNAME "polkit-qt-gui-1") ++ set(POLKITQT-1_AGENT_PCNAME "polkit-qt-agent-1") ++ set(POLKITQT-1_CAMEL_NAME "PolkitQt-1") ++ set(POLKITQT-1_EXAMPLE "polkit-example") ++ set(POLKITQT-1_EXAMPLE_HELPER "polkit-example-helper") ++ set(POLKITQT-1_AGENT_EXAMPLE "polkit-agent-example") ++ set(POLKITQT-1_INCLUDE_PATH "polkit-qt-1") ++endif() ++ ++set(CMAKE_AUTOMOC TRUE) ++set(CMAKE_INCLUDE_CURRENT_DIR TRUE) + +-find_package(Qt4 REQUIRED) +-find_package(Automoc4 REQUIRED) + find_package(Polkit REQUIRED) + find_package(GObject REQUIRED) + find_package(GIO REQUIRED) + + add_definitions(-DQT_NO_KEYWORDS) + +-include (${QT_USE_FILE}) +-include (InstallSettings) + include (MacroWriteBasicCMakeVersionFile) + include (CheckFunctionExists) + + include_directories( +- ${CMAKE_CURRENT_BINARY_DIR} + ${POLKIT_INCLUDE_DIR} + ${POLKIT_AGENT_INCLUDE_DIR} + ${GLIB2_INCLUDE_DIR} +@@ -30,8 +98,12 @@ include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/core + ${CMAKE_CURRENT_SOURCE_DIR}/includes +- ${QT_QTXML_INCLUDE_DIR} + ) ++if(NOT USE_QT5) ++ include_directories( ++ ${QT_QTXML_INCLUDE_DIR} ++ ) ++endif() + + # Check for older polkit + set(CMAKE_REQUIRED_INCLUDES ${POLKIT_INCLUDE_DIR} ${POLKIT_AGENT_INCLUDE_DIR}) +@@ -80,7 +152,7 @@ install(FILES + polkitqt1-export.h + + DESTINATION +- ${INCLUDE_INSTALL_DIR}/polkit-qt-1 COMPONENT Devel) ++ ${INCLUDE_INSTALL_DIR}/${POLKITQT-1_INCLUDE_PATH} COMPONENT Devel) + + install(FILES + includes/PolkitQt1/Authority +@@ -90,50 +162,50 @@ install(FILES + includes/PolkitQt1/TemporaryAuthorization + includes/PolkitQt1/ActionDescription + DESTINATION +- ${INCLUDE_INSTALL_DIR}/polkit-qt-1/PolkitQt1 COMPONENT Devel) ++ ${INCLUDE_INSTALL_DIR}/${POLKITQT-1_INCLUDE_PATH}/PolkitQt1 COMPONENT Devel) + + install(FILES + includes/PolkitQt1/Gui/Action + includes/PolkitQt1/Gui/ActionButton + includes/PolkitQt1/Gui/ActionButtons + DESTINATION +- ${INCLUDE_INSTALL_DIR}/polkit-qt-1/PolkitQt1/Gui COMPONENT Devel) ++ ${INCLUDE_INSTALL_DIR}/${POLKITQT-1_INCLUDE_PATH}/PolkitQt1/Gui COMPONENT Devel) + + install(FILES + includes/PolkitQt1/Agent/Listener + includes/PolkitQt1/Agent/Session + DESTINATION +- ${INCLUDE_INSTALL_DIR}/polkit-qt-1/PolkitQt1/Agent COMPONENT Devel) ++ ${INCLUDE_INSTALL_DIR}/${POLKITQT-1_INCLUDE_PATH}/PolkitQt1/Agent COMPONENT Devel) + + if(NOT WIN32) + # Pkgconfig +- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polkit-qt-1.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/polkit-qt-1.pc @ONLY) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/polkit-qt-1.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig ) +- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polkit-qt-core-1.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/polkit-qt-core-1.pc ++ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polkit-qt-1.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_PCNAME}.pc @ONLY) ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_PCNAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig ) ++ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polkit-qt-core-1.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_CORE_PCNAME}.pc + @ONLY) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/polkit-qt-core-1.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig ) +- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polkit-qt-gui-1.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/polkit-qt-gui-1.pc @ONLY) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/polkit-qt-gui-1.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig ) +- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polkit-qt-agent-1.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/polkit-qt-agent-1.pc ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_CORE_PCNAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig ) ++ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polkit-qt-gui-1.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_GUI_PCNAME}.pc @ONLY) ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_GUI_PCNAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig ) ++ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/polkit-qt-agent-1.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_AGENT_PCNAME}.pc + @ONLY) +- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/polkit-qt-agent-1.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig ) ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${POLKITQT-1_AGENT_PCNAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig ) + endif(NOT WIN32) + + # CMake Config files +-configure_file(PolkitQt-1Config.cmake.in "${CMAKE_BINARY_DIR}/PolkitQt-1Config.cmake" @ONLY) ++configure_file(PolkitQt-1Config.cmake.in "${CMAKE_BINARY_DIR}/${POLKITQT-1_CAMEL_NAME}Config.cmake" @ONLY) + + # this file is used by to check if the installed version can be used. +-macro_write_basic_cmake_version_file(${CMAKE_BINARY_DIR}/PolkitQt-1ConfigVersion.cmake ++macro_write_basic_cmake_version_file(${CMAKE_BINARY_DIR}/${POLKITQT-1_CAMEL_NAME}ConfigVersion.cmake + ${POLKITQT-1_VERSION_MAJOR} ${POLKITQT-1_VERSION_MINOR} ${POLKITQT-1_VERSION_PATCH}) + + if(USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR) +- set(_PolkitQt-1Config_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/PolkitQt-1) ++ set(_PolkitQt-1Config_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/${POLKITQT-1_CAMEL_NAME}) + else(USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR) +- set(_PolkitQt-1Config_INSTALL_DIR ${LIB_INSTALL_DIR}/PolkitQt-1/cmake) ++ set(_PolkitQt-1Config_INSTALL_DIR ${LIB_INSTALL_DIR}/${POLKITQT-1_CAMEL_NAME}/cmake) + endif(USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR) + +-install(FILES ${CMAKE_BINARY_DIR}/PolkitQt-1ConfigVersion.cmake +- ${CMAKE_BINARY_DIR}/PolkitQt-1Config.cmake ++install(FILES ${CMAKE_BINARY_DIR}/${POLKITQT-1_CAMEL_NAME}ConfigVersion.cmake ++ ${CMAKE_BINARY_DIR}/${POLKITQT-1_CAMEL_NAME}Config.cmake + DESTINATION ${_PolkitQt-1Config_INSTALL_DIR} ) + + option(BUILD_EXAMPLES "Builds a set of examples for polkit-qt-1" OFF) +@@ -145,6 +217,9 @@ add_subdirectory(cmake) + + option(BUILD_TEST "Builds unit tests for polkit-qt-1" OFF) + if (BUILD_TEST) ++ if(USE_QT5) ++ find_package(Qt5Test ${REQUIRED_QT_VERSION} REQUIRED) ++ endif() + add_subdirectory(test) + endif (BUILD_TEST) + +diff --git a/PolkitQt-1Config.cmake.in b/PolkitQt-1Config.cmake.in +index 1356de7af5a4a7456b7c01fcbbcd53594b7a70cd..dc86b3c96ddf8f8a4e2c3f5ffc4309f2250514a3 100644 +--- a/PolkitQt-1Config.cmake.in ++++ b/PolkitQt-1Config.cmake.in +@@ -13,29 +13,30 @@ if(NOT POLKITQT-1_INSTALL_DIR) + set(POLKITQT-1_INSTALL_DIR "@CMAKE_INSTALL_PREFIX@") + endif(NOT POLKITQT-1_INSTALL_DIR) + +-set(POLKITQT-1_INCLUDE_DIR "@INCLUDE_INSTALL_DIR@/polkit-qt-1") +-set(POLKITQT-1_LIB_DIR "@LIB_INSTALL_DIR@") ++set(POLKITQT-1_INCLUDE_DIR "${POLKITQT-1_INSTALL_DIR}/@INCLUDE_INSTALL_DIR@/@POLKITQT-1_INCLUDE_PATH@") ++set(POLKITQT-1_INCLUDE_DIRS "${POLKITQT-1_INCLUDE_DIR}") ++set(POLKITQT-1_LIB_DIR "${POLKITQT-1_INSTALL_DIR}/@LIB_INSTALL_DIR@") + set(POLKITQT-1_POLICY_FILES_INSTALL_DIR "${POLKITQT-1_INSTALL_DIR}/share/polkit-1/actions") + + # Compatibility + if(WIN32) + if(MINGW) +- set(POLKITQT-1_CORE_LIBRARY "${POLKITQT-1_LIB_DIR}/libpolkit-qt-core-1.dll.a") +- set(POLKITQT-1_AGENT_LIBRARY "${POLKITQT-1_LIB_DIR}/libpolkit-qt-agent-1.dll.a") +- set(POLKITQT-1_GUI_LIBRARY "${POLKITQT-1_LIB_DIR}/libpolkit-qt-gui-1.dll.a") ++ set(POLKITQT-1_CORE_LIBRARY "${POLKITQT-1_LIB_DIR}/lib@POLKITQT-1_CORE_PCNAME@.dll.a") ++ set(POLKITQT-1_AGENT_LIBRARY "${POLKITQT-1_LIB_DIR}/lib@POLKITQT-1_AGENT_PCNAME@.dll.a") ++ set(POLKITQT-1_GUI_LIBRARY "${POLKITQT-1_LIB_DIR}/lib@POLKITQT-1_GUI_PCNAME@.dll.a") + else(MINGW) +- set(POLKITQT-1_CORE_LIBRARY "${POLKITQT-1_LIB_DIR}/polkit-qt-core-1.lib") +- set(POLKITQT-1_AGENT_LIBRARY "${POLKITQT-1_LIB_DIR}/polkit-qt-agent-1.lib") +- set(POLKITQT-1_GUI_LIBRARY "${POLKITQT-1_LIB_DIR}/polkit-qt-gui-1.lib") ++ set(POLKITQT-1_CORE_LIBRARY "${POLKITQT-1_LIB_DIR}/@POLKITQT-1_CORE_PCNAME@.lib") ++ set(POLKITQT-1_AGENT_LIBRARY "${POLKITQT-1_LIB_DIR}/@POLKITQT-1_AGENT_PCNAME@.lib") ++ set(POLKITQT-1_GUI_LIBRARY "${POLKITQT-1_LIB_DIR}/@POLKITQT-1_GUI_PCNAME@.lib") + endif(MINGW) + elseif(APPLE) +- set(POLKITQT-1_CORE_LIBRARY "${POLKITQT-1_LIB_DIR}/libpolkit-qt-core-1.dylib") +- set(POLKITQT-1_AGENT_LIBRARY "${POLKITQT-1_LIB_DIR}/libpolkit-qt-agent-1.dylib") +- set(POLKITQT-1_GUI_LIBRARY "${POLKITQT-1_LIB_DIR}/libpolkit-qt-gui-1.dylib") ++ set(POLKITQT-1_CORE_LIBRARY "${POLKITQT-1_LIB_DIR}/lib@POLKITQT-1_CORE_PCNAME@.dylib") ++ set(POLKITQT-1_AGENT_LIBRARY "${POLKITQT-1_LIB_DIR}/lib@POLKITQT-1_AGENT_PCNAME@.dylib") ++ set(POLKITQT-1_GUI_LIBRARY "${POLKITQT-1_LIB_DIR}/lib@POLKITQT-1_GUI_PCNAME@.dylib") + else() +- set(POLKITQT-1_CORE_LIBRARY "${POLKITQT-1_LIB_DIR}/libpolkit-qt-core-1.so") +- set(POLKITQT-1_AGENT_LIBRARY "${POLKITQT-1_LIB_DIR}/libpolkit-qt-agent-1.so") +- set(POLKITQT-1_GUI_LIBRARY "${POLKITQT-1_LIB_DIR}/libpolkit-qt-gui-1.so") ++ set(POLKITQT-1_CORE_LIBRARY "${POLKITQT-1_LIB_DIR}/lib@POLKITQT-1_CORE_PCNAME@.so") ++ set(POLKITQT-1_AGENT_LIBRARY "${POLKITQT-1_LIB_DIR}/lib@POLKITQT-1_AGENT_PCNAME@.so") ++ set(POLKITQT-1_GUI_LIBRARY "${POLKITQT-1_LIB_DIR}/lib@POLKITQT-1_GUI_PCNAME@.so") + endif() + + set(POLKITQT-1_LIBRARIES ${POLKITQT-1_GUI_LIBRARY} ${POLKITQT-1_CORE_LIBRARY} ${POLKITQT-1_AGENT_LIBRARY}) +diff --git a/agent/CMakeLists.txt b/agent/CMakeLists.txt +index 80d1bd3b2681e58bd52b91a5d3bf5751b33aa8e5..f1ba438d71edbcb890754b20efc932dc738b1d91 100644 +--- a/agent/CMakeLists.txt ++++ b/agent/CMakeLists.txt +@@ -1,25 +1,20 @@ +-include_directories( +- ${CMAKE_CURRENT_BINARY_DIR} +- ${CMAKE_CURRENT_SOURCE_DIR} +-) +- + set(polkit_qt_agent_SRCS + polkitqt1-agent-session.cpp + polkitqt1-agent-listener.cpp + listeneradapter.cpp + polkitqtlistener.cpp + ) +-automoc4_add_library(polkit-qt-agent-1 SHARED ${polkit_qt_agent_SRCS}) ++add_library(${POLKITQT-1_AGENT_PCNAME} SHARED ${polkit_qt_agent_SRCS}) + +-target_link_libraries(polkit-qt-agent-1 ++target_link_libraries(${POLKITQT-1_AGENT_PCNAME} + ${POLKIT_LIBRARIES} + ${QT_QTCORE_LIBRARY} + ${POLKIT_AGENT_LIBRARY} +- polkit-qt-core-1 ++ ${POLKITQT-1_CORE_PCNAME} + ) + +-set_target_properties(polkit-qt-agent-1 PROPERTIES VERSION ${POLKITQT-1_LIBRARY_VERSION} ++set_target_properties(${POLKITQT-1_AGENT_PCNAME} PROPERTIES VERSION ${POLKITQT-1_LIBRARY_VERSION} + SOVERSION ${POLKITQT-1_ABI_VERSION} + DEFINE_SYMBOL MAKE_POLKITQT1_LIB) + +-install(TARGETS polkit-qt-agent-1 ${INSTALL_TARGETS_DEFAULT_ARGS}) ++install(TARGETS ${POLKITQT-1_AGENT_PCNAME} ${INSTALL_TARGETS_DEFAULT_ARGS}) +diff --git a/agent/listeneradapter.cpp b/agent/listeneradapter.cpp +index b25449009208d7e24401cd67a93c93e778cbab14..5513a9b79dfc2031b579693ea225c377c6db07e1 100644 +--- a/agent/listeneradapter.cpp ++++ b/agent/listeneradapter.cpp +@@ -142,5 +142,3 @@ void ListenerAdapter::removeListener(Listener *listener) + } + + } +- +-#include "listeneradapter_p.moc" +diff --git a/agent/polkitqt1-agent-listener.cpp b/agent/polkitqt1-agent-listener.cpp +index 394a92ef8d5215751f9a4f16bcfadd391eda528d..38744ec6c0fbad833e22586cba0e602b413e2494 100644 +--- a/agent/polkitqt1-agent-listener.cpp ++++ b/agent/polkitqt1-agent-listener.cpp +@@ -124,5 +124,3 @@ const PolkitAgentListener *Listener::listener() + } + + } +- +-#include "polkitqt1-agent-listener.moc" +diff --git a/agent/polkitqt1-agent-session.cpp b/agent/polkitqt1-agent-session.cpp +index 0aca92e1793f7402b1207e5355fd81d151e8b6ff..7aea33265e86b12183d317c523f06f6be78a14aa 100644 +--- a/agent/polkitqt1-agent-session.cpp ++++ b/agent/polkitqt1-agent-session.cpp +@@ -168,5 +168,3 @@ void AsyncResult::setError(const QString &text) + Q_ASSERT(d->result); + g_simple_async_result_set_error(d->result, POLKIT_ERROR, POLKIT_ERROR_FAILED, "%s", text.toUtf8().data()); + } +- +-#include "polkitqt1-agent-session.moc" +diff --git a/cmake/modules/FindAutomoc4.cmake b/cmake/modules/FindAutomoc4.cmake +deleted file mode 100644 +index fb6dc774383ba8a15d5544950f7b6de165c09541..0000000000000000000000000000000000000000 +--- a/cmake/modules/FindAutomoc4.cmake ++++ /dev/null +@@ -1,81 +0,0 @@ +-# - Try to find automoc4 +-# Once done this will define +-# +-# AUTOMOC4_FOUND - automoc4 has been found +-# AUTOMOC4_EXECUTABLE - the automoc4 tool +-# AUTOMOC4_VERSION - the full version of automoc4 +-# AUTOMOC4_VERSION_MAJOR, AUTOMOC4_VERSION_MINOR, AUTOMOC4_VERSION_PATCH - AUTOMOC4_VERSION +-# broken into its components +-# +-# It also adds the following macros +-# AUTOMOC4( ) +-# Use this to run automoc4 on all files contained in the list . +-# +-# AUTOMOC4_MOC_HEADERS( header1.h header2.h ...) +-# Use this to add more header files to be processed with automoc4. +-# +-# AUTOMOC4_ADD_EXECUTABLE( src1 src2 ...) +-# This macro does the same as ADD_EXECUTABLE, but additionally +-# adds automoc4 handling for all source files. +-# +-# AUTOMOC4_ADD_LIBRARY( src1 src2 ...) +-# This macro does the same as ADD_LIBRARY, but additionally +-# adds automoc4 handling for all source files. +- +-# Internal helper macro, may change or be removed anytime: +-# _ADD_AUTOMOC4_TARGET( ) +-# +-# Since version 0.9.88: +-# The following two macros are only to be used for KDE4 projects +-# and do something which makes sure automoc4 works for KDE. Don't +-# use them anywhere else. +-# _AUTOMOC4_KDE4_PRE_TARGET_HANDLING( ) +-# _AUTOMOC4_KDE4_POST_TARGET_HANDLING() +- +- +-# Copyright (c) 2008-2009, Alexander Neundorf, +-# +-# Redistribution and use is allowed according to the terms of the BSD license. +-# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +- +- +-# check if we are inside KDESupport +-if("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") +- # when building this project as part of kdesupport +- set(AUTOMOC4_CONFIG_FILE "${KDESupport_SOURCE_DIR}/automoc/Automoc4Config.cmake") +-else("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") +- # when building this project outside kdesupport +- +- # CMAKE_[SYSTEM_]PREFIX_PATH exists starting with cmake 2.6.0 +- file(TO_CMAKE_PATH "$ENV{CMAKE_PREFIX_PATH}" _env_CMAKE_PREFIX_PATH) +- file(TO_CMAKE_PATH "$ENV{CMAKE_LIBRARY_PATH}" _env_CMAKE_LIBRARY_PATH) +- +- find_file(AUTOMOC4_CONFIG_FILE NAMES Automoc4Config.cmake +- PATH_SUFFIXES automoc4 lib/automoc4 lib64/automoc4 +- PATHS ${_env_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH} ${CMAKE_SYSTEM_PREFIX_PATH} +- ${_env_CMAKE_LIBRARY_PATH} ${CMAKE_LIBRARY_PATH} ${CMAKE_SYSTEM_LIBRARY_PATH} +- ${CMAKE_INSTALL_PREFIX} +- NO_DEFAULT_PATH ) +-endif("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") +- +- +-if(AUTOMOC4_CONFIG_FILE) +- include(${AUTOMOC4_CONFIG_FILE}) +- set(AUTOMOC4_FOUND TRUE) +-else(AUTOMOC4_CONFIG_FILE) +- set(AUTOMOC4_FOUND FALSE) +-endif(AUTOMOC4_CONFIG_FILE) +- +-if (AUTOMOC4_FOUND) +- if (NOT Automoc4_FIND_QUIETLY) +- message(STATUS "Found Automoc4: ${AUTOMOC4_EXECUTABLE}") +- endif (NOT Automoc4_FIND_QUIETLY) +-else (AUTOMOC4_FOUND) +- if (Automoc4_FIND_REQUIRED) +- message(FATAL_ERROR "Did not find automoc4 (part of kdesupport).") +- else (Automoc4_FIND_REQUIRED) +- if (NOT Automoc4_FIND_QUIETLY) +- message(STATUS "Did not find automoc4 (part of kdesupport).") +- endif (NOT Automoc4_FIND_QUIETLY) +- endif (Automoc4_FIND_REQUIRED) +-endif (AUTOMOC4_FOUND) +diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt +index f2efca4dee4cb73298a048832d80c9d6a914d815..e9b3ebb77f94f4d6d0e7b1a2a6ba108483df2df2 100644 +--- a/core/CMakeLists.txt ++++ b/core/CMakeLists.txt +@@ -1,8 +1,3 @@ +-include_directories( +- ${CMAKE_CURRENT_BINARY_DIR} +- ${CMAKE_CURRENT_SOURCE_DIR} +-) +- + set(polkit_qt_core_SRCS + polkitqt1-authority.cpp + polkitqt1-identity.cpp +@@ -12,9 +7,9 @@ set(polkit_qt_core_SRCS + polkitqt1-actiondescription.cpp + ) + +-automoc4_add_library(polkit-qt-core-1 SHARED ${polkit_qt_core_SRCS}) ++add_library(${POLKITQT-1_CORE_PCNAME} SHARED ${polkit_qt_core_SRCS}) + +-target_link_libraries(polkit-qt-core-1 ++target_link_libraries(${POLKITQT-1_CORE_PCNAME} + ${QT_QTCORE_LIBRARY} + ${QT_QTDBUS_LIBRARY} + ${QT_QTXML_LIBRARY} +@@ -24,8 +19,8 @@ target_link_libraries(polkit-qt-core-1 + ${GIO_LIBRARIES} + ) + +-set_target_properties(polkit-qt-core-1 PROPERTIES VERSION ${POLKITQT-1_LIBRARY_VERSION} ++set_target_properties(${POLKITQT-1_CORE_PCNAME} PROPERTIES VERSION ${POLKITQT-1_LIBRARY_VERSION} + SOVERSION ${POLKITQT-1_ABI_VERSION} + DEFINE_SYMBOL MAKE_POLKITQT1_LIB) + +-install(TARGETS polkit-qt-core-1 ${INSTALL_TARGETS_DEFAULT_ARGS}) ++install(TARGETS ${POLKITQT-1_CORE_PCNAME} ${INSTALL_TARGETS_DEFAULT_ARGS})