2016-01-12 23:52:28 +00:00
|
|
|
%__python2 /usr/bin/python2
|
2017-10-25 18:56:17 +00:00
|
|
|
%python2_sitelib %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
|
|
|
|
%python2_sitearch %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
|
|
|
|
%python2_version %(%{__python2} -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")
|
|
|
|
%python2_version_nodots %(%{__python2} -Esc "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))")
|
2016-01-12 23:52:28 +00:00
|
|
|
|
|
|
|
%py2_shbang_opts -s
|
|
|
|
|
2016-11-24 14:53:47 +00:00
|
|
|
# Use the slashes after expand so that the command starts on the same line as
|
|
|
|
# the macro
|
|
|
|
%py2_build() %{expand:\\\
|
2018-02-03 11:57:13 +00:00
|
|
|
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
|
|
|
|
%{__python2} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py2_shbang_opts}" %{?*}
|
2016-11-15 23:16:16 +00:00
|
|
|
sleep 1
|
2016-01-12 23:52:28 +00:00
|
|
|
}
|
|
|
|
|
2016-11-24 14:53:47 +00:00
|
|
|
%py2_build_egg() %{expand:\\\
|
2018-02-03 11:57:13 +00:00
|
|
|
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
|
|
|
|
%{__python2} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
|
2016-11-16 23:28:31 +00:00
|
|
|
sleep 1
|
|
|
|
}
|
|
|
|
|
2016-11-24 14:53:47 +00:00
|
|
|
%py2_build_wheel() %{expand:\\\
|
2018-02-03 11:57:13 +00:00
|
|
|
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
|
|
|
|
%{__python2} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
|
2016-11-15 23:12:23 +00:00
|
|
|
sleep 1
|
|
|
|
}
|
|
|
|
|
2016-11-24 14:53:47 +00:00
|
|
|
%py2_install() %{expand:\\\
|
2018-02-03 11:57:13 +00:00
|
|
|
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
|
|
|
|
%{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
|
2016-01-12 23:52:28 +00:00
|
|
|
}
|
2016-11-15 23:12:23 +00:00
|
|
|
|
2016-11-24 14:53:47 +00:00
|
|
|
%py2_install_egg() %{expand:\\\
|
2016-11-15 23:12:23 +00:00
|
|
|
mkdir -p %{buildroot}%{python2_sitelib}
|
|
|
|
easy_install-%{python2_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python2_version}.egg %{?*}
|
|
|
|
}
|
2016-11-16 23:28:31 +00:00
|
|
|
|
2016-11-24 14:53:47 +00:00
|
|
|
%py2_install_wheel() %{expand:\\\
|
2017-01-23 17:52:17 +00:00
|
|
|
pip%{python2_version} install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
|
2016-11-16 23:28:31 +00:00
|
|
|
}
|