python-rpm-macros/macros.python3

27 lines
1.1 KiB
Plaintext

# use the underscored macros to redefine the behavior of %%python3_version etc.
%__python3 /usr/bin/python3.4
# use the non-underscored macros to refer to Python in spec, etc.
%python3 %__python3
#__python3_other /usr/bin/python3.5
#python3_other %%__python3_other
%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('.',''))")
%python3_platform %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_platform())")
%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\
}
%py3_install() %{expand:\
CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\
}