python38/python3.macros

26 lines
1.2 KiB
Text
Raw Normal View History

2012-02-01 19:19:07 +04:00
%__python3 /usr/bin/python3
%python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
%python3_version %(%{__python3} -c "import sys; print(sys.version[0:3])")
%py3_ver %(%{__python3} -c "import sys; v=sys.version_info[:2]; print('%%d.%%d'%%v)" 2>/dev/null || echo PYTHON-NOT-FOUND)
%py3_prefix %(%{__python3} -c "import sys; print(sys.prefix)" 2>/dev/null || echo PYTHON-NOT-FOUND)
%py3_platsitedir %python3_sitearch
%py3_puresitedir %python3_sitelib
%py3_incdir %(%{__python3} -c 'from distutils.sysconfig import get_python_inc; print(get_python_inc())' 2>/dev/null || echo PYTHON-INCLUDEDIR-NOT-FOUND)
2014-06-22 19:45:41 +04:00
%py3dir %{_builddir}/python3-%{name}-%{version}-%{release}
2016-07-07 15:13:03 +03:00
%py_setup setup.py
%py3_shbang_opts -s
%py3_build() %{expand:\
CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?1}\
}
%py3_install() %{expand:\
CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\
}
2016-11-15 18:01:43 +03:00
%py3_test() %{expand:\
%{__python3} %{py_setup} %{?py_setup_args} test %{?1}\
}