On Thu, Dec 27, 2007, Russ P. Herrold wrote:
> + - jbj: RFE: capture arbitrary 'defines' from the ENV, and the
> invocation
> + command line, each to end up in binary *.rpm's to show more of build
> + time options
Have a look at OpenPKG's "%option" implementation. It seamlessly does
exactly what you are seeking for, I think. And it does not even need any
RPM hacking, just a few macro tricks. It actually is already possible
with RPM 4 (which OpenPKG still officially uses).
An "%option with_bar <default>" in foo.spec results in "foo" to
automatically "%define with_bar <value>" and "Provide: foo::with_bar =
<value>" and <value> is <default> or <override> if package "foo" was
built with "rpm -bb --define 'with_foo <override>' foo.spec". For the
boolean "with_xxx" options OpenPKG even uses the shorthands "rpm -bb
--with foo" and "rpm -bb --without foo".
The "%option" stuff is what we call "build-time options" asd the
"with_foo" in foo.spec is usually used in "%if/%endif" constructs to
conditionally build or not build some parts of a program.
The "%option" is just syntactic sugar, but the fact that build-time
options automatically lead to a "Provides" tag is the really
essential part of such a facility. As this way the options are
_remembered_ in the binary RPM and the RPMDB for installed packages
and additionally other packages can "Requires" them.
In OpenPKG for instance the "wordpress" package contains "BuildPreReq:
perl-dbi, perl-dbi::with_dbd_mysql = yes" to ensure that the Perl DBI
stuff in package "perl-dbi" was built with the MySQL DBD enabled.
Ralf S. Engelschall
[EMAIL PROTECTED]
www.engelschall.com
______________________________________________________________________
RPM Package Manager http://rpm5.org
Developer Communication List [email protected]