Group :: Development/Other
RPM: rpm-build-python3
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
rpm-build-python3-0.1.7/ 0000755 0000000 0000000 00000000000 12131612742 0015011 5 ustar 00root root 0000000 0000000 rpm-build-python3-0.1.7/brp-bytecompile_python3 0000755 0000000 0000000 00000004345 12131612742 0021526 0 ustar 00root root 0000000 0000000 #!/bin/sh -e
#
# brp-bytecompile_python3 - compile python3 modules.
# based on brp-bytecompile_python3
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
. /usr/lib/rpm/functions
ValidateBuildRoot
if [ -z "$RPM_PYTHON3" ]; then
RPM_PYTHON3=/usr/bin/python3
fi
if [ -z "$RPM_PYTHON3_VERSION" ]; then
RPM_PYTHON3_VERSION=`LC_ALL=C $RPM_PYTHON3 -c 'import sys; print("{0}.{1}".format(sys.version_info[0],sys.version_info[1]))' 2>/dev/null || echo unknown`
fi
if [ -z "$RPM_PYTHON3_COMPILE_DEEP" ]; then
RPM_PYTHON3_COMPILE_DEEP=20
fi
if [ -z "$RPM_PYTHON3_COMPILE_INCLUDE" ]; then
RPM_PYTHON3_COMPILE_INCLUDE="/usr/lib/python$RPM_PYTHON3_VERSION"
if [ `arch` = "x86_64" ] && [ -d $RPM_BUILD_ROOT/usr/lib64/python$RPM_PYTHON3_VERSION] ; then
RPM_PYTHON3_COMPILE_INCLUDE="$RPM_PYTHON3_COMPILE_INCLUDE /usr/lib64/python$RPM_PYTHON3_VERSION"
fi
fi
cd $RPM_BUILD_ROOT
if [ `find -type f -name \*.py |wc -l` -gt 0 ]; then
echo "Bytecompiling python3 modules in $PWD using $RPM_PYTHON3"
$RPM_PYTHON3 /usr/lib/rpm/python3.compileall.py "--exclude=$RPM_PYTHON3_COMPILE_EXCLUDE" "--include=$RPM_PYTHON3_COMPILE_INCLUDE" "--deep=$RPM_PYTHON3_COMPILE_DEEP" ${RPM_PYTHON3_COMPILE_SKIP_X:+--skip_x} ${RPM_PYTHON3_COMPILE_CLEAN:+--clean} "--prefix=$RPM_BUILD_ROOT"
echo "Bytecompiling python3 modules with optimization in $PWD using $RPM_PYTHON3 -O"
$RPM_PYTHON3 -O /usr/lib/rpm/python3.compileall.py "--exclude=$RPM_PYTHON3_COMPILE_EXCLUDE" "--include=$RPM_PYTHON3_COMPILE_INCLUDE" "--deep=$RPM_PYTHON3_COMPILE_DEEP" ${RPM_PYTHON3_COMPILE_SKIP_X:+--skip_x} ${RPM_PYTHON3_COMPILE_CLEAN:+--clean} "--prefix=$RPM_BUILD_ROOT"
fi