From owner-freebsd-ports Sun Oct 31 15:23: 1 1999 Delivered-To: freebsd-ports@freebsd.org Received: from relay.nuxi.com (nuxi.cs.ucdavis.edu [169.237.7.38]) by hub.freebsd.org (Postfix) with ESMTP id 217B814EE0 for ; Sun, 31 Oct 1999 15:22:45 -0800 (PST) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (root@d60-025.leach.ucdavis.edu [169.237.60.25]) by relay.nuxi.com (8.9.3/8.9.3) with ESMTP id PAA15654; Sun, 31 Oct 1999 15:22:43 -0800 (PST) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.9.3/8.9.1) id PAA50143; Sun, 31 Oct 1999 15:22:43 -0800 (PST) (envelope-from obrien) Date: Sun, 31 Oct 1999 15:22:42 -0800 From: "David O'Brien" To: Cc@FreeBSD.ORG:Marcin Cieslak , ports@FreeBSD.ORG Subject: Re: gif2png: 'optional' dependencies Message-ID: <19991031152242.B23583@dragon.nuxi.com> Reply-To: obrien@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from chuckr@picnic.mat.net on Tue, Oct 26, 1999 at 01:08:55PM -0400 X-Operating-System: FreeBSD 4.0-CURRENT Organization: The NUXI BSD group X-PGP-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Keyid: 34F9F9D5 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > This is done by a lot of ports. Use a patch to change that line to > something easily replaced, like %%PREFIX%%/bin, and then use > a pre-install target to sed that: > > pre-install: > $(SED) -e "s/%%PREFIX%%/$(PREFIX)/" < infile >outfile A much cleaner way is: ${PERL} -pi.orig -e "s:/usr/bin/python:${PREFIX}/bin/python:" \ /path_to_file_to_change as one does not need to patch the file 1st and one does not need to mv the file to a temperary name before using sed (since sed cannot do in-place editing). -- -- David (obrien@NUXI.com) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message