Beginner Question: Best way to substitute variables

Christian Weisgerber naddy at mips.inka.de
Wed Dec 15 07:19:33 PST 2004


Frank Behrens <frank at pinky.sax.de> wrote:

> What is the best way to set variables in scripts (e.g. pkg-install) 
> and text files (e.g. pkg-message) depending from Makefile variables 
> (e.g. PREFIX)? 

> Put all files in a separate directory, create Makefile dependencies 
> and replace the desired strings with "sed". But this seems to be not 
> the usual way, I could not find any example port.

In fact, that is the usual way.  Well, most ports probably don't
bother with Makefile dependencies and just run the substitution
from a configure/build/install rule.

Try

$ find /usr/ports -name Makefile | xargs grep pkg-install\\. /dev/null

Among plenty of chaff, this turns up a number of ports that generate
pkg-install from pkg-install.in etc.

-- 
Christian "naddy" Weisgerber                          naddy at mips.inka.de



More information about the freebsd-ports mailing list