132 |
- |
1 |
%py_setup setup.py
|
|
|
2 |
%py_shbang_opts -s
|
|
|
3 |
|
|
|
4 |
%py_build() %{expand:\
|
177 |
- |
5 |
CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python} %{py_shbang_opts}" %{?1}\
|
132 |
- |
6 |
}
|
|
|
7 |
|
|
|
8 |
%py_install() %{expand:\
|
|
|
9 |
CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\
|
|
|
10 |
}
|
|
|
11 |
|
|
|
12 |
%python_provide() %{lua:\
|
|
|
13 |
function string.starts(String,Start)\
|
|
|
14 |
return string.sub(String,1,string.len(Start))==Start\
|
|
|
15 |
end\
|
|
|
16 |
package = rpm.expand("%{?1:%{1}}");\
|
|
|
17 |
vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
|
|
|
18 |
if (string.starts(package, "python2-")) then\
|
|
|
19 |
if (rpm.expand("%{?buildarch}") ~= "noarch") then\
|
|
|
20 |
str = "Provides: python-" .. string.sub(package,9,string.len(package)) .. "%{?_isa} = " .. vr;\
|
|
|
21 |
print(rpm.expand(str));\
|
|
|
22 |
end\
|
|
|
23 |
print("\\nProvides: python-");\
|
|
|
24 |
print(string.sub(package,9,string.len(package)));\
|
|
|
25 |
print(" = ");\
|
|
|
26 |
print(vr);\
|
|
|
27 |
--Obsoleting the previous default python package\
|
|
|
28 |
print("\\nObsoletes: python-");\
|
|
|
29 |
print(string.sub(package,9,string.len(package)));\
|
|
|
30 |
print(" < ");\
|
|
|
31 |
print(vr);\
|
|
|
32 |
elseif (string.starts(package, "python" .. rpm.expand("%{python3_pkgversion}") .. "-")) then\
|
|
|
33 |
--No unversioned provides as python3 is not default\
|
|
|
34 |
elseif (rpm.expand("%{?python3_other_pkgversion}") ~= "" and string.starts(package, "python" .. rpm.expand("%{python3_other_pkgversion}") .. "-")) then\
|
|
|
35 |
--No unversioned provides as python3_other is not default\
|
|
|
36 |
elseif (string.starts(package, "pypy-")) then\
|
|
|
37 |
--No unversioned provides as pypy is not default\
|
|
|
38 |
elseif (string.starts(package, "pypy3-")) then\
|
|
|
39 |
--No unversioned provides as pypy is not default\
|
|
|
40 |
elseif (string.starts(package, "python-")) then\
|
|
|
41 |
--Providing the current default python\
|
|
|
42 |
print("Provides: python2-");\
|
|
|
43 |
print(string.sub(package,8,string.len(package)));\
|
|
|
44 |
print(" = ");\
|
|
|
45 |
print(vr);\
|
|
|
46 |
else\
|
|
|
47 |
print("%python_provide: ERROR: ");\
|
|
|
48 |
print(package);\
|
|
|
49 |
print(" not recognized.");\
|
|
|
50 |
end\
|
|
|
51 |
}
|