3

According to the Fedora documentation the %{?dist} tag when building an RPM on CentOS 7 I should get .el7. but currently I get .el7.centos.

The line from my .spec:

Release: 1%{?_buildid}%{?dist}

I cannot find any documentation talking about this change or any way to change it back to the old (and in my case preferred) behaviour.

Any pointers on how to force the old behaviour?

1
  • 1
    This seems to have been remedied by a change to the definition of %{dist} in /etc/rpm/macros.dist in the centos-release-7-5.1804.el7.centos.2.x86_64 update.
    – jhfrontz
    Commented Jun 28, 2018 at 14:37

1 Answer 1

3

I just fought the same problem. A search led me here: http://rpmfind.net/linux/RPM/centos/7.1.1503/x86_64/Packages/centos-release-7-1.1503.el7.centos.2.8.x86_64.html

The value of "%{dist}" is (at least on CentOS 7) defined by the file "/etc/rpm/macros.dist", and you might modify that file. As a less drastic means, try this in your spec file:

%if 0%{?rhel} == 7
  %define dist .el7
  # CentOS 7 would force ".el7.centos", we want to avoid that.
%endif
2
  • Sorry about bad formatting: Commented Sep 9, 2015 at 10:28
  • 1
    You can also do %define dist %{expand:%%(/usr/lib/rpm/redhat/dist.sh --dist)} which is valid for both centos6 and centos7 Commented Mar 7, 2018 at 11:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .