]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blob - setup.py
setup and docs: various improvements to setup and docs
[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     # This invokes our own customized version of ez_setup.py to make sure that
19     # setuptools >= v0.6c8 (a.k.a. v0.6-final) is installed.
20
21     # setuptools < v0.6c8 doesn't handle eggs which get installed into the CWD
22     # as a result of being transitively depended on in a setup_requires, but
23     # then are needed for the installed code to run, i.e. in an
24     # install_requires.
25     use_setuptools(download_delay=0, min_version="0.6c8")
26
27 from setuptools import Extension, find_packages, setup
28
29 # Make the dependency-version-requirement, which is used by the Makefile at
30 # build-time, also available to the app at runtime:
31 import shutil
32 try:
33     shutil.copyfile("_auto_deps.py", os.path.join("src", "allmydata", "_auto_deps.py"))
34 except EnvironmentError:
35     # Nevermind then -- perhaps it is already in place and in any case we can do
36     # without it.
37     pass
38
39 trove_classifiers=[
40     "Development Status :: 5 - Production/Stable",
41     "Environment :: Console",
42     "Environment :: Web Environment",
43     "License :: OSI Approved :: GNU General Public License (GPL)", 
44     "License :: DFSG approved",
45     "License :: Other/Proprietary License",
46     "Intended Audience :: Developers", 
47     "Intended Audience :: End Users/Desktop",
48     "Intended Audience :: System Administrators",
49     "Operating System :: Microsoft",
50     "Operating System :: Microsoft :: Windows",
51     "Operating System :: Unix",
52     "Operating System :: POSIX :: Linux",
53     "Operating System :: POSIX",
54     "Operating System :: MacOS :: MacOS X",
55     "Operating System :: Microsoft :: Windows :: Windows NT/2000",
56     "Operating System :: OS Independent", 
57     "Natural Language :: English", 
58     "Programming Language :: C", 
59     "Programming Language :: Python", 
60     "Topic :: Utilities",
61     "Topic :: System :: Systems Administration",
62     "Topic :: System :: Filesystems",
63     "Topic :: System :: Distributed Computing",
64     "Topic :: Software Development :: Libraries",
65     "Topic :: Communications :: Usenet News",
66     "Topic :: System :: Archiving :: Backup", 
67     "Topic :: System :: Archiving :: Mirroring", 
68     "Topic :: System :: Archiving", 
69     ]
70
71
72 VERSIONFILE = "src/allmydata/_version.py"
73 verstr = "unknown"
74 try:
75     verstrline = open(VERSIONFILE, "rt").read()
76 except EnvironmentError:
77     pass # Okay, there is no version file.
78 else:
79     VSRE = r"^verstr = ['\"]([^'\"]*)['\"]"
80     mo = re.search(VSRE, verstrline, re.M)
81     if mo:
82         verstr = mo.group(1)
83     else:
84         print "unable to find version in %s" % (VERSIONFILE,)
85         raise RuntimeError("if %s.py exists, it is required to be well-formed" % (VERSIONFILE,))
86
87 LONG_DESCRIPTION=\
88 """Welcome to the Tahoe project, a secure, decentralized, fault-tolerant 
89 filesystem.  All of the source code is available under a Free Software, Open 
90 Source licence.
91
92 This filesystem is encrypted and spread over multiple peers in such a way that 
93 it remains available even when some of the peers are unavailable, 
94 malfunctioning, or malicious."""
95
96 miscdeps=os.path.join(os.getcwd(), 'misc', 'dependencies')
97 dependency_links=[os.path.join(miscdeps, t) for t in os.listdir(miscdeps) if t.endswith(".tar")]
98
99 # By adding a web page to the dependency_links we are able to put new packages
100 # up there and have them be automatically discovered by existing copies of the
101 # tahoe source when that source was built.
102 dependency_links.append("http://allmydata.org/trac/tahoe/wiki/Dependencies")
103
104 setup_requires = []
105 setup_requires.append('pyutil >= 1.3.16') # used by the Windows installer builder, see misc/sub-ver.py
106
107 # darcsver is needed only if you want "./setup.py darcsver" to write a new
108 # version stamp in src/allmydata/_version.py, with a version number derived from
109 # darcs history.
110 # http://pypi.python.org/pypi/darcsver
111 if 'darcsver' in sys.argv[1:]:
112     setup_requires.append('darcsver >= 1.1.2')
113
114 # setuptools_darcs is required to produce complete distributions (such as with
115 # "sdist" or "bdist_egg"), unless there is a PKG-INFO file present which shows
116 # that this is itself a source distribution.
117 # http://pypi.python.org/pypi/setuptools_darcs
118 if not os.path.exists('PKG-INFO'):
119     setup_requires.append('setuptools_darcs >= 1.1.0')
120
121 import _auto_deps
122
123 setup(name='allmydata-tahoe',
124       version=verstr,
125       description='secure, decentralized, fault-tolerant filesystem',
126       long_description=LONG_DESCRIPTION,
127       author='the allmydata.org Tahoe project',
128       author_email='tahoe-dev@allmydata.org',
129       url='http://allmydata.org/',
130       license='GNU GPL',
131       package_dir = {'':'src'},
132       packages=find_packages("src"),
133       classifiers=trove_classifiers,
134       test_suite="allmydata.test",
135       install_requires=_auto_deps.install_requires,
136       include_package_data=True,
137       setup_requires=setup_requires,
138       dependency_links=dependency_links,
139       entry_points = { 'console_scripts': [ 'tahoe = allmydata.scripts.runner:run' ] },
140       zip_safe=False, # We prefer unzipped for easier access.
141       )