Error trying to sign RPM

vpram86 picture vpram86 · Aug 10, 2012 · Viewed 11.3k times · Source

I am trying to build and sign an RPM. I created my .rpmmacro file in the location I am building /path/to/macrodir/ Then I am using --define with _topdir referring to /path/to/macrodir/

If I build the RPM without giving --sign; its working fine.

rpmbuild --define "_topdir /path/to/macrodir" -bb spec

The .rpmmacro is in macrodir and contains

%_signature gpg
%_gpg_name Name (Comment) <emailid>
%_gpgpath pathtognupgfolder
%_gpgbin locationofgpgexec

If I include --sign then its throwing the error

rpmbuild --define "_topdir /path/to/macrodir" -bb --sign spec

error: You must set "%_gpg_name" in your macro file

I am not able to see what I am doing wrong. Any suggestions?

Answer

dfarrell07 picture dfarrell07 · Jul 15, 2015

As the OP mentioned in a comment, setting the %gpg_name macro via a --define flag to rpm/rpmbuild/rpmsign works.

rpm --define "_gpg_name <your email or name>" --addsign <RPM to sign>