From owner-freebsd-ports Fri Dec 15 22: 0:12 2000 From owner-freebsd-ports@FreeBSD.ORG Fri Dec 15 22:00:09 2000 Return-Path: Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 3978437B402 for ; Fri, 15 Dec 2000 22:00:05 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id eBG605222495; Fri, 15 Dec 2000 22:00:05 -0800 (PST) (envelope-from gnats) Resent-Date: Fri, 15 Dec 2000 22:00:05 -0800 (PST) Resent-Message-Id: <200012160600.eBG605222495@freefall.freebsd.org> Resent-From: gnats-admin@FreeBSD.org (GNATS Management) Resent-To: freebsd-ports@FreeBSD.org Resent-Reply-To: gnats-admin@FreeBSD.org, matt@gsicomp.on.ca Received: from xena.gsicomp.on.ca (cr677933-a.ktchnr1.on.wave.home.com [24.43.230.149]) by hub.freebsd.org (Postfix) with ESMTP id 12EAF37B400; Fri, 15 Dec 2000 21:52:00 -0800 (PST) Received: from gabby.gsicomp.on.ca (root@gabby.gsicomp.on.ca [192.168.0.2]) by xena.gsicomp.on.ca (8.9.3/8.9.3) with ESMTP id AAA87597; Sat, 16 Dec 2000 00:51:59 -0500 (EST) (envelope-from root@gabby.gsicomp.on.ca) Received: (from root@localhost) by gabby.gsicomp.on.ca (8.9.3/8.9.3) id AAA52571; Sat, 16 Dec 2000 00:51:59 -0500 (EST) (envelope-from root) Message-Id: <200012160551.AAA52571@gabby.gsicomp.on.ca> Date: Sat, 16 Dec 2000 00:51:59 -0500 (EST) From: matt@gsicomp.on.ca Sender: root@gabby.gsicomp.on.ca Reply-To: matt@gsicomp.on.ca To: FreeBSD-gnats-submit@freebsd.org, asami@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/23581: Updates to bsd.port.mk to detect changing values of ${PREFIX} Resent-Sender: gnats@FreeBSD.org Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 23581 >Category: ports >Synopsis: Updates to bsd.port.mk to detect changing values of ${PREFIX} >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Dec 15 22:00:01 PST 2000 >Closed-Date: >Last-Modified: >Originator: Matt Emmerton >Release: FreeBSD 4.1-RELEASE i386 >Organization: GSI Computer Services >Environment: FreeBSD 4.1-RELEASE (GABBY.20001124.01) #0: Fri Nov 24 00:46:27 EST 2000 >Description: Any port which uses GNU configure, Perl's MakeMaker, IMake, or a custom 'configure' script in order to generate Makefiles will be passed ${PREFIX}, which will then be hardcoded into the resulting Makefiles. Many such ports also rely on post-install targets to install documentation, sample configurations or startup scripts which are not installed by the Makefiles generated above. In these cases, most components of the port will be installed under the ${PREFIX} given during the initial make, with any files installed by the post-install target using the ${PREFIX} given during installation. Unfortunately, there is no mechanism to prevent ports being built with one choice of ${PREFIX}, and then being installed with another. This patch addresses this issue. >How-To-Repeat: 1. Select a port that uses one of the above configuration mechanisms. (I used ftp/cftp during testing of this patch). 2. Do a 'make PREFIX=/some/dir' 3. Do a 'make install PREFIX=/some/other/dir' >Fix: --- bsd.port.mk.orig Sat Dec 16 00:03:42 2000 +++ bsd.port.mk Sat Dec 16 00:33:58 2000 @@ -1760,6 +1760,9 @@ .if !target(do-configure) do-configure: +.if defined(GNU_CONFIGURE) || defined(PERL_CONFIGURE) || defined(USE_IMAKE) + @echo ${PREFIX} > ${WRKDIR}/.configure_dir +.endif .if defined(USE_AUTOMAKE) @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOMAKE_ENV} ${AUTOMAKE} \ ${AUTOMAKE_ARGS}) @@ -1769,6 +1772,7 @@ ${AUTOCONF_ARGS}) .endif @if [ -f ${SCRIPTDIR}/configure ]; then \ + @echo ${PREFIX} > ${WRKDIR}/.configure_dir; \ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \ ${SCRIPTDIR}/configure; \ fi @@ -2057,6 +2061,15 @@ @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} configure @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} real-build ${INSTALL_COOKIE}: + if [ -f ${WRKDIR}/.configure_dir ]; then \ + if [ "x${PREFIX}" != "x`${CAT} ${WRKDIR}/.configure_dir`" ]; then \ + ${ECHO} "===> ${PKGNAME} has already been configured to install into `${CAT} ${WRKDIR}/.configure_dir`."; \ + ${ECHO} " If you wish to install into another directory, you must first do a"; \ + ${ECHO} " \`\`make clean'' followed by \`\`make PREFIX=${PREFIX}'' in order"; \ + ${ECHO} " to install into ${PREFIX}."; \ + exit 1; \ + fi; \ + fi @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} build @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} real-install # Scan PLIST for setugid files and startup scripts >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message