@staticmethod
def generate(config, spec):
    """Generate the core RPM package metadata."""
    name = config.core.name
    version = config.core.version
    release = config.core.release
    summary = config.core.summary
    group = config.core.group
    license = config.core.license
    url = config.core.url
    source = config.core.source
    buildroot = config.core.buildroot
    buildarch = config.core.buildarch
    requires = tuple(config.core.requires)
    conflicts = tuple(config.core.conflicts)
    obsoletes = tuple(config.core.obsoletes)
    provides = tuple(config.core.provides)
    spec.tags['Name'] = name
    spec.tags['Version'] = version
    spec.tags['Release'] = release
    spec.tags['BuildRoot'] = buildroot
    if requires:
        spec.tags['Requires'] = ', '.join(requires)
    if conflicts:
        spec.tags['Conflicts'] = ', '.join(conflicts)
    if obsoletes:
        spec.tags['Obsoletes'] = ', '.join(obsoletes)
    if provides:
        spec.tags['Provides'] = ', '.join(provides)
    if buildarch:
        spec.tags['BuildArch'] = buildarch
    if summary:
        spec.tags['Summary'] = summary
    if group:
        spec.tags['Group'] = group
    if license:
        spec.tags['License'] = license
    if url:
        spec.tags['Url'] = url
    if source:
        spec.tags['Source0'] = source
    spec.blocks.prep.append('rm -rf %{buildroot}/*')
    spec.blocks.clean.append('rm -rf %{buildroot}')
    return spec
