'Initialize object for creating unpack, patch, build tasks
Unpacking assumed to have no dependencies.
Patching assumed to depend only on the unpacking.
Build depends on packing / patching and on given dependencies
Parameters
name : str
package name
filename : str
filename containing source archive to unpack
build_cmd : str or callable
command to build after extracting
depends : str or sequence, optional
depends for build
after : str or sequence, optional
names to set build to follow after (task name depends)
patcher : None or str or callable, optional
If str, a file containing a ``-p1`` patch for the sources.  If
callable, then a rule to apply for patching. If None, don\'t patch
unpacked_sdir : str or None, optional
directory created by unpacking `filename`.  If None we guess from
`filename`
build_src_sdir : str, optional
subdirectory in build directory into which to unpack'

def __init__(self, name, filename, build_cmd, depends=(), after=(), patcher=None, unpacked_sdir=None, build_src_sdir='src'):

    self.name = name
    self.filename = filename
    self.build_cmd = build_cmd
    (_, fname) = psplit(filename)
    if fname.endswith('.tar.gz'):
        self.unpack_cmd = 'tar    zxf'
        fname = fname[:(-7)]
    elif fname.endswith('.tar.bz2'):
        self.unpack_cmd = 'tar    jxf'
        fname = fname[:(-8)]
    elif fname.endswith('.zip'):
        self.unpack_cmd = 'unzip'
        fname = fname[:(-4)]
    else:
        raise ValueError(("Can't    work    out    type    of    archive    " + fname))
    self.patcher = patcher
    if (unpacked_sdir is None):
        unpacked_sdir = fname
    self.unpacked_sdir = unpacked_sdir
    self.depends = seq_to_list(depends)
    self.after = seq_to_list(after)
    self.build_src_sdir = build_src_sdir
    self._register_instance()
