diff options
author | Florent Thoumie <flz@FreeBSD.org> | 2009-09-17 12:24:09 +0000 |
---|---|---|
committer | Florent Thoumie <flz@FreeBSD.org> | 2009-09-17 12:24:09 +0000 |
commit | 897af990f1e9e1637f72d3747f2a1ee6f238a5b4 (patch) | |
tree | 27c56caf1d9d5b5907a320e28f00ee68b6643794 /Mk | |
parent | a6898071a0abeba2f74b0dbf3b9a02cce8dc8bae (diff) | |
download | ports-897af990f1e9e1637f72d3747f2a1ee6f238a5b4.tar.gz ports-897af990f1e9e1637f72d3747f2a1ee6f238a5b4.zip |
- Introduce new GNU_CONFIGURE_PREFIX to override default --prefix value
passed to configure when GNU_CONFIGURE is set. [1]
- Few changes to the new USERS/GROUPS variables (users/groups are created
earlier, so they're available in do-install; creates homedir when
it's not /var/empty or /nonexistent; set login class if specified).
PR: ports/67436 [1]
Submitted by: (hrs, self) [1]
Feature safe: yes
Notes
Notes:
svn path=/head/; revision=241568
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/bsd.port.mk | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index d74c57f4a8b0..55600a78348b 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -891,9 +891,13 @@ FreeBSD_MAINTAINER= portmgr@FreeBSD.org # - The name of target to call when GNU_CONFIGURE is # defined. # Default: ${ARCH}-portbld-freebsd${OSREL} +# GNU_CONFIGURE_PREFIX +# - The directory passed as prefix to the configure script if +# GNU_CONFIGURE is set. +# Default: ${PREFIX} # CONFIGURE_ARGS # - Pass these args to configure if ${HAS_CONFIGURE} is set. -# Default: "--prefix=${PREFIX} --infodir=${PREFIX}/${INFO_PATH} +# Default: "--prefix=${GNU_CONFIGURE_PREFIX} --infodir=${PREFIX}/${INFO_PATH} # --mandir=${MANPREFIX}/man --build=${CONFIGURE_TARGET}" if # GNU_CONFIGURE is set, "CC=${CC} CCFLAGS=${CFLAGS} # PREFIX=${PREFIX} INSTALLPRIVLIB=${PREFIX}/lib @@ -2908,7 +2912,8 @@ CONFIGURE_FAIL_MESSAGE?= "Please report the problem to ${MAINTAINER} [maintainer .if !defined(CONFIGURE_MAX_CMD_LEN) CONFIGURE_MAX_CMD_LEN!= ${SYSCTL} -n kern.argmax .endif -CONFIGURE_ARGS+= --prefix=${PREFIX} $${_LATE_CONFIGURE_ARGS} +GNU_CONFIGURE_PREFIX?= ${PREFIX} +CONFIGURE_ARGS+= --prefix=${GNU_CONFIGURE_PREFIX} $${_LATE_CONFIGURE_ARGS} CONFIGURE_ENV+= lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN} HAS_CONFIGURE= yes @@ -4034,7 +4039,7 @@ create-users-groups: exit 1; \ fi @IFS=":"; ${GREP} -h ^${_group}: ${GID_FILES} | head -n 1 | while read group foo gid members; do \ - gid=$$(($$gid+${GID_OFFSET}));\ + gid=$$(($$gid+${GID_OFFSET})); \ if ! ${PW} groupshow $$group >/dev/null 2>&1; then \ ${ECHO_MSG} "Creating group \`$$group' with gid \`$$gid'."; \ ${PW} groupadd $$group -g $$gid; \ @@ -4058,22 +4063,26 @@ create-users-groups: exit 1; \ fi @IFS=":"; ${GREP} -h ^${_user}: ${UID_FILES} | head -n 1 | while read login passwd uid gid class change expire gecos homedir shell; do \ - uid=$$(($$uid+${UID_OFFSET}));\ - gid=$$(($$gid+${GID_OFFSET}));\ + uid=$$(($$uid+${UID_OFFSET})); \ + gid=$$(($$gid+${GID_OFFSET})); \ + class="$${class:+-L }$$class"; \ + homedir=$$(echo $$homedir | sed "s|^/usr/local|${PREFIX}|"); \ if ! ${PW} usershow $$login >/dev/null 2>&1; then \ ${ECHO_MSG} "Creating user \`$$login' with uid \`$$uid'."; \ - ${PW} useradd $$login -u $$uid -g $$gid -c "$$gecos" -d $$homedir -s $$shell; \ + eval ${PW} useradd $$login -u $$uid -g $$gid $$class -c \"$$gecos\" -d $$homedir -s $$shell; \ + case $$homedir in /nonexistent|/var/empty) ;; *) ${INSTALL} -d -g $$gid -o $$uid $$homedir;; esac; \ else \ ${ECHO_MSG} "Using existing user \`$$login'."; \ fi; \ - ${ECHO_CMD} "@exec if ! ${PW} usershow $$login >/dev/null 2>&1; then ${PW} useradd $$login -u $$uid -g $$gid -c \"$$gecos\" -d $$homedir -s $$shell; fi" >> ${TMPPLIST}; \ + ${ECHO_CMD} "@exec if ! ${PW} usershow $$login >/dev/null 2>&1; then ${PW} useradd $$login -u $$uid -g $$gid $$class -c \"$$gecos\" -d $$homedir -s $$shell; fi" >> ${TMPPLIST}; \ + case $$homedir in /nonexistent|/var/empty) ;; *) ${ECHO_CMD} "@exec ${INSTALL} -d -g $$gid -o $$uid $$homedir" >> ${TMPPLIST};; esac; \ done .endfor .if defined(GROUPS) .for _group in ${GROUPS} # _bgpd:*:130: @IFS=":"; ${GREP} -h ^${_group}: ${GID_FILES} | head -n 1 | while read group foo gid members; do \ - gid=$$(($$gid+${GID_OFFSET}));\ + gid=$$(($$gid+${GID_OFFSET})); \ IFS=","; for _login in $$members; do \ list=`${PW} usershow $${_login} -P | ${SED} -ne 's/.*Groups: //p'`; \ ${ECHO_MSG} "Setting \`$${_login}' groups to \`$$list$${list:+,}${_group}'."; \ @@ -4272,8 +4281,8 @@ _INSTALL_SEQ= install-message check-conflicts \ run-depends lib-depends apply-slist pre-install \ pre-install-script generate-plist check-already-installed _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \ - pre-su-install-script do-install install-desktop-entries \ - create-users-groups post-install post-install-script \ + pre-su-install-script create-users-groups do-install \ + install-desktop-entries post-install post-install-script \ add-plist-info add-plist-docs add-plist-examples add-plist-data \ add-plist-post install-rc-script compress-man \ install-ldconfig-file fake-pkg security-check |