from setuptools import setup, find_packages

long_description = (open('README.txt').read() + '\n\n' + open('CHANGES.txt').read())

version = '0.0.3dev'

# Always write version.txt to indicate which revision is used for this version.
try:
    import bzrlib.branch
    branch = bzrlib.branch.Branch.open('.')
    revision_number, revision_id = branch.last_revision_info()
    versiontxt = file('version.txt', 'w')
    versiontxt.truncate(0)
    versiontxt.write(version+'-r'+str(revision_number))
    if 'dev' in version:
        # Include revision number in eggname if this is a dev egg.
        version+='-r'+str(revision_number)
except ImportError:
    # Just ignore
    pass

setup(name='ztm.collation',
      version=version,
      description="An implementation of unicode.orgs collation algorithm.",
      long_description=long_description,
      keywords='unicode, collation',
      author='ztmproject.org',
      author_email='ztm@ztmproject.org',
      url='http://ztmproject.org/',
      license='LGPL',
      classifiers=[ 'Programming Language :: Python'
                  , 'Development Status :: 3 - Alpha'
                  , 'Intended Audience :: Developers'
                  ],
      packages=find_packages('src'),
      package_dir = {'': 'src'},
      namespace_packages=['ztm'],
      dependency_links=["http://ztmproject.org/snapshots/"],
      zip_safe=False,
      include_package_data=True,
      extras_require={ 'test': []
                     , 'i18n': []
                     , 'documentation': [ 'Sphinx'
                                        , 'collective.recipe.sphinxbuilder'
                                        , 'repoze.sphinx.autointerface'
                                        , 'PIL'
                                        , 'docutils>=0.6'
                                        ]
                     },
      install_requires=['setuptools']
      )

