RPM Community Forums

Mailing List Message of <rpm-users>

Re: rpm-5.0.2: changing package file name convention

From: Jeff Johnson <n3npq@mac.com>
Date: Wed 06 Feb 2008 - 16:52:14 CET
Message-Id: <42EFA5AE-DFD5-430A-8F13-3258D9F7D43C@mac.com>

On Feb 6, 2008, at 10:40 AM, Stefan Westmeier wrote:

> Hi,
> as I want my packages being named different than standard, I  
> changed the naming convention by
> setting:
> %_build_name_fmt %%{NAME}-%%{VERSION}-%%{Project}-%%{Branch}-%% 
> {RELEASE}.x86.rpm
> %_repackage_name_fmt %%{NAME}-%%{VERSION}-%%{Project}-%%{Branch}-%% 
> {RELEASE}.x86.rpm
> I defined "Project" and "Branch" as additional tags via % 
> _arbitrary_tags. Here some examples for packages:
> most-bin-1.0-refprj-tr-0802061556.x86.rpm
> most-src-1.0-refprj-tr-0802061556.x86.rpm
> most-trg-1.0-refprj-tr-0802061556.x86.rpm
> Using rpm -qa --qf '<some string>' showing the additional tags  
> works fine.
> Whenever I install packages with
> rpm -i most-bin-1.0-refprj-tr-0802061556.x86.rpm
> the package being installed is reported in the output as
> most-bin-1.0-0802061556
> Is there any way to get the additional parts of the package being  
> displayed ?


Don't bother redefining %_build_name_fmt et al, you want/need to  
change Release:

Change the spec file to look something like

     Release: %{?Project:%{Project}_}%{?Branch:%{Branch}_}0802061556

Note the use of underscore '_' rather than dash '-'. rpmbuild forbids  
'-' in Version: and Release:
so that a dash '-' character can be used as a separator in dependency  
EVR strings with possibly
unspecified V and R.

You could also simplify to
     Release: %{?Project}%{?Branch}0802061556
if you chose to add the trailing underscore '_' in the macro  

73 de Jeff
Received on Wed Feb 6 16:52:38 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.