By default, GNU config.guess seems to add the release to the os name for solaris, eg sparc-sun-solaris2.9. Why it does this, hey I don't know. But I guess it can be a useful way to distinguish features between versions without having to look at further information. In a specfile, I'd like to match against any version. I figure an easy way to do this is with a like operator. %if %{_target_os} =~ "solaris2.*" ... %endif Maybe this operator could be more generally useful as well. Anyway, it was pretty easy to work up the code, patch is coming. See what you think.
Created attachment 96732 [details] Add a like operator for the specfile parser. Sorry, I don't know Doxygen.
Build tests based on arch are fatally flawed by design, it's the wrong name space for packaging (think: spec files are not like cross-compiling *.c). Adding loosey-goosey regex matches isn't the right thing to do because it just postpones the day of doom needlessly The %if syntax (which is line oriented) has never fit in well with macro expansion (which is stream oriented). The entire %if expression parser needs scrap somewhen, possibly soon. Otherwise, the patch looks fine. NEEDINFO so's I don't have to stare at the bug report.
If the patch is ok, but you are not going to use it because it "isn't the right thing to do", why not close this WONTFIX?