-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmacros.python
31 lines (24 loc) · 1.27 KB
/
macros.python
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
%__python /usr/bin/python
%python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib())")
%python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1))")
%python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")
%py_setup setup.py
%_py_shebang_s s
%_py_shebang_P %(RPM_BUILD_ROOT= %{__python} -Esc "import sys; print('P' if hasattr(sys.flags, 'safe_path') else '')")
%py_shbang_opts -%{?_py_shebang_s}%{?_py_shebang_P}
%py_shbang_opts_nodash %(opts=%{py_shbang_opts}; echo ${opts#-})
%py_shebang_flags %(opts=%{py_shbang_opts}; echo ${opts#-})
%py_shebang_fix %{__python} -B %{_debconfigdir}/pathfix.py -pni %{__python} -ka%{py_shebang_flags}
%py_build CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python} %{py_shbang_opts}"
%py_install %{__python} %{py_setup} %{?py_setup_args} install --no-compile -O0 --skip-build --root %{buildroot} --install-layout=deb
%py_bytecompile_requires \
Requires(preun): python-minimal \
Requires(post): python-minimal \
%{nil}
%py_bytecompile_post() \
pycompile -p %{1} \
%{nil}
%py_bytecompile_preun() \
pyclean -p %{1} \
%{nil}