Why does '.el7' get duplicated while building the rpm file using spec in Red Hat Enterprise Linux 7?

Solution Verified - Updated -

Issue

  • Trying to build a custom rpm file, where Release is defined as follows in spec file.
Release: 3%{?dist}
  • Everything works as expected. %{dist} becomes part of the produced file name, eg, foo-1.2-3.el7.noarch.rpm etc. And, if the following is used:
Release: %{?release}
  • It gets a name sans %{dist}, eg, foo-1.2-3.noarch.rpm.
  • However, if the following is used, the .el7 gets duplicated. That is, foo-1.2-3.el7.el7.noarch.rpm, why?
Release: %{?release}%{?dist}
  • What is wrong? How can one get a parameterized release number with just one instance of the %{dist}?

Environment

  • Red Hat Enterprise Linux 7.0
  • rpmbuild

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content