diff options
author | Michael Johnson <ahze@FreeBSD.org> | 2006-11-11 16:36:23 +0000 |
---|---|---|
committer | Michael Johnson <ahze@FreeBSD.org> | 2006-11-11 16:36:23 +0000 |
commit | 7f33fac9e0e5d8be742ea03a8ba553bdaf989718 (patch) | |
tree | 220570795bfbff80a39db0362c83a6f478ab87e7 /devel | |
parent | 6c283f47a995a99768efcb8c38b7dd24df0eeb31 (diff) | |
download | ports-7f33fac9e0e5d8be742ea03a8ba553bdaf989718.tar.gz ports-7f33fac9e0e5d8be742ea03a8ba553bdaf989718.zip |
- Reserve UID and GID 561 for distcc
Requested by: Stefan Thurner <thurners@nicsys.de>
Notes
Notes:
svn path=/head/; revision=177060
Diffstat (limited to 'devel')
-rw-r--r-- | devel/distcc/Makefile | 16 | ||||
-rw-r--r-- | devel/distcc/pkg-install | 97 |
2 files changed, 37 insertions, 76 deletions
diff --git a/devel/distcc/Makefile b/devel/distcc/Makefile index 4ec67229bec3..0d8b92b5725c 100644 --- a/devel/distcc/Makefile +++ b/devel/distcc/Makefile @@ -70,10 +70,6 @@ DOC_FILES= AUTHORS INSTALL NEWS README \ doc/protocol-1.txt doc/status-1.txt \ doc/protocol-2.txt doc/reporting-bugs.txt -pre-install: - @${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" \ - ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL - do-install: @${INSTALL_PROGRAM} ${WRKSRC}/distcc ${PREFIX}/bin @${INSTALL_PROGRAM} ${WRKSRC}/distccmon-text ${PREFIX}/bin @@ -82,28 +78,26 @@ do-install: .endif @${INSTALL_PROGRAM} ${WRKSRC}/distccd ${PREFIX}/sbin -post-install: install-doc install-man +post-install: @${TOUCH} ${DISTCCD_PIDFILE} - @${CHOWN} distcc:distcc ${DISTCCD_PIDFILE} .if defined(WITH_COMPILER_LINKS) @${MKDIR} ${PREFIX}/${CCLINKDIR} .for link in ${DISTCC_COMPILERS} ${LN} -sf ${PREFIX}/bin/distcc ${PREFIX}/${CCLINKDIR}/${link} .endfor .endif - @${CAT} ${PKGMESSAGE} - -install-doc: .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} .for FILE in ${DOC_FILES} @${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR} .endfor .endif - -install-man: .for f in ${MAN1} @${INSTALL_MAN} ${WRKSRC}/man/${f} ${MANPREFIX}/man/man1 .endfor + @${CAT} ${PKGMESSAGE} +.if !defined(PACKAGE_BUILDING) + @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL +.endif .include <bsd.port.post.mk> diff --git a/devel/distcc/pkg-install b/devel/distcc/pkg-install index f66c434adaf5..ac8a2625a0d7 100644 --- a/devel/distcc/pkg-install +++ b/devel/distcc/pkg-install @@ -1,69 +1,36 @@ #!/bin/sh -# -# $FreeBSD$ -# -PKG_PREFIX=${PKG_PREFIX:=/usr/local} -BATCH=${BATCH:=no} - -ask() { - local question default answer - - question=$1 - default=$2 - if [ -z "${PACKAGE_BUILDING}" -a x${BATCH} = xno ]; then - read -p "${question} [${default}]? " answer - fi - if [ x${answer} = x ]; then - answer=${default} - fi - echo ${answer} -} - -yesno() { - local question default answer - - question=$1 - default=$2 - while :; do - answer=$(ask "${question}" "${default}") - case "${answer}" in - [Yy]*) return 0;; - [Nn]*) return 1;; - esac - echo "Please answer yes or no." - done -} - -if [ x"$2" = xPRE-INSTALL ]; then - USER=distcc - GROUP=distcc - - if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then - echo "You already have a group \"${GROUP}\", so I will use it." - else - if /usr/sbin/pw groupadd ${GROUP} -h - - then - echo "Added group \"${GROUP}\"." +case $2 in +POST-INSTALL) + USER=distcc + GROUP=${USER} + UID=561 + GID=${UID} + PW=/usr/sbin/pw + CHOWN=/usr/sbin/chown + if ${PW} group show "${GROUP}" 2>/dev/null; then + echo "You already have a group \"${GROUP}\", so I will use it." else - echo "Adding group \"${GROUP}\" failed..." - echo "Please create it, and try again." - exit 1 - fi - fi - - if /usr/sbin/pw usershow "${USER}" 2>/dev/null; then - echo "You already have a user \"${USER}\", so I will use it." - else - if /usr/sbin/pw useradd ${USER} -g ${GROUP} -h - \ - -s /sbin/nologin \ - -c "Distcc" - then - echo "Added user \"${USER}\"." + if ${PW} groupadd ${GROUP} -g ${GID}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + exit 1 + fi + fi + + if ${PW} user show "${USER}" 2>/dev/null; then + echo "You already have a user \"${USER}\", so I will use it." else - echo "Adding user \"${USER}\" failed..." - echo "Please create it, and try again." - exit 1 - fi - fi -fi + if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + -d "/nonexistent" -s /sbin/nologin -c "Distcc user" + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi + fi + exit 0 + ;; +esac |