Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jan 2003 20:04:35 +0200
From:      Peter Pentchev <roam@ringlet.net>
To:        Roman Neuhauser <neuhauser@bellavista.cz>
Cc:        freebsd-ports <freebsd-ports@freebsd.org>
Subject:   Re: Porting question
Message-ID:  <20030123180435.GA19722@straylight.oblivion.bg>
In-Reply-To: <20030123175712.GE86853@freepuppy.bellavista.cz>
References:  <20030123175712.GE86853@freepuppy.bellavista.cz>

next in thread | previous in thread | raw e-mail | index | archive | help

--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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030123180435.GA19722>