I would need that too because I generate a lot of configuration rpms
with the application xml2hostconf (
http://xml2hostconf.sf.net ).
gpg-agent together with rpmbuild would be a nice combination to do this.
It doesn't seem possible at the momement:
http://lists.gnupg.org/pipermail/gnupg-users/2004-January/021302.html
I haven't looked closely into this yet. In my trials I laborated a while
with rpmbuild and some --define command line options, but I soon found
out it is actually rpmbuild that asks for the passphrase.
cheers,
Erik Sjölund