python-rpm-macros/macros.python3

37 lines
1.4 KiB
Plaintext
Raw Normal View History

2016-01-12 23:52:28 +00: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; sys.stdout.write(sys.version[:3])")
%python3_version_nodots %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
%py3dir %{_builddir}/python3-%{name}-%{version}-%{release}
%py3_shbang_opts -s
2016-11-15 23:16:16 +00:00
%py3_build() %{expand:
CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?*}
2016-11-15 23:16:16 +00:00
sleep 1
2016-01-12 23:52:28 +00:00
}
%py3_build_egg() %{expand:
CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
sleep 1
}
%py3_build_wheel() %{expand:
CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
sleep 1
}
2016-11-15 23:16:16 +00:00
%py3_install() %{expand:
CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
2016-01-12 23:52:28 +00:00
}
%py3_install_egg() %{expand:
mkdir -p %{buildroot}%{python3_sitelib}
easy_install-%{python3_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python3_version}.egg %{?*}
}
%py3_install_wheel() %{expand:
pip%{python3_version} install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot}
2016-11-17 04:32:46 +00:00
}