diff options
author | Richard Hughes <richard@hughsie.com> | 2017-08-15 12:30:36 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2017-08-15 12:30:36 +0100 |
commit | b570101cc6a8be360f74f69de329fdd4de407ff8 (patch) | |
tree | 5c4d53303cdf657346cf79d253a607b76c346a86 | |
parent | bac411aa6597352825291a85a571f2e8fc4cf283 (diff) | |
download | colord-b570101cc6a8be360f74f69de329fdd4de407ff8.tar.gz |
Add the fallback PolicyKit rules for older versions
-rw-r--r-- | policy/its/polkit.its | 8 | ||||
-rw-r--r-- | policy/its/polkit.loc | 6 | ||||
-rw-r--r-- | policy/meson.build | 31 |
3 files changed, 37 insertions, 8 deletions
diff --git a/policy/its/polkit.its b/policy/its/polkit.its new file mode 100644 index 0000000..1c37e6b --- /dev/null +++ b/policy/its/polkit.its @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<its:rules xmlns:its="http://www.w3.org/2005/11/its" + version="2.0"> + <its:translateRule selector="//*" translate="no"/> + <its:translateRule selector="//action/description | + //action/message" + translate="yes"/> +</its:rules> diff --git a/policy/its/polkit.loc b/policy/its/polkit.loc new file mode 100644 index 0000000..c7427ec --- /dev/null +++ b/policy/its/polkit.loc @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<locatingRules> + <locatingRule name="polkit policy" pattern="*.policy"> + <documentRule localName="policyconfig" target="polkit.its"/> + </locatingRule> +</locatingRules> diff --git a/policy/meson.build b/policy/meson.build index 7aaffae..df16e52 100644 --- a/policy/meson.build +++ b/policy/meson.build @@ -5,11 +5,26 @@ policy_in = configure_file( output : 'org.freedesktop.color.policy.in', configuration : con2, ) -i18n.merge_file( - input: policy_in, - output: 'org.freedesktop.color.policy', - install: true, - install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions') , - type: 'xml', - po_dir: join_paths(meson.source_root(), 'po') -) + +#newer polkit has the ITS rules included +if polkit.version().version_compare('>0.113') + i18n.merge_file( + input: policy_in, + output: 'org.freedesktop.color.policy', + install: true, + install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions') , + type: 'xml', + po_dir: join_paths(meson.source_root(), 'po') + ) +#older polkit is missing ITS rules and will fail +else + i18n.merge_file( + input: policy_in, + output: 'org.freedesktop.color.policy', + install: true, + install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions') , + type: 'xml', + data_dirs: join_paths(meson.source_root(), 'policy'), + po_dir: join_paths(meson.source_root(), 'po') + ) +endif |