"""P4Python - Python interface to Perforce API Perforce is the fast SCM system at www.perforce.com. This package provides a simple interface from Python wrapping the Perforce C++ API to gain performance and ease of coding. Similar to interfaces available for Ruby and Perl. """ classifiers = """\ Development Status :: 4 - Beta Intended Audience :: Developers License :: Freely Distributable Programming Language :: Python Topic :: Software Development :: Libraries :: Python Modules Topic :: Software Development :: Version Control Topic :: Software Development Topic :: Utilities Operating System :: Microsoft :: Windows Operating System :: Unix """ # Seems to work fine with ActiveState Python2.3 and Linux # Note you need to link p4api to whereever you put Perforce API # See notes in P4API documentation for building with API on different # platforms: # http://www.perforce.com/perforce/doc.042/manuals/p4api/02_clientprog.html from distutils.core import setup, Extension import os, sys # Fix for older versions of Python if sys.version_info < (2, 3): _setup = setup def setup(**kwargs): if kwargs.has_key("classifiers"): del kwargs["classifiers"] _setup(**kwargs) doclines = __doc__.split("\n") NAME = "P4Python" VERSION = "0.5" PY_MODULES = ["p4"] DESCRIPTION=doclines[0] AUTHOR="Robert Cowham" MAINTAINER="Robert Cowham" AUTHOR_EMAIL="robert@vaccaperna.co.uk" MAINTAINER_EMAIL="robert@vaccaperna.co.uk" LICENSE="http://public.perforce.com/guest/robert_cowham/perforce/API/python/main/LICENSE.txt" URL="http://public.perforce.com/guest/robert_cowham/perforce/API/python/index.html" def do_setup(): if os.name == "nt": setup(name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, maintainer=MAINTAINER, maintainer_email=MAINTAINER_EMAIL, license=LICENSE, url=URL, classifiers = filter(None, classifiers.split("\n")), long_description = "\n".join(doclines[2:]), py_modules=PY_MODULES, ext_modules=[Extension("P4Client", ["P4Clientmodule.cc"], include_dirs=["p4api"], library_dirs=["p4api"], libraries=["oldnames", "wsock32", "advapi32", # MSVC libs "libclient", "librpc", "libsupp"], # P4API libs extra_compile_args=["/DOS_NT", "/DMT", "/DCASE_INSENSITIVE"], extra_link_args=["/NODEFAULTLIB:libcmt"], )]) else: # Assume Linux setup(name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, maintainer=MAINTAINER, maintainer_email=MAINTAINER_EMAIL, license=LICENSE, url=URL, classifiers = filter(None, classifiers.split("\n")), long_description = "\n".join(doclines[2:]), py_modules=PY_MODULES, ext_modules=[Extension("P4Client", ["P4Clientmodule.cc"], include_dirs=["p4api"], library_dirs=["p4api"], libraries=["client", "rpc", "supp"], # P4API libs extra_compile_args=["-DOS_LINUX"], )]) if __name__ == "__main__": do_setup()