3 # Allmydata Tahoe -- secure, distributed storage grid
5 # Copyright (C) 2008 Allmydata, Inc.
7 # This file is part of tahoe.
9 # See the docs/about.html file for licensing information.
14 from ez_setup import use_setuptools
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.
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
25 use_setuptools(download_delay=0, min_version="0.6c8")
27 from setuptools import Extension, find_packages, setup
28 from setuptools.command import sdist
30 # Make the dependency-version-requirement, which is used by the Makefile at
31 # build-time, also available to the app at runtime:
34 shutil.copyfile("_auto_deps.py", os.path.join("src", "allmydata", "_auto_deps.py"))
35 except EnvironmentError:
36 # Nevermind then -- perhaps it is already in place and in any case we can do
41 "Development Status :: 5 - Production/Stable",
42 "Environment :: Console",
43 "Environment :: Web Environment",
44 "License :: OSI Approved :: GNU General Public License (GPL)",
45 "License :: DFSG approved",
46 "License :: Other/Proprietary License",
47 "Intended Audience :: Developers",
48 "Intended Audience :: End Users/Desktop",
49 "Intended Audience :: System Administrators",
50 "Operating System :: Microsoft",
51 "Operating System :: Microsoft :: Windows",
52 "Operating System :: Unix",
53 "Operating System :: POSIX :: Linux",
54 "Operating System :: POSIX",
55 "Operating System :: MacOS :: MacOS X",
56 "Operating System :: Microsoft :: Windows :: Windows NT/2000",
57 "Operating System :: OS Independent",
58 "Natural Language :: English",
59 "Programming Language :: C",
60 "Programming Language :: Python",
62 "Topic :: System :: Systems Administration",
63 "Topic :: System :: Filesystems",
64 "Topic :: System :: Distributed Computing",
65 "Topic :: Software Development :: Libraries",
66 "Topic :: Communications :: Usenet News",
67 "Topic :: System :: Archiving :: Backup",
68 "Topic :: System :: Archiving :: Mirroring",
69 "Topic :: System :: Archiving",
73 VERSIONFILE = "src/allmydata/_version.py"
76 verstrline = open(VERSIONFILE, "rt").read()
77 except EnvironmentError:
78 pass # Okay, there is no version file.
80 VSRE = r"^verstr = ['\"]([^'\"]*)['\"]"
81 mo = re.search(VSRE, verstrline, re.M)
85 print "unable to find version in %s" % (VERSIONFILE,)
86 raise RuntimeError("if %s.py exists, it is required to be well-formed" % (VERSIONFILE,))
89 """Welcome to the Tahoe project, a secure, decentralized, fault-tolerant
90 filesystem. All of the source code is available under a Free Software, Open
93 This filesystem is encrypted and spread over multiple peers in such a way that
94 it remains available even when some of the peers are unavailable,
95 malfunctioning, or malicious."""
97 # For Desert Island builds, assume that the user has extracted the dependency
98 # tarball into a directory named 'misc/dependencies'.
99 dependency_links=[os.path.join(os.getcwd(), 'misc', 'dependencies')]
101 # By adding a web page to the dependency_links we are able to put new packages
102 # up there and have them be automatically discovered by existing copies of the
103 # tahoe source when that source was built.
104 dependency_links.append("http://allmydata.org/trac/tahoe/wiki/Dependencies")
106 # Default setup_requires are pyutil for the Windows installer builder(see
107 # misc/sub-ver.py) and Twisted for the tests.
108 #setup_requires = ['pyutil >= 1.3.16', 'Twisted >= 2.4.0']
110 # darcsver is needed only if you want "./setup.py darcsver" to write a new
111 # version stamp in src/allmydata/_version.py, with a version number derived from
113 # http://pypi.python.org/pypi/darcsver
114 if 'darcsver' in sys.argv[1:]:
115 setup_requires.append('darcsver >= 1.1.5')
117 # setuptools_darcs is required to produce complete distributions (such as with
118 # "sdist" or "bdist_egg"), unless there is a PKG-INFO file present which shows
119 # that this is itself a source distribution.
120 # http://pypi.python.org/pypi/setuptools_darcs
121 if not os.path.exists('PKG-INFO'):
122 setup_requires.append('setuptools_darcs >= 1.1.0')
124 class MySdist(sdist.sdist):
125 """ A hook in the sdist command so that we can determine whether this the
126 tarball should be 'SUMO' or not, i.e. whether or not to include the
127 external dependency tarballs.
130 # Add our own sumo option to the sdist command, which toggles the
131 # external dependencies being included in the sdist.
132 user_options = sdist.sdist.user_options + \
133 [('sumo', 's', "create a 'sumo' sdist which includes the external " \
135 boolean_options = ['sumo']
137 def initialize_options(self):
138 sdist.sdist.initialize_options(self)
142 self.run_command('egg_info')
143 ei_cmd = self.get_finalized_command('egg_info')
144 self.filelist = ei_cmd.filelist
145 self.filelist.append(os.path.join(ei_cmd.egg_info,'SOURCES.txt'))
147 # If '--sumo' wasn't specified in the arguments, do not include
148 # the external dependency tarballs in the sdist.
150 self.filelist.exclude_pattern(None, prefix='misc/dependencies')
152 print self.filelist.files
154 self.check_metadata()
155 self.make_distribution()
157 dist_files = getattr(self.distribution,'dist_files',[])
158 for file in self.archive_files:
159 data = ('sdist', '', file)
160 if data not in dist_files:
161 dist_files.append(data)
165 setup(name='allmydata-tahoe',
167 description='secure, decentralized, fault-tolerant filesystem',
168 long_description=LONG_DESCRIPTION,
169 author='the allmydata.org Tahoe project',
170 author_email='tahoe-dev@allmydata.org',
171 url='http://allmydata.org/',
173 cmdclass={'sdist': MySdist},
174 package_dir = {'':'src'},
175 packages=find_packages("src"),
176 classifiers=trove_classifiers,
177 test_suite="allmydata.test",
178 install_requires=_auto_deps.install_requires,
179 include_package_data=True,
180 setup_requires=setup_requires,
181 dependency_links=dependency_links,
182 entry_points = { 'console_scripts': [ 'tahoe = allmydata.scripts.runner:run' ] },
183 zip_safe=False, # We prefer unzipped for easier access.