def _extract_name_from_spec(spec):
    """Parse an adapter specification given as 'name=adapt' into 'name'
    and 'adapt'.
    
    Args:
        spec: Adapter spec.
    
    Returns:
        (name, spec)
    """
    fields = spec.split('=', 1)
    if len(fields) > 1:
        name, spec = fields
        name = name.strip()
    else:
        name = None
    spec = spec.strip()
    return name, spec