Similar knobs, such as firewalld_zone and sysctl_config, are already features, so convert this one as well to comply with expectations. Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx> --- libvirt.spec.in | 2 +- meson.build | 14 +++++++++++--- meson_options.txt | 2 +- mingw-libvirt.spec.in | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index cc04efe081..529c29214d 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1128,7 +1128,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) -Dselinux=enabled \ %{?arg_selinux_mount} \ -Dapparmor=disabled \ - -Dapparmor_profiles=false \ + -Dapparmor_profiles=disabled \ -Dsecdriver_apparmor=disabled \ -Dudev=enabled \ -Dyajl=enabled \ diff --git a/meson.build b/meson.build index 55bb724a52..be6765a034 100644 --- a/meson.build +++ b/meson.build @@ -857,11 +857,19 @@ if apparmor_dep.found() conf.set_quoted('APPARMOR_PROFILES_PATH', '/sys/kernel/security/apparmor/profiles') endif -if get_option('apparmor_profiles') +if not get_option('apparmor_profiles').disabled() + apparmor_profiles_enable = true + if not conf.has('WITH_APPARMOR') - error('Cannot enable apparmor_profiles without apparmor') + apparmor_profiles_enable = false + if get_option('apparmor_profiles').enabled() + error('Cannot enable apparmor_profiles without apparmor') + endif + endif + + if apparmor_profiles_enable + conf.set('WITH_APPARMOR_PROFILES', 1) endif - conf.set('WITH_APPARMOR_PROFILES', 1) endif # FIXME rewrite to use dependency() once we can use 2.4.48 diff --git a/meson_options.txt b/meson_options.txt index 2606648b64..f4f40fe9b5 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -69,7 +69,7 @@ option('driver_vmware', type: 'feature', value: 'auto', description: 'VMware dri option('driver_vz', type: 'feature', value: 'auto', description: 'Virtuozzo driver') option('secdriver_apparmor', type: 'feature', value: 'auto', description: 'use AppArmor security driver') -option('apparmor_profiles', type: 'boolean', value: false, description: 'install apparmor profiles') +option('apparmor_profiles', type: 'feature', value: 'disabled', description: 'install apparmor profiles') option('secdriver_selinux', type: 'feature', value: 'auto', description: 'use SELinux security driver') diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in index 87223e205c..bcc2bd93e3 100644 --- a/mingw-libvirt.spec.in +++ b/mingw-libvirt.spec.in @@ -108,7 +108,7 @@ exit 1 -Dcurl=enabled \ -Ddocs=enabled \ -Dapparmor=disabled \ - -Dapparmor_profiles=false \ + -Dapparmor_profiles=disabled \ -Dattr=disabled \ -Daudit=disabled \ -Dbash_completion=disabled \ -- 2.31.1