3 # zfec -- fast forward error correction library with Python interface
5 # Copyright (C) 2007 Allmydata, Inc.
6 # Author: Zooko Wilcox-O'Hearn
8 # This file is part of zfec.
10 # See README.txt for licensing information.
14 miscdeps=os.path.join(os.getcwd(), 'misc', 'dependencies')
17 from ez_setup import use_setuptools
21 if 'cygwin' in sys.platform.lower():
25 download_base = "file:"+os.path.join('misc', 'dependencies')+os.path.sep
26 use_setuptools(min_version=min_version, download_delay=0, download_base=download_base, to_dir=miscdeps)
28 from setuptools import Extension, find_packages, setup
30 DEBUGMODE=("--debug" in sys.argv)
35 extra_compile_args.append("-std=c99")
40 extra_compile_args.append("-O0")
41 extra_compile_args.append("-g")
42 extra_compile_args.append("-Wall")
43 extra_link_args.append("-g")
44 undef_macros.append('NDEBUG')
47 "Development Status :: 5 - Production/Stable",
48 "Environment :: Console",
49 "License :: OSI Approved :: GNU General Public License (GPL)",
50 "License :: DFSG approved",
51 "License :: Other/Proprietary License",
52 "Intended Audience :: Developers",
53 "Intended Audience :: End Users/Desktop",
54 "Intended Audience :: System Administrators",
55 "Operating System :: Microsoft",
56 "Operating System :: Microsoft :: Windows",
57 "Operating System :: Unix",
58 "Operating System :: POSIX :: Linux",
59 "Operating System :: POSIX",
60 "Operating System :: MacOS :: MacOS X",
61 "Operating System :: Microsoft :: Windows :: Windows NT/2000",
62 "Operating System :: OS Independent",
63 "Natural Language :: English",
64 "Programming Language :: C",
65 "Programming Language :: Python",
67 "Topic :: System :: Systems Administration",
68 "Topic :: System :: Filesystems",
69 "Topic :: System :: Distributed Computing",
70 "Topic :: Software Development :: Libraries",
71 "Topic :: Communications :: Usenet News",
72 "Topic :: System :: Archiving :: Backup",
73 "Topic :: System :: Archiving :: Mirroring",
74 "Topic :: System :: Archiving",
78 (cin, cout, cerr,) = os.popen3("darcsver --quiet")
82 VERSIONFILE = "zfec/_version.py"
85 verstrline = open(VERSIONFILE, "rt").read()
86 except EnvironmentError:
87 pass # Okay, there is no version file.
89 VSRE = r"^verstr = ['\"]([^'\"]*)['\"]"
90 mo = re.search(VSRE, verstrline, re.M)
94 print "unable to find version in %s" % (VERSIONFILE,)
95 raise RuntimeError("if %s.py exists, it is required to be well-formed" % (VERSIONFILE,))
97 dependency_links=[os.path.join(miscdeps, t) for t in os.listdir(miscdeps) if t.endswith(".tar")]
101 description='a fast erasure code with command-line, C, and Python interfaces',
102 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.',
103 author='Zooko O\'Whielacronx',
104 author_email='zooko@zooko.com',
105 url='http://allmydata.org/source/zfec',
107 dependency_links=dependency_links,
108 install_requires=["argparse >= 0.8", "pyutil >= 1.3.5"],
109 tests_require=["pyutil >= 1.3.5"],
110 packages=find_packages(),
111 include_package_data=True,
112 setup_requires=['setuptools_darcs >= 1.1.0',],
113 classifiers=trove_classifiers,
114 entry_points = { 'console_scripts': [ 'zfec = zfec.cmdline_zfec:main', 'zunfec = zfec.cmdline_zunfec:main' ] },
115 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),],
116 test_suite="zfec.test",
117 zip_safe=False, # I prefer unzipped for easier access.