-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmacros.python2
31 lines (25 loc) · 1.43 KB
/
macros.python2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# SPDX-License-Identifier: MIT
%__python2 /usr/bin/python2
%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))")
%python2_pkgversion %{nil}
%_py2_shebang_s s
%_py2_shebang_P %(RPM_BUILD_ROOT= %{__python2} -Esc "import sys; print('P' if hasattr(sys.flags, 'safe_path') else '')")
%py2_shbang_opts -%{?_py2_shebang_s}%{?_py2_shebang_P}
%py2_shbang_opts_nodash %(opts=%{py2_shbang_opts}; echo ${opts#-})
%py2_shebang_flags %(opts=%{py2_shbang_opts}; echo ${opts#-})
%py2_shebang_fix %{__python2} -B %{_debconfigdir}/pathfix.py -pni %{__python2} -ka%{py2_shebang_flags}
%py2_build CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py2_shbang_opts}"
%py2_install %{__python2} %{py_setup} %{?py_setup_args} install --no-compile -O0 --skip-build --root %{buildroot} --install-layout=deb
%py2_bytecompile_requires \
Requires(preun): python-minimal \
Requires(post): python-minimal \
%{nil}
%py2_bytecompile_post() \
pycompile -p %{1} -V -3.0 \
%{nil}
%py2_bytecompile_preun() \
pyclean -p %{1} \
%{nil}