'Install a single source package.
If output is given it should be a file-like object and it
will receive a log of what happened.'

def installPackageOnly(self, output=None):

    if ('Install-command' in self._dict):
        return ('%s:    Binary    package    cannot    have    Install-command' % self.fullname())
    if ('Pre-install-command' in self._dict):
        if _cmd(output, '/tmp', self._dict['Pre-install-command']):
            return ('pre-install    %s:    running    "%s"    failed' % (self.fullname(), self._dict['Pre-install-command']))
    self.beforeInstall()
    filename = os.path.split(self.archiveFilename)[1]
    for (ext, unpackerClass, arg) in ARCHIVE_FORMATS:
        if (filename[(- len(ext)):] == ext):
            break
    else:
        return ('%s:    unknown    extension    for    archive    file:    %s' % (self.fullname(), filename))
    self.basename = filename[:(- len(ext))]
    install_renames = []
    for (k, newloc) in self._db.preferences.installLocations:
        if (not newloc):
            continue
        if (k == '--install-lib'):
            oldloc = DEFAULT_INSTALLDIR
        else:
            return ("%s:    Don't    know    installLocation    %s" % (self.fullname(), k))
        install_renames.append((oldloc, newloc))
    unpacker = unpackerClass(arg, dir='/', renames=install_renames)
    rv = unpacker.unpack(self.archiveFilename, output=output, package=self)
    if rv:
        return rv
    self.afterInstall()
    if ('Post-install-command' in self._dict):
        if _cmd(output, '/tmp', self._dict['Post-install-command']):
            return ('%s:    post-install:    running    "%s"    failed' % (self.fullname(), self._dict['Post-install-command']))
    return None
