Hmm, the %python_alternative script tries to be too clever and fails in finding the correct file pattern in the %files section [1]:
[ 47s] RPM build errors: [ 47s] File not found: /home/abuild/rpmbuild/BUILDROOT/python-aliyun-img-utils-1.1.0-2.1.x86_64/usr/share/man/man1/*-3.6
Any idea?
The macro is actually not clever enough. You have to expand the filelist before the macro sees it. python_alternative must create several directives per file: foo, foo-3.6 and the ghost entry. And the results are different for manpages, so the lua cannot just mangle the still unexpanded shell glob pattern. The same is true for %python_install_alternative, which would just write the glob into the scriptlet. I suspect rpmlint will give you an error there, because it cannot expand the glob and compare with the filelist.