Ignore:
Timestamp:
May 30, 2011, 9:42:19 PM (9 years ago)
Author:
jmr@…
Message:

create RUNUSR at install time and default to 'macports'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/Makefile.in

    r77866 r79025  
    3838# Only run these scripts when not building in a destroot
    3939ifeq ($(DESTDIR),)
     40# create run user if it doesn't exist
     41        @if test -n "${DSCL}" -a -n "${DSEDITGROUP}" ; then \
     42        if ! ${DSEDITGROUP} -q -o read ${RUNUSR} > /dev/null 2>&1 ; then \
     43            if test $$USER = root; then \
     44                echo "Creating group \"${RUNUSR}\"" ; \
     45                ${DSEDITGROUP} -q -o create -n . ${RUNUSR} ; \
     46            else \
     47                echo "Not creating group \"${RUNUSR}\" (not root)" ; \
     48            fi ; \
     49        fi ; \
     50        if ! ${DSCL} -q . -list /Users/${RUNUSR} > /dev/null 2>&1 ; then \
     51            if test $$USER = root; then \
     52                echo "Creating user \"${RUNUSR}\"" ; \
     53                ${DSCL} -q . -create /Users/${RUNUSR} Password * ; \
     54                ${DSCL} -q . -create /Users/${RUNUSR} UniqueID $(($(${DSCL} . -list /Users UniqueID | /usr/bin/awk '{print $2}' | sort -ug | tail -1)+1)) ; \
     55                ${DSCL} -q . -create /Users/${RUNUSR} PrimaryGroupID $(${DSCL} -q . -read /Groups/${RUNUSR} PrimaryGroupID | /usr/bin/awk '{print $2}') ; \
     56                ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory /dev/null ; \
     57                ${DSCL} -q . -create /Users/${RUNUSR} UserShell /usr/bin/false ; \
     58            else \
     59                echo "Not creating user \"${RUNUSR}\" (not root)" ; \
     60            fi ; \
     61        fi ; \
     62    else \
     63        echo "Can't find ${DSCL} / ${DSEDITGROUP}, not creating user \"${RUNUSR}\"" ; \
     64    fi
    4065# Add [default] tag to the central MacPorts repository, if it isn't already
    4166        $(TCLSH) src/upgrade_sources_conf_default.tcl "${prefix}"
Note: See TracChangeset for help on using the changeset viewer.