]> git.rkrishnan.org Git - tahoe-lafs/zfec.git/blob - zfec/setup.py
zfec: setup: bump the required version number of setuptools_darcs to >= 1.0.4
[tahoe-lafs/zfec.git] / zfec / setup.py
1 #!/usr/bin/env python
2
3 # zfec -- fast forward error correction library with Python interface
4
5 # Copyright (C) 2007 Allmydata, Inc.
6 # Author: Zooko Wilcox-O'Hearn
7
8 # This file is part of zfec.
9 #
10 # This program is free software; you can redistribute it and/or modify it
11 # under the terms of the GNU General Public License as published by the Free
12 # Software Foundation; either version 2 of the License, or (at your option)
13 # any later version, with the added permission that, if you become obligated
14 # to release a derived work under this licence (as per section 2.b), you may
15 # delay the fulfillment of this obligation for up to 12 months.  If you are
16 # obligated to release code under section 2.b of this licence, you are
17 # obligated to release it under these same terms, including the 12-month grace
18 # period clause.  See the COPYING file for details.
19 #
20 # If you would like to inquire about a commercial relationship with Allmydata,
21 # Inc., please contact partnerships@allmydata.com and visit
22 # http://allmydata.com/.
23
24 try:
25     from ez_setup import use_setuptools
26 except ImportError:
27     pass
28 else:
29     import sys
30     if 'cygwin' in sys.platform.lower():
31         min_version='0.6c6'
32     else:
33         min_version='0.6a9'
34     use_setuptools(min_version=min_version, download_delay=0)
35
36 from setuptools import Extension, find_packages, setup
37
38 DEBUGMODE=("--debug" in sys.argv)
39
40 extra_compile_args=[]
41 extra_link_args=[]
42
43 extra_compile_args.append("-std=c99")
44
45 undef_macros=[]
46
47 if DEBUGMODE:
48     extra_compile_args.append("-O0")
49     extra_compile_args.append("-g")
50     extra_compile_args.append("-Wall")
51     extra_link_args.append("-g")
52     undef_macros.append('NDEBUG')
53
54 trove_classifiers=[
55     "Development Status :: 5 - Production/Stable",
56     "Environment :: Console",
57     "License :: OSI Approved :: GNU General Public License (GPL)", 
58     "License :: DFSG approved",
59     "Intended Audience :: Developers", 
60     "Intended Audience :: End Users/Desktop",
61     "Intended Audience :: System Administrators",
62     "Operating System :: Microsoft",
63     "Operating System :: Microsoft :: Windows",
64     "Operating System :: Unix",
65     "Operating System :: POSIX :: Linux",
66     "Operating System :: POSIX",
67     "Operating System :: MacOS :: MacOS X",
68     "Operating System :: Microsoft :: Windows :: Windows NT/2000",
69     "Operating System :: OS Independent", 
70     "Natural Language :: English", 
71     "Programming Language :: C", 
72     "Programming Language :: Python", 
73     "Topic :: Utilities",
74     "Topic :: System :: Systems Administration",
75     "Topic :: System :: Filesystems",
76     "Topic :: System :: Distributed Computing",
77     "Topic :: Software Development :: Libraries",
78     "Topic :: Communications :: Usenet News",
79     "Topic :: System :: Archiving :: Backup", 
80     "Topic :: System :: Archiving :: Mirroring", 
81     "Topic :: System :: Archiving", 
82     ]
83
84 try:
85     import os
86     (cin, cout, cerr,) = os.popen3("darcsver")
87     print cout.read()
88 except Exception, le:
89     pass
90 import re
91 VERSIONFILE = "zfec/_version.py"
92 verstr = "unknown"
93 VSRE = re.compile("^verstr = ['\"]([^'\"]*)['\"]", re.M)
94 try:
95     verstrline = open(VERSIONFILE, "rt").read()
96 except EnvironmentError:
97     pass # Okay, there is no version file.
98 else:
99     mo = VSRE.search(verstrline)
100     if mo:
101         verstr = mo.group(1)
102     else:
103         print "unable to find version in %s" % (VERSIONFILE,)
104         raise RuntimeError("if %s.py exists, it is required to be well-formed" % (VERSIONFILE,))
105
106 setup(name='zfec',
107       version=verstr,
108       description='a fast erasure code with command-line, C, and Python interfaces',
109       long_description='Fast, portable, programmable erasure coding a.k.a. "forward error correction": the generation of redundant blocks of information such that if some blocks are lost then the original data can be recovered from the remaining blocks.',
110       author='Zooko O\'Whielacronx',
111       author_email='zooko@zooko.com',
112       url='http://allmydata.org/source/zfec',
113       license='GNU GPL',
114       install_requires=["argparse >= 0.8", "pyutil >= 1.3.5",],
115       packages=find_packages(),
116       include_package_data=True,
117       setup_requires=['setuptools_darcs >= 1.0.4',],
118       classifiers=trove_classifiers,
119       entry_points = { 'console_scripts': [ 'zfec = zfec.cmdline_zfec:main', 'zunfec = zfec.cmdline_zunfec:main' ] },
120       ext_modules=[Extension('zfec/_fec', ['zfec/fec.c', 'zfec/_fecmodule.c',], extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, undef_macros=undef_macros),],
121       test_suite="zfec.test",
122       zip_safe=False, # I prefer unzipped for easier access.
123       )