3 ]@s"ddljjZGdddejZdS)Nc@s eZdZdZddZddZdS) bdist_rpmaf Override the default bdist_rpm behavior to do the following: 1. Run egg_info to ensure the name and version are properly calculated. 2. Always run 'install' using --single-version-externally-managed to disable eggs in RPM distributions. 3. Replace dash with underscore in the version numbers for better RPM compatibility. cCs|jdtjj|dS)Negg_info) run_commandorigrrun)selfrB/tmp/pip-build-8jg9gmni/setuptools/setuptools/command/bdist_rpm.pyrs z bdist_rpm.runcsl|jj}|jdd}tjj|}d|d|fdd|D}|jd}d|}|j|||S)N-_z%define version cs0g|](}|jddjddjddjqS)zSource0: %{name}-%{version}.tarz)Source0: %{name}-%{unmangled_version}.tarzsetup.py install z5setup.py install --single-version-externally-managed z%setupz&%setup -n %{name}-%{unmangled_version})replace).0line)line23line24rr s z-bdist_rpm._make_spec_file..z%define unmangled_version ) distribution get_versionr rr_make_spec_fileindexinsert)rversionZ rpmversionspecZ insert_locZunmangled_versionr)rrr rs     zbdist_rpm._make_spec_fileN)__name__ __module__ __qualname____doc__rrrrrr rs r)Zdistutils.command.bdist_rpmcommandrrrrrr s