Rpmbuild - setting name of created .rpm
Asked Answered
T

1

13

I've been trying to find out what's the easiest way to set a fixed filename during rpm creation. Can it be set somewhere in .spec file or as rpmbuild parameter? The default name depends on version and release number. Name of my rpm has to be always the same.

thanks

sync

Tersanctus answered 15/3, 2010 at 20:7 Comment(0)
C
19

Yes, override the %_rpmfilename macro. The default value according to my rpm --showrc is:

%%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm

So, you could add the following (or similar) to the top of your .spec file:

%define _rpmfilename %%{NAME}.%%{OS}.%%{ARCH}.rpm
Cacophonous answered 24/3, 2010 at 11:1 Comment(1)
caveat: you should have a very good reason for doing this per RPM, if you really want to change the naming scheme and make it incompatible with your distro (ie you are packaging for your own distro with different naming standards), redefine _rpmfilename "upstream" in the system rpm macrosHolcman

© 2022 - 2024 — McMap. All rights reserved.