I have a .spec file:

Name:           somefile
Version:        1.0.0
Release:        1%{?dist}

Which produces an RPM:


Why is %{dist} applying .fc30 twice? If I remove %{dist} then I end up with a file:


The value of %{dist}, according to rpm is just .fc30, as expected:

$ rpm --eval %{dist}


It seems to duplicate the last part no matter what it is:

Release:        1.123

This gave me a file: somefile-1.0.0-1.123.123.noarch.rpm.


This seems to be a result of the dist macro:

$ rpm --showrc | grep ' dist'
-13: dist   %{?distprefix}.fc30%{?with_bootstrap:~bootstrap}

Am I using it wrong?

  • What does rpm --eval %_rpmfilename say? Does that give you any hints? Try to follow the fields from there and expand them with rpm --eval to see if you find which one is duplicating the last field... – filbranden Aug 31 '19 at 16:04
  • It says: %{ARCH}/%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm – Zhro Aug 31 '19 at 16:57
  • Does the specfile itself redefine any RPM macros such as _rpmfilename? How are you building the RPM, are you using rpmbuild -ba directly or are you using a wrapper around it (which could be passing additional options)? – filbranden Aug 31 '19 at 17:11
  • I am using rpmbuild directly with no wrapper. I did not redefine any variables. – Zhro Aug 31 '19 at 20:16
  • Yes... But is there any %define inside somefile.spec? – filbranden Aug 31 '19 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.