rpmbuild is duplicating OS name in rpm package names when dist tag is in spec file #2397
Replies: 2 comments
-
This is a bad habit. If you want to pre-define the "base" part of the release (or any other similar part) in a macro, use a different name from the tag. Such as "%rel", or whatever. That's probably not the problem here and doing this wont (currently) break anything, but it's confusing (to yourself and the viewer) at best. There are two ways you can get an extra dist there like that: either you have %_rpmfilename overridden to something peculiar including %{dist}, or something in the spec is directly or indirectly defining %distprefix or %dist itself. Impossible to say without the actual spec. If you grab and build https://github.com/rpm-software-management/rpm/blob/master/tests/data/SPECS/mini.spec, do you get the dist in the package name as such? If not, what happens if you add %{?dist} to the Release: tag? |
Beta Was this translation helpful? Give feedback.
-
Oh thank you for your answer. I looked into this issue further, I don't think rpmbuild is what's causing this. These packages which I'm trying to build as rpms, are python packages. They are using a build wheel, and I'm pretty sure now, that they're is something wrong with the plat-name or plat-tag. Thank you very much for your assistance, it sent me in the right direction. I really do appreciate it, as this is very new to me, and I'm still learning. |
Beta Was this translation helpful? Give feedback.
-
I am new to building rpm packages, and my problem is very similiar to this unix stack exchange:
https://unix.stackexchange.com/questions/538458/why-is-my-rpmbuild-dist-fc30-fc30-instead-of-just-fc30
The problem is there's no answer to that question.
I am using rpmbuild -ba directly with no wrapper, just like the other user. I did not redefine any variables, and there is no %define inside the spec file.
I'm on fedora 35, and spec file looks like:
Name: somefile
Version: 1.0.0
Release: %{release}%{?dist}
Which produces an rpm called:
somefile-1.0.0-1.fc35.fc35.noarch.rpm
Just like the unix stack exchange question, the value of %{dist}, according to rpm is just .fc35, as expected:
$ rpm --eval %{dist}
.fc35
And again, if I redefine the release, as something different, for example:
Name: somefile
Version: 1.0.0
Release: 1.123
This gave me a file: somefile-1.0.0-1.123.123.noarch.rpm
The dist macro is defined as %{?distprefix}.fc35%{?with_bootstrap:~bootstrap}
Is the bootstrap function adding an additional os name to the rpm? I am currently using rpm version 16, therefore would a possible solution be to update to version 17 and add %bcond bootstrap 0 to the spec file to disable the bootstrap function?
As per the information in:
https://rpm-software-management.github.io/rpm/manual/conditionalbuilds.html
Hopefully, this question makes sense, as I said I'm still very new to building and packaging rpms.
Beta Was this translation helpful? Give feedback.
All reactions