[Spice-devel] [PATCH] Make path to the USB ACL helper configurable

Hans de Goede hdegoede at redhat.com
Wed Dec 21 06:26:03 PST 2011


Ack.

On 12/21/2011 03:20 PM, Christophe Fergeau wrote:
> It's currently installed in $bindir, but this patch makes it possible
> for distros like fedora to install it in $libexecdir/spice/
> ---
>   configure.ac         |    7 +++++++
>   gtk/Makefile.am      |    8 +++++---
>   gtk/usb-acl-helper.c |    2 +-
>   3 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 44c30d6..577b2ee 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -348,6 +348,13 @@ else
>     fi
>   fi
>
> +AC_ARG_WITH([usb-acl-helper-dir],
> +  AS_HELP_STRING([--with-usb-acl-helper-dir=DIR],
> +                 [Directory where the USB ACL helper binary should be installed]),
> +  [ACL_HELPER_DIR="$with_usb_acl_helper_dir"],
> +  [ACL_HELPER_DIR="${bindir}/"])
> +AC_SUBST([ACL_HELPER_DIR])
> +
>   AC_ARG_WITH([coroutine],
>     AS_HELP_STRING([--with-coroutine=@<:@ucontext/gthread/winfiber/auto@:>@],
>                    [use ucontext or GThread for coroutines @<:@default=auto@:>@]),
> diff --git a/gtk/Makefile.am b/gtk/Makefile.am
> index 224d861..2e76014 100644
> --- a/gtk/Makefile.am
> +++ b/gtk/Makefile.am
> @@ -22,7 +22,8 @@ EXTRA_DIST =					\
>
>   bin_PROGRAMS = spicy snappy spicy-stats
>   if WITH_POLKIT
> -bin_PROGRAMS += spice-client-glib-usb-acl-helper
> +acldir = $(ACL_HELPER_DIR)
> +acl_PROGRAMS = spice-client-glib-usb-acl-helper
>   endif
>
>   lib_LTLIBRARIES = \
> @@ -198,6 +199,7 @@ if WITH_POLKIT
>   USB_ACL_HELPER_SRCS = \
>   	usb-acl-helper.c		\
>   	usb-acl-helper.h
> +AM_CPPFLAGS += -DACL_HELPER_PATH="\"$(ACL_HELPER_DIR)\""
>   else
>   USB_ACL_HELPER_SRCS =
>   endif
> @@ -402,8 +404,8 @@ spice_client_glib_usb_acl_helper_CPPFLAGS =	\
>   	$(NULL)
>
>   install-exec-hook:
> -	-chown root $(DESTDIR)$(bindir)/spice-client-glib-usb-acl-helper
> -	-chmod u+s  $(DESTDIR)$(bindir)/spice-client-glib-usb-acl-helper
> +	-chown root $(DESTDIR)$(acldir)/spice-client-glib-usb-acl-helper
> +	-chmod u+s  $(DESTDIR)$(acldir)/spice-client-glib-usb-acl-helper
>
>   endif
>
> diff --git a/gtk/usb-acl-helper.c b/gtk/usb-acl-helper.c
> index e5f8b4d..7fe8404 100644
> --- a/gtk/usb-acl-helper.c
> +++ b/gtk/usb-acl-helper.c
> @@ -184,7 +184,7 @@ void spice_usb_acl_helper_open_acl(SpiceUsbAclHelper *self,
>       GIOStatus status;
>       GPid helper_pid;
>       gsize bytes_written;
> -    gchar *argv[] = { "spice-client-glib-usb-acl-helper", NULL };
> +    gchar *argv[] = { ACL_HELPER_PATH"/spice-client-glib-usb-acl-helper", NULL };
>       gint in, out;
>       gchar buf[128];
>


More information about the Spice-devel mailing list