Date: Mon, 23 Aug 2004 04:31:04 +0900 (JST) From: Hiroo Ono <hiroo+freebsd@oikumene.gcd.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/70831: make perl5.8 port SU_CMD aware Message-ID: <200408221931.i7MJV4mP044423@chrysanthe.oikumene.gcd.org> Resent-Message-ID: <200408221940.i7MJeSkB094952@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 70831 >Category: ports >Synopsis: make perl5.8 port SU_CMD aware >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Aug 22 19:40:27 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Hiroo Ono >Release: FreeBSD 4.10-STABLE i386 >Organization: >Environment: System: FreeBSD chrysanthe.oikumene.gcd.org 4.10-STABLE FreeBSD 4.10-STABLE #17: Mon Jun 7 23:51:40 JST 2004 hiroo@chrysanthe.oikumene.gcd.org:/build/usr/src/sys/CHRYSANTHE i386 >Description: The pre-install and post-install target of lang/perl5.8 port do not check the case that user id is not 0. To enable portupgrade work running with user privilege, use SU_CMD in such cases. >How-To-Repeat: run make install without root privilege in lang/perl5.8 >Fix: The patch to Makefile is attached. Note that I have a machine that place WRKDIR on a NFS partition for some reason, I'd like to run portupgrade with non-root user privilege and make use of SU_CMD. --- perl5.8-Makefile.diff begins here --- --- Makefile.orig Sun Aug 22 21:50:16 2004 +++ Makefile Sun Aug 22 23:49:45 2004 @@ -98,6 +98,11 @@ .endif MAN3PREFIX= ${PREFIX}/lib/perl5/${PERL_VER}/perl +# Determine whether or not we can use rootly owner/group functions. +.if !defined(UID) +UID!= ${ID} -u +.endif + test: @(cd ${WRKSRC}; make test) @@ -115,10 +120,30 @@ > ${WRKDIR}/use.perl pre-install: +.if ${UID} != 0 && !defined(INSTALL_AS_USER) + @${SU_CMD} "${RM} -f ${PREFIX}/bin/perl${PERL_VER}" + @${SU_CMD} "${RM} -f ${PREFIX}/bin/perl" +.else @${RM} -f ${PREFIX}/bin/perl${PERL_VER} @${RM} -f ${PREFIX}/bin/perl +.endif post-install: +.if ${UID} != 0 && !defined(INSTALL_AS_USER) + @${SU_CMD} "${STRIP_CMD} ${PREFIX}/bin/perl${PERL_VER}" + @${SU_CMD} "${STRIP_CMD} ${PREFIX}/bin/perl" + @${SU_CMD} "${LN} -sf ${PREFIX}/bin/perl${PERL_VER} ${PREFIX}/bin/perl5" + $${SU_CMD} "{INSTALL_SCRIPT} ${WRKDIR}/use.perl ${PREFIX}/bin/use.perl" +.for files in ${BSDPAN_FILES} + ${SU_CMD} "${MKDIR} ${BSDPAN_DEST}/${files:H}" + ${SU_CMD} "${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ + ${BSDPAN_WRKSRC}/${files} ${BSDPAN_DEST}/${files}" +.endfor + @(cd ${INCLUDEDIR} && ${SU_CMD} "${PREFIX}/bin/h2ph *.h machine/*.h sys/*.h)" + ${SU_CMD} "${MKDIR} ${PREFIX}/${SITE_PERL_REL}/auto" + ${SU_CMD} "${MKDIR} ${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto" + ${SU_CMD} "${MKDIR} ${PREFIX}/lib/perl5/${PERL_VER}/man/man3" +.else @${STRIP_CMD} ${PREFIX}/bin/perl${PERL_VER} @${STRIP_CMD} ${PREFIX}/bin/perl @${LN} -sf ${PREFIX}/bin/perl${PERL_VER} ${PREFIX}/bin/perl5 @@ -132,10 +157,15 @@ ${MKDIR} ${PREFIX}/${SITE_PERL_REL}/auto ${MKDIR} ${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto ${MKDIR} ${PREFIX}/lib/perl5/${PERL_VER}/man/man3 +.endif .if ${OSVERSION} < 502100 @fmt ${PKGMESSAGE} .else +.if ${UID} != 0 && !defined(INSTALL_AS_USER) + @${SU_CMD} "${PREFIX}/bin/use.perl port" +.else @${PREFIX}/bin/use.perl port +.endif .endif .include <bsd.port.post.mk> --- perl5.8-Makefile.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408221931.i7MJV4mP044423>