]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: properly conditionalize polkit installation
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 12 Apr 2017 23:09:26 +0000 (19:09 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 24 Apr 2017 01:47:28 +0000 (21:47 -0400)
... including pkla installation on Debian.

v2:
- fix polkit-gobject-1 pkgconfig name

meson.build
meson_options.txt
src/core/meson.build
src/hostname/meson.build
src/import/meson.build
src/locale/meson.build
src/login/meson.build
src/machine/meson.build
src/network/meson.build
src/timedate/meson.build

index b04c92776c329cc3627cb1211ed63e2b60e1f05c..9b46a7edd8962bab87a003b004745be9cebccbc8 100644 (file)
@@ -617,6 +617,21 @@ if smack_run_label != ''
   m4_defines += ['-DHAVE_SMACK_RUN_LABEL']
 endif
 
+want_polkit = get_option('polkit')
+install_polkit = false
+install_polkit_pkla = false
+if want_polkit != 'no'
+  conf.set('ENABLE_POLKIT', 1)
+  install_polkit = true
+
+  libpolkit = dependency('polkit-gobject-1',
+                         required : false)
+  if libpolkit.found() and libpolkit.version().version_compare('< 0.106')
+    message('Old polkit detected, will install pkla files')
+    install_polkit_pkla = true
+  endif
+endif
+
 want_audit = get_option('audit')
 if want_audit != 'no'
   libaudit = dependency('audit', required : want_audit == 'yes')
index 610e365fcd394ef12ea7a03ae0c8612facdd2fba..b1b80bfa69f1113d5923f5f11e840ef5a6d79ac8 100644 (file)
@@ -159,6 +159,8 @@ option('smack', type : 'combo', choices : ['auto', 'yes', 'no'],
        description : 'SMACK support')
 option('smack-run-label', type : 'string',
        description : 'run systemd --system itself with a specific SMACK label')
+option('polkit', type : 'combo', choices : ['auto', 'yes', 'no'],
+       description : 'PolicyKit support')
 
 option('audit', type : 'combo', choices : ['auto', 'yes', 'no'],
        description : 'libaudit support')
index bf4e2dbed9b2b46ea774c45947e6565433374457..97410a8cc4172d0e9e1965baa19e58a803e189aa 100644 (file)
@@ -203,7 +203,7 @@ custom_target(
   input : policy_in,
   output : 'org.freedesktop.systemd1.policy',
   command : intltool_command,
-  install : true,
+  install : install_polkit,
   install_dir : polkitpolicydir)
 
 # TODO: this might work with meson from git, see
@@ -214,7 +214,7 @@ custom_target(
 #   po_dir : po_dir,
 #   input : policy_in,
 #   output : 'org.freedesktop.systemd1.policy',
-#   install : true,
+#   install : install_polkit,
 #   install_dir : polkitpolicydir)
 
 install_data('system.conf',
index 43a035c0bf1e644542872f9c92877ec6a1581191..6985a41910a8893ef5fa18b9588405fc8fdec143 100644 (file)
@@ -11,6 +11,6 @@ if conf.get('ENABLE_HOSTNAMED', 0) == 1
     input : 'org.freedesktop.hostname1.policy.in',
     output : 'org.freedesktop.hostname1.policy',
     command : intltool_command,
-    install : true,
+    install : install_polkit,
     install_dir : polkitpolicydir)
 endif
index 173d6d6f3f964cf7b5bb0a56e556b098bf431e74..66f43dd714a92f7683578583ec8fabde1cd20ffc 100644 (file)
@@ -61,7 +61,7 @@ if conf.get('ENABLE_IMPORTD', 0) == 1
     input : 'org.freedesktop.import1.policy.in',
     output : 'org.freedesktop.import1.policy',
     command : intltool_command,
-    install : true,
+    install : install_polkit,
     install_dir : polkitpolicydir)
 
   install_data('import-pubring.gpg',
index 2f903cffd0f076775a5fe22dfc3eca61a3d123ce..775ad2ce7702ad214578bb138207ad20b908e523 100644 (file)
@@ -19,7 +19,7 @@ if conf.get('ENABLE_LOCALED', 0) == 1
     input : 'org.freedesktop.locale1.policy.in',
     output : 'org.freedesktop.locale1.policy',
     command : intltool_command,
-    install : true,
+    install : install_polkit,
     install_dir : polkitpolicydir)
 endif
 
index 75b849886207aa13a769455b5c3762bcbb5b8d75..d3e2b73e8b46ee8ca27217eb61bb1b07391e6965 100644 (file)
@@ -78,7 +78,7 @@ if conf.get('ENABLE_LOGIND', 0) == 1
     input : 'org.freedesktop.login1.policy.in',
     output : 'org.freedesktop.login1.policy',
     command : intltool_command,
-    install : true,
+    install : install_polkit,
     install_dir : polkitpolicydir)
 
   install_data('70-power-switch.rules',
index bf4f88f1aae2508fdcc0bc5d4dd54f2a01e64f5b..de9824628216eb04f4d1fadad9c4d98551a49568 100644 (file)
@@ -34,7 +34,7 @@ if conf.get('ENABLE_MACHINED', 0) == 1
     input : 'org.freedesktop.machine1.policy.in',
     output : 'org.freedesktop.machine1.policy',
     command : intltool_command,
-    install : true,
+    install : install_polkit,
     install_dir : polkitpolicydir)
 endif
 
index 66d6a52dcf62fd525eff2a02bab9c5c0ddebaa47..4cde77729247ad358a428ffd37d46915361426ce 100644 (file)
@@ -108,8 +108,14 @@ if conf.get('ENABLE_NETWORKD', 0) == 1
                install_dir : dbuspolicydir)
   install_data('org.freedesktop.network1.service',
                install_dir : dbussystemservicedir)
-  install_data('systemd-networkd.rules',
-               install_dir : polkitrulesdir)
+  if install_polkit
+    install_data('systemd-networkd.rules',
+                 install_dir : polkitrulesdir)
+  endif
+  if install_polkit_pkla
+    install_data('systemd-networkd.pkla',
+                 install_dir : polkitpkladir)
+  endif
 
   tests += [
     [['src/network/test-networkd-conf.c'],
index f9c19f1d67089df978acaf292202f2ddd8cc6e46..52518a87e4ac216c29c77d31d24809fd029a8f0c 100644 (file)
@@ -11,6 +11,6 @@ if conf.get('ENABLE_TIMEDATED', 0) == 1
     input : 'org.freedesktop.timedate1.policy.in',
     output : 'org.freedesktop.timedate1.policy',
     command : intltool_command,
-    install : true,
+    install : install_polkit,
     install_dir : polkitpolicydir)
 endif