Error trying to sign RPM

12,459

Solution 1

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.

Solution 2

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>

Solution 3

At least on my machine the file is called .rpmmacros (with an s).

Share:
12,459
vpram86
Author by

vpram86

Updated on June 13, 2022

Comments

  • vpram86
    vpram86 almost 2 years

    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?