#!/usr/bin/env python
import os
import re

try:
    from setuptools import setup, Extension
except ImportError:
    from distutils.core import setup, Extension


if os.path.isfile("MANIFEST"):
    os.unlink("MANIFEST")


BUILD_CEXTENSIONS = True


VERSION = re.search('version = "([^"]+)"',
                    open("storm/__init__.py").read()).group(1)


def find_packages():
    # implement a simple find_packages so we don't have to depend on
    # setuptools
    packages = []
    for directory, subdirectories, files in os.walk("storm"):
        if '__init__.py' in files:
            packages.append(directory.replace(os.sep, '.'))
    return packages


setup(
    name="storm",
    version=VERSION,
    description="Storm is an object-relational mapper (ORM) for Python developed at Canonical.",
    author="Gustavo Niemeyer",
    author_email="gustavo@niemeyer.net",
    maintainer="Storm Developers",
    maintainer_email="storm@lists.canonical.com",
    license="LGPL",
    url="https://storm.canonical.com",
    download_url="https://launchpad.net/storm/+download",
    packages=find_packages(),
    zip_safe=False,
    include_package_data=True,
    package_data={"": ["*.zcml"]},
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
        "Programming Language :: Python",
        "Topic :: Database",
        "Topic :: Database :: Front-Ends",
        "Topic :: Software Development :: Libraries :: Python Modules",
    ],
    ext_modules=(BUILD_CEXTENSIONS and
                 [Extension("storm.cextensions", ["storm/cextensions.c"])])
)

@@ -45,20 +45,22 @@
 ry:%0A    
-from
+import
  setupto
@@ -62,31 +62,73 @@
 tuptools
- import setup, 
+%0A    setup = setuptools.setup%0A    Extension = setuptools.
 Extensio
@@ -157,12 +157,14 @@
     
-from
+import
  dis
@@ -178,23 +178,73 @@
 core
- import setup, 
+%0A    setup = distutils.core.setup%0A    Extension = distutils.core.
 Exte
@@ -811,16 +811,26 @@
 ription=
+(%0A        
 %22Storm i
@@ -876,16 +876,27 @@
  Python 
+%22%0A        %22
 develope
@@ -911,16 +911,17 @@
 onical.%22
+)
 ,%0A    au
@@ -1428,16 +1428,17 @@
         
+(
 %22License
@@ -1472,16 +1472,28 @@
 rary or 
+%22%0A         %22
 Lesser G
@@ -1521,16 +1521,17 @@
  (LGPL)%22
+)
 ,%0A      

Fix lint in setup.py.