* adding setup.py, and __init__.py to make this installable package.
[quix0rs-apt-p2p.git] / setup.py
1 #!/usr/bin/env python
2
3 import os
4 import sys
5
6 try:
7     import distutils.core
8     import distutils.command.build_ext
9 except ImportError:
10     raise SystemExit, """\
11 You don't have the python development modules installed.  
12
13 If you have Debian you can install it by running
14     apt-get install python-dev
15
16 If you have RedHat and know how to install this from an RPM please
17 email us so we can put instructions here.
18 """
19
20 try:
21     import twisted
22 except ImportError:
23     raise SystemExit, """\
24 You don't have Twisted installed.
25
26 Twisted can be downloaded from 
27     http://twistedmatrix.com/products/download
28
29 Anything later that version 1.0.3 should work
30 """
31
32 try:
33     import sqlite
34 except ImportError:
35     raise SystemExit, """\
36 You don't have PySQLite installed.
37
38 PySQLite can be downloaded from 
39     http://sourceforge.net/project/showfiles.php?group_id=54058&release_id=139482
40 """
41
42 setup_args = {
43     'name': 'khashmir',
44     'author': 'Andrew Loewenstern',
45     'author_email': 'burris@users.sourceforge.net',
46     'licence': 'MIT',
47     'package_dir': {'khashmir': '.'},
48     'packages': [
49         'khashmir', 
50     ],
51 }
52
53 if hasattr(distutils.dist.DistributionMetadata, 'get_keywords'):
54     setup_args['keywords'] = "internet tcp p2p"
55
56 if hasattr(distutils.dist.DistributionMetadata, 'get_platforms'):
57     setup_args['platforms'] = "win32 posix"
58
59 if __name__ == '__main__':
60     apply(distutils.core.setup, (), setup_args)