diff options
author | Sebastien Braun | 2010-10-06 15:17:40 +0200 |
---|---|---|
committer | Sebastien Braun | 2010-10-06 15:17:40 +0200 |
commit | dce35518d9b91b1bac0394792f83450fbe4aa3bc (patch) | |
tree | 42b966e7aa0984bfbddbd8d8b7a7923c780be86d /src/input | |
parent | Detect the presence of PolKit on configuration (diff) | |
download | pvs-dce35518d9b91b1bac0394792f83450fbe4aa3bc.tar.gz pvs-dce35518d9b91b1bac0394792f83450fbe4aa3bc.tar.xz pvs-dce35518d9b91b1bac0394792f83450fbe4aa3bc.zip |
Install PolKit policy file
and try to detect the policy directory.
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/CMakeLists.txt | 19 | ||||
-rw-r--r-- | src/input/org.openslx.pvs.input.policy | 18 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/input/CMakeLists.txt b/src/input/CMakeLists.txt index 44cf6b6..0cf5177 100644 --- a/src/input/CMakeLists.txt +++ b/src/input/CMakeLists.txt @@ -67,16 +67,35 @@ if(UNIX) find_program(PKEXEC_LOCATION pkexec) if(PKEXEC_LOCATION OR ENABLE_POLKIT) set(POLKIT_FOUND ON) + set(POLKIT_PREFIX ${CMAKE_INSTALL_PREFIX}) + set(POLKIT_POLICY_DIR ${POLKIT_PREFIX}/share/polkit-1/actions) endif() else() pkg_check_modules(POLKIT "polkit-gobject-1") + if(POLKIT_FOUND) + execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} polkit-gobject-1 --variable=policydir + OUTPUT_VARIABLE POLKIT_POLICY_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT POLKIT_POLICY_DIR) + set(POLKIT_FOUND OFF) + endif() + endif() endif() # now, arrange for policykit integration: if(POLKIT_FOUND OR ENABLE_POLKIT) + if(NOT POLKIT_POLICY_DIR) + message(SEND_ERROR "PolicyKit integration is enabled, but cannot find PolicyKit's actions directory. Please set POLKIT_POLICY_DIR to the right value") + endif() + + install(FILES org.openslx.pvs.input.policy + DESTINATION ${POLKIT_POLICY_DIR}) set_property(SOURCE ${pvsprivinputd_SRCS} APPEND PROPERTY COMPILE_DEFINITIONS HAVE_POLKIT) + message(STATUS "PolicyKit integration: enabled") + else() + message(STATUS "PolicyKit integration: disabled") endif() endif() diff --git a/src/input/org.openslx.pvs.input.policy b/src/input/org.openslx.pvs.input.policy new file mode 100644 index 0000000..f0de9f2 --- /dev/null +++ b/src/input/org.openslx.pvs.input.policy @@ -0,0 +1,18 @@ +<?xml version="1.0" ?> +<!DOCTYPE policyconfig PUBLIC + "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" + "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd"> +<policyconfig> + <vendor>The OpenSLX project</vendor> + <vendor_url>http://lab.openslx.org/pvs</vendor_url> + + <action id="org.openslx.pvs.privilegedinput"> + <description>Use privileged input actions in PVS</description> + <message>Authentication is required to let PVS use privileged input actions</message> + <defaults> + <allow_inactive>auth_self_keep</allow_inactive> + <allow_active>auth_self_keep</allow_active> + <allow_any>auth_admin_keep</allow_any> + </defaults> + </action> +</policyconfig> |