[Pymoul-svn] SF.net SVN: pymoul: [278] pymoul/trunk/setup.py
Status: Alpha
Brought to you by:
tiran
|
From: <ti...@us...> - 2007-03-23 17:40:10
|
Revision: 278
http://pymoul.svn.sourceforge.net/pymoul/?rev=278&view=rev
Author: tiran
Date: 2007-03-23 10:40:11 -0700 (Fri, 23 Mar 2007)
Log Message:
-----------
Merge r277:276 setup.py
Backmerge to fix erroneous checkin. Next time please check with svn st and svn diff before you commit
Modified Paths:
--------------
pymoul/trunk/setup.py
Modified: pymoul/trunk/setup.py
===================================================================
--- pymoul/trunk/setup.py 2007-03-23 00:50:23 UTC (rev 277)
+++ pymoul/trunk/setup.py 2007-03-23 17:40:11 UTC (rev 278)
@@ -1,19 +1,121 @@
-"""
-This is a setup.py script generated by py2applet
+#!/usr/bin/env python2.5
+"""pyMoul: Python tools for Myst Online - URU Live (MOUL)
-Usage:
- python setup.py py2app
+TODO: Long description of pyMoul
"""
+__author__ = "Christian Heimes"
+__version__ = "$Id$"
+__revision__ = "$Revision$"
+import sys
+import os
+import time
+from glob import glob
+
+if sys.version_info < (2,5):
+ raise RuntimeError("Python 2.5+ required:\n%s" % sys.version)
+
+# boot strap easy setup
+SETUPTOOLS_VERSION = "0.6c1"
+from utilities.ez_setup import use_setuptools
+use_setuptools(version=SETUPTOOLS_VERSION)
+
+# import the rest
from setuptools import setup
+from setuptools import find_packages
+from setuptools import Extension
-APP = ['src/moul/qt/moulqt.py']
-DATA_FILES = []
-OPTIONS = {'argv_emulation': True}
+from utilities.compileui import compileUi
-setup(
- app=APP,
- data_files=DATA_FILES,
- options={'py2app': OPTIONS},
- setup_requires=['py2app'],
+VERSION = "0.0"
+
+ctea = Extension('crypttea._pyxtea',
+ ['src/crypttea/_pyxtea.pyx', 'src/crypttea/ctea.c']
+ )
+ext_modules = [ctea]
+#if os.name == 'posix':
+# ext_modules.append(ctea)
+
+setup_infos = dict(
+ name = "pyMoul",
+ version = VERSION,
+ description = __doc__[:__doc__.find('\n')].strip(),
+ long_description = '\n'.join([line
+ for line in __doc__.split('\n')[1:]]),
+ author = "Christian Heimes",
+ author_email = "chr...@ch...",
+ url = "http://sourceforge.net/projects/pymoul/",
+ #download_url = "http://sourceforge.net/projects/pymoul/",
+ license = "GPL",
+ keywords = "myst online uru live moul cyan",
+ classifiers = (
+ 'Development Status :: 2 - Alpha',
+ 'Environment :: Win32 (MS Windows)',
+ 'Intended Audience :: End Users/Desktop',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: GNU General Public License (GPL)',
+ 'Natural Language :: English',
+ 'Operating System :: Microsoft :: Windows',
+ 'Operating System :: POSIX',
+ 'Programming Language :: Python',
+ 'Topic :: Games/Entertainment :: Multi-User Dungeons (MUD)',
+ ),
)
+
+setup_options = dict(
+ setup_requires = ["setuptools>="+SETUPTOOLS_VERSION,],
+ install_requires = ["pytz>=2006p"],
+ data_files = [
+ ('docs', list(glob('*.txt'))),
+ ('i18n', list(glob('src/moul/qt/i18n/pymoul_*.qm'))),
+ ],
+ package_dir = {'' : 'src'},
+ packages = find_packages('src', exclude="moul.qt"),
+ include_package_data = True,
+ zip_safe = False,
+ namespace_packages = ['moul'],
+ ext_modules = ext_modules,
+)
+
+def writeMetadata():
+ dirname = os.path.dirname(__file__)
+ ver = os.path.join(dirname, 'version.txt')
+ open(ver, 'w').write(VERSION)
+ meta = os.path.join(dirname, 'src', 'moul', 'metadata.py')
+ fd = open(meta, 'w')
+ fd.write("# pyMoul metadata informations\n")
+ fd.write("# THIS FILE IS AUTO GENERATED. DO NOT ALTER!\n\n")
+ fd.write("__version__ = '%s'\n\n" % VERSION)
+ for name, value in setup_infos.items():
+ if not isinstance(value, basestring):
+ continue
+ fd.write("%s = '''%s'''\n" % (name, value))
+ fd.write("\nREADME = '''%s'''\n" % open('README.txt', 'r').read())
+ fd.write("\nLICENSE = '''%s'''\n" % open('GPL.txt', 'r').read())
+ fd.close()
+
+###
+# Write Metadata and compile UI files
+writeMetadata()
+compileUi()
+
+kwargs = {}
+kwargs.update(setup_infos)
+kwargs.update(setup_options)
+
+# Do some windows stuff
+_plat = sys.platform.startswith
+if _plat('win32'):
+ from utilities.setup_win32 import updateSetupOptions
+ from utilities.setup_win32 import updateSetupOptionsQT
+ updateSetupOptions(kwargs)
+ updateSetupOptionsQT(kwargs)
+elif _plat('darwin'):
+ from utilities.setup_darwin import updateSetupOptions
+ updateSetupOptions(kwargs)
+elif _plat('linux2'):
+ kwargs['packages'].append('moul.qt')
+else:
+ raise OSError(sys.platform)
+
+setup(**kwargs)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|