+class my_install_data (install_data):
+ def finalize_options (self):
+ """Needed to make this thing work properly."""
+ self.set_undefined_options ('install',
+ ('install_lib', 'install_dir'),
+ ('root', 'root'),
+ ('force', 'force'),
+ )
+ def run (self):
+ """Taken shamlessly from VTK source"""
+ self.mkpath(self.install_dir)
+ for f in self.data_files:
+ if type(f) == StringType:
+ # it's a simple file, so copy it
+ f = convert_path(f)
+ if self.warn_dir:
+ self.warn("setup script did not provide a directory for "
+ "'%s' -- installing right in '%s'" %
+ (f, self.install_dir))
+ (out, _) = self.copy_file(f, self.install_dir)
+ self.outfiles.append(out)
+ else:
+ # it's a tuple with path to install to and a list of files
+ dir = convert_path(f[0])
+ if not os.path.isabs(dir):
+ dir = os.path.join(self.install_dir, dir)
+ elif self.root:
+ dir = change_root(self.root, dir)
+ self.mkpath(dir)
+ for data in f[1]:
+ data = convert_path(data)
+ (out, _) = self.copy_file(data, dir)
+ self.outfiles.append(out)
+
+# I should not hardcode 'bin' since user could build in none default path...
+# Well keep finger cross it won't happen :P