The generator deliberately does not use %{_prefix} in order to avoid
generating provides for packages that set a custom prefix. This is done
to ensure that provides are only generated for paths where the Python
interpreter actually loads modules from.
As we can't use %{_prefix} (which would make it all much simpler), this
commit adds a conditional to look in /app only when the %flatpak macro
is defined, and /usr otherwise.
This should fix provides generation for /app-installed flatpak builds.
https://fedoraproject.org/wiki/Changes/Disable_Python_2_Dist_RPM_Generators_and_Freeze_Python_2_Macros
The regex previously matched any Python version in a form of <single digit>.<at least one digit>.
Now it matches anything from 3.0 above: <single digit (3 or higher)>.<at least one digit>
It still does not match <multiple digits>.<at least one digit>, e.g. 11.0.
This is a breaking change, hence the version bump.
Running this python script on all possible files is way too expensive.
Some of the packages timeout due to that.
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>