From owner-freebsd-ports Wed Apr 11 0:43:39 2001 Delivered-To: freebsd-ports@freebsd.org Received: from pcwin002.win.tue.nl (pcwin002.win.tue.nl [131.155.71.72]) by hub.freebsd.org (Postfix) with ESMTP id 383D637B422 for ; Wed, 11 Apr 2001 00:43:36 -0700 (PDT) (envelope-from stijn@pcwin002.win.tue.nl) Received: (from stijn@localhost) by pcwin002.win.tue.nl (8.11.3/8.11.3) id f3B7hes20824; Wed, 11 Apr 2001 09:43:40 +0200 (CEST) (envelope-from stijn) Date: Wed, 11 Apr 2001 09:43:40 +0200 From: Stijn Hoop To: Adam Kranzel Cc: freebsd-ports@freebsd.org Subject: Re: Question about making a port prefix-clean Message-ID: <20010411094340.A20170@pcwin002.win.tue.nl> References: <01041100123400.17830@teru.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <01041100123400.17830@teru.dyndns.org>; from adam@alameda.edu on Wed, Apr 11, 2001 at 12:12:34AM -0700 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, On Wed, Apr 11, 2001 at 12:12:34AM -0700, Adam Kranzel wrote: > I am working on my first port (of Slash'Em, which is a variant of Nethack), > and have a question about making it prefix-clean. > > There are 6 patches necessary, 5 of which are to makefiles, and thus easy to > make prefix-clean. However one patch is to a pregenerated .h file, which > (among other things) defines the directory to install to. > Since it is a .h file not a makefile, I can't use the standard make variables > to change it for prefix-cleaness. > Is there a way to do this? I'm guessing they are generated in the 'make configure' step? You can define a post-configure target, which gets run after make configure. You could then patch them using sed or perl. For example: post-configure: ${PERL} -pi -e "s@/usr/local@${PREFIX}@g" ${WRKSRC}/foo.h or something like that. Note that this is hackish; however it should work. Maybe other people have better solutions than this :) > I have checked the various Nethack ports (which mine originally derived > from), and they have not dealt with this, and have just left it as is, and > thus not prefix-clean. > I have also checked the porters handbook and not found anything. It's not exactly a common situation... > If there is a way to do it I will also fix the Nethack ports, and submit > patches :) That would be cool. --Stijn -- Q: Why is Batman better than Bill Gates? A: Batman was able to beat the Penguin. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message