Change python to python2 at rpm macro file 30/321030/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 13 Mar 2025 06:36:05 +0000 (15:36 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 13 Mar 2025 06:36:05 +0000 (15:36 +0900)
Change-Id: I48a6e762e11dc7ae131fd9dc31bfc171b2e1892c

packaging/macros.python

index bce9c44399947ff914ab8b35316cb7f5296abab7..033a19cada66063bfc33797287b93247d5985311 100644 (file)
@@ -1,18 +1,18 @@
-%py_ver                        %(python -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND)
-%py_prefix             %(python -c "import sys; print sys.prefix" 2>/dev/null || echo PYTHON-NOT-FOUND)
+%py_ver                        %(python2 -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND)
+%py_prefix             %(python2 -c "import sys; print sys.prefix" 2>/dev/null || echo PYTHON-NOT-FOUND)
 %py_libdir             %{py_prefix}/%{_lib}/python%{py_ver}
 %py_incdir             %{py_prefix}/include/python%{py_ver}
 %py_sitedir            %{py_libdir}/site-packages
 %py_compile(O) \
 find %1 -name '*.pyc' -exec rm -f {} \\; \
-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 \
+python2 -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 \
 %{-O: \
 find %1 -name '*.pyo' -exec rm -f {} \\; \
-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 \
+python2 -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 \
 }
 %py_requires(d) \
-BuildRequires: /usr/bin/python %{-d:python-devel} \
+BuildRequires: /usr/bin/python2 %{-d:python-devel} \
 Requires(pre): python = %{py_ver}
 
-%python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib();")
-%python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True);")
+%python_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib; print get_python_lib();")
+%python_sitearch %(python2 -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True);")