from setuptools import setup, find_packages

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

version = '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
except bzrlib.errors.NotBranchError:
    pass

setup(name='ztm.publishing',
      version=version,
      description="Topic Maps driven CMS.",
      long_description=long_description,
      keywords='TopicMaps CMS',
      author='ztmproject.org',
      author_email='ztm@ztmproject.org',
      url='http://ztmproject.org/',
      license='GPL',
      classifiers=['Programming Language :: Python',
                   'Environment :: Web Environment',
                   'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
                   'Topic :: Internet :: WWW/HTTP :: Indexing/Search',
                   'Topic :: Internet :: WWW/HTTP :: Site Management',
                   'Framework :: Zope3',
                   'Development Status :: 3 - Alpha',
                   'Intended Audience :: Developers',
                   'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
                   'Operating System :: MacOS :: MacOS X',
                   'Operating System :: Microsoft :: Windows',
                   'Operating System :: POSIX',
                   ],
      dependency_links=[ "http://ztmproject.org/snapshots/" ],
      packages=find_packages('src'),
      package_dir={'': 'src'},
      namespace_packages = ['ztm'],
      include_package_data=True,
      extras_require={ 'test': [ 'zope.app.testing'
                               , 'zope.app.appsetup'
                               ]
                     , 'i18n': [ 'cc.gettext'
                               , 'zope.app.applicationcontrol'
                               ]
                     , 'documentation': [ 'collective.recipe.sphinxbuilder'
                                        , 'docutils>=0.6'
                                        ]
                     },
      zip_safe=False,
      install_requires=[ 'setuptools'
                       , 'zope.component'
                       , 'zope.interface'
                       , 'zope.security'
                       , 'zope.pluggableauth'
                       , 'zope.principalannotation'
                       , 'zope.traversing'
                       , 'zope.lifecycleevent'
                       , 'zope.site'
                       , 'ztm.webdesk'
                       , 'ztm.workflow'
                       , 'ztm.wizard'
                       , 'ztm.contenteditor'
                       , 'ztm.index'
                       , 'ztm.search'
                       , 'ztm.editor'
                       , 'ztm.navigator'
                       ],
      )

