From owner-freebsd-ports Fri Apr 28 19: 8:22 2000 Delivered-To: freebsd-ports@freebsd.org Received: from rock.ghis.net (rock.ghis.net [209.222.164.7]) by hub.freebsd.org (Postfix) with ESMTP id B4E1A37B7C7; Fri, 28 Apr 2000 19:08:15 -0700 (PDT) (envelope-from will@blackdawn.com) Received: from argon.blackdawn.com (07-087.dial.008.popsite.net [209.69.77.87]) by rock.ghis.net (8.9.3/8.9.3) with ESMTP id TAA89517; Fri, 28 Apr 2000 19:07:51 -0700 (PDT) Received: by argon.blackdawn.com (Postfix, from userid 1000) id 0CDED1950; Fri, 28 Apr 2000 22:07:21 -0400 (EDT) Date: Fri, 28 Apr 2000 22:07:20 -0400 From: Will Andrews To: FreeBSD Ports Cc: Stijn Hoop , Satoshi Asami Subject: Re: bsd.port.mk suggestion: INSTALL_BEFORE_ARGS Message-ID: <20000428220720.E3419@argon.blackdawn.com> References: <20000423134810.R6549@argon.blackdawn.com> <20000424134438.B74806@pcwin002.win.tue.nl> <20000424075531.A604@argon.blackdawn.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ReaqsoxgOBHFXBhH" X-Mailer: Mutt 1.0.1i In-Reply-To: <20000424075531.A604@argon.blackdawn.com>; from andrews@TECHNOLOGIST.COM on Mon, Apr 24, 2000 at 07:55:31AM -0400 X-Operating-System: FreeBSD 5.0-CURRENT i386 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii On Mon, Apr 24, 2000 at 07:55:31AM -0400, Will Andrews wrote: > To -ports: Hello, anyone here!? Do you want me to write code for this > before a discussion ensues??? HELLO!?!?! I've written up a rather large patch that needs a few fixes. For the most part, it seems like it would work. But it doesn't. I know some things are not done the Right Way (tm). For example, DIR should go in mk/sys.mk or mk/bsd.own.mk. Review requested, PLEASE. :-) -- Will Andrews GCS/E/S @d- s+:+>+:- a--->+++ C++ UB++++ P+ L- E--- W+++ !N !o ?K w--- ?O M+ V-- PS+ PE++ Y+ PGP+>+++ t++ 5 X++ R+ tv+ b++>++++ DI+++ D+ G++>+++ e->++++ h! r-->+++ y? --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="port.diff" Index: bsd.port.mk =================================================================== RCS file: /extra/cvsroot/ports/Mk/bsd.port.mk,v retrieving revision 1.337 diff -u -r1.337 bsd.port.mk --- bsd.port.mk 2000/04/20 01:06:12 1.337 +++ bsd.port.mk 2000/04/29 02:03:48 @@ -246,10 +246,12 @@ # Variables that serve as convenient "aliases" for your *-install targets. # Use these like: "${INSTALL_PROGRAM} ${WRKSRC}/prog ${PREFIX}/bin". # -# INSTALL_PROGRAM - A command to install binary executables. -# INSTALL_SCRIPT - A command to install executable scripts. -# INSTALL_DATA - A command to install sharable data. -# INSTALL_MAN - A command to install manpages (doesn't compress). +# INSTALL_BEFORE_CMD - Command to prefix the installation in order to gain +# proper privileges for that installation. +# INSTALL_PROGRAM - A command to install binary executables. +# INSTALL_SCRIPT - A command to install executable scripts. +# INSTALL_DATA - A command to install sharable data. +# INSTALL_MAN - A command to install manpages (doesn't compress). # # Set the following to specify all manpages that your port installs. # These manpages will be automatically listed in ${PLIST}. Depending @@ -865,6 +867,8 @@ .endif .endif +INSTALL_BEFORE_CMD?= + # Figure out where the local mtree file is .if !defined(MTREE_FILE) .if defined(USE_X_PREFIX) @@ -877,14 +881,17 @@ MTREE_ARGS?= -U -f ${MTREE_FILE} -d -e -p # A few aliases for *-install targets +DIR?=-d +INSTALL_DIR= \ + ${INSTALL_BEFORE_CMD} ${INSTALL} ${DIR} INSTALL_PROGRAM= \ - ${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} + ${INSTALLBEFORE_CMD} ${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} INSTALL_SCRIPT= \ - ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} + ${INSTALL_BEFORE_CMD} ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} INSTALL_DATA= \ - ${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} + ${INSTALL_BEFORE_CMD} ${INSTALL} ${COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} INSTALL_MAN= \ - ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} + ${INSTALL_BEFORE_CMD} ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \ BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \ @@ -1744,14 +1751,14 @@ .if !target(do-install) do-install: .if defined(USE_GMAKE) - @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}) + @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${INSTALL_BEFORE_CMD} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}) .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES) - @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man) + @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${INSTALL_BEFORE_CMD} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man) .endif .else defined(USE_GMAKE) - @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}) + @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${INSTALL_BEFORE_CMD} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}) .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES) - @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man) + @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${INSTALL_BEFORE_CMD} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} install.man) .endif .endif .endif @@ -1872,16 +1879,16 @@ .endif .if make(real-install) @${MKDIR} ${PREFIX} - @if [ `id -u` != 0 ]; then \ + @${INSTALL_BEFORE_CMD} `${SH} -c if [ \`id -u\` != 0 ]; then \ if [ -w ${PREFIX}/ ]; then \ ${ECHO_MSG} "Warning: not superuser, you may get some errors during installation."; \ else \ ${ECHO_MSG} "Error: ${PREFIX}/ not writable."; \ ${FALSE}; \ fi; \ - fi + fi` .if !defined(NO_MTREE) - @if [ `id -u` = 0 ]; then \ + @${INSTALL_BEFORE_CMD} `${SH} -c if [ \`id -u\` = 0 ]; then \ if [ ! -f ${MTREE_FILE} ]; then \ ${ECHO} "Error: mtree file \"${MTREE_FILE}\" is missing."; \ ${ECHO} "Copy it from a suitable location (e.g., /usr/src/etc/mtree) and try again."; \ @@ -1892,11 +1899,11 @@ else \ ${ECHO_MSG} "Warning: not superuser, can't run mtree."; \ ${ECHO_MSG} "You may want to become root and try again to ensure correct permissions."; \ - fi + fi` .endif - @if [ -d ${PREFIX}/info -a ! -f ${PREFIX}/info/dir -a -f /usr/share/info/dir ]; then \ + @${INSTALL_BEFORE_CMD} `${SH} -c if [ -d ${PREFIX}/info -a ! -f ${PREFIX}/info/dir -a -f /usr/share/info/dir ]; then \ ${SED} -ne '1,/Menu:/p' /usr/share/info/dir > ${PREFIX}/info/dir; \ - fi + fi` .endif .if make(real-configure) && defined(USE_LIBTOOL) @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch-libtool --ReaqsoxgOBHFXBhH-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message