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