Make polkit support optional
This commit makes the inclusion of support for PolicyKit optional. It is enabled by default for compatibility with existing builds, but can be disabled by passing `--without-polkit` to `rpmbuild`.no-polkit
parent
30b049a9a1
commit
1a70767ab7
|
@ -1,4 +1,5 @@
|
|||
#define _version_suffix
|
||||
%define with_polkit 0%{!?_without_polkit:1}
|
||||
|
||||
Name: spice-gtk
|
||||
Version: 0.34
|
||||
|
@ -23,7 +24,9 @@ BuildRequires: cyrus-sasl-devel
|
|||
BuildRequires: libcacard-devel
|
||||
BuildRequires: gobject-introspection-devel
|
||||
BuildRequires: libacl-devel
|
||||
%if %{with_polkit}
|
||||
BuildRequires: polkit-devel
|
||||
%endif
|
||||
BuildRequires: gtk-doc
|
||||
BuildRequires: vala-tools
|
||||
BuildRequires: usbutils
|
||||
|
@ -110,10 +113,19 @@ find . -name '*.stamp' | xargs touch
|
|||
|
||||
|
||||
%build
|
||||
%if %{with_polkit}
|
||||
%define usb_acl_helper %{_libexecdir}/spice-gtk-%{_arch}/
|
||||
%define arg_polkit --with-polkit
|
||||
%define arg_usb_acl_helper --with-usb-acl-helper-dir=%{usb_acl_helper}
|
||||
%else
|
||||
%define arg_polkit --without-polkit
|
||||
%endif
|
||||
|
||||
%configure \
|
||||
--enable-gtk-doc \
|
||||
--enable-webdav \
|
||||
--with-usb-acl-helper-dir=%{_libexecdir}/spice-gtk-%{_arch}/ \
|
||||
%{?arg_polkit} \
|
||||
%{?arg_usb_acl_helper} \
|
||||
--enable-lz4 \
|
||||
--enable-vala \
|
||||
--disable-werror
|
||||
|
@ -150,9 +162,11 @@ rm -f %{buildroot}%{_libdir}/*.la
|
|||
%{_libdir}/libspice-client-glib-2.0.so.*
|
||||
%{_libdir}/libspice-controller.so.*
|
||||
%{_libdir}/girepository-1.0/SpiceClientGLib-2.0.typelib
|
||||
%if %{with_polkit}
|
||||
%dir %{_libexecdir}/spice-gtk-%{_arch}/
|
||||
%attr(4755, root, root) %{_libexecdir}/spice-gtk-%{_arch}/spice-client-glib-usb-acl-helper
|
||||
%{_datadir}/polkit-1/actions/org.spice-space.lowlevelusbaccess.policy
|
||||
%endif
|
||||
|
||||
%files -n spice-glib-devel
|
||||
%{_libdir}/libspice-client-glib-2.0.so
|
||||
|
|
Loading…
Reference in New Issue