diff --git a/Makefile.in b/Makefile.in index 184d431aa..09d98fcb9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -45,6 +45,7 @@ install:: $(INSTALL) -o "${DSTUSR}" -g "${DSTGRP}" -m 444 $(srcdir)/keys/archives/*.pub "$(DESTDIR)${datadir}/macports/keys/archives/" # Only run these scripts when not building in a destroot ifeq ($(DESTDIR),) +ifeq (@NO_ROOTPRIVS@,) # create run user if it doesn't exist @if test `id -u` -eq 0; then \ if test -n "${DSCL}" -a -n "${DSEDITGROUP}" ; then \ @@ -93,6 +94,7 @@ ifeq ($(DESTDIR),) else \ echo "Not creating or updating user or group \"${RUNUSR}\" (not root)" ; \ fi +endif # Move ping cache to new location @if [ -f "${localstatedir}/macports/pingtimes" ]; then \ mv "${localstatedir}/macports/pingtimes" "${localstatedir}/macports/cache/pingtimes"; \ diff --git a/aclocal.m4 b/aclocal.m4 index cc92d20c3..7c220f0d1 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -554,12 +554,11 @@ AC_DEFUN([MP_CHECK_OLDLAYOUT],[ AC_DEFUN([MP_CHECK_NOROOTPRIVILEGES],[ dnl if the user specifies --with-no-root-privileges, dnl use current user and group. - dnl use ~/Library/Tcl as Tcl package directory AC_REQUIRE([MP_PATH_MPCONFIGDIR]) - AC_ARG_WITH(no-root-privileges, [AS_HELP_STRING([--with-no-root-privileges],[specify that MacPorts should be installed in your home directory])], [ROOTPRIVS=$withval] ) + AC_ARG_WITH(no-root-privileges, [AS_HELP_STRING([--with-no-root-privileges],[specify that MacPorts should be installed in your home directory])], [NO_ROOTPRIVS=$withval] ) - if test "${ROOTPRIVS+set}" = set; then + if test "${NO_ROOTPRIVS+set}" = set; then # Set install-user to current user AC_MSG_CHECKING([for install user]) DSTUSR=`id -un` diff --git a/configure b/configure index bde9cfba1..6beeef19b 100755 --- a/configure +++ b/configure @@ -705,6 +705,7 @@ MPFRAMEWORKSDIR MPAPPLICATIONSDIR MTREE_GNAME DSTMODE +NO_ROOTPRIVS RUNUSR DSTGRP DSTUSR @@ -7060,11 +7061,11 @@ printf "%s\n" "$mpconfigdir" >&6; } # Check whether --with-no-root-privileges was given. if test ${with_no_root_privileges+y} then : - withval=$with_no_root_privileges; ROOTPRIVS=$withval + withval=$with_no_root_privileges; NO_ROOTPRIVS=$withval fi - if test "${ROOTPRIVS+set}" = set; then + if test "${NO_ROOTPRIVS+set}" = set; then # Set install-user to current user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for install user" >&5 printf %s "checking for install user... " >&6; } @@ -7092,6 +7093,7 @@ printf "%s\n" "$RUNUSR" >&6; } + # Check for install ownership diff --git a/configure.ac b/configure.ac index 6562bbe4e..b678845dd 100644 --- a/configure.ac +++ b/configure.ac @@ -222,6 +222,7 @@ MP_PATH_MPCONFIGDIR # Check whether to install without root privileges MP_CHECK_NOROOTPRIVILEGES +AC_SUBST(NO_ROOTPRIVS) # Check for install ownership MP_CHECK_INSTALLUSER