From fdd8fe7cc1abc93e3e01094166a7d2905782bb1b Mon Sep 17 00:00:00 2001
From: Zooko O'Whielacronx <zooko@zooko.com>
Date: Thu, 26 Apr 2007 14:47:54 -0700
Subject: [PATCH] zfec: make it Python 2.4-compatible (but also it requires
 setuptools again)

---
 src/zfec/setup.py                                      | 6 +++---
 src/zfec/zfec/__init__.py                              | 2 +-
 src/zfec/zfec/cmdline/__init__.py                      | 0
 src/zfec/zfec/{cmdline/zfec.py => cmdline_zfec.py}     | 8 ++++----
 src/zfec/zfec/{cmdline/zunfec.py => cmdline_zunfec.py} | 8 ++++----
 5 files changed, 12 insertions(+), 12 deletions(-)
 delete mode 100644 src/zfec/zfec/cmdline/__init__.py
 rename src/zfec/zfec/{cmdline/zfec.py => cmdline_zfec.py} (96%)
 rename src/zfec/zfec/{cmdline/zunfec.py => cmdline_zunfec.py} (96%)

diff --git a/src/zfec/setup.py b/src/zfec/setup.py
index 7fb590df..aa300c65 100644
--- a/src/zfec/setup.py
+++ b/src/zfec/setup.py
@@ -26,7 +26,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
-from distutils.core import Extension, setup
+from setuptools import Extension, find_packages, setup
 
 DEBUGMODE=False
 # DEBUGMODE=True
@@ -66,9 +66,9 @@ setup(name='zfec',
       url='http://allmydata.org/source/zfec',
       license='GNU GPL',
       platform='Any',
-      packages=['zfec', 'zfec.cmdline', 'zfec.util', 'zfec.test'],
+      packages=find_packages(),
       classifiers=trove_classifiers,
-      entry_points = { 'console_scripts': [ 'zfec = zfec.cmdline.zfec:main', 'zunfec = zfec.cmdline.zunfec:main' ] },
+      entry_points = { 'console_scripts': [ 'zfec = zfec.cmdline_zfec:main', 'zunfec = zfec.cmdline_zunfec:main' ] },
       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),],
       test_suite="zfec.test.test_zfec",
       )
diff --git a/src/zfec/zfec/__init__.py b/src/zfec/zfec/__init__.py
index 236986f7..e7ce28e3 100644
--- a/src/zfec/zfec/__init__.py
+++ b/src/zfec/zfec/__init__.py
@@ -17,5 +17,5 @@ __version__ = Version("1.0.0a5-1-STABLE")
 __sources__ = ["http://allmydata.com/source/zfec",]
 
 from _fec import Encoder, Decoder, Error
-import filefec
+import filefec, cmdline_zfec, cmdline_zunfec
 
diff --git a/src/zfec/zfec/cmdline/__init__.py b/src/zfec/zfec/cmdline/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/src/zfec/zfec/cmdline/zfec.py b/src/zfec/zfec/cmdline_zfec.py
similarity index 96%
rename from src/zfec/zfec/cmdline/zfec.py
rename to src/zfec/zfec/cmdline_zfec.py
index 5853cb7c..07e80233 100644
--- a/src/zfec/zfec/cmdline/zfec.py
+++ b/src/zfec/zfec/cmdline_zfec.py
@@ -7,11 +7,11 @@
 
 import sys
 
-from ..util import argparse
-from .. import filefec
+from util import argparse
+import filefec
 
-from ..zfec import __version__ as libversion
-from ..util.version import Version
+from zfec import __version__ as libversion
+from util.version import Version
 __version__ = Version("1.0.0a1-0-STABLE")
 
 def main():
diff --git a/src/zfec/zfec/cmdline/zunfec.py b/src/zfec/zfec/cmdline_zunfec.py
similarity index 96%
rename from src/zfec/zfec/cmdline/zunfec.py
rename to src/zfec/zfec/cmdline_zunfec.py
index 0865adbb..c3dc51fb 100644
--- a/src/zfec/zfec/cmdline/zunfec.py
+++ b/src/zfec/zfec/cmdline_zunfec.py
@@ -7,11 +7,11 @@
 
 import os, sys
 
-from ..util import argparse
-from .. import filefec
+from util import argparse
+import filefec
 
-from ..zfec import __version__ as libversion
-from ..util.version import Version
+from zfec import __version__ as libversion
+from util.version import Version
 __version__ = Version("1.0.0a1-0-STABLE")
 
 def main():
-- 
2.45.2