3
^                 @   s"   d dl jjZG dd dejZdS )    Nc               @   s    e Zd ZdZdd Zdd ZdS )	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.
    c             C   s   | j d tjj|  d S )Negg_info)run_commandorigr   run)self r   B/tmp/pip-build-ao6tmhm0/setuptools/setuptools/command/bdist_rpm.pyr      s    
zbdist_rpm.runc                sl   | j j }|jdd}tjj| }d|  d|  fdd|D }|jd }d| }|j|| |S )N-_z%define version c                s0   g | ](}|j d dj ddj ddj  qS )zSource0: %{name}-%{version}.tarz)Source0: %{name}-%{unmangled_version}.tarzsetup.py install z5setup.py install --single-version-externally-managed z%setupz&%setup -n %{name}-%{unmangled_version})replace).0line)line23line24r   r	   
<listcomp>   s   
z-bdist_rpm._make_spec_file.<locals>.<listcomp>   z%define unmangled_version )distributionget_versionr   r   r   _make_spec_fileindexinsert)r   versionZ
rpmversionspecZ
insert_locZunmangled_versionr   )r   r   r	   r      s    

zbdist_rpm._make_spec_fileN)__name__
__module____qualname____doc__r   r   r   r   r   r	   r      s   	r   )Zdistutils.command.bdist_rpmcommandr   r   r   r   r   r	   <module>   s   