7777from easybuild .tools .utilities import remove_unwanted_chars
7878from easybuild .tools .version import this_is_easybuild , VERBOSE_VERSION , VERSION
7979
80-
8180_log = fancylogger .getLogger ('easyblock' )
8281
8382
@@ -1444,8 +1443,19 @@ def extensions_step(self, fetch=False):
14441443 self .clean_up_fake_module (fake_mod_data )
14451444
14461445 def package_step (self ):
1447- """Package software (e.g. into an RPM)."""
1448- pass
1446+ """Prepare package software (e.g. into an RPM) with fpm."""
1447+ rpmname = "HPCBIOS.20150211-%s-%s" % (self .name , self .version )
1448+ os .chdir (os .environ ['TMPDIR' ])
1449+
1450+ if self .toolchain .name == "dummy" :
1451+ dependencies = []
1452+ else :
1453+ dependencies = [ "=" .join ([ self .toolchain .name , self .toolchain .version ]) ]
1454+ dependencies .extend ([ "=" .join ([ dep ['name' ], dep ['version' ] ]) for dep in self .cfg .dependencies () ])
1455+ depstring = '--dependency ' + ' --dependency ' .join (dependencies )
1456+
1457+ cmd = "fpm --workdir $TMPDIR -t rpm --name %s -s dir %s -C %s" % (rpmname , depstring , self .installdir )
1458+ (out , _ ) = run_cmd (cmd , log_all = True , simple = False )
14491459
14501460 def post_install_step (self ):
14511461 """
@@ -1787,11 +1797,11 @@ def prepare_step_spec(initial):
17871797 # part 3: post-iteration part
17881798 steps_part3 = [
17891799 ('extensions' , 'taking care of extensions' , [lambda x : x .extensions_step ()], False ),
1790- ('package' , 'packaging' , [lambda x : x .package_step ()], True ),
17911800 ('postproc' , 'postprocessing' , [lambda x : x .post_install_step ()], True ),
17921801 ('sanitycheck' , 'sanity checking' , [lambda x : x .sanity_check_step ()], False ),
17931802 ('cleanup' , 'cleaning up' , [lambda x : x .cleanup_step ()], False ),
17941803 ('module' , 'creating module' , [lambda x : x .make_module_step ()], False ),
1804+ # ('package', 'packaging', [lambda x: x.package_step()], True),
17951805 ]
17961806
17971807 # full list of steps, included iterated steps
@@ -1803,6 +1813,14 @@ def prepare_step_spec(initial):
18031813 lambda x : x .test_cases_step (),
18041814 ], False ))
18051815
1816+ ## CHANGE TRUE TO build_option, and
1817+ ## ADD build-pkg to all the configuration dicts
1818+ ## # if build_option('build-pkg'):
1819+ if True :
1820+ steps .append (('package' , 'packaging' , [lambda x : x .package_step ()], True ))
1821+ else :
1822+ self .log .debug ('Skipping package step' )
1823+
18061824 return steps
18071825
18081826 def run_all_steps (self , run_test_cases ):
0 commit comments