Hacked By AnonymousFox

Current Path : /opt/alt/python311/lib64/python3.11/distutils/command/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/distutils/command/__pycache__/bdist_rpm.cpython-311.opt-1.pyc

�

c��f!T���dZddlZddlZddlZddlmZddlmZddlm	Z	ddl
TddlmZddl
mZGd	�d
e��ZdS)zwdistutils.command.bdist_rpm

Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions).�N)�Command)�DEBUG)�
write_file)�*)�get_python_version)�logc�X�eZdZdZgd�Zgd�Zdddd�Zd�Zd	�Zd
�Z	d�Z
d�Zd
�Zd�Z
dS)�	bdist_rpmzcreate an RPM distribution)))zbdist-base=Nz/base directory for creating built distributions)z	rpm-base=Nzdbase directory for creating RPMs (defaults to "rpm" under --bdist-base; must be specified for RPM 2))z	dist-dir=�dzDdirectory to put final RPM files in (and .spec files if --spec-only))zpython=NzMpath to Python interpreter to hard-code in the .spec file (default: "python"))z
fix-pythonNzLhard-code the exact path to the current Python interpreter in the .spec file)z	spec-onlyNzonly regenerate spec file)zsource-onlyNzonly generate source RPM)zbinary-onlyNzonly generate binary RPM)z	use-bzip2Nz7use bzip2 instead of gzip to create source distribution)zdistribution-name=Nzgname of the (Linux) distribution to which this RPM applies (*not* the name of the module distribution!))zgroup=Nz9package classification [default: "Development/Libraries"])zrelease=NzRPM release number)zserial=NzRPM serial number)zvendor=NzaRPM "vendor" (eg. "Joe Blow <joe@example.com>") [default: maintainer or author from setup script])z	packager=NzBRPM packager (eg. "Jane Doe <jane@example.net>") [default: vendor])z
doc-files=Nz6list of documentation files (space or comma-separated))z
changelog=Nz
RPM changelog)zicon=Nzname of icon file)z	provides=Nz%capabilities provided by this package)z	requires=Nz%capabilities required by this package)z
conflicts=Nz-capabilities which conflict with this package)zbuild-requires=Nz+capabilities required to build this package)z
obsoletes=Nz*capabilities made obsolete by this package)�
no-autoreqNz+do not automatically calculate dependencies)�	keep-temp�kz"don't clean up RPM build directory)�no-keep-tempNz&clean up RPM build directory [default])�use-rpm-opt-flagsNz8compile with RPM_OPT_FLAGS when building from source RPM)�no-rpm-opt-flagsNz&do not pass any RPM CFLAGS to compiler)�	rpm3-modeNz"RPM 3 compatibility mode (default))�	rpm2-modeNzRPM 2 compatibility mode)zprep-script=Nz3Specify a script for the PREP phase of RPM building)z
build-script=Nz4Specify a script for the BUILD phase of RPM building)zpre-install=Nz:Specify a script for the pre-INSTALL phase of RPM building)zinstall-script=Nz6Specify a script for the INSTALL phase of RPM building)z
post-install=Nz;Specify a script for the post-INSTALL phase of RPM building)zpre-uninstall=Nz<Specify a script for the pre-UNINSTALL phase of RPM building)zpost-uninstall=Nz=Specify a script for the post-UNINSTALL phase of RPM building)z
clean-script=Nz4Specify a script for the CLEAN phase of RPM building)zverify-script=Nz6Specify a script for the VERIFY phase of the RPM build)zforce-arch=Nz0Force an architecture onto the RPM build process)�quiet�qz3Run the INSTALL phase of RPM building in quiet mode)r
rrrrr
rr)rrrc�(�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|_&dS)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��selfs �B/opt/alt/python311/lib64/python3.11/distutils/command/bdist_rpm.py�initialize_optionszbdist_rpm.initialize_options�s%�������
���
�������������������!%�����
������������
���������	���� ���"��� ���!������ ���!���"�����	���
���
����"���������!"��������������
�
�
�c�b�|�dd��|j�@|jstd���tj�|jd��|_|j�!|j	rtj|_nd|_n|j	rtd���tjdkrtdtjz���|jr|jrtd	���|j���sd
|_|�dd��|���dS)N�bdist)rrz)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)rr)�set_undefined_optionsrr;�DistutilsOptionError�os�path�joinrrr�sys�
executable�name�DistutilsPlatformErrorrr�distribution�has_ext_modulesr:�finalize_package_datar>s r@�finalize_optionszbdist_rpm.finalize_options�sU���"�"�7�,H�I�I�I��=� ��>�
C�*�A�C�C�C��G�L�L���%�@�@�D�M��;����
(�!�n����'����
�_�	N�&�L�N�N�
N��7�g���(�*2�46�G�*<�=�=�
=���	L�� 0�	L�&�J�L�L�
L�� �0�0�2�2�	'�%&�D�"��"�"�7�,D�E�E�E��"�"�$�$�$�$�$rBc�d�|�dd��|�d|j����d|j����d���|�d��|�d��t|jt��rGdD]D}tj	�
|��r#||jvr|j�|���E|�d	d
��|�d��|�d��|�d
��|�|j
��|_
|�d��|�d��|�d��|�d��|�d��|�d��|�d��|�d��|�d��|�d��|�d��|�d��|�d��|�d��|�d��|�d��dS)Nr"zDevelopment/Librariesr%z <�>r&r')�READMEz
README.txtr#�1r$r!r(r)r*r+r,r-r.r/r0r1r2r4r5r6r7r8r=)�
ensure_stringrQ�get_contact�get_contact_email�ensure_string_list�
isinstancer'�listrJrK�exists�append�_format_changelogr(�ensure_filename)r?�readmes  r@rSzbdist_rpm.finalize_package_data�s������7�$;�<�<�<����8�(,�(9�(E�(E�(G�(G�(G�(G�(,�(9�(K�(K�(M�(M�(M�(M�O�	P�	P�	P�	
���:�&�&�&�����,�,�,��d�n�d�+�+�	2�2�
2�
2���7�>�>�&�)�)�2�f�D�N�.J�.J��N�)�)�&�1�1�1�����9�c�*�*�*����8�$�$�$����.�/�/�/����;�'�'�'��/�/���?�?������V�$�$�$����]�+�+�+����^�,�,�,����-�.�.�.����^�,�,�,����_�-�-�-����]�+�+�+����^�,�,�,����_�-�-�-����-�.�.�.�	
���
�+�+�+����
�+�+�+�����,�,�,���� 0�1�1�1�����,�,�,����<�(�(�(�(�(rBc��trctd��td|j��td|j��td|j��td|j��|jr|j}|�|��nRi}dD]E}tj
�|j|��||<|�||���F|d}tj
�|d|j
���z��}|�t ||���fd	|z��|jrdS|j
jdd�}|�d
��}|jr	dg|_ndg|_|�d
��||j
_|���d
}|d}|�||��|jrWtj
�|j��r|�|j|��nt7d|jz���t9jd��dg}	|jr|	�d��n2|j r|	�d��n|	�d��|	�!dd|j"zg��|j#r<|	�!ddtj
�$|j��zg��|j%s|	�d��|j&r|	�d��|	�|��d}
|
dz}d|
zdz}d|�d|�d |�d!�}
tj'|
��}	g}d}	|�(��}|snL|�)���*��}|�|d#��|�|d
}�c|�+��}|rtYd$t[|
��z���	|�+��n#|�+��wxYw|�.|	��|j/�s�|j
�0��rtc��}nd%}|j s�tj
�|d&|��}|�2||j��tj
�|j|��}|j
j�d'||f��|js�|D]�}tj
�|d(|��}tj
�|��r|�2||j��tj
�|jtj
�3|����}|j
j�d'||f����dSdSdS))Nzbefore _get_package_data():zvendor =z
packager =zdoc_files =zchangelog =)�SOURCES�SPECS�BUILD�RPMS�SRPMSrfz%s.speczwriting '%s'�sdist�bztar�gztarrrezicon file '%s' does not existz
building RPMs�rpmbuildz-bsz-bbz-baz--definez__python %sz
_topdir %sz--cleanz--quietz%{name}-%{version}-%{release}z.src.rpmz%{arch}/z.%{arch}.rpmz
rpm -q --qf '� z\n' --specfile '�'TrzFailed to execute: %s�anyrir
rh)4r�printr%r&r'r(rr�mkpathrJrKrLrrQ�get_name�executer�_make_spec_file�
dist_files�reinitialize_commandr �formats�run_command�get_archive_files�	copy_filer)r_�DistutilsFileErrorr�inforr`r�extendrr;�abspathr9r�popen�readline�strip�split�close�DistutilsExecError�repr�spawn�dry_runrRr�	move_file�basename)r?�spec_dir�rpm_dirr�	spec_path�saved_dist_filesrj�source�
source_dir�rpm_cmd�
nvr_string�src_rpm�non_src_rpm�q_cmd�out�binary_rpms�
source_rpm�line�l�status�	pyversion�srpm�filenamerEs                        r@�runz
bdist_rpm.runs���	1��/�0�0�0��*�d�k�*�*�*��,��
�.�.�.��-���0�0�0��-���0�0�0��>�	(��}�H��K�K��!�!�!�!��G�C�
(�
(���W�\�\�$�-��;�;���
����G�A�J�'�'�'�'��w�'�H��G�L�L��!*�T�->�-G�-G�-I�-I�!I�K�K�	����Z���*�*�,�,�.�#�i�/�	1�	1�	1�
�>�	��F� �,�7����:���)�)�'�2�2���>�	&�$�I�E�M�M�$�I�E�M�����!�!�!�'7���$��(�(�*�*�1�-���Y�'�
����v�z�*�*�*��9�	C��w�~�~�d�i�(�(�
C����t�y�*�5�5�5�5�(�5��	�A�C�C�C�	���!�!�!��,����	"��N�N�5�!�!�!�!�
�
�	"��N�N�5�!�!�!�!��N�N�5�!�!�!����
�M�D�K�$?�@�A�A�A��>�	M��N�N�J�)�B�G�O�O�D�M�,J�,J�J�L�
M�
M�
M��~�	&��N�N�9�%�%�%��:�	&��N�N�9�%�%�%����y�!�!�!�
5�
��z�)�� �:�-��>����G�G�[�[�[�)�)�)�-���h�u�o�o��	��K��J�	
&��|�|�~�~������J�J�L�L�&�&�(�(���"�"�1�Q�4�(�(�(��%�!"�1��J�	
&��Y�Y�[�[�F��
P�(�)@�4��;�;�)N�O�O�O�
P�
�I�I�K�K�K�K��C�I�I�K�K�K�K�����
�
�7�����|�	@�� �0�0�2�2�
"�.�0�0�	�	�!�	��#�
8��w�|�|�G�G�$4�j�A�A�����t�T�]�3�3�3��7�<�<��
�z�B�B���!�,�3�3� �)�X�6�8�8�8��#�
@�&�@�@�C��'�,�,�w�v���<�<�C��w�~�~�c�*�*�@����s�D�M�:�:�:�#%�7�<�<��
�02��0@�0@��0E�0E�$G�$G���)�4�;�;�(�)�X�>�@�@�@��+	@�	@�
@�
@�@�@s
�BQ�Qc��tj�|jtj�|����S)N)rJrKrLrr�)r?rKs  r@�
_dist_pathzbdist_rpm._dist_path�s*���w�|�|�D�M�2�7�+;�+;�D�+A�+A�B�B�BrBc	�
�d|j���zd|j����dd��zd|j���zd|j�dd��zdd|j���zg}t
jd	��}d
�d�|�	��D����}d}d
}|�||��}||kr0|�
d��|�
d|zd
z��|�gd���|jr|�
d��n|�
d��|�d|j�
��zd|jzddg��|js/|j���s|�
d��n|�
d|jz��dD]�}t#||�����}t'|t(��r.|�
|�dd�|�������g|�|�
|�d|������|j���dkr/|�
d|j���z��|jr|�
d|jz��|jr0|�
d d�|j��z��|jr:|�
d!t2j�|j��z��|jr|�
d"��|�dd#|j���g��|j�dt2j�t>j d$����}d%|z}	|j!rd&|	z}	d'|z}
d(d)d*|	fd+d,|
fd-d.d/d0d1d2g	}|D]�\}}
}t#||
��}|s|r�|�dd3|zg��|rbtE|��5}|�|�#���$d
����ddd��n#1swxYwY��|�
|����|�gd4���|j%r0|�
d5d�|j%��z��|j&r1|�dd6g��|�|j&��|S)7ziGenerate the text of an RPM spec file and return it as a
        list of strings (one per line).
        z
%define name z%define version �-�_z%define unmangled_version z%define release �z	Summary: zrpm --eval %{__os_install_post}�
c�<�g|]}d|���z��S)z  %s \)r�)�.0r�s  r@�
<listcomp>z-bdist_rpm._make_spec_file.<locals>.<listcomp>�s;��!G�!G�!G�%)�"+�T�Z�Z�\�\�!9�!G�!G�!GrBzbrp-python-bytecompile \
z%brp-python-bytecompile %{__python} \
z2# Workaround for http://bugs.python.org/issue14443z%define __os_install_post )z
Name: %{name}zVersion: %{version}zRelease: %{release}z-Source0: %{name}-%{unmangled_version}.tar.bz2z,Source0: %{name}-%{unmangled_version}.tar.gzz	License: zGroup: z>BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildrootzPrefix: %{_prefix}zBuildArch: noarchz
BuildArch: %s)�Vendor�Packager�Provides�Requires�	Conflicts�	Obsoletesz: rnN�UNKNOWNzUrl: zDistribution: zBuildRequires: zIcon: z
AutoReq: 0z%descriptionrz%s buildzenv CFLAGS="$RPM_OPT_FLAGS" z>%s install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES)r3r*z&%setup -n %{name}-%{unmangled_version}�buildr+�installr,)�cleanr-zrm -rf $RPM_BUILD_ROOT)�verifyscriptr.N)�prer/N)�postr0N)�preunr1N)�postunr2N�%)r�z%files -f INSTALLED_FILESz%defattr(-,root,root)z%doc z
%changelog)'rQrs�get_version�replacer#�get_description�
subprocess�	getoutputrL�
splitlinesr`r~r �get_licenser"r=rR�getattr�lowerr]r^�get_urlr!r7r)rJrKr�r<�get_long_descriptionrrM�argvr:�open�readr�r'r()r?�	spec_file�vendor_hook�problem�fixed�
fixed_hook�field�val�def_setup_call�	def_build�install_cmd�script_options�rpm_opt�attr�default�fs                r@ruzbdist_rpm._make_spec_file�sE��
�d�/�8�8�:�:�:���!2�!>�!>�!@�!@�!H�!H��S�!Q�!Q�Q�(�4�+<�+H�+H�+J�+J�J����!5�!5�c�#�!>�!>�>���$�+�;�;�=�=�=�
�	�!�*�+L�M�M���i�i�!G�!G�-8�-C�-C�-E�-E�!G�!G�!G�H�H��/��9�� �(�(��%�8�8�
���$�$����Q�R�R�R����9�J�F��M�N�N�N�	���$�$�$�	%�	%�	%��>�	M����L�M�M�M�M����K�L�L�L�����$�+�7�7�9�9�9���
�"�L� �	$�	%�	%�	%���	B��$�4�4�6�6�
6�� � �!4�5�5�5�����o���?�A�A�A��	:�	:�E��$����
�
�.�.�C��#�t�$�$�
:�� � �U�U�U�C�H�H�S�M�M�M�!B�C�C�C�C���� � �U�U�U�C�C�!8�9�9�9����$�$�&�&�)�3�3����W�t�'8�'@�'@�'B�'B�B�C�C�C��!�	H����-��0F�F�G�G�G���	<����.� �X�X�d�&9�:�:�;�
<�
<�
<��9�	E����X���(8�(8���(C�(C�C�D�D�D��?�	+����\�*�*�*��������2�2�4�4��	�	�	�$%)�K�K�K���0@�0@���!��0M�0M�0M�N����/�	��!�	C�6��B�I�2�5C�D��
N�
�n�i�0�
�(�+�6�?�3�(�*�,�.�

��)7�	.�	.�$�W�d�G��$��%�%�C��
.�g�
.�� � ���'�M�"$�%�%�%��.��c���?�a�!�(�(���������)=�)=�>�>�>�?�?�?�?�?�?�?�?�?�?�?����?�?�?�?���$�$�W�-�-�-��	������	�	�	��>�	A����W�s�x�x���'?�'?�?�@�@�@��>�	-�������
 �
 �
 �
���T�^�,�,�,��s�-;R4�4R8	�;R8	c�`�|s|Sg}|����d��D]t}|���}|ddkr|�d|g���:|ddkr|�|���\|�d|z���u|ds|d=|S)zKFormat the changelog correctly and convert it to a list of strings
        r�rrr�r�z  )r�r�r~r`)r?r(�
new_changelogr�s    r@razbdist_rpm._format_changelog0s����	����
��O�O�%�%�+�+�D�1�1�	2�	2�D��:�:�<�<�D��A�w�#�~�~��$�$�b�$�Z�0�0�0�0��a��C����$�$�T�*�*�*�*��$�$�T�D�[�1�1�1�1��Q��	!��a� ��rBN)�__name__�
__module__�__qualname__�description�user_options�boolean_options�negative_optrArTrSr�r�rura�rBr@r
r
s�������.�K�k
�k
�k
�L�Z.�.�.�O�%0�(;�!,�.�.�L�
+�+�+�Z%�%�%�>+)�+)�+)�ZB@�B@�B@�HC�C�C�g�g�g�R����rBr
)�__doc__r�rMrJ�distutils.corer�distutils.debugr�distutils.file_utilr�distutils.errors�distutils.sysconfigr�	distutilsrr
r�rBr@�<module>r�s�����
������������"�"�"�"�"�"�!�!�!�!�!�!�*�*�*�*�*�*�����2�2�2�2�2�2�������u�u�u�u�u��u�u�u�u�urB

Hacked By AnonymousFox1.0, Coded By AnonymousFox