1 %py_ver %(python -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND)
2 %py_prefix %(python -c "import sys; print sys.prefix" 2>/dev/null || echo PYTHON-NOT-FOUND)
3 %py_libdir %{py_prefix}/%{_lib}/python%{py_ver}
4 %py_incdir %{py_prefix}/include/python%{py_ver}
5 %py_sitedir %{py_libdir}/site-packages
7 find %1 -name '*.pyc' -exec rm -f {} \\; \
8 python -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 \
10 find %1 -name '*.pyo' -exec rm -f {} \\; \
11 python -O -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 \
14 BuildRequires: /usr/bin/python %{-d:python-devel} \
15 PreReq: python = %{py_ver}
17 %python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib();")
18 %python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True);")