Compare commits

..

2 Commits

Author SHA1 Message Date
Dustin 74aa4d5b6b Disable polkit by default 2018-01-24 16:02:39 -06:00
Dustin b7f2ffc0cc Make polkit support optional
This commit modifies the spec file for libvirt to make the inclusion of
support for PolicyKit optional. It is enabled by default to preserve the
existing behavior, but can be disabled by passing `--without-polkit` to
`rpmbuild`.
2018-01-24 16:02:39 -06:00
1 changed files with 16 additions and 1 deletions

View File

@ -85,6 +85,7 @@
%endif %endif
# A few optional bits off by default, we enable later # A few optional bits off by default, we enable later
%define with_polkit 0%{!?_without_polkit:0}
%define with_fuse 0%{!?_without_fuse:0} %define with_fuse 0%{!?_without_fuse:0}
%define with_cgconfig 0%{!?_without_cgconfig:0} %define with_cgconfig 0%{!?_without_cgconfig:0}
%define with_sanlock 0%{!?_without_sanlock:0} %define with_sanlock 0%{!?_without_sanlock:0}
@ -361,6 +362,7 @@ BuildRequires: radvd
BuildRequires: ebtables BuildRequires: ebtables
BuildRequires: module-init-tools BuildRequires: module-init-tools
BuildRequires: cyrus-sasl-devel BuildRequires: cyrus-sasl-devel
%if %{with_polkit}
%if 0%{?fedora} || 0%{?rhel} >= 7 %if 0%{?fedora} || 0%{?rhel} >= 7
# F22 polkit-devel doesn't pull in polkit anymore, which we need for pkcheck # F22 polkit-devel doesn't pull in polkit anymore, which we need for pkcheck
BuildRequires: polkit >= 0.112 BuildRequires: polkit >= 0.112
@ -368,6 +370,7 @@ BuildRequires: polkit-devel >= 0.112
%else %else
BuildRequires: polkit-devel >= 0.93 BuildRequires: polkit-devel >= 0.93
%endif %endif
%endif
# For mount/umount in FS driver # For mount/umount in FS driver
BuildRequires: util-linux BuildRequires: util-linux
%if %{with_qemu} %if %{with_qemu}
@ -502,11 +505,13 @@ Requires: module-init-tools
# for /sbin/ip & /sbin/tc # for /sbin/ip & /sbin/tc
Requires: iproute Requires: iproute
Requires: avahi-libs Requires: avahi-libs
%if %{with_polkit}
%if 0%{?fedora} || 0%{?rhel} >= 7 %if 0%{?fedora} || 0%{?rhel} >= 7
Requires: polkit >= 0.112 Requires: polkit >= 0.112
%else %else
Requires: polkit >= 0.93 Requires: polkit >= 0.93
%endif %endif
%endif
%if %{with_cgconfig} %if %{with_cgconfig}
Requires: libcgroup Requires: libcgroup
%endif %endif
@ -1193,6 +1198,12 @@ exit 1
%define arg_libxl --without-libxl %define arg_libxl --without-libxl
%endif %endif
%if %{with_polkit}
%define arg_polkit --with-polkit
%else
%define arg_polkit --without-polkit
%endif
%if %{with_phyp} %if %{with_phyp}
%define arg_phyp --with-phyp %define arg_phyp --with-phyp
%else %else
@ -1336,7 +1347,7 @@ rm -f po/stamp-po
%{?arg_libxl} \ %{?arg_libxl} \
--with-sasl \ --with-sasl \
--with-avahi \ --with-avahi \
--with-polkit \ %{?arg_polkit} \
--with-libvirtd \ --with-libvirtd \
%{?arg_uml} \ %{?arg_uml} \
%{?arg_phyp} \ %{?arg_phyp} \
@ -1858,9 +1869,11 @@ exit 0
%{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug %{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug
%endif %endif
%if %{with_polkit}
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy %{_datadir}/polkit-1/actions/org.libvirt.unix.policy
%{_datadir}/polkit-1/actions/org.libvirt.api.policy %{_datadir}/polkit-1/actions/org.libvirt.api.policy
%{_datadir}/polkit-1/rules.d/50-libvirt.rules %{_datadir}/polkit-1/rules.d/50-libvirt.rules
%endif
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/ %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/
@ -1875,7 +1888,9 @@ exit 0
%{_mandir}/man8/virtlockd.8* %{_mandir}/man8/virtlockd.8*
%{_mandir}/man7/virkey*.7* %{_mandir}/man7/virkey*.7*
%if %{with_polkit}
%doc examples/polkit/*.rules %doc examples/polkit/*.rules
%endif
%files daemon-config-network %files daemon-config-network
%dir %{_datadir}/libvirt/networks/ %dir %{_datadir}/libvirt/networks/