ó
OyTLc           @   sB   d  d l  m Z d  d l Z d  d l Z d e f d     YZ d S(   iĸĸĸĸ(   t	   bdist_rpmNR    c           B   sA   e  Z d    Z e j d k  r- d d  Z n  d   Z d   Z RS(   c         C   s   t  j |   d  |  _ d  S(   N(   t
   _bdist_rpmt   initialize_optionst   Nonet   no_egg(   t   self(    (    s@   /usr/lib/python2.7/dist-packages/setuptools/command/bdist_rpm.pyR      s    s   2.5i   c      
   C   s   t  j |  | | |  | |  j k r | j d  r t |  j d g   j d | j d  ra d pk t j d  t	 j
 j | t	 j
 j |   f  n  d  S(   Ns   .rpmt
   dist_filesR    s   .src.rpmt   anyi   (   R   t	   move_filet   dist_dirt   endswitht   getattrt   distributiont   appendt   syst   versiont   ost   patht   joint   basename(   R   t   srct   dstt   level(    (    s@   /usr/lib/python2.7/dist-packages/setuptools/command/bdist_rpm.pyR      s    c         C   s   |  j  d  t j |   d  S(   Nt   egg_info(   t   run_commandR   t   run(   R   (    (    s@   /usr/lib/python2.7/dist-packages/setuptools/command/bdist_rpm.pyR      s    c         C   sē   |  j  j   } | j d d  } t j |   } d | } d | } g  | D]< } | j d d  j d d  j d d	  j | |  ^ qK } | j | j |  d
 d |  | 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 (   R   t   get_versiont   replaceR   t   _make_spec_filet   insertt   index(   R   R   t
   rpmversiont   spect   line23t   line24t   line(    (    s@   /usr/lib/python2.7/dist-packages/setuptools/command/bdist_rpm.pyR   *   s    


F!(   t   __name__t
   __module__R   R   R   R   R   R   (    (    (    s@   /usr/lib/python2.7/dist-packages/setuptools/command/bdist_rpm.pyR    	   s
   			(   t   distutils.command.bdist_rpmR    R   R   R   (    (    (    s@   /usr/lib/python2.7/dist-packages/setuptools/command/bdist_rpm.pyt   <module>   s   