0%

RPM打包时指定python自动编译版本为3.X的方法

指定python自动编译的版本为python3的方法

在spec文件里添加

1
%define  __python /usr/bin/python3

RPM打包时关闭python自动编译的方法

编辑 /usr/lib/rpm/redhat/macros, 注释掉brp-python-bytecompile一行

1
2
3
4
5
6
7
8
9
10
11
%__os_install_post    \
/usr/lib/rpm/redhat/brp-compress \
%{!?__debug_package:\
/usr/lib/rpm/redhat/brp-strip %{__strip} \
/usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \
} \
/usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \
/usr/lib/rpm/brp-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build} \
/usr/lib/rpm/redhat/brp-python-hardlink \
%{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \
%{nil}