Skip to content

Commit

Permalink
Added first version of experimental support for package_step (based o…
Browse files Browse the repository at this point in the history
…n code by Marc Litherland)

Update easyblock.py

Bug fixes round #1

bugfixing round #2

Bugfixes round #3

Bugfixes round #4

Bugfixes #5. Rewritten map() as list comprehension. Still not available as an optional parameter
  • Loading branch information
sntgluca authored and rjeschmi committed Mar 26, 2015
1 parent 1b2c507 commit 22e28e5
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions easybuild/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
from easybuild.tools.utilities import remove_unwanted_chars
from easybuild.tools.version import this_is_easybuild, VERBOSE_VERSION, VERSION


_log = fancylogger.getLogger('easyblock')


Expand Down Expand Up @@ -1444,8 +1443,19 @@ def extensions_step(self, fetch=False):
self.clean_up_fake_module(fake_mod_data)

def package_step(self):
"""Package software (e.g. into an RPM)."""
pass
"""Prepare package software (e.g. into an RPM) with fpm."""
rpmname = "HPCBIOS.20150211-%s-%s" % (self.name, self.version)
os.chdir(os.environ['TMPDIR'])

if self.toolchain.name == "dummy":
dependencies = []
else:
dependencies = [ "=".join([ self.toolchain.name, self.toolchain.version ]) ]
dependencies.extend([ "=".join([ dep['name'], dep['version'] ]) for dep in self.cfg.dependencies() ])
depstring = '--dependency ' + ' --dependency '.join(dependencies)

cmd = "fpm --workdir $TMPDIR -t rpm --name %s -s dir %s -C %s" % (rpmname, depstring, self.installdir)
(out, _) = run_cmd(cmd, log_all=True, simple=False)

def post_install_step(self):
"""
Expand Down Expand Up @@ -1787,11 +1797,11 @@ def prepare_step_spec(initial):
# part 3: post-iteration part
steps_part3 = [
('extensions', 'taking care of extensions', [lambda x: x.extensions_step()], False),
('package', 'packaging', [lambda x: x.package_step()], True),
('postproc', 'postprocessing', [lambda x: x.post_install_step()], True),
('sanitycheck', 'sanity checking', [lambda x: x.sanity_check_step()], False),
('cleanup', 'cleaning up', [lambda x: x.cleanup_step()], False),
('module', 'creating module', [lambda x: x.make_module_step()], False),
# ('package', 'packaging', [lambda x: x.package_step()], True),
]

# full list of steps, included iterated steps
Expand All @@ -1803,6 +1813,14 @@ def prepare_step_spec(initial):
lambda x: x.test_cases_step(),
], False))

## CHANGE TRUE TO build_option, and
## ADD build-pkg to all the configuration dicts
## # if build_option('build-pkg'):
if True:
steps.append(('package', 'packaging', [lambda x: x.package_step()], True))
else:
self.log.debug('Skipping package step')

return steps

def run_all_steps(self, run_test_cases):
Expand Down

0 comments on commit 22e28e5

Please sign in to comment.