fedora-python / pyp2rpm

Tool to convert a package from PyPI to RPM SPECFILE or to generate SRPM.
MIT License
127 stars 39 forks source link

cli script is missing from %files section when -p3 option is used #16

Closed marbu closed 9 years ago

marbu commented 9 years ago

When I try to regenerate srpm of kaptan with python3 support like this (ignoring issue #7 for now):

pyp2rpm -n kaptan --srpm -p3

pyp2rpm doesn't include kaptan command line tool into %files section which means that generated spec file is invalid:

Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/makerpm/rpmbuild/BUILDROOT/python-kaptan-0.5.8-1.fc22.i386
error: Installed (but unpackaged) file(s) found:
   /usr/bin/kaptan
   /usr/bin/python3-kaptan

RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/bin/kaptan
   /usr/bin/python3-kaptan

Relevant diff of generated specfile follows (compared to previous run without -p3):

 %files
 %doc README.md LICENSE
-%{_bindir}/kaptan
 %{python2_sitelib}/%{pypi_name}
 %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
+%if 0%{?with_python3}
+%files -n python3-%{pypi_name}
+%doc README.md LICENSE
+%{python3_sitelib}/%{pypi_name}
+%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
+%endif # with_python3
+

Unfortunately since python packaging policy is being redefined because of python3 as default change, I'm not sure what the expected fix for this would be.

I'm using pyp2rpm-1.1.2-1.fc22.noarch