Your IP : 18.117.254.202
3
� f�T � @ s� d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl
mZ ddlT ddl
mZ dd lmZ G d
d� de�ZdS )zwdistutils.command.bdist_rpm
Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions).� N)�Command)�DEBUG)�get_platform)�
write_file)�*)�get_python_version)�logc + @ s� e Zd ZdZdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�g)Zd4d9d=d2dUgZd4d9d=dX�ZdYdZ� Zd[d\� Zd]d^� Z d_d`� Z
dadb� Zdcdd� Zdedf� Z
dS )�� bdist_rpmzcreate an RPM distribution�bdist-base=N�/base directory for creating built distributions� rpm-base=�dbase directory for creating RPMs (defaults to "rpm" under --bdist-base; must be specified for RPM 2)� dist-dir=�d�Ddirectory to put final RPM files in (and .spec files if --spec-only)�python=�Mpath to Python interpreter to hard-code in the .spec file (default: "python")�
fix-python�Lhard-code the exact path to the current Python interpreter in the .spec file� spec-only�only regenerate spec file�source-only�only generate source RPM�binary-only�only generate binary RPM� use-bzip2�7use bzip2 instead of gzip to create source distribution�distribution-name=�gname of the (Linux) distribution to which this RPM applies (*not* the name of the module distribution!)�group=�9package classification [default: "Development/Libraries"]�release=�RPM release number�serial=�RPM serial number�vendor=�aRPM "vendor" (eg. "Joe Blow <joe@example.com>") [default: maintainer or author from setup script]� packager=�BRPM packager (eg. "Jane Doe <jane@example.net>") [default: vendor]�
doc-files=�6list of documentation files (space or comma-separated)�
changelog=�
RPM changelog�icon=�name of icon file� provides=�%capabilities provided by this package� requires=�%capabilities required by this package�
conflicts=�-capabilities which conflict with this package�build-requires=�+capabilities required to build this package�
obsoletes=�*capabilities made obsolete by this package�
no-autoreq�+do not automatically calculate dependencies� keep-temp�k�"don't clean up RPM build directory�no-keep-temp�&clean up RPM build directory [default]�use-rpm-opt-flags�8compile with RPM_OPT_FLAGS when building from source RPM�no-rpm-opt-flags�&do not pass any RPM CFLAGS to compiler� rpm3-mode�"RPM 3 compatibility mode (default)� rpm2-mode�RPM 2 compatibility mode�prep-script=�3Specify a script for the PREP phase of RPM building�
build-script=�4Specify a script for the BUILD phase of RPM building�pre-install=�:Specify a script for the pre-INSTALL phase of RPM building�install-script=�6Specify a script for the INSTALL phase of RPM building�
post-install=�;Specify a script for the post-INSTALL phase of RPM building�pre-uninstall=�<Specify a script for the pre-UNINSTALL phase of RPM building�post-uninstall=�=Specify a script for the post-UNINSTALL phase of RPM building�
clean-script=�4Specify a script for the CLEAN phase of RPM building�verify-script=�6Specify a script for the VERIFY phase of the RPM build�force-arch=�0Force an architecture onto the RPM build process�quiet�q�3Run the INSTALL phase of RPM building in quiet mode)zno-keep-tempzno-rpm-opt-flagsz rpm2-modec C s� d | _ d | _d | _d | _d | _d | _d | _d | _d | _d | _ d | _
d | _d | _d | _
d | _d | _d | _d | _d | _d | _d | _d | _d | _d | _d | _d | _d | _d | _d | _d | _d | _d | _d | _ d| _!d| _"d| _#d| _$d | _%d| _&d S )Nr � )'�
bdist_base�rpm_base�dist_dir�python�
fix_python� spec_only�binary_only�source_only� use_bzip2�distribution_name�group�release�serial�vendor�packager� doc_files� changelog�icon�prep_script�build_script�install_script�clean_script�
verify_script�pre_install�post_install�
pre_uninstall�post_uninstall�prep�provides�requires� conflicts�build_requires� obsoletes� keep_temp�use_rpm_opt_flags� rpm3_mode�
no_autoreq�
force_archr\ )�self� r� �@/opt/alt/python36/lib64/python3.6/distutils/command/bdist_rpm.py�initialize_options� sN zbdist_rpm.initialize_optionsc C s� | j dd� | jd kr6| js$td��tjj| jd�| _| jd krX| j rPt
j| _qfd| _n| j rftd��tjdkr~t
dtj ��| jr�| jr�td ��| jj� s�d
| _| j dd
� | j� d S )NZbdistr` z)you must specify --rpm-base in RPM 2 mode�rpm�python3z8--python and --fix-python are mutually exclusive options�posixz9don't know how to create RPM distributions on platform %sz6cannot supply both '--source-only' and '--binary-only'r rb )r` r` )rb rb )Zset_undefined_optionsra r� ZDistutilsOptionError�os�path�joinr` rc rd �sys�
executable�nameZDistutilsPlatformErrorrf rg �distribution�has_ext_modulesr� �finalize_package_data)r� r� r� r� �finalize_options� s.
zbdist_rpm.finalize_optionsc C sX | j dd� | j dd| jj� | jj� f � | j d� | jd� t| jt�r|x.dD ]&}tj j
|�rR|| jkrR| jj|� qRW | j d d
� | j d� | j d� | j d
� | j| j
�| _
| jd� | jd� | jd� | jd� | jd� | jd� | jd� | jd� | jd� | jd� | jd� | jd� | jd� | jd� | jd� | j d� d S )Nrj zDevelopment/Librariesrm z%s <%s>rn ro �README�
README.txtrk �1rl ri rp rq rr rs rt ru rv rw rx ry rz r| r} r~ r r� r� )r� r� )Z
ensure_stringr� Zget_contactZget_contact_emailZensure_string_list�
isinstancero �listr� r� �exists�append�_format_changelogrp Zensure_filename)r� Zreadmer� r� r� r� � s>