Search code examples
rpmsigninggnupgrpmbuild

Error trying to sign RPM


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?


Solution

  • Follow this detailed writeup on how to sign custom rpm pacakge.

    I faced a different problem, when running the following command it failed complaining no rpm file found.

    rpm --addsign gyum-2.0-5.FC3.i386.rpm
    

    After installing rpmsign package everything worked.