Closed hroncok closed 7 years ago
We could use macroed_pkg_name filter that is used to generate global name and names of the packages. Result for normal packages would be unchanged and
%{?python_provide:%python_provide python3-stdnum}
would appear there in corner cases like python-stdnum.
Based on the commit, i don't think this addresses all the related issues (what about the doc subpackage?). I haven't have time to test it yet, but it certainly seems so based on the commit itself.
Yes, you are right. I was probably focused on the provides too much :) I think the main issue is now fixed. Macros aren't used in the spec file, but there isn't so many packages like this one. Do you think this is an acceptable solution?
pyp2rpm should ideally use macros in corner cases like python-stdnum.
Take a package that is called python-something (on Python level, i.e. on PyPI) and run it trough pyp2rpm, tak for example python-stdnum, this is the current output (shortened where not relevant):
The important thing here is that pyp2rpm somewhere knows the RPM subpackages should be pythonX-stdnum and not pythonX-python-stdnum, but it does so without honoring macros and does so not in the
%python_provide
macros, resulting in following provides:python2-stdnum:
python3-stdnum:
Also, note the python-python-stdnum-doc package.
The correct resolution here would be to set
%pypi_name
just tostdnum
and change the bits where needed to be chnaged. However, that would be a bit false, because the PyPI name is not juststdnum
, so maybe rename the macro?This is the proposed spec: