Date: Fri, 28 Apr 2000 22:07:20 -0400 From: Will Andrews <andrews@technologist.com> To: FreeBSD Ports <ports@FreeBSD.org> Cc: Stijn Hoop <stijn@win.tue.nl>, Satoshi Asami <asami@FreeBSD.org> Subject: Re: bsd.port.mk suggestion: INSTALL_BEFORE_ARGS Message-ID: <20000428220720.E3419@argon.blackdawn.com> In-Reply-To: <20000424075531.A604@argon.blackdawn.com>; from andrews@TECHNOLOGIST.COM on Mon, Apr 24, 2000 at 07:55:31AM -0400 References: <20000423134810.R6549@argon.blackdawn.com> <20000424134438.B74806@pcwin002.win.tue.nl> <20000424075531.A604@argon.blackdawn.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <andrews@technologist.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000428220720.E3419>