setup.py
changeset 8 c7ae4d2e820c
parent 7 776ba4914dfc
child 15 497067ee16b7
equal deleted inserted replaced
7:776ba4914dfc 8:c7ae4d2e820c
     1 #!/usr/bin/env python3.2
     1 #!/usr/bin/env python3
     2 
     2 
     3 from distutils.core import setup
     3 from distutils.core import setup
       
     4 from distutils.command.bdist_rpm import bdist_rpm
       
     5 import sys
       
     6 
       
     7 
       
     8 class my_bdist_rpm(bdist_rpm):
       
     9     def __init__(self, *args, **kwargs):
       
    10         bdist_rpm.__init__(self, *args, **kwargs)
       
    11         self._alter_name()
       
    12 
       
    13     def _alter_name(self):
       
    14         """Prepend "python-" or "python3-" in package name."""
       
    15         if sys.version_info.major == 3:
       
    16             prefix = 'python3-'
       
    17         else:
       
    18             prefix = 'python-'
       
    19         self.distribution.metadata.name = prefix + self.distribution.metadata.name
       
    20 
     4 
    21 
     5 setup(
    22 setup(
     6     name='python3-pycolib',
    23     name='pycolib',
     7     version='0.0.1',
    24     version='0.0.1',
     8     description='Library of small auxiliary modules',
    25     description='Library of small auxiliary modules',
     9     author='Radek Brich',
    26     author='Radek Brich',
    10     author_email='radek.brich@devl.cz',
    27     author_email='radek.brich@devl.cz',
    11     url='http://hg.devl.cz/pycolib',
    28     url='http://hg.devl.cz/pycolib',
    12     packages=['pycolib'],
    29     packages=['pycolib'],
    13     )
    30     cmdclass={'bdist_rpm': my_bdist_rpm},
       
    31 )
    14 
    32