Am Donnerstag, 8. Juni 2023, 12:14:47 CEST schrieb Daniel Garcia:
You can use one or another macro, not both at the same time. * %sle15_python_module_pythons: is to build just for python3.11 * %sle15allpythons: is to build for python3.6 and python3.11
So if a .spec contains the second macro, OBS will produce python3-foo.rpm and python311-foo.rpm.
At the end these macros just set the %pythons define, so by default it's "python3", but sle15_python_module_pythons set it to be "python311" and sle15allpythons set it to "python311 python3".
So if you need to build for a different python, you can override this macro, in your project or even don't use any of these macros and just set the pythons that you need in every .spec file, something like "%global pythons pythonX pythonY pythonZ"
The idea to use the macros instead of direct python version is to be able to adapt in the future, if we change the python version, we'll just need to change the macro and not every package, and it can be modified at project level for customization.
Okay. Have now played around a little and tried. Have now in my spec files only the following: %if 0%{?sle_version} == 150500 && 0%{?is_opensuse} %{?sle15allpythons} %endif Means for 15.4 python3.6 will be built, for 15.5 36 and 3.11 and for Tumbleweed 3.9, 3.10 and 3.11. But for me this means that you don't need any macro for 15.4. For 15.5 sle15allpythons and for Tumbleweed also none. Is that correct? I have to use the above if-loop, because otherwise I get an error when building 15.4. But 15.5 and Tumbleweed build. Is this also correct? Then one last question. How do I prevent a build conflict in my repo when there is an update in the devel project? Then it says in the devel spec: %{?sle15_python_module_pythons} and in mine: %if 0%{?sle_version} == 150500 && 0%{?is_opensuse} %{?sle15allpythons} %endif Sorry if I'm being annoying but would you still answer these questions for me? Regards Eric