Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contribute muscle #212

Merged
merged 6 commits into from Jul 3, 2013
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
45 changes: 45 additions & 0 deletions easybuild/easyblocks/m/muscle.py
@@ -0,0 +1,45 @@
##
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
# Copyright:: Copyright 2012-2013 The Cyprus Institute
# Authors:: Andreas Panteli <a.panteli@cyi.ac.cy>, George Tsouloupas <g.tsouloupas@cyi.ac.cy>
# License:: MIT/GPL
# $Id$
#
##
"""
EasyBuild support for building and installing MUSCLE, implemented as an easyblock

@author: Andreas Panteli (CyI), George Tsouloupas (CyI)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One author per line please.

"""

import os

from easybuild.framework.easyblock import EasyBlock
from easybuild.easyblocks.generic.packedbinary import PackedBinary
from easybuild.tools.filetools import mkdir, extract_file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: double newline for class line.

class EB_MUSCLE(PackedBinary):
"""
Support for building MUSCLE

"""
def extract_step(self):
"""
Unpack the source files.
"""

newdir = '%s-%s' % (self.name.lower(), self.version)
self.cfg['start_dir'] = os.path.join(self.builddir, newdir)
try:
mkdir(self.cfg['start_dir'])
self.log.debug("Created new directory %s" % (self.cfg['start_dir']))
except OSError, err:
self.log.exception("Can't create new directory %s: %s" % (self.cfg['start_dir'], err))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix indentation.

for tmp in self.src:
self.log.info("Unpacking source %s" % tmp['name'])
srcdir = extract_file(tmp['path'], self.cfg['start_dir'], cmd=tmp['cmd'], extra_options=self.cfg['unpack_options'])
if srcdir:
self.src[self.src.index(tmp)]['finalpath'] = srcdir
else:
self.log.error("Unpacking source %s failed" % tmp['name'])