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 <ikey@solus-project.com>
tingping/wmclass
Ikey Doherty 2017-01-18 22:35:08 +00:00 committed by Alexander Larsson
parent ca107ebb16
commit 3b64fbc4f5
2 changed files with 7 additions and 1 deletions

View File

@ -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 \

View File

@ -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]])],