From 3b64fbc4f51692ca821c1e197b671ac4b22bf726 Mon Sep 17 00:00:00 2001 From: Ikey Doherty Date: Wed, 18 Jan 2017 22:35:08 +0000 Subject: [PATCH] profile: Support alternative profile.d locations Typically Linux distributions employ /etc/profile.d for system wide environment manipulation prior to multi-user initialisation. Modern distribution efforts split the vendor configuration from the local sysadmin configuration and data, by not using the /etc/ directories, for example. To enable this stateless pattern, this change adds a new --with-profile-dir option to use an alternative location, such as within /usr/share/. This ensures that the data (not configuration) is owned through the update process, and does not conflict with changes made locally to the system, enforcing domains of ownership. To preserve backwards compatible behaviour, the default directory remains set to /etc/profile.d. Signed-off-by: Ikey Doherty --- Makefile.am | 2 +- configure.ac | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 24b25287..c56a2ef1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -119,7 +119,7 @@ completiondir = $(datadir)/bash-completion/completions completion_DATA = completion/flatpak EXTRA_DIST += $(completion_DATA) -profiledir = $(sysconfdir)/profile.d +profiledir = $(PROFILE_DIR) profile_DATA = flatpak.sh EXTRA_DIST += \ profile/flatpak.sh.in \ diff --git a/configure.ac b/configure.ac index b9a5f72a..a56211b3 100644 --- a/configure.ac +++ b/configure.ac @@ -108,6 +108,12 @@ AC_ARG_WITH(system_fonts_dir, SYSTEM_FONTS_DIR=$with_system_fonts_dir AC_SUBST(SYSTEM_FONTS_DIR) +AC_ARG_WITH(profile_dir, + AS_HELP_STRING([--with-profile-dir=PATH],[choose directory for profile.d files, [default=SYSCONFDIR/profile.d]]), + with_profile_dir="$withval", with_profile_dir=${sysconfdir}/profile.d) +PROFILE_DIR=$with_profile_dir +AC_SUBST(PROFILE_DIR) + AC_ARG_VAR([BWRAP], [Bubblewrap executable]) AC_ARG_WITH([system-bubblewrap], [AS_HELP_STRING([--with-system-bubblewrap], [Use system bwrap executable [default=check $BWRAP]])],