Hi guys.
I'm trying to rebuild 'rust-vhost-device-gpu.spec' from 'rust-vhost-device-gpu-0.1.0-2.el10s.src.rpm' and I fail with: ... Start: buildsrpm Start: rpmbuild -bs error: macro expansion did not return an integer: (%2) ? "%{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}" : "%{expand:%%{?_with_%{1}:%%global with_%{1} 1}}" error: expanded string: %2 ...
This is some tickery I'm missing here - missing args to cmd which in my case is 'mock' - specific to this .spec?
many thanks, L
Hi, the error message seems to come somewhere from handling conditional builds [1]. My wild guess would be that you have a %bcond somewhere that is missing it's second argument.
[1]: https://rpm-software-management.github.io/rpm/manual/conditionalbuilds.html
Hope this helps!
On 2026-01-22 at 14:34 +0100, lejeczek via devel wrote:
Hi guys.
I'm trying to rebuild 'rust-vhost-device-gpu.spec' from 'rust-vhost-device-gpu-0.1.0-2.el10s.src.rpm' and I fail with: ... Start: buildsrpm Start: rpmbuild -bs error: macro expansion did not return an integer: (%2) ? "%{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}" : "%{expand:%%{?_with_%{1}:%%global with_%{1} 1}}" error: expanded string: %2 ...
It may be a generic source rpm meant to build on multiple distributions. You can search spec file for any code for Fedora, Suse and just comment it out, or change it for CentOS only instead.