From ad1914a9123f841a8313512839c2149f76a597d9 Mon Sep 17 00:00:00 2001 From: Vadim Rutkovsky Date: Tue, 13 Jan 2015 13:40:21 +0100 Subject: [PATCH 1/2] Use sudo and DESTDIR in install-exec-hook This will allow installing the app via jhbuild --- Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index c0d50b6b..be1704b1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,5 +30,5 @@ xdg_app_LDADD = $(OSTREE_LIBS) xdg_app_CFLAGS = $(OSTREE_CFLAGS) install-exec-hook: - chown root $(bindir)/xdg-app-helper - chmod u+s $(bindir)/xdg-app-helper + sudo chown root $(DESTDIR)$(bindir)/xdg-app-helper + sudo chmod u+s $(DESTDIR)$(bindir)/xdg-app-helper From 4720d889f8119cff5b47f8d18195d90cfc1dae4f Mon Sep 17 00:00:00 2001 From: Vadim Rutkovsky Date: Tue, 13 Jan 2015 14:56:14 +0100 Subject: [PATCH 2/2] Use sudo only if --enable-sudo is passed --- Makefile.am | 4 ++-- configure.ac | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index be1704b1..1d3882bf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,5 +30,5 @@ xdg_app_LDADD = $(OSTREE_LIBS) xdg_app_CFLAGS = $(OSTREE_CFLAGS) install-exec-hook: - sudo chown root $(DESTDIR)$(bindir)/xdg-app-helper - sudo chmod u+s $(DESTDIR)$(bindir)/xdg-app-helper + $(SUDO_BIN) chown root $(DESTDIR)$(bindir)/xdg-app-helper + $(SUDO_BIN) chmod u+s $(DESTDIR)$(bindir)/xdg-app-helper diff --git a/configure.ac b/configure.ac index 08f5af76..b22bb898 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,11 @@ PKG_CHECK_MODULES(OSTREE, [glib-2.0 libgsystem >= 2015.1 gio-2.0 ostree-1 >= 201 AC_SUBST(OSTREE_CFLAGS) AC_SUBST(OSTREE_LIBS) +AC_ARG_ENABLE(sudo, + AS_HELP_STRING([--enable-sudo],[Use sudo to set setuid flags on binaries during install]), + [SUDO_BIN="sudo"], [SUDO_BIN=""]) +AC_SUBST([SUDO_BIN]) + AC_CONFIG_FILES([ Makefile ])