]> git.rkrishnan.org Git - tahoe-lafs/zfec.git/blob - zfec/setup.py
zfec: autogenerate version numbers from darcs history
[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.  See the file
16 # COPYING for details.
17 #
18 # If you would like to inquire about a commercial relationship with Allmydata,
19 # Inc., please contact partnerships@allmydata.com and visit
20 # http://allmydata.com/.
21
22 from ez_setup import use_setuptools
23 use_setuptools(min_version='0.6a9')
24
25 from setuptools import Extension, find_packages, setup
26
27 DEBUGMODE=False
28 # DEBUGMODE=True
29
30 extra_compile_args=[]
31 extra_link_args=[]
32
33 extra_compile_args.append("-std=c99")
34
35 undef_macros=[]
36
37 if DEBUGMODE:
38     extra_compile_args.append("-O0")
39     extra_compile_args.append("-g")
40     extra_compile_args.append("-Wall")
41     extra_link_args.append("-g")
42     undef_macros.append('NDEBUG')
43
44 trove_classifiers=[
45     "Development Status :: 5 - Production/Stable",
46     "Environment :: Console",
47     "License :: OSI Approved :: GNU General Public License (GPL)", 
48     "License :: DFSG approved",
49     "Intended Audience :: Developers", 
50     "Intended Audience :: End Users/Desktop",
51     "Intended Audience :: System Administrators",
52     "Operating System :: Microsoft",
53     "Operating System :: Microsoft :: Windows",
54     "Operating System :: Unix",
55     "Operating System :: POSIX :: Linux",
56     "Operating System :: POSIX",
57     "Operating System :: MacOS :: MacOS X",
58     "Operating System :: Microsoft :: Windows :: Windows NT/2000",
59     "Operating System :: OS Independent", 
60     "Natural Language :: English", 
61     "Programming Language :: C", 
62     "Programming Language :: Python", 
63     "Topic :: Utilities",
64     "Topic :: System :: Systems Administration",
65     "Topic :: System :: Filesystems",
66     "Topic :: System :: Distributed Computing",
67     "Topic :: Software Development :: Libraries",
68     "Topic :: Communications :: Usenet News",
69     "Topic :: System :: Archiving :: Backup", 
70     "Topic :: System :: Archiving :: Mirroring", 
71     "Topic :: System :: Archiving", 
72     ]
73
74 import re
75 VERSIONFILE = "zfec/_version.py"
76 verstr = "unknown"
77 VSRE = re.compile("^verstr = ['\"]([^'\"]*)['\"]", re.M)
78 try:
79     verstrline = open(VERSIONFILE, "rt").read()
80 except EnvironmentError:
81     pass # Okay, there is no version file.
82 else:
83     mo = VSRE.search(verstrline)
84     if mo:
85         verstr = mo.group(1)
86     else:
87         print "unable to find version in %s" % (VERSIONFILE,)
88         raise RuntimeError("if %s.py exists, it must be well-formed" % (VERSIONFILE,))
89
90 setup(name='zfec',
91       install_requires=['pyutil>=1.0.0',],
92       version=verstr,
93       description='a fast erasure code with command-line, C, and Python interfaces',
94       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.',
95       author='Zooko O\'Whielacronx',
96       author_email='zooko@zooko.com',
97       url='http://allmydata.org/source/zfec',
98       license='GNU GPL',
99       packages=find_packages(),
100       classifiers=trove_classifiers,
101       entry_points = { 'console_scripts': [ 'zfec = zfec.cmdline_zfec:main', 'zunfec = zfec.cmdline_zunfec:main' ] },
102       ext_modules=[Extension('_fec', ['zfec/fec.c', 'zfec/_fecmodule.c',], extra_link_args=extra_link_args, extra_compile_args=extra_compile_args, undef_macros=undef_macros),],
103       test_suite="zfec.test",
104       )