]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blob - setup.py
setup: finish switching from Tahoe's versions of autoversioning tools to pyutil's...
[tahoe-lafs/tahoe-lafs.git] / setup.py
1 #! /usr/bin/env python
2
3 # Allmydata Tahoe -- secure, distributed storage grid
4
5 # Copyright (C) 2007 Allmydata, Inc.
6
7 # This file is part of tahoe.
8
9 # This program is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by the Free
11 # Software Foundation; either version 2 of the License, or (at your option)
12 # any later version, with the added permission that, if you become obligated
13 # to release a derived work under this licence (as per section 2.b), you may
14 # delay the fulfillment of this obligation for up to 12 months.  If you are
15 # obligated to release code under section 2.b of this licence, you are
16 # obligated to release it under these same terms, including the 12-month grace
17 # period clause.  See the COPYING file for details.
18 #
19 # If you would like to inquire about a commercial relationship with Allmydata,
20 # Inc., please contact partnerships@allmydata.com and visit
21 # http://allmydata.com/.
22
23 import sys, re, os
24 try:
25     from ez_setup import use_setuptools
26 except ImportError:
27     pass
28 else:
29     if 'cygwin' in sys.platform.lower():
30         min_version='0.6c6'
31     else:
32         # foolscap uses a module-level os.urandom() during import, which
33         # breaks inside older setuptools' sandboxing. 0.6c4 is the first
34         # version which fixed this problem.
35         min_version='0.6c4'
36     download_base = "file:"+os.path.join('misc', 'dependencies')+os.path.sep
37     use_setuptools(min_version=min_version,
38                    download_base=download_base,
39                    download_delay=0)
40
41 from setuptools import Extension, find_packages, setup
42
43 from calcdeps import install_requires, dependency_links
44
45 trove_classifiers=[
46     "Development Status :: 3 - Alpha", 
47     "Environment :: Console",
48     "Environment :: Web Environment",
49     # "License :: Free Software (GPL variant)", # Not a real acceptable value.  I guess this means we really need to get our licence DFSG/OSI approved.
50     # "License :: Open Source (GPL variant)", # Not a real acceptable value.  I guess this means we really need to get our licence DFSG/OSI approved.
51     "Intended Audience :: Developers", 
52     "Intended Audience :: End Users/Desktop",
53     "Intended Audience :: System Administrators",
54     "Operating System :: Microsoft",
55     "Operating System :: Microsoft :: Windows",
56     "Operating System :: Unix",
57     "Operating System :: POSIX :: Linux",
58     "Operating System :: POSIX",
59     "Operating System :: MacOS :: MacOS X",
60     "Operating System :: Microsoft :: Windows :: Windows NT/2000",
61     "Operating System :: OS Independent", 
62     "Natural Language :: English", 
63     "Programming Language :: C", 
64     "Programming Language :: Python", 
65     "Topic :: Utilities",
66     "Topic :: System :: Systems Administration",
67     "Topic :: System :: Filesystems",
68     "Topic :: System :: Distributed Computing",
69     "Topic :: Software Development :: Libraries",
70     "Topic :: Communications :: Usenet News",
71     "Topic :: System :: Archiving :: Backup", 
72     "Topic :: System :: Archiving :: Mirroring", 
73     "Topic :: System :: Archiving", 
74     ]
75
76
77 # Build _version.py before trying to extract a version from it. If we aren't
78 # running from a darcs checkout, this will leave any pre-existing _version.py
79 # alone.
80 try:
81     (cin, cout, cerr,) = os.popen3("darcsver --quiet allmydata-tahoe src/allmydata/_version.py")
82     print cout.read()
83 except Exception, le:
84     pass
85 VERSIONFILE = "src/allmydata/_version.py"
86 verstr = "unknown"
87 VSRE = re.compile("^verstr = ['\"]([^'\"]*)['\"]", re.M)
88 try:
89     verstrline = open(VERSIONFILE, "rt").read()
90 except EnvironmentError:
91     pass # Okay, there is no version file.
92 else:
93     mo = VSRE.search(verstrline)
94     if mo:
95         verstr = mo.group(1)
96     else:
97         print "unable to find version in %s" % (VERSIONFILE,)
98         raise RuntimeError("if %s.py exists, it is required to be well-formed" % (VERSIONFILE,))
99
100 LONG_DESCRIPTION=\
101 """Welcome to the AllMyData "tahoe" project. This project implements a secure,
102 distributed, fault-tolerant storage grid under a Free Software licence.
103
104 The basic idea is that the data in this storage grid is spread over all
105 participating nodes, using an algorithm that can recover the data even if a
106 majority of the nodes are no longer available."""
107
108
109 setup(name='allmydata-tahoe',
110       version=verstr,
111       description='secure, distributed storage grid',
112       long_description=LONG_DESCRIPTION,
113       author='Allmydata, Inc.',
114       author_email='tahoe-dev@allmydata.org',
115       url='http://allmydata.org/',
116       license='GNU GPL v2 or later, plus transitive 12 month grace period; http://allmydata.org/trac/tahoe/browser/COPYING',
117       package_dir = {'':'src'},
118       packages=find_packages("src"),
119       classifiers=trove_classifiers,
120       test_suite="allmydata.test",
121       install_requires=install_requires,
122       include_package_data=True,
123       setup_requires=["setuptools_darcs >= 1.0.5",],
124       dependency_links=dependency_links,
125       entry_points = { 'console_scripts': [ 'tahoe = allmydata.scripts.runner:run' ] },
126       zip_safe=False, # We prefer unzipped for easier access.
127       extras_require={'autoversioning':'pyutil >= 1.3.8'},
128       )