[openrtm-commit:00379] r464 - branches/RELENG_1_1/OpenRTM-aist-Python
openrtm @ openrtm.org
openrtm @ openrtm.org
2011年 8月 25日 (木) 10:40:28 JST
Author: kurihara
Date: 2011-08-25 10:40:27 +0900 (Thu, 25 Aug 2011)
New Revision: 464
Modified:
branches/RELENG_1_1/OpenRTM-aist-Python/setup.py
Log:
updated for 1.1.0.
Modified: branches/RELENG_1_1/OpenRTM-aist-Python/setup.py
===================================================================
--- branches/RELENG_1_1/OpenRTM-aist-Python/setup.py 2011-08-14 05:09:21 UTC (rev 463)
+++ branches/RELENG_1_1/OpenRTM-aist-Python/setup.py 2011-08-25 01:40:27 UTC (rev 464)
@@ -14,6 +14,8 @@
from distutils import version
from distutils.command.build import build
from distutils.command.sdist import sdist
+from distutils.command.install import install
+from distutils.command.install_data import install_data
core.DEBUG = False
@@ -25,32 +27,21 @@
if os.sep == '/':
g_os = "unix"
if sys.version_info[0:3] >= (2, 6, 0):
- dist_dir = os.path.join(sys.prefix,'lib','python'+sys.version[:3],'dist-packages')
- if os.path.isdir(dist_dir):
- sitedir = os.path.join("lib", "python" + sys.version[:3], "dist-packages")
- else:
- sitedir = os.path.join("lib", "python" + sys.version[:3], "site-packages")
example_sitedir = os.path.join("share", "OpenRTM-aist", "examples", "python")
elif sys.version_info[0:3] >= (2, 2, 0):
- sitedir = os.path.join("lib", "python" + sys.version[:3], "site-packages")
example_sitedir = os.path.join("share", "OpenRTM-aist", "examples", "python")
elif os.sep == ':':
- sitedir = os.path.join("lib", "site-packages")
example_sitedir = os.path.join("lib", "site-packages")
elif os.sep == '\\':
print "os: win32"
g_os = "win32"
- sitedir = os.path.join("lib", "site-packages")
example_sitedir = os.path.join("lib", "site-packages")
else:
if sys.version_info[0:3] >= (2, 2, 0):
- sitedir = os.path.join("lib", "site-packages")
example_sitedir = os.path.join("lib", "site-packages")
else:
- sitedir = "."
example_sitedir = os.path.join("lib", "site-packages")
-
def compile_idl(cmd, pars, files):
"""
Put together command line for python stubs generation.
@@ -249,6 +240,7 @@
('build_ext', has_ext_modules),
('build_scripts', has_scripts)]
+
class OtherSetupForSdist(sdist):
def initialize_options(self):
@@ -257,7 +249,6 @@
sdist.initialize_options(self)
if is_examples:
self.template = "MANIFEST_examples.in"
- #self.manifest = "MANIFEST"
self.use_defaults = 0
self.force_manifest = 1
stub_dirs = ["SimpleService","SimpleService__POA"]
@@ -276,7 +267,6 @@
for dir_ in stub_dirs:
if not os.path.isdir(os.path.join(os.getcwd(),"OpenRTM_aist","RTM_IDL",dir_)):
os.mkdir(os.path.join(os.getcwd(),"OpenRTM_aist","RTM_IDL",dir_))
-
def make_distribution (self):
"""Create the source distribution(s). First, we create the release
@@ -316,6 +306,23 @@
dir_util.remove_tree(base_dir, dry_run=self.dry_run)
+install_data_dir = None
+
+class Install(install):
+ def run(self):
+ global install_data_dir
+ install_data_dir = self.install_purelib
+ install.run(self)
+
+class InstallData(install_data):
+ def run(self):
+ global install_data_dir
+ for i in range(len(self.data_files)):
+ dir = os.path.join(install_data_dir,self.data_files[i][0])
+ self.data_files[i] = (dir,self.data_files[i][1])
+ install_data.run(self)
+
+
############################### data for setup() ###########################################
@@ -452,7 +459,7 @@
"OpenRTM_aist.utils.rtc-template",
"OpenRTM_aist.utils.rtm-naming"]
-unix_data_files = [(sitedir,['OpenRTM-aist.pth'])]
+unix_data_files = [("",['OpenRTM-aist.pth'])]
idl_files= glob.glob(os.path.join('OpenRTM_aist',
'RTM_IDL',
@@ -463,32 +470,32 @@
'device_interfaces',
'*.idl'))
-unix_data_files.append((os.path.join(sitedir,'OpenRTM_aist', 'utils', 'rtcd'),
+unix_data_files.append((os.path.join('OpenRTM_aist', 'utils', 'rtcd'),
['OpenRTM_aist/utils/rtcd/rtcd.conf']))
-unix_data_files.append((os.path.join(sitedir,'OpenRTM_aist', 'utils', 'rtcd'),
+unix_data_files.append((os.path.join('OpenRTM_aist', 'utils', 'rtcd'),
['OpenRTM_aist/utils/rtcd/rtc.conf']))
-unix_data_files.append((os.path.join(sitedir,'OpenRTM_aist', 'ext', 'sdo', 'observer'),
+unix_data_files.append((os.path.join('OpenRTM_aist', 'ext', 'sdo', 'observer'),
['OpenRTM_aist/ext/sdo/observer/rtc.conf']))
for idl in idl_files:
- unix_data_files.append((os.path.join(sitedir, 'OpenRTM_aist', 'RTM_IDL'),
+ unix_data_files.append((os.path.join('OpenRTM_aist', 'RTM_IDL'),
[idl]))
for device_idl in device_if_idl_files:
- unix_data_files.append((os.path.join(sitedir, 'OpenRTM_aist', 'RTM_IDL',
+ unix_data_files.append((os.path.join('OpenRTM_aist', 'RTM_IDL',
'device_interfaces'), [device_idl]))
import copy
win32_data_files = copy.deepcopy(unix_data_files)
-win32_data_files.append((os.path.join(sitedir,'OpenRTM_aist', 'examples'),
+win32_data_files.append((os.path.join('OpenRTM_aist', 'examples'),
['OpenRTM_aist/examples/rtc.conf.sample']))
-win32_data_files.append((os.path.join(sitedir,'OpenRTM_aist', 'examples'),
+win32_data_files.append((os.path.join('OpenRTM_aist', 'examples'),
['OpenRTM_aist/examples/component.conf']))
-win32_data_files.append((os.path.join(sitedir,'OpenRTM_aist', 'ext', 'sdo', 'observer'),
+win32_data_files.append((os.path.join('OpenRTM_aist', 'ext', 'sdo', 'observer'),
['OpenRTM_aist/ext/sdo/observer/setup.bat']))
-unix_data_files.append((os.path.join(sitedir,'OpenRTM_aist', 'ext', 'sdo', 'observer'),
+unix_data_files.append((os.path.join('OpenRTM_aist', 'ext', 'sdo', 'observer'),
['OpenRTM_aist/ext/sdo/observer/setup.sh']))
templates_xml = glob.glob(os.path.join('OpenRTM_aist',
@@ -497,7 +504,7 @@
'*.xml'))
for tmp_xml in templates_xml:
- win32_data_files.append((os.path.join(sitedir,'OpenRTM_aist', 'examples', 'Templates'),
+ win32_data_files.append((os.path.join('OpenRTM_aist', 'examples', 'Templates'),
[tmp_xml]))
@@ -541,7 +548,8 @@
url = pkg_url,
long_description = pkg_long_desc,
license = pkg_license,
- cmdclass = { "build":Build, "build_idl":Build_idl, "build_doc":Build_doc, "sdist":OtherSetupForSdist },
+ cmdclass = { "build":Build, "build_idl":Build_idl, "build_doc":Build_doc,
+ "sdist":OtherSetupForSdist, "install":Install, "install_data":InstallData },
packages = unix_packages,
scripts= ['OpenRTM_aist/utils/rtcprof/rtcprof_python',
'OpenRTM_aist/utils/rtcd/rtcd_python',
@@ -561,7 +569,7 @@
url = pkg_url,
long_description = pkg_long_desc,
license = pkg_license,
- cmdclass = { "build":Build, "build_idl":Build_idl, "build_doc":Build_doc, "sdist":OtherSetupForSdist },
+ cmdclass = { "build":Build, "build_idl":Build_idl, "build_doc":Build_doc, "sdist":OtherSetupForSdist},
packages = win32_packages,
scripts= ['OpenRTM_aist/utils/rtcprof/rtcprof_python.bat',
'OpenRTM_aist/utils/rtcd/rtcd_python.bat',
@@ -622,7 +630,8 @@
url = pkg_url,
long_description = pkg_long_desc,
license = pkg_license,
- cmdclass = { "build":Build, "build_idl":Build_idl, "build_doc":Build_doc },
+ cmdclass = { "build":Build, "build_idl":Build_idl, "build_doc":Build_doc,
+ "install":Install, "install_data":InstallData },
packages = win32_packages,
scripts= ['OpenRTM_aist/utils/rtcprof/rtcprof_python.bat',
'OpenRTM_aist/utils/rtcd/rtcd_python.bat',
openrtm-commit メーリングリストの案内