summaryrefslogtreecommitdiff
path: root/python/setup.py
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2010-02-15 06:49:30 +0000
committerRafael H. Schloming <rhs@apache.org>2010-02-15 06:49:30 +0000
commitd6be0fa66f6fca86a741b49c9ac3717a072a96d0 (patch)
tree6da856485eccc3c76ad804b836c7af580409d39b /python/setup.py
parent75b9098e465a9da8764514410c93f79beb1d3be0 (diff)
downloadqpid-python-d6be0fa66f6fca86a741b49c9ac3717a072a96d0.tar.gz
more futzing with setup.py; pulled specs into python/qpid package
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@910165 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/setup.py')
-rwxr-xr-x[-rw-r--r--]python/setup.py74
1 files changed, 22 insertions, 52 deletions
diff --git a/python/setup.py b/python/setup.py
index af01d7646c..445ba704e5 100644..100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -20,8 +20,7 @@
import os, re, sys
from distutils.core import setup, Command
from distutils.command.build_py import build_py as _build_py
-from distutils.command.install import install as _install
-from distutils.command.install_lib import install_lib
+from distutils.command.install_lib import install_lib as _install_lib
from distutils.dep_util import newer
from distutils.errors import DistutilsFileError
from distutils import log
@@ -136,68 +135,39 @@ class build_py(preprocessor, _build_py):
else:
return None, None
-options = [('amqp-spec-dir=', None, "location of the AMQP specifications")]
-
-class install(_install):
-
- user_options = _install.user_options + options
-
- def initialize_options(self):
- _install.initialize_options(self)
- self.amqp_spec_dir = None
-
- def get_sub_commands(self):
- return ['qpid_config'] + _install.get_sub_commands(self)
-
-class qpid_config(preprocessor, install_lib):
-
- user_options = options
-
- def initialize_options(self):
- install_lib.initialize_options(self)
- self.prefix = None
- self.amqp_spec_dir = None
-
- def finalize_options(self):
- install_lib.finalize_options(self)
- self.set_undefined_options('install',
- ('prefix', 'prefix'),
- ('amqp_spec_dir', 'amqp_spec_dir'))
- if self.amqp_spec_dir is None:
- self.amqp_spec_dir = "%s/share/amqp" % self.prefix
+class install_lib(_install_lib):
def get_outputs(self):
- return [os.path.join(self.install_dir, "qpid_config.py"),
- os.path.join(self.install_dir, "qpid_config.pyc")]
+ outputs = _install_lib.get_outputs(self)
+ extra = []
+ for of in outputs:
+ if os.path.basename(of) == "amqp.0-10-qpid-errata.xml":
+ extra.append("%s.ops.pcl" % of)
+ return outputs + extra
def install(self):
- self.mkpath(self.install_dir)
- file, _ = self.copy_file("qpid_config.py", self.install_dir)
- return [file]
-
- def configure(self, input):
- idx = input.index("AMQP_SPEC_DIR")
- end = input.index(os.linesep, idx)
- return input[:idx] + \
- ('AMQP_SPEC_DIR="%s"' % self.amqp_spec_dir) + \
- input[end:]
-
- def actor(self, src, dst):
- file = os.path.basename(src)
- if file == "qpid_config.py":
- return "configuring", self.configure
- else:
- return None, None
+ outfiles = _install_lib.install(self)
+ extra = []
+ for of in outfiles:
+ if os.path.basename(of) == "amqp.0-10-qpid-errata.xml":
+ tgt = "%s.ops.pcl" % of
+ if self.force or newer(of, tgt):
+ log.info("preloading %s to %s" % (of, os.path.basename(tgt)))
+ if not self.dry_run:
+ from qpid.ops import load_types
+ load_types(of)
+ extra.append(tgt)
+ return outfiles + extra
setup(name="qpid-python",
version="0.7",
author="Apache Qpid",
author_email="dev@qpid.apache.org",
packages=["mllib", "qpid", "qpid.tests"],
+ package_data={"qpid": ["specs/*.dtd", "specs/*.xml"]},
scripts=["qpid-python-test"],
url="http://qpid.apache.org/",
license="Apache Software License",
description="Python client implementation for Apache Qpid",
cmdclass={"build_py": build_py,
- "install": install,
- "qpid_config": qpid_config})
+ "install_lib": install_lib})