portmaster not replacing %var% in final pkg-msg
Sahil Tandon
sahil at FreeBSD.org
Mon May 31 07:39:35 UTC 2010
On Sun, 30 May 2010, Eitan Adler wrote:
> $cd lang/go && portmaster .
> ------------------------------------------------------------------
> To build Go programs for FreeBSD, you'll want to set up your
> environment properly. The following environment variables should
> be set:
> ...
> GOOS=freebsd
> GOARCH=386
> GOROOT=/usr/local/lib/go
This works because of the following sed-fu in lang/go/Makefile:
post-install:
@${CAT} ${PKGMESSAGE} | ${SED} \
-e "s|%%PREFIX%%|${PREFIX}|g" \
-e "s|%%ARCH%%|${GOARCH}|g" \
-e "s|%%GOOBJ%%|${GOOBJ}|g"
> ===>>> pkg-message for go-20100413
[ .. ]
> GOARCH=%%ARCH%%
> GOROOT=%%PREFIX%%/lib/go
It's probably preferable for lang/go to utilize SUB_FILES and
SUB_LIST instead of using ${SED} to manually expand VAR=VALUE pairs in
post-install. For context, see:
http://www.freebsd.org/doc/en/books/porters-handbook/book.html#USING-SUB-FILES
--
Sahil Tandon <sahil at FreeBSD.org>
More information about the freebsd-questions
mailing list