distro/rpm: use modern %pyproject_* macros
Support new %pyproject_* macros where they're supported, otherwise use older %py3_* macros which work everywhere.
Introduce new %{PYPROJECT} var which is only set on distros supporting new macros - Fedora >= 40 and EL >= 9.