python-rpm-macros/macros.python3

27 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

# use the underscored macros to redefine the behavior of %%python3_version etc.
2016-01-25 23:55:23 +00:00
%__python3 /usr/bin/python3.4
# use the non-underscored macros to refer to Python in spec, etc.
%python3 %__python3
2016-01-25 23:55:23 +00:00
#__python3_other /usr/bin/python3.5
#python3_other %%__python3_other
2016-01-25 23:55:23 +00:00
2016-01-12 23:52:28 +00:00
%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; sys.stdout.write(sys.version[:3])")
%python3_version_nodots %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
2018-07-09 19:34:36 +00:00
%python3_platform %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_platform())")
2016-01-12 23:52:28 +00:00
%py3dir %{_builddir}/python3-%{name}-%{version}-%{release}
%py3_shbang_opts -s
%py3_build() %{expand:\
CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?1};\
sleep 1\
2016-01-12 23:52:28 +00:00
}
%py3_install() %{expand:\
CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\
}