From owner-freebsd-ports Thu Jan 23 10: 5:32 2003 Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E2DA37B401 for ; Thu, 23 Jan 2003 10:05:30 -0800 (PST) Received: from straylight.ringlet.net (office.sbnd.net [217.75.140.130]) by mx1.FreeBSD.org (Postfix) with SMTP id 5877043ED8 for ; Thu, 23 Jan 2003 10:05:26 -0800 (PST) (envelope-from roam@ringlet.net) Received: (qmail 20531 invoked by uid 1000); 23 Jan 2003 18:04:35 -0000 Date: Thu, 23 Jan 2003 20:04:35 +0200 From: Peter Pentchev To: Roman Neuhauser Cc: freebsd-ports Subject: Re: Porting question Message-ID: <20030123180435.GA19722@straylight.oblivion.bg> Mail-Followup-To: Roman Neuhauser , freebsd-ports References: <20030123175712.GE86853@freepuppy.bellavista.cz> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PNTmBPCT7hxwcZjr" Content-Disposition: inline In-Reply-To: <20030123175712.GE86853@freepuppy.bellavista.cz> User-Agent: Mutt/1.5.3i Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 23, 2003 at 06:57:12PM +0100, Roman Neuhauser wrote: > I haven't spotted this in the Porter's Handbook, so I'll ask here: >=20 > a ported program has some hardcoded paths, in quite a few files. I want > to make it $PREFIX-clean. What's the canonical way of doing this? My > first thought was something along these lines: >=20 > files/patch-aa: > +++ foo > --- foo.orig > ... > - ... /etc/something > + ... @@PREFIX@@/etc/something > ... >=20 > Makefile: > USE_REINPLACE=3D yes > PATCHED_FILES=3D foo bar baz >=20 > post-patch: > for f in ${PATCHED_FILES}; do \ > ${REINPLACE_CMD} s,@@PREFIX@@,${PREFIX} $$f; \ > done >=20 > But is this the correct approach? Either this, or something like post-patch: ${FIND} ${WRKSRC} -type f | ${XARGS} ${REINPLACE_CMD} \ "s,/etc/,${PREFIX}/etc/," \ -e "s,/tmp/,${PREFIX}/tmp/," / .... =2E.but only if you are really, really sure that this will not leave civilian casualties :) Of course, the best way would be to contact the program's author and convince them that resistance is futile and hardcoded paths *will* go away in a future version one way or another, so... :P But I see how this might take time and effort, so the above two ways are what you have to work with right now. G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 This sentence contains exactly threee erors. --PNTmBPCT7hxwcZjr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+MC6z7Ri2jRYZRVMRAjO0AJ4yPT9CBqOZP4Pq5b3fbwvVPa2kxwCfZ60e 0WFaCWpOj6sck63K2SUBYHw= =ZehB -----END PGP SIGNATURE----- --PNTmBPCT7hxwcZjr-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message