Blame SOURCES/macros.pybytecompile

2a6dbc
# Note that the path could itself be a python file, or a directory
2a6dbc
2a6dbc
# Python's compile_all module only works on directories, and requires a max
2a6dbc
# recursion depth
2a6dbc
2a6dbc
%py_byte_compile()\
2a6dbc
python_binary="%1"\
2a6dbc
bytecode_compilation_path="%2"\
2a6dbc
find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2], optimize=opt) for opt in range(2) for f in sys.argv[1:]]' || :\
2a6dbc
%{nil}