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