ó
.¿”Wc           @   s/   d  d l  j j Z d e j f d „  ƒ  YZ d S(   iÿÿÿÿNt	   bdist_rpmc           B   s    e  Z d  Z d „  Z d „  Z RS(   sf  
    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(   Nt   egg_info(   t   run_commandt   origR    t   run(   t   self(    (    s@   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/bdist_rpm.pyR      s    c   	      C   sÁ   |  j  j ƒ  } | j d d ƒ } t j j |  ƒ } d | } d | } g  | D]< } | j d d ƒ j d d ƒ j d d	 ƒ j | | ƒ ^ qN } | j | ƒ d
 } d | } | j | | ƒ | S(   Nt   -t   _s   %define version s   Source0: %{name}-%{version}.tars)   Source0: %{name}-%{unmangled_version}.tars   setup.py install s5   setup.py install --single-version-externally-managed s   %setups&   %setup -n %{name}-%{unmangled_version}i   s   %define unmangled_version (   t   distributiont   get_versiont   replaceR   R    t   _make_spec_filet   indext   insert(	   R   t   versiont
   rpmversiont   spect   line23t   line24t   linet
   insert_loct   unmangled_version(    (    s@   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/bdist_rpm.pyR      s    


F
(   t   __name__t
   __module__t   __doc__R   R   (    (    (    s@   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/bdist_rpm.pyR       s   		(   t   distutils.command.bdist_rpmt   commandR    R   (    (    (    s@   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/bdist_rpm.pyt   <module>   s   