]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blob - setup.py
setup: use setuptools (if it is present) at run-time to give a specific error message...
[tahoe-lafs/tahoe-lafs.git] / setup.py
1 #! /usr/bin/env python
2
3 # Allmydata Tahoe -- secure, distributed storage grid
4
5 # Copyright (C) 2008 Allmydata, Inc.
6
7 # This file is part of tahoe.
8
9 # See the docs/about.html file for licensing information.
10
11 import os, re, sys
12
13 try:
14     from ez_setup import use_setuptools
15 except ImportError:
16     pass
17 else:
18     # On cygwin there was a permissions error that was fixed in 0.6c6.  (Also
19     # foolscap uses a module-level os.urandom() during import, which breaks
20     # inside older setuptools' sandboxing. 0.6c4 is the first version which
21     # fixed this problem.)
22     use_setuptools(min_version='0.6c6')
23
24 from setuptools import Extension, find_packages, setup
25
26 trove_classifiers=[
27     "Development Status :: 4 - Beta", 
28     "Environment :: Console",
29     "Environment :: Web Environment",
30     "License :: OSI Approved :: GNU General Public License (GPL)", 
31     "License :: DFSG approved",
32     "License :: Other/Proprietary License",
33     "Intended Audience :: Developers", 
34     "Intended Audience :: End Users/Desktop",
35     "Intended Audience :: System Administrators",
36     "Operating System :: Microsoft",
37     "Operating System :: Microsoft :: Windows",
38     "Operating System :: Unix",
39     "Operating System :: POSIX :: Linux",
40     "Operating System :: POSIX",
41     "Operating System :: MacOS :: MacOS X",
42     "Operating System :: Microsoft :: Windows :: Windows NT/2000",
43     "Operating System :: OS Independent", 
44     "Natural Language :: English", 
45     "Programming Language :: C", 
46     "Programming Language :: Python", 
47     "Topic :: Utilities",
48     "Topic :: System :: Systems Administration",
49     "Topic :: System :: Filesystems",
50     "Topic :: System :: Distributed Computing",
51     "Topic :: Software Development :: Libraries",
52     "Topic :: Communications :: Usenet News",
53     "Topic :: System :: Archiving :: Backup", 
54     "Topic :: System :: Archiving :: Mirroring", 
55     "Topic :: System :: Archiving", 
56     ]
57
58
59 VERSIONFILE = "src/allmydata/_version.py"
60 verstr = "unknown"
61 try:
62     verstrline = open(VERSIONFILE, "rt").read()
63 except EnvironmentError:
64     pass # Okay, there is no version file.
65 else:
66     VSRE = r"^verstr = ['\"]([^'\"]*)['\"]"
67     mo = re.search(VSRE, verstrline, re.M)
68     if mo:
69         verstr = mo.group(1)
70     else:
71         print "unable to find version in %s" % (VERSIONFILE,)
72         raise RuntimeError("if %s.py exists, it is required to be well-formed" % (VERSIONFILE,))
73
74 LONG_DESCRIPTION=\
75 """Welcome to the Tahoe project, a secure, decentralized, fault-tolerant 
76 filesystem.  All of the source code is available under a Free Software, Open 
77 Source licence.
78
79 This filesystem is encrypted and spread over multiple peers in such a way that 
80 it remains available even when some of the peers are unavailable, 
81 malfunctioning, or malicious."""
82
83 miscdeps=os.path.join(os.getcwd(), 'misc', 'dependencies')
84 dependency_links=[os.path.join(miscdeps, t) for t in os.listdir(miscdeps) if t.endswith(".tar")]
85
86 # By adding a web page to the dependency_links we are able to put new packages
87 # up there and have them be automatically discovered by existing copies of the
88 # tahoe source when that source was built.
89 dependency_links.append("http://allmydata.org/trac/tahoe/wiki/Dependencies")
90
91 setup_requires = []
92
93 # darcsver is needed only if you want "./setup.py darcsver" to write a new
94 # version stamp in src/allmydata/_version.py, with a version number derived from
95 # darcs history.
96 # http://pypi.python.org/pypi/darcsver
97 setup_requires.append('darcsver >= 1.0.0')
98
99 # setuptools_darcs is required to produce complete distributions (such as with
100 # "sdist" or "bdist_egg"), unless there is a PKG-INFO file present which shows
101 # that this is itself a source distribution.
102 # http://pypi.python.org/pypi/setuptools_darcs
103 if not os.path.exists('PKG-INFO'):
104     setup_requires.append('setuptools_darcs >= 1.1.0')
105
106 install_requires=["zfec >= 1.3.0",
107                   "foolscap >= 0.2.3",
108                   "simplejson >= 1.7.3",
109                   "pycryptopp >= 0.2.9",
110                   "nevow >= 0.6.0",
111                   "zope.interface >= 3.1.0",
112                   ]
113
114 setup(name='allmydata-tahoe',
115       version=verstr,
116       description='secure, decentralized, fault-tolerant filesystem',
117       long_description=LONG_DESCRIPTION,
118       author='Allmydata, Inc.',
119       author_email='tahoe-dev@allmydata.org',
120       url='http://allmydata.org/',
121       license='GNU GPL',
122       package_dir = {'':'src'},
123       packages=find_packages("src"),
124       classifiers=trove_classifiers,
125       test_suite="allmydata.test",
126       install_requires=install_requires,
127       include_package_data=True,
128       setup_requires=setup_requires,
129       dependency_links=dependency_links,
130       entry_points = { 'console_scripts': [ 'tahoe = allmydata.scripts.runner:run' ] },
131       zip_safe=False, # We prefer unzipped for easier access.
132       )