1
  Y   ˆl–Ãa¾”Ê:”Ê�~ão\må1hß�þ[p Y¹E®Œ OùÂ„€?Á_ŠI|¥�+Wé3ž¯a–Ü4ý( ©¤ýÔâ€jãM\ÊbÑ¿Á ?÷     """distutils.command.bdist_rpm

Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions)."""

import subprocess
import sys
import os

from ..core import Command
from ..debug import DEBUG
from ..file_util import write_file
from ..errors import (
    DistutilsOptionError,
    DistutilsPlatformError,
    DistutilsFileError,
    DistutilsExecError,
)
from ..sysconfig import get_python_version
from distutils._log import log


class bdist_rpm(Command):

    description = "create an RPM distribution"

    user_options = [
        ('bdist-base=', None, "base directory for creating built distributions"),
        (
            'rpm-base=',
            None,
            "base directory for creating RPMs (defaults to \"rpm\" under "
            "--bdist-base; must be specified for RPM 2)",
        ),
        (
            'dist-dir=',
            'd',
            "directory to put final RPM files in " "(and .spec files if --spec-only)",
        ),
        (
            'python=',
            None,
            "path to Python interpreter to hard-code in the .spec file "
            "(default: \"python\")",
        ),
        (
            'fix-python',
            None,
            "hard-code the exact path to the current Python interpreter in "
            "the .spec file",
        ),
        ('spec-only', None, "only regenerate spec file"),
        ('source-only', None, "only generate source RPM"),
        ('binary-only', None, "only generate binary RPM"),
        ('use-bzip2', None, "use bzip2 instead of gzip to create source distribution"),
        # More meta-data: too RPM-specific to put in the setup script,
        # but needs to go in the .spec file -- so we make these options
        # to "bdist_rpm".  The idea is that packagers would put this
        # info in setup.cfg, although they are of course free to
        # supply it on the command line.
        (
            'distribution-name=',
            None,
            "name of the (Linux) distribution to which this "
            "RPM applies (*not* the name of the module distribution!)",
        ),
        ('group=', None, "package classification [default: \"Development/Libraries\"]"),
        ('release=', None, "RPM release number"),
        ('serial=', None, "RPM serial number"),
        (
            'vendor=',
            None,
            "RPM \"vendor\" (eg. \"Joe Blow <joe@example.com>\") "
            "[default: maintainer or author from setup script]",
        ),
        (
            'packager=',
            None,
            "RPM packager (eg. \"Jane Doe <jane@example.net>\") " "[default: vendor]",
        ),
        ('doc-files=', None, "list of documentation files (space or comma-separated)"),
        ('changelog=', None, "RPM changelog"),
        ('icon=', None, "name of icon file"),
        ('provides=', None, "capabilities provided by this package"),
        ('requires=', None, "capabilities required by this package"),
        ('conflicts=', None, "capabilities which conflict with this package"),
        ('build-requires=', None, "capabilities required to build this package"),
        ('obsoletes=', None, "capabilities made obsolete by this package"),
        ('no-autoreq', None, "do not automatically calculate dependencies"),
        # Actions to take when building RPM
        ('keep-temp', 'k', "don't clean up RPM build directory"),
        ('no-keep-temp', None, "clean up RPM build directory [default]"),
        (
            'use-rpm-opt-flags',
            None,
            "compile with RPM_OPT_FLAGS when building from source RPM",
        ),
        ('no-rpm-opt-flags', None, "do not pass any RPM CFLAGS to compiler"),
        ('rpm3-mode', None, "RPM 3 compatibility mode (default)"),
        ('rpm2-mode', None, "RPM 2 compatibility mode"),
        # Add the hooks necessary for specifying custom scripts
        ('prep-script=', None, "Specify a script for the PREP phase of RPM building"),
        ('build-script=