from setuptools import setup, find_packages
import os, glob
import distutils.command.bdist_wininst
from distutils.command.bdist_wininst import bdist_wininst
#from setuptools_bzr import __version__

longdesc = '''lechat, Libre-Entreprise Common Hypervisor and Administration Tool.'''

try:
    import py2exe
except:
    print 'Error loading py2exe for Windows.'

class my_bdist_wininst(bdist_wininst):
    def initialize_options(self):
        bdist_wininst.initialize_options(self)
        self.title = 'LECHAT-0.2'
        #self.bitmap = 'setup_wininst.bmp'
        #self.install_script = 'lechat-postinstall.py'
        
distutils.command.bdist_wininst.bdist_wininst = my_bdist_wininst

setup(
    name = "lechat",
    setup_requires = [ "setuptools_bzr" ],
    version = "0.2",
    description = "Libre-Entreprise Common Hypervisor and Administration Tool",
    author = "guillaume pernot",
    author_email = "gpernot@praksys.org",

    packages=['lechat',
              'lechat.client',
              'lechat.client.Qt4',
              'lechat.client.Qt4.qtreactor',
              'lechat.server',
              'lechat.server.watchers',
              'lechat.server.watchers.Cyrus',
              ],
    
    package_dir = {'lechat': 'lechat',
                   'lechat.client': 'client',
                   'lechat.server': 'server', },
    
    package_data={ 'lechat.client': ['locale/*/LC_MESSAGES/*.mo',
                                     'resources/*.png',
                                     'doc/lechat.xpm'],
                   'lechat.server': ['../doc/server.conf'],},
    scripts=['server/lechat-server', 'client/lechat-client'],

    download_url = 'http://tranquilinux.org',
    license = 'GPLv3',
    platforms = 'Posix; MacOS X; Windows',
    classifiers = [ 'Development Status :: 4 - Beta',
                    'Intended Audience :: System Administrators',
                    'Intended Audience :: Information Technology',
                    'License :: OSI Approved :: GNU General Public License (GPL)',
                    'Operating System :: All POSIX (Linux/BSD/UNIX-like OSes)',
                    'Operating System :: Linux',
                    'Operating System :: 32-bit MS Windows (NT/2000/XP)',
                    'Topic :: System :: Systems Administration',
                    'Topic :: Networking :: Monitoring' ],
    long_description = longdesc,
    #py_modules = ['config'],
    #include_package_data = True,
    #packages = find_packages(),
    data_files = [('locale/fr/LC_MESSAGES', ['client/locale/fr/LC_MESSAGES/lechat.mo']),],
    #('lechat-client/resources', glob.glob(os.path.join('client','resources','*.png'))),
    #              ('lechat/lib', glob.glob(os.path.join('lechat','lib','*.pl')))],
    windows=[{'script': 'client/lechat-client',
              'icon_resources': [(1, 'doc/lechat.ico')] }],
    options={'py2exe':{'includes':['sip', 'PyQt4._qt',
                                   'twisted.web.resource',
                                   'twisted.internet.win32eventreactor']}},
    #entry_points = {
    #'setuptools.file_finders': [ 'bzr = setuptools_bzr:find_files_for_bzr', ],
    #},
    #install_requires = { 'bzr': ['bzr'], },
    url = 'http://bzr.praksys.org/lechat'
    )


