diff --git a/easybuild/easyblocks/b/blat.py b/easybuild/easyblocks/b/blat.py old mode 100755 new mode 100644 diff --git a/easybuild/easyblocks/b/bwa.py b/easybuild/easyblocks/b/bwa.py old mode 100755 new mode 100644 diff --git a/easybuild/easyblocks/c/chimera.py b/easybuild/easyblocks/c/chimera.py old mode 100755 new mode 100644 diff --git a/easybuild/easyblocks/generic/binariestarball.py b/easybuild/easyblocks/generic/binariestarball.py index f6a56aec0a8..82246b9a382 100644 --- a/easybuild/easyblocks/generic/binariestarball.py +++ b/easybuild/easyblocks/generic/binariestarball.py @@ -32,6 +32,7 @@ import stat from easybuild.easyblocks.generic.tarball import Tarball +from easybuild.framework.easyconfig import CUSTOM from easybuild.tools.build_log import EasyBuildError from easybuild.tools.filetools import adjust_permissions @@ -40,21 +41,40 @@ class BinariesTarball(Tarball): """ Support for installing a tarball of binaries """ + @staticmethod + def extra_options(extra_vars=None): + """ + Define list of files to be copied during the installation process + """ + extra_vars = Tarball.extra_options(extra_vars) + # Allow specification of files to copy explicitly. + # If files_to_copy is a zero-length list, all files (but not + # directories, etc.) in start_dir will be copied with their + # current names. + extra_vars.update({ + 'files_to_copy': [None, "List of optional (source_file, destination_file) tuples", CUSTOM,] + }) + return extra_vars def install_step(self): """Install by copying unzipped binaries to 'bin' subdir of installation dir, and fixing permissions.""" bindir = os.path.join(self.installdir, 'bin') + items_to_copy = [] try: os.makedirs(bindir) - for item in os.listdir(self.cfg['start_dir']): + if self.cfg['files_to_copy'] is None: + for item in os.listdir(self.cfg['start_dir']): + items_to_copy.append((os.path.join(self.cfg['start_dir'], item), item)) + else: + items_to_copy.append(os.path.join(self.cfg['start_dir'], item) for item in self.cfg['files_to_copy']) + for (item, destname) in items_to_copy: if os.path.isfile(item): - shutil.copy2(os.path.join(self.cfg['start_dir'], item), bindir) + shutil.copy2(item, os.path.join(bindir, destname)) # make sure binary has executable permissions - adjust_permissions(os.path.join(bindir, item), stat.S_IXUSR|stat.S_IXGRP|stat.S_IXOTH, add=True) - self.log.debug("Copied %s to %s and fixed permissions" % (item, bindir)) + adjust_permissions(os.path.join(bindir, destname), stat.S_IXUSR|stat.S_IXGRP|stat.S_IXOTH, add=True) + self.log.debug("Copied %s to %s and fixed permissions", item, bindir) else: - self.log.warning("Skipping non-file %s in %s, not copying it." % (item, self.cfg['start_dir'])) + self.log.warning("%s: not a file. Skipping.", item) except OSError, err: - raise EasyBuildError("Copying binaries in %s to install dir 'bin' failed: %s", self.cfg['start_dir'], err) - + raise EasyBuildError("Copying binaries to install dir 'bin' failed: %s", err) diff --git a/easybuild/easyblocks/generic/cmdcp.py b/easybuild/easyblocks/generic/cmdcp.py old mode 100755 new mode 100644 diff --git a/easybuild/easyblocks/generic/makecp.py b/easybuild/easyblocks/generic/makecp.py old mode 100755 new mode 100644 diff --git a/easybuild/easyblocks/m/modeller.py b/easybuild/easyblocks/m/modeller.py old mode 100755 new mode 100644