I’m trying to do this:
%if 0%{?debian_version} <= 10 || 0%{?ubuntu_version} <= 1910
Substitute: qt5-qmake qt5-default
%endif
But it doesn’t work as expected. Instead, it just evaluates to true if it’s debian or ubuntu, but I need to check for specific version.
Is this even possible? Can’t find a documentation or source code for these macro parser.
For other poor souls with similar problem
I found a source code for this place: https://github.com/openSUSE/obs-build/blob/master/configs/ubuntu.conf and by the looks of things there is no way to distinguish ubuntu/debian versions
But I solved my particular problem, which is “qt5-default” package in Debian>10 and Ubuntu 21.04+. Older versions have this package, but newer ones don’t. So I replaced “qt5-default” with “qt5-qmake” in control and dsc files Build-Depends. This fixes newer versions and breaks the older. To make everything works I’ve added “export QT_SELECT=qt5” to debian.rules file.
Here’s a working example https://build.opensuse.org/package/show/home:oleg_antonyan/mpz