-
Notifications
You must be signed in to change notification settings - Fork 20
/
macros.in
32 lines (23 loc) · 886 Bytes
/
macros.in
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
32
%python_flavor %{_python_macro_init}%{lua: print(flavor)}
%if_python_kind() %if "%{python_flavor}" == "%1"
%if_not_python_kind() %if "%{python_flavor}" != "%1"
%ifpycache %if "%{python_flavor}" != "python2"
%pycache_only() %ifpycache \
%** \
%endif
%_python_use_flavor() \
last_flavor=`[ -f _current_flavor ] && cat _current_flavor || true` \
if [ -z "$last_flavor" ]; then last_flavor="tmp"; fi \
if [ "$last_flavor" != "%1" ]; then \
if [ -d build ]; then mv build _build.$last_flavor; fi \
if [ -d _build.%1 ]; then mv _build.%1 build; fi \
fi \
echo %1 > _current_flavor \
python_flavor=%1 \
%{nil}
%_python_stash_flavor() \
if [ -d build ]; then mv build _build.%1; fi \
if [ -d _build.tmp ]; then mv _build.tmp build; fi \
%{nil}
### LUA-MACROS ###
%_python_macro_init %{_python_definitions}%{_python_scan_spec}%{lua: rpm.define("_python_macro_init %{nil}")}